Getting started
Installation
Install emoteTTV using you favorite package manager:
Then, you can import emoteTTV like this:
Basic usage
You can use emoteTTV to parse any messages you want and then convert the results to the format that better suits you. For example, let's parse a sample message and get an array to see how it works:
This will return an array of words and emotes to be handled however you want. Notice this only replaces global third party emotes, as we didn't specify a Twitch channel and didn't pass the Twitch emote offsets that the Twitch IRC gives us (we'll see more about that later).
Also, if we just want to simply render the message with emotes, handling an array of words can be tiring. So instead of .toArray()
let's use .toHTML()
to render the message on the document body:
This should render something like this:
Real-world usage
Core concepts
At this point, you might have noticed that you don't need to instantiate emoteTTV like you would with other parser libraries — you can use it right away. This is because emoteTTV works as a singleton, we have a single instance of the parser and we manage everything internally.
Last updated