simple-helix-api
Advanced tools
Comparing version 3.3.0-beta.9 to 3.3.0-beta.10
@@ -38,15 +38,16 @@ "use strict"; | ||
if (!emotes) { | ||
return {}; | ||
return []; | ||
} | ||
const result = {}; | ||
const result = []; | ||
emotes.split("/").forEach(emote => { | ||
const [id, position] = emote.split(":"); | ||
const [start, end] = position.split("-").map(Number); | ||
const emoteName = text.substring(start, end + 1); | ||
result[emoteName] = { | ||
code: emoteName, | ||
const [id, positionsRaw] = emote.split(":"); | ||
const positions = positionsRaw.split(",").map(position => { | ||
const splitted = position.split("-").map(Number); | ||
return [splitted[0], splitted[1] + 1]; | ||
}); | ||
result.push({ | ||
code: text.substring(positions[0][0], positions[0][1]), | ||
id: Number(id), | ||
start, | ||
end: end + 1 | ||
}; | ||
positions | ||
}); | ||
}); | ||
@@ -53,0 +54,0 @@ return result; |
{ | ||
"name": "simple-helix-api", | ||
"version": "3.3.0-beta.9", | ||
"version": "3.3.0-beta.10", | ||
"description": "The Simple Helix API allows developers to easily develop applications for Twitch", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -12,3 +12,3 @@ import { IRCMessage } from "irc-message-ts"; | ||
badges: Record<string, number>; | ||
emotes: Record<string, Record<string, string | number>>; | ||
emotes: Record<string, any>[]; | ||
mod: boolean; | ||
@@ -22,3 +22,3 @@ subscriber: boolean; | ||
state(state: string): boolean; | ||
emotes(text: string, emotes: string): Record<string, Record<string, string | number>>; | ||
emotes(text: string, emotes: string): Record<string, any>[]; | ||
badges(badges: string): Record<string, number>; | ||
@@ -25,0 +25,0 @@ date(timestamp: string | number): Date; |
97914
2232