zorael / kameloso

IRC bot with Twitch support
Boost Software License 1.0
8 stars 3 forks source link

Highlight custom BetterTTV, FrankerFaceZ and 7tv emotes #158

Closed zorael closed 1 year ago

zorael commented 1 year ago

This makes the Twitch plugin issue some API calls to fetch custom BetterTTV, FrankerFaceZ and 7tv emotes. With this information it can then detect them in messages, and embed them as emotes into IRCEvents. This in turn allows the Printer plugin to highlight them, much as it already does with official Twitch emotes.

The fetching is a one-time thing, done after connection established for global emotes (on GLOBALUSERSTATE) and upon joining home channels for channel-specific ones (on ROOMSTATE).

Detecting emotes is done manually by walking through channel message contents, word by word, checking if they exist in the custom emotes associative arrays.

edit: The setting to disable it was removed. The feature does incur a lot of AA lookups, but not an overwhelming amount, and the interplay between it and ecount makes it tricky to reason about when it should be disabled.