API reference#
Client Reference#
- clsClient.from_client
- asyncstart
- asyncstop
- defsubscribe_channel_bans
- defsubscribe_channel_cheers
- defsubscribe_channel_follows
- defsubscribe_channel_goal_begin
- defsubscribe_channel_goal_end
- defsubscribe_channel_goal_progress
- defsubscribe_channel_hypetrain_begin
- defsubscribe_channel_hypetrain_end
- defsubscribe_channel_hypetrain_progress
- defsubscribe_channel_moderators_add
- defsubscribe_channel_moderators_remove
- defsubscribe_channel_poll_begin
- defsubscribe_channel_poll_end
- defsubscribe_channel_poll_progress
- defsubscribe_channel_prediction_begin
- defsubscribe_channel_prediction_end
- defsubscribe_channel_prediction_lock
- defsubscribe_channel_prediction_progress
- defsubscribe_channel_reward_add
- defsubscribe_channel_reward_redeem
- defsubscribe_channel_reward_redeem_update
- defsubscribe_channel_reward_remove
- defsubscribe_channel_reward_update
- defsubscribe_channel_shoutout_create
- defsubscribe_channel_shoutout_receive
- defsubscribe_channel_stream_end
- defsubscribe_channel_stream_start
- defsubscribe_channel_subscription_end
- defsubscribe_channel_subscription_gifts
- defsubscribe_channel_subscription_messages
- defsubscribe_channel_subscriptions
- defsubscribe_channel_unbans
- defsubscribe_channel_update
- class twitchio.eventsub.Client(transport: BaseTransport, token_handler: TokenHandlerT, proxy: str | None = None, proxy_auth: aiohttp.BasicAuth | None = None, trace: aiohttp.TraceConfig | None = None)#
The base EventSub client, which handles incoming eventsub data and dispatches it through its own event system. This client is completely standalone from the core TwitchIO
Client, and can operate without any attachedClient. When operating in standalone mode, a Token Handler is still required to manage token access for HTTP calls. To operate Eventsub with a coretwitchio.Clientattached, create this class usingfrom_client().- Parameters
transport (
WebsocketTransport|WebhookTransport) – The transport to use to receive notifications. For more information on each transport, read the corresponding documentation.token_handler (
twitchio.tokens.TokenHandler) – The token handler to use for requesting tokens during HTTP requests. When using theWebsocketTransport, this must have user tokens available for the targets of the subscriptions. When using theWebhookTransport, this must have a client token available, as that is what Twitch requires for webhooks.proxy (
str|None) – The optional proxy to use when making requests. This is passed directly to aiohttp.proxy_auth (
aiohttp.BasicAuth|None) – The auth to give to the proxy. This is passed directly to aiohttp.trace (
aiohttp.TraceConfig|None) – Trace information to configure aiohttp. This is passed directly to aiohttp.
- classmethod from_client(transport: BaseTransport, client: _BaseClient) Self#
Creates a Client that can interface with the Eventsub API system. When created using this method, the client will interact with the core
Client, using its token handler, and additionally dispatching events through its event system (in addition to the standalone events).- Parameters
transport (
WebsocketTransport|WebhookTransport) – The transport to use to receive notifications. For more information on each transport, read the corresponding documentation.client (
twitchio.Client|Twitchio.ext.commands.Bot) – The core client to attach this client to.
- coroutine start() None#
Starts the Eventsub Client, which will initialize the underlying transport and subscribe/listen to events.
- coroutine stop() None#
Stops the Eventsub Client, which tells the underlying transport to stop listening for events, and clean up after itself.
Note
The client cannot be restarted once it has been stopped.
- subscribe_channel_bans(broadcaster: BaseUser) Awaitable[HTTPSubscribeResponse]#
- Parameters
broadcaster (
PartialUser) – The channel to for this subscription to target. This user must have authenticated your app.- Returns
- subscribe_channel_cheers(broadcaster: BaseUser) Awaitable[HTTPSubscribeResponse]#
- Parameters
broadcaster (
PartialUser) – The channel to for this subscription to target. This user must have authenticated your app.- Returns
- subscribe_channel_follows(broadcaster: BaseUser) Awaitable[HTTPSubscribeResponse]#
- Parameters
broadcaster (
PartialUser) – The channel to for this subscription to target. This user must have authenticated your app.- Returns
- subscribe_channel_goal_begin(broadcaster: BaseUser) Awaitable[HTTPSubscribeResponse]#
- Parameters
broadcaster (
PartialUser) – The channel to for this subscription to target. This user must have authenticated your app.- Returns
- subscribe_channel_goal_end(broadcaster: BaseUser) Awaitable[HTTPSubscribeResponse]#
- Parameters
broadcaster (
PartialUser) – The channel to for this subscription to target. This user must have authenticated your app.- Returns
- subscribe_channel_goal_progress(broadcaster: BaseUser) Awaitable[HTTPSubscribeResponse]#
- Parameters
broadcaster (
PartialUser) – The channel to for this subscription to target. This user must have authenticated your app.- Returns
- subscribe_channel_hypetrain_begin(broadcaster: BaseUser) Awaitable[HTTPSubscribeResponse]#
- Parameters
broadcaster (
PartialUser) – The channel to for this subscription to target. This user must have authenticated your app.- Returns
- subscribe_channel_hypetrain_end(broadcaster: BaseUser) Awaitable[HTTPSubscribeResponse]#
- Parameters
broadcaster (
PartialUser) – The channel to for this subscription to target. This user must have authenticated your app.- Returns
- subscribe_channel_hypetrain_progress(broadcaster: BaseUser) Awaitable[HTTPSubscribeResponse]#
- Parameters
broadcaster (
PartialUser) – The channel to for this subscription to target. This user must have authenticated your app.- Returns
- subscribe_channel_moderators_add(broadcaster: BaseUser) Awaitable[HTTPSubscribeResponse]#
- Parameters
broadcaster (
PartialUser) – The channel to for this subscription to target. This user must have authenticated your app.- Returns
- subscribe_channel_moderators_remove(broadcaster: BaseUser) Awaitable[HTTPSubscribeResponse]#
- Parameters
broadcaster (
PartialUser) – The channel to for this subscription to target. This user must have authenticated your app.- Returns
- subscribe_channel_poll_begin(broadcaster: BaseUser) Awaitable[HTTPSubscribeResponse]#
- Parameters
broadcaster (
PartialUser) – The channel to for this subscription to target. This user must have authenticated your app.- Returns
- subscribe_channel_poll_end(broadcaster: BaseUser) Awaitable[HTTPSubscribeResponse]#
- Parameters
broadcaster (
PartialUser) – The channel to for this subscription to target. This user must have authenticated your app.- Returns
- subscribe_channel_poll_progress(broadcaster: BaseUser) Awaitable[HTTPSubscribeResponse]#
- Parameters
broadcaster (
PartialUser) – The channel to for this subscription to target. This user must have authenticated your app.- Returns
- subscribe_channel_prediction_begin(broadcaster: BaseUser) Awaitable[HTTPSubscribeResponse]#
- Parameters
broadcaster (
PartialUser) – The channel to for this subscription to target. This user must have authenticated your app.- Returns
- subscribe_channel_prediction_end(broadcaster: BaseUser) Awaitable[HTTPSubscribeResponse]#
- Parameters
broadcaster (
PartialUser) – The channel to for this subscription to target. This user must have authenticated your app.- Returns
- subscribe_channel_prediction_lock(broadcaster: BaseUser) Awaitable[HTTPSubscribeResponse]#
- Parameters
broadcaster (
PartialUser) – The channel to for this subscription to target. This user must have authenticated your app.- Returns
- subscribe_channel_prediction_progress(broadcaster: BaseUser) Awaitable[HTTPSubscribeResponse]#
- Parameters
broadcaster (
PartialUser) – The channel to for this subscription to target. This user must have authenticated your app.- Returns
- subscribe_channel_reward_add(broadcaster: BaseUser) Awaitable[HTTPSubscribeResponse]#
- Parameters
broadcaster (
PartialUser) – The channel to for this subscription to target. This user must have authenticated your app.- Returns
- subscribe_channel_reward_redeem(broadcaster: BaseUser, moderator: BaseUser) Awaitable[HTTPSubscribeResponse]#
- Parameters
broadcaster (
PartialUser) – The channel to for this subscription to target.moderator (
PartialUser) – The moderator that is authorizing the action. This user must have authenticated your app.
- Returns
- subscribe_channel_reward_redeem_update(broadcaster: BaseUser, moderator: BaseUser) Awaitable[HTTPSubscribeResponse]#
- Parameters
broadcaster (
PartialUser) – The channel to for this subscription to target.moderator (
PartialUser) – The moderator that is authorizing the action. This user must have authenticated your app.
- Returns
- subscribe_channel_reward_remove(broadcaster: BaseUser) Awaitable[HTTPSubscribeResponse]#
- Parameters
broadcaster (
PartialUser) – The channel to for this subscription to target. This user must have authenticated your app.- Returns
- subscribe_channel_reward_update(broadcaster: BaseUser) Awaitable[HTTPSubscribeResponse]#
- Parameters
broadcaster (
PartialUser) – The channel to for this subscription to target. This user must have authenticated your app.- Returns
- subscribe_channel_shoutout_create(broadcaster: BaseUser, moderator: BaseUser) Awaitable[HTTPSubscribeResponse]#
- Parameters
broadcaster (
PartialUser) – The channel to for this subscription to target.moderator (
PartialUser) – The moderator that is authorizing the action. This user must have authenticated your app.
- Returns
- subscribe_channel_shoutout_receive(broadcaster: BaseUser, moderator: BaseUser) Awaitable[HTTPSubscribeResponse]#
- Parameters
broadcaster (
PartialUser) – The channel to for this subscription to target.moderator (
PartialUser) – The moderator that is authorizing the action. This user must have authenticated your app.
- Returns
- subscribe_channel_stream_end(broadcaster: BaseUser) Awaitable[HTTPSubscribeResponse]#
- Parameters
broadcaster (
PartialUser) – The channel to for this subscription to target. This user must have authenticated your app.- Returns
- subscribe_channel_stream_start(broadcaster: BaseUser) Awaitable[HTTPSubscribeResponse]#
- Parameters
broadcaster (
PartialUser) – The channel to for this subscription to target. This user must have authenticated your app.- Returns
- subscribe_channel_subscription_end(broadcaster: BaseUser) Awaitable[HTTPSubscribeResponse]#
- Parameters
broadcaster (
PartialUser) – The channel to for this subscription to target. This user must have authenticated your app.- Returns
- subscribe_channel_subscription_gifts(broadcaster: BaseUser) Awaitable[HTTPSubscribeResponse]#
- Parameters
broadcaster (
PartialUser) – The channel to for this subscription to target. This user must have authenticated your app.- Returns
- subscribe_channel_subscription_messages(broadcaster: BaseUser) Awaitable[HTTPSubscribeResponse]#
- Parameters
broadcaster (
PartialUser) – The channel to for this subscription to target. This user must have authenticated your app.- Returns
- subscribe_channel_subscriptions(broadcaster: BaseUser) Awaitable[HTTPSubscribeResponse]#
- Parameters
broadcaster (
PartialUser) – The channel to for this subscription to target. This user must have authenticated your app.- Returns
- subscribe_channel_unbans(broadcaster: BaseUser) Awaitable[HTTPSubscribeResponse]#
- Parameters
broadcaster (
PartialUser) – The channel to for this subscription to target. This user must have authenticated your app.- Returns
- subscribe_channel_update(broadcaster: BaseUser) Awaitable[HTTPSubscribeResponse]#
- Parameters
broadcaster (
PartialUser) – The channel to for this subscription to target. This user must have authenticated your app.- Returns
Event Reference#
- class twitchio.eventsub.Subscription(payload: _SubscriptionPayload, transport: BaseTransport)#
Subscription info given when twitch fires an event. For info on the message itself, check
meta- cost#
The cost of the the subscription towards your total subscription points. If the user has authorized your application this is 0.
- Type
- condition#
The condition for this subscription to trigger an event. # TODO determine dicts on this.
- transport#
The transport that dispatched this event.
New in version 3.0.
- Type
BaseTransport
- class twitchio.eventsub.WebsocketMeta(data: _WebsocketMessageMetadata)#
- class twitchio.eventsub.RevocationEvent(transport: BaseTransport)#
Event created when someone revokes access for your app. This event has no special attributes, you can determine information about the revoked event via
subscription. You can listen to this event via theevent_eventsub_revocationevent or via subclassing the EventSub client.- subscription#
The subscription that triggered this event.
- Type
- meta#
The metadata associated with this event. There are slight differences between the webhook metadata and websocket metadata. This was previously known as
headers.Changed in version 3.0.
- Type
- transport#
The transport that received this event.
New in version 3.0.
- Type
BaseTransport
- class twitchio.eventsub.ChallengeEvent(transport: BaseTransport)#
This event is created to challenge your webhook authenticity (meaning it is only used when using the
WebhookTransporttransport). These challenges are handled by TwitchIO, so you shouldn’t need to deal with these. You can listen to this event via theevent_eventsub_challengeevent or via subclassing the EventSub client.- subscription#
The subscription that triggered this event.
- Type
- meta#
The metadata associated with this event. There are slight differences between the webhook metadata and websocket metadata. This was previously known as
headers.Changed in version 3.0.
- Type
- transport#
The transport that received this event.
New in version 3.0.
- Type
BaseTransport
- class twitchio.eventsub.NotificationEvent(transport: BaseTransport)#
This event is created when a notification is received from twitch.
- subscription#
The subscription that triggered this event.
- Type
- meta#
The metadata associated with this event. There are slight differences between the webhook metadata and websocket metadata. This was previously known as
headers.Changed in version 3.0.
- Type
- transport#
The transport that received this event.
New in version 3.0.
- Type
BaseTransport
- class twitchio.eventsub.ReconnectEvent(transport: BaseTransport)#
This event is created when the twitch websocket wants the client to reconnect. Reconnecting is automatically handled, this event is simply to inform you of it happening.
- reconnect_url#
The URL provided by twitch to reconnect to. This will keep the existing subscriptions intact for us.
- Type
class:str
- subscription#
The subscription that triggered this event.
- Type
- meta#
The metadata associated with this event. There are slight differences between the webhook metadata and websocket metadata. This was previously known as
headers.Changed in version 3.0.
- Type
- transport#
The transport that received this event.
New in version 3.0.
- Type
BaseTransport
- class twitchio.eventsub.KeepaliveEvent(transport: BaseTransport)#
This event is created to fill space and let you know twitch is still sending you events after a spout of silence. Nothing needs to be done.
- subscription#
The subscription that triggered this event.
- Type
- meta#
The metadata associated with this event. There are slight differences between the webhook metadata and websocket metadata. This was previously known as
headers.Changed in version 3.0.
- Type
- transport#
The transport that received this event.
New in version 3.0.
- Type
BaseTransport
Event Data Reference#
- class twitchio.eventsub.ChannelBan(transport: BaseTransport, payload: ChannelBanPayload)#
A channel ban or timeout. Indicates someone was banned from the channel’s chat.
- user#
The user who was banned.
- Type
PartialUser
- broadcaster#
The channel from which the user was banned.
- Type
PartialUser
- moderator#
The moderator who banned the user.
- Type
PartialUser
- banned_at#
When the ban occurred.
- Type
- ends_at#
When the timeout ends.
Noneif it is a ban (permanent).- Type
datetime.datetime|None
- class twitchio.eventsub.ChannelCheer(transport: BaseTransport, payload: ChannelCheerPayload)#
A cheer on a channel. Someone sent an amount of bits.
- user#
The user who gave the gifts. Could be
Noneif the gifter was anonymous.- Type
PartialUser|None
- broadcaster#
The channel that the user subscribed to.f
- Type
PartialUser
- class twitchio.eventsub.ChannelCustomReward(transport: BaseTransport, payload: ChannelCustomRewardModifyPayload)#
A Custom Reward event
- broadcaster#
The channel on which the reward was modified.
- Type
- redemptions_skip_request_queue#
Whether redemptions will bypass the redemption request queue.
- Type
- cooldown_expires_at#
When the cooldown will expire, if on cooldown.
- Type
datetime.datetime|None
- amount_redeemed_current_stream#
How many of this reward have been redeemed during the current stream.
Nonewhen not live.- Type
int|None
- max_per_stream#
The max amount of this reward that can be redeemed in a stream.
- Type
ChannelCustomReward_streamlimits
- global_cooldown#
The global cooldown configuration for this reward.
- Type
ChannelCustomReward_global_cooldown
- image#
The image for this reward.
- Type
- default_image#
The default image for this reward.
- Type
- class twitchio.eventsub.ChannelCustomRewardAdd(transport: BaseTransport, payload: ChannelCustomRewardModifyPayload)#
A Custom Reward event
- broadcaster#
The channel on which the reward was modified.
- Type
- redemptions_skip_request_queue#
Whether redemptions will bypass the redemption request queue.
- Type
- cooldown_expires_at#
When the cooldown will expire, if on cooldown.
- Type
datetime.datetime|None
- amount_redeemed_current_stream#
How many of this reward have been redeemed during the current stream.
Nonewhen not live.- Type
int|None
- max_per_stream#
The max amount of this reward that can be redeemed in a stream.
- Type
ChannelCustomReward_streamlimits
- global_cooldown#
The global cooldown configuration for this reward.
- Type
ChannelCustomReward_global_cooldown
- image#
The image for this reward.
- Type
- default_image#
The default image for this reward.
- Type
- class twitchio.eventsub.ChannelCustomRewardRemove(transport: BaseTransport, payload: ChannelCustomRewardModifyPayload)#
A Custom Reward event
- broadcaster#
The channel on which the reward was modified.
- Type
- redemptions_skip_request_queue#
Whether redemptions will bypass the redemption request queue.
- Type
- cooldown_expires_at#
When the cooldown will expire, if on cooldown.
- Type
datetime.datetime|None
- amount_redeemed_current_stream#
How many of this reward have been redeemed during the current stream.
Nonewhen not live.- Type
int|None
- max_per_stream#
The max amount of this reward that can be redeemed in a stream.
- Type
ChannelCustomReward_streamlimits
- global_cooldown#
The global cooldown configuration for this reward.
- Type
ChannelCustomReward_global_cooldown
- image#
The image for this reward.
- Type
- default_image#
The default image for this reward.
- Type
- class twitchio.eventsub.ChannelCustomRewardUpdate(transport: BaseTransport, payload: ChannelCustomRewardModifyPayload)#
A Custom Reward event
- broadcaster#
The channel on which the reward was modified.
- Type
- redemptions_skip_request_queue#
Whether redemptions will bypass the redemption request queue.
- Type
- cooldown_expires_at#
When the cooldown will expire, if on cooldown.
- Type
datetime.datetime|None
- amount_redeemed_current_stream#
How many of this reward have been redeemed during the current stream.
Nonewhen not live.- Type
int|None
- max_per_stream#
The max amount of this reward that can be redeemed in a stream.
- Type
ChannelCustomReward_streamlimits
- global_cooldown#
The global cooldown configuration for this reward.
- Type
ChannelCustomReward_global_cooldown
- image#
The image for this reward.
- Type
- default_image#
The default image for this reward.
- Type
- class twitchio.eventsub.ChannelFollow(transport: BaseTransport, payload: ChannelFollowPayload)#
A channel follow. Indicates someone followed the broadcaster.
- user#
The user who followed.
- Type
PartialUser
- broadcaster#
The user who received the follow.
- Type
PartialUser
- followed_at#
The time the follow happened.
- Type
- class twitchio.eventsub.ChannelGoalBegin(transport: BaseTransport, payload: ChannelGoalBeginProgressPayload)#
A goal begin event
- broadcaster#
The broadcaster that started the goal
- Type
- started_at#
The datetime the goal was started.
- Type
- class twitchio.eventsub.ChannelGoalEnd(transport: BaseTransport, payload: ChannelGoalEndPayload)#
A goal begin event
- broadcaster#
The broadcaster that started the goal
- Type
- started_at#
The datetime the goal was started.
- Type
- class twitchio.eventsub.ChannelGoalProgress(transport: BaseTransport, payload: ChannelGoalBeginProgressPayload)#
A goal begin event
- broadcaster#
The broadcaster that started the goal
- Type
- started_at#
The datetime the goal was started.
- Type
- class twitchio.eventsub.ChannelHypeTrainBegin(transport: BaseTransport, payload: ChannelHypeTrainBeginProgressPayload)#
A Hype Train Begin event
- broadcaster#
The channel the Hype Train occurred in.
- Type
- started#
When the Hype Train started.
- Type
- expires#
When the Hype Train ends.
- Type
- top_contributions#
The top contributions of the Hype Train.
- Type
List[
HypeTrainContributor]
- last_contribution#
The last contributor to the Hype Train.
- Type
- class twitchio.eventsub.ChannelHypeTrainEnd(transport: BaseTransport, payload: ChannelHypeTrainEndPayload)#
A Hype Train End event
- broadcaster#
The channel the Hype Train occurred in.
- Type
- started#
When the Hype Train started.
- Type
- top_contributions#
The top contributions of the Hype Train.
- Type
List[
HypeTrainContributor]
- cooldown_ends_at#
When another Hype Train can begin.
- Type
- class twitchio.eventsub.ChannelHypeTrainProgress(transport: BaseTransport, payload: ChannelHypeTrainBeginProgressPayload)#
A Hype Train Progress event
- broadcaster#
The channel the Hype Train occurred in.
- Type
- started#
When the Hype Train started.
- Type
- expires#
When the Hype Train ends.
- Type
- top_contributions#
The top contributions of the Hype Train.
- Type
List[
HypeTrainContributor]
- last_contribution#
The last contributor to the Hype Train.
- Type
- class twitchio.eventsub.ChannelModeratorAdd(transport: BaseTransport, payload: ChannelModeratorAddPayload)#
Moderator added to channel
- user#
The user being added as a moderator.
- Type
- broadcaster#
The channel that is having a moderator added.
- Type
- class twitchio.eventsub.ChannelModeratorRemove(transport: BaseTransport, payload: ChannelModeratorRemovePayload)#
Moderator removed from channel
- user#
The user being removed from moderator status.
- Type
- broadcaster#
The channel that is having a moderator removed.
- Type
- class twitchio.eventsub.ChannelPollBegin(transport: BaseTransport, payload: ChannelPollBeginPayload)#
A Poll Begin event
- broadcaster#
The channel the poll occured in.
- Type
- choices#
The choices in the poll.
- Type
List[
PollChoice]
- started_at#
When the poll started.
- Type
- ends_at#
When the poll is set to end.
- Type
- class twitchio.eventsub.ChannelPollEnd(transport: BaseTransport, payload: ChannelPollEndPayload)#
A Poll End event
- broadcaster#
The channel the poll occured in.
- Type
- choices#
The choices in the poll.
- Type
List[
PollChoice]
- status#
How the poll ended.
- Type
- started_at#
When the poll started.
- Type
- ended_at#
When the poll is set to end.
- Type
- class twitchio.eventsub.ChannelPollProgress(transport: BaseTransport, payload: ChannelPollBeginPayload)#
A Poll Progress event. dispatched when a poll received an update to votes
- broadcaster#
The channel the poll occured in.
- Type
- choices#
The choices in the poll.
- Type
List[
PollChoice]
- started_at#
When the poll started.
- Type
- ends_at#
When the poll is set to end.
- Type
- class twitchio.eventsub.ChannelPredictionBegin(transport: BaseTransport, payload: ChannelPredictionBeginPayload)#
A Prediction Begin event
- broadcaster#
The channel the prediction occured in.
- Type
- outcomes#
The outcomes for the prediction.
- Type
List[
PredictionOutcome]
- started_at#
When the prediction started.
- Type
- locks_at#
When the prediction is set to be locked.
- Type
- class twitchio.eventsub.ChannelPredictionEnd(transport: BaseTransport, payload: ChannelPredictionEndPayload)#
A Prediction Begin/Progress event
- broadcaster#
The channel the prediction occured in
- Type
- outcomes#
The outcomes for the prediction
- Type
List[
PredictionOutcome]
- status#
How the prediction ended
- Type
- started_at#
When the prediction started
- Type
- ended_at#
When the prediction ended
- Type
- class twitchio.eventsub.ChannelPredictionLock(transport: BaseTransport, payload: ChannelPredictionProgressLockPayload)#
A Prediction Lock event
- broadcaster#
The channel the prediction occured in.
- Type
- outcomes#
The outcomes for the prediction.
- Type
List[
PredictionOutcome]
- started_at#
When the prediction started.
- Type
- locked_at#
When the prediction was locked.
- Type
- class twitchio.eventsub.ChannelPredictionProgress(transport: BaseTransport, payload: ChannelPredictionBeginPayload)#
A Prediction Progress event
- broadcaster#
The channel the prediction occured in.
- Type
- outcomes#
The outcomes for the prediction.
- Type
List[
PredictionOutcome]
- started_at#
When the prediction started.
- Type
- locks_at#
When the prediction is set to be locked.
- Type
- class twitchio.eventsub.ChannelRaid(transport: BaseTransport, payload: ChannelRaidPayload)#
A Raid event
- raider#
The person initiating the raid.
- Type
- reciever#
The person recieving the raid.
- Type
- class twitchio.eventsub.ChannelShoutoutCreate(transport: BaseTransport, payload: ChannelShoutoutCreatePayload)#
A shoutout create event. This is created when a shoutout is created, not received.
- broadcaster#
The broadcaster from which the shoutout is coming.
- Type
- moderator#
The moderator that created the shoutout.
- Type
- target#
The person receiving the shoutout.
- Type
- started_at#
When the shoutout started.
- Type
- cooldown_ends_at#
When another shoutout can happen.
- Type
- target_cooldown_ends_at#
When the target can have another shoutout towards them.
- Type
- class twitchio.eventsub.ChannelShoutoutReceive(transport: BaseTransport, payload: ChannelShoutoutCreatePayload)#
A shoutout receive event. This is created when a shoutout is received, not created.
- broadcaster#
The broadcaster receiving the shoutout.
- Type
- sender#
The person sending the shoutout.
- Type
- started_at#
When the shoutout started.
- Type
- class twitchio.eventsub.ChannelSubscribe(transport: BaseTransport, payload: ChannelSubscribePayload)#
A channel subscription. Indicates someone subscribed to the channel. This does not include resubscriptions.
- user#
The user who subscribed.
- Type
PartialUser
- broadcaster#
The channel that the user subscribed to.
- Type
PartialUser
- tier#
The tier of the subscription.
- Type
Literal[1000, 2000, 3000]
- class twitchio.eventsub.ChannelSubscribeEnd(transport: BaseTransport, payload: ChannelSubscribeEndPayload)#
The end of a channel subscription. Indicates that someone has unsubscribed from the channel.
- user#
The user who subscribed.
- Type
PartialUser
- broadcaster#
The channel that the user subscribed to.
- Type
PartialUser
- tier#
The tier of the subscription.
- Type
Literal[1000, 2000, 3000]
- class twitchio.eventsub.ChannelSubscribeGift(transport: BaseTransport, payload: ChannelSubscriptionGiftPayload)#
A gifted subscription to a channel. This could be one or more gifts.
- user#
The user who gave the gifts. Could be
Noneif the gift is anonymous.- Type
PartialUser|None
- broadcaster#
The channel that the user subscribed to.
- Type
PartialUser
- cumulative_total#
How many gifts the user has given in total. This can be
Noneif the gift is anonymous or the user doesn’t share this.- Type
int|None
- tier#
The tier of the subscription.
- Type
Literal[1000, 2000, 3000]
- class twitchio.eventsub.ChannelSubscribeMessage(transport: BaseTransport, payload: ChannelSubscriptionMessagePayload)#
A resubscription message, as seen in chat.
- user#
The user who gave the gifts.
- Type
PartialUser
- broadcaster#
The channel that the user subscribed to.
- Type
PartialUser
- stream_moths#
How many months in a row the user has been subscribed to the channel.
Noneif not shared by the user.- Type
int|None
- tier#
The tier of the subscription.
- Type
Literal[1000, 2000, 3000]
- class twitchio.eventsub.ChannelUnban(transport: BaseTransport, payload: ChannelUnbanPayload)#
A Channel Unban event
- user#
The user that was unbanned.
- Type
- broadcaster#
The channel the unban occurred in.
- Type
- moderator#
The moderator that performed the unban.
- Type
:class`twitchio.PartialUser`
- class twitchio.eventsub.ChannelUpdate(transport: BaseTransport, payload: ChannelUpdatePayload)#
A Channel Update. You can listen to this event via the
event_eventsub_channel_updateevent or via subclassing the EventSub client.- broadcaster#
The channel being updated
- Type
- class twitchio.eventsub.EventData(transport: BaseTransport, payload: Any)#
- class twitchio.eventsub.HypeTrainContributor(transport: BaseTransport, payload: ChannelHypeTrain_ContributorPayload)#
A Contributor to a Hype Train
- user#
The user.
- Type
- class twitchio.eventsub.ImageLinks(payload: ImagePayload)#
Provides URLS for various image locations.
New in version 3.0.
- class twitchio.eventsub.PartialReward(payload: ChannelCustomRewardRedemptionModify_RewardPayload)#
A partial reward object, which provides limited information about the reward that was redeemed.
- class twitchio.eventsub.PollChoice(data: ChannelPollBegin_ChoicePayload)#
A Poll Choice
- class twitchio.eventsub.PollStatus(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)#
The status of a poll.
ACTIVE: Poll is currently in progress. COMPLETED: Poll has reached its ended_at time. TERMINATED: Poll has been manually terminated before its ended_at time. ARCHIVED: Poll is no longer visible on the channel. MODERATED: Poll is no longer visible to any user on Twitch. INVALID: Something went wrong determining the state.
- class twitchio.eventsub.PredictionOutcome(transport: BaseTransport, data: ChannelPredictionBegin_outcomesPayload)#
A Prediction Outcome
- class twitchio.eventsub.PredictionStatus(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)#
The status of a Prediction.
ACTIVE: Prediction is active and viewers can make predictions. LOCKED: Prediction has been locked and viewers can no longer make predictions. RESOLVED: A winning outcome has been chosen and the Channel Points have been distributed to the users who guessed the correct outcome. CANCELED: Prediction has been canceled and the Channel Points have been refunded to participants.
- class twitchio.eventsub.Predictor(transport: BaseTransport, data: dict)#
A Predictor
- user#
The user who predicted an outcome
- Type
- class twitchio.eventsub.StreamOffline(transport: BaseTransport, payload: StreamOfflinePayload)#
A Stream Offline event
- broadcaster#
The channel that went live.
- Type
- class twitchio.eventsub.StreamOnline(transport: BaseTransport, payload: StreamOnlinePayload)#
A Stream Start event
- broadcaster#
The channel that went live.
- Type
- type#
One of “live”, “playlist”, “watch_party”, “premier”, or “rerun”. The type of live event.
- Type
- started_at#
The time when the stream started.
- Type
- class twitchio.eventsub.UserAuthorizationGrant(transport: BaseTransport, payload: UserAuthorizationGrantPayload)#
An Authorization Granted event
This subscription type is only supported by webhooks. Provided client_id must match the client id in the application access token.
- user#
The user that has granted authorization for your app.
- Type
- class twitchio.eventsub.UserAuthorizationRevoke(transport: BaseTransport, payload: UserAuthorizationRevokePayload)#
An Authorization Revoke event
This subscription type is only supported by webhooks. Provided client_id must match the client id in the application access token.
- user#
The user that has revoked authorization for your app.
- Type