You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It doesn't seem to be quite that simple. Some emote codes are actually regexes:
"code": "\\:-?\\)"
That's just the regular smiley face.
As you see, this one even has the closing brace properly escaped.
So it might be necessary to implement some kind of algorithm to determine whether or not a given emote code is a regex.
This probably needs to be throroughly tested to make sure not a single emote code gets misinterpreted or throws an error like this.
Ah shoot, I didn't realize some of the codes are already regexes, and ones that are properly escaped at that. That adds a frustrating layer of complexity. I am guessing Twitch recently updated some of the emote codes? We've been using .findEmoteId for awhile now and it only started throwing this error within the last week.
Bug Report
Code
Expected behavior
To return correct emote id if a match is found, not throw an error.
Actual Behavior
Throws the following error:
It appears
emote.code
needs to have RegEx characters escaped on this line:https://github.com/d-fischer/twitch/blob/b28451c07cfe3f138250bd3eef55160380423660/packages/twitch/src/API/Kraken/Channel/EmoteSetList.ts#L29
Environment
The text was updated successfully, but these errors were encountered: