twitchdev / twitch-cli

The official Twitch CLI to make developing on Twitch easier.
Apache License 2.0
604 stars 71 forks source link

Update EventSub to match latest live EventSub documentation (November '22) #191

Closed Xemdo closed 1 year ago

Xemdo commented 1 year ago

Currently the following are out of sync

channel.ban .event.bannedat (Missing from CLI) - [Added 1a37caea7571f4ce7f84feb150783fea9942dcb7]_

channel.channel_points_custom_reward.add .event.redemptions_redeemed_currentstream (Set to 0 in CLI, null in docs) - [Sorta Valid -- See below]_

drop.entitlement.grant .subscription.categoryid (Missing from CLI) - [Added 1a37caea7571f4ce7f84feb150783fea9942dcb7]_ .subscription.campaignid (Missing from CLI) - [Added 1a37caea7571f4ce7f84feb150783fea9942dcb7] .subscription.cost - [Valid -- docs need updating]_

extension.bits_transaction.create .subscription.cost (Set to 1 in CLI, 0 in docs) - [Valid -- docs need updating] .event.product.indevelopment (Set to true in CLI, false in docs) - [Valid -- Doesn't matter; Could be user input in the future]_

channel.hype_train.begin .event.level (Missing from CLI; Reported in #190) - [Added 8a397d5d8620af1ea7c9efbc89984f353f984de6]

channel.hype_train.begin / .progress / .end .event.[top_contributions/lastcontribution].type (Missing 'other' from CLI) - [Added 1fa3d4bd204b7ae9f15e6d88be72ba14a5aa486f]_

channel.prediction.begin / .progress / .lock .event.outcomes.users (Consistent in CLI, inconsistent in doc. Is this optional?) - [Valid -- docs need updating]

user.update .event.email (Missing from CLI) - [Added 8a397d5d8620af1ea7c9efbc89984f353f984de6] .event.emailverified (Missing from CLI) - [Added 8a397d5d8620af1ea7c9efbc89984f353f984de6]_

The following are missing from the CLI

channel.charity_campaign.donate - [Added 02890a9d94b54df20b3f2f48e36996c36f7dc174] channel.charity_campaign.start - [Added b51df2d784595c910ee3a2ef260f1d148406ed77] channel.charity_campaign.progress - [Added b51df2d784595c910ee3a2ef260f1d148406ed77] channel.charity_campaign.stop - [Added b51df2d784595c910ee3a2ef260f1d148406ed77]

Relevant links

https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types

Xemdo commented 1 year ago

user.update is also not in the same naming convention as the rest of the CLI. It should be updated to user-update. This wont make any breaking changes, as the EventSub event name always works anyway.

Xemdo commented 1 year ago

On channel.channel_points_custom_reward.add, the field should_redemptions_skip_request_queue sometimes doesn't exist (when tested in production).

Barry tested this and found:

Using the "add reward" topic, redemptions_redeemed_current_stream is
- null if the channel is not live
- null if the channel is live and has infinite stock
- 0 if the channel is live and has max_per_stream_setting enabled (aka limited stock)

I don't think limited stock rewards are more common than unlimited, but ultimately it doesn't matter. This could be something to set manually if needed. For now, it can remain at a default of 0.