🎉Events
Time to go over the events that are available for you to subscribe to, as well as all the data that each event emits.
Available Events
This is the *current* list of available events, as time goes on more events may be added, but to keep overlays that have been made working, event types will never be removed unless absolutely necessary.
message
command
sticker
support
follow
subscription
giftsub
resub
host
raid
Event Data
Each event has different data that it will emit when the event happens, so let's go over those!
Message
The message event is likely the event that will be most commonly used. It is also the event that has the most "pre-processing" done to it. First, we'll just show you what it looks like, then we'll give a brief overview of how it's structured.
This is the message event, it is the IChatMessage
that will be emitted to your listener. Most of this event should be pretty obvious, the slightly unconventional part is the way the actual chat message is formatted. Within the event, there is an array property called message
this property is an array that contains n elements that are either a text message, or an emote message. This is done like this because Pixel Chat parses out all emotes for you! The other small thing to note is the from
property, this property specifies what platform the message is from, be that twitch
of trovo
etc.
Command
This is the command event, it is emitted every time there is a message event and is designed to make dealing with commands a little bit easier. The command
property will always be the first word in the message, and the args
array will be everything that comes after that, split by spaces.
Sticker
The sticker event is an event exclusive to Trovo, and emits whenever a sticker is used in chat. the event will contain info such as the url to the gif of the sticker, as well as the urls for the background animations assuming they exist for the said sticker.
Support
This is going to be your basic support events, such as bits, mana, or elixir. The "currency" field represents what currency was used and as of writing this will always be one of [bits, mana, elixir].
Follow
This is your basic follow event, it will be fired whenever a viewer follows the channel.
Subscription
GiftSub
Resub
Host
Please note that host events are not emitted for Twitch channels, as these events are not easily available from twitch.
Raid
Last updated