RealtimeChat: Inline Events
The idea is that I want subscriptions to be displayed using the chat panel, this might eventually replace the usage of the web view with the StreamElements component.
Twitch has multiple events that are relevant for this implementation, all of them in the context of EventSub
Subscribe
Name: channel.subscribe
This is the message that is sent whenever someone subscribes or receives a gifted sub. The tier is given as a number multiplied by 1000 and as a string (tier 1 or prime would be "1000").
This event is pretty easy to handle as the only strange thing seems to be that the event sub message does not include information regaring if the subscription is a prime subscription, these are just tier 1 subs which include tier as "1000".
Another thing to consider is that rendering events that have is_gift as true will probably bee to spammy for a mobile screen?
Official badge for a prime subscription
Official badge for regular subscription
Note: It looks like sometimes you will receive a subscribe event and a gift event for the same sub.
Subscription Gift
Name: channel.subscription.gift
This is the message that is sent whenever a user gifts subscriptions, as far as I know one should also receive channel.subscribe events after this events for every gift, the difference is that the event will have is_gift as true.
This event is also relatively easy to handle, the main relevant thing is that whenever is_anonymous is true then you should not use user_name but instead use something else.
Official anonymous gifted subscription
Subscription Message
Name: channel.subscription.message
This should be the message we receive whenever a user resubscribes.
This event is sent for resubs and is probably the only one that has some complexity because it brings a “lightweight” message within (the regular messages usually have more/different properties)
This lightweight message will probably require tweaking the current TwitchMessageModel or creating a new model and handling logic, so that this message is also pinned.
Official badge for a prime re subscription with a streak
Official badge for a prime subscription with a message
Channel Points Custom Reward Redemption Add
Name: channel.channel_points_custom_reward_redemption.add
This is received whenever a user redeems a channel point reward, as of this moment I am not sure if preset rewards are instantly fulfilled and how the exact behaviour is for custom reward redemption.
Channel Points Custom Reward Redemption Update
Name: channel.channel_points_custom_reward_redemption.update
This is received whenever a channel point redemption is updated, this seems to exist because channel point rewards can be customized by the creator, for example creators can add rewards that trigger external actions such as OBS overlays to show or sounds to be played.
This events are added to a queue with status unfulfilled until the creator (or software he/she uses) fulfills the reward and then sends an API call to update the reward.