Hi! I am making a custom chat box window for my streaming overlay so I can add all sorts of random features to it. However, even though I used the https://api.twitch.tv/kraken/chat/emoticon_images?emotesets= call to get all the default emojis (I generated a custom json to save time), when someone types a sub emote it just returns as the default string (e.g. taykagGun or something). What would be the best solution to get the image url from the emote name? I am using both the URL api and tmi.js
If you are parsing a chat message
You would parse the tags of a chat message for the emotes object.
Which’ll give you the emoteID and the places in the string for that emote
Then you can construct the URL to the image
https://static-cdn.jtvnw.net/emoticons/v1/emoteID/1.0
You can substitute 1.0 for 2.0 and 3.0 depending on what size you want.
Hmm; I assumed something like that. The object you are talking about is https://api.twitch.tv/kraken/chat/emoticons correct?
No the object I refer to is a chat “tag”
See emotes in the table
Okay; I am sort of confused. Say my messages are fetched through this:
twitchclient.on("chat", function (channel, user, message, self) {
})
I’ve looked through these 4 data points and nothing contains what you linked (I think)
Looks like you are using TMI.js you’d have to refer to their document for how to extract emotes/tags
So i somehow overlooked the part in the user data that literally specifies the emotes in the string… Sorry about that!
Thanks for your help though!