TwitchApi.EventSub (twitch_api v0.2.1)
Start using Twitch EventSub
You can test all your subscriptions using:
https://github.com/twitchdev/twitch-cli/blob/main/docs/event.md#verify-subscription
Link to this section Summary
Functions
List all event sub listeners
Start listening to channel points usage
Start listening to follows
Start listening to when the streamer goes offline
Start listening to when the streamer comes online
Start listening to subscriptions
Stop listening to certain events
Stop listening to all the event sub channels that have no longer installed the extension
Link to this section Functions
list_event_subs(client_id, app_access_token, cursor \\ nil)
List all event sub listeners
There is a maximum, so make sure to stop listening at some point
listen_to_channel_points_used(client_id, app_access_token, callback_url, secret, channel)
Start listening to channel points usage
Scopes required: channel:read:redemptions or channel:manage:redemptions
listen_to_follows(client_id, app_access_token, callback_url, secret, channel)
Start listening to follows
https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelfollow
listen_to_stream_offline(client_id, app_access_token, callback_url, secret, channel)
Start listening to when the streamer goes offline
https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#streamoffline
listen_to_stream_online(client_id, app_access_token, callback_url, secret, channel)
Start listening to when the streamer comes online
https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#streamonline
listen_to_subscriptions(client_id, app_access_token, callback_url, secret, channel)
Start listening to subscriptions
https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelsubscribe
Scopes required: channel:read:subscriptions
Test using the twitch cli:
twitch event verify-subscription subscribe -F https://localhost:4001/webhooks/listen-to-subscriptions
stop_listening(client_id, app_access_token, subscription_id)
Stop listening to certain events
stop_listening_to_event_subs_for_uninstalled_channels(client_id, token, after_stop_listening_closure, cursor \\ nil)
Stop listening to all the event sub channels that have no longer installed the extension
Use after_stop_listening_closure(channel) to add additional logic after we've stopped listening to an event sub