Classes
AppEvents
¶
Bases: _BaseEvents
Event handler for app-based event subscriptions using conduits.
automod_message_hold(broadcaster_user_id, moderator_user_id, version='2')
async
¶
Subscribe to automod message hold event.
Token and Authorization Requirements::
| Token Type | Required Scopes | Authorization Requirements |
|---|---|---|
| User Access | moderator:manage:automod | Token holder must be moderator/broadcaster |
| App Access | moderator:manage:automod | User authorized app with scope, must be mod/bc |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
broadcaster_user_id
|
str
|
The broadcaster user ID for the channel to monitor. |
required |
moderator_user_id
|
str
|
The moderator user ID. Must match the user ID in the access token. |
required |
version
|
Literal['1', '2']
|
The version number that identifies the definition of the subscription's data. |
'2'
|
Returns:
| Type | Description |
|---|---|
Subscription
|
Created or existing subscription (based on ignore_conflict). |
Raises:
| Type | Description |
|---|---|
TokenError
|
If using webhooks/conduits without an app access token. |
BadRequest
|
If the request parameters are invalid or websocket transport has different user subscriptions. |
Unauthorized
|
If the token is invalid, expired, or lacks required scopes. |
Forbidden
|
If subscription missing proper authorization. |
RateLimit
|
The request exceeds the number of subscriptions that you may create. |
Conflict
|
If a subscription with the same type and condition already exists. |
Examples:
Version 1::
@client.event
async def on_automod_message_hold_v1(message: Event[AutomodHoldEventV1]):
...
Version 2::
@client.event
async def on_automod_message_hold_v2(message: Event[AutomodHoldEventV2]):
...
automod_message_update(broadcaster_user_id, moderator_user_id, version='2')
async
¶
Subscribe to automod message update event.
Token and Authorization Requirements::
| Token Type | Required Scopes | Authorization Requirements |
|---|---|---|
| User Access | moderator:manage:automod | Token holder must be moderator/broadcaster |
| App Access | moderator:manage:automod | User authorized app with scope, must be moderator/broadcaster |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
broadcaster_user_id
|
str
|
The broadcaster user ID for the channel to monitor. |
required |
moderator_user_id
|
str
|
The moderator user ID. Must match the user ID in the access token. |
required |
version
|
Literal['1', '2']
|
The version number that identifies the definition of the subscription's data. |
'2'
|
Returns:
| Type | Description |
|---|---|
Subscription
|
Created or existing subscription (based on ignore_conflict). |
Raises:
| Type | Description |
|---|---|
TokenError
|
If using webhooks/conduits without an app access token. |
BadRequest
|
If the request parameters are invalid or websocket transport has different user subscriptions. |
Unauthorized
|
If the token is invalid, expired, or lacks required scopes. |
Forbidden
|
If subscription missing proper authorization. |
RateLimit
|
The request exceeds the number of subscriptions that you may create. |
Conflict
|
If a subscription with the same type and condition already exists. |
Examples:
Version 1::
@client.event
async def on_automod_message_update_v1(message: Event[AutomodUpdateEventV1]):
...
Version 2::
@client.event
async def on_automod_message_update_v2(message: Event[AutomodUpdateEventV2]):
...
automod_settings_update(broadcaster_user_id, moderator_user_id, version='1')
async
¶
Subscribe to automod settings update event.
Token and Authorization Requirements::
| Token Type | Required Scopes | Authorization Requirements |
|---|---|---|
| User Access | moderator:read:automod_settings | Token holder must be moderator/broadcaster |
| App Access | moderator:read:automod_settings | User authorized app with scope, must be mod/bc |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
broadcaster_user_id
|
str
|
The broadcaster user ID for the channel to monitor. |
required |
moderator_user_id
|
str
|
The moderator user ID. Must match the user ID in the access token. |
required |
version
|
Literal['1']
|
The version number that identifies the definition of the subscription's data. |
'1'
|
Returns:
| Type | Description |
|---|---|
Subscription
|
Created or existing subscription (based on ignore_conflict). |
Raises:
| Type | Description |
|---|---|
TokenError
|
If using webhooks/conduits without an app access token. |
BadRequest
|
If the request parameters are invalid or websocket transport has different user subscriptions. |
Unauthorized
|
If the token is invalid, expired, or lacks required scopes. |
Forbidden
|
If subscription missing proper authorization. |
RateLimit
|
The request exceeds the number of subscriptions that you may create. |
Conflict
|
If a subscription with the same type and condition already exists. |
Examples:
Version 1::
@client.event
async def on_automod_settings_update_v1(message: Event[AutomodSettingsUpdateEvent]):
...
automod_terms_update(broadcaster_user_id, moderator_user_id, version='1')
async
¶
Subscribe to automod terms update event.
Token and Authorization Requirements::
| Token Type | Required Scopes | Authorization Requirements |
|---|---|---|
| User Access | moderator:manage:automod | Token holder must be moderator/broadcaster |
| App Access | moderator:manage:automod | User authorized app with scope, must be moderator/broadcaster |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
broadcaster_user_id
|
str
|
The broadcaster user ID for the channel to monitor. |
required |
moderator_user_id
|
str
|
The moderator user ID. Must match the user ID in the access token. |
required |
version
|
Literal['1']
|
The version number that identifies the definition of the subscription's data. |
'1'
|
Returns:
| Type | Description |
|---|---|
Subscription
|
Created or existing subscription (based on ignore_conflict). |
Raises:
| Type | Description |
|---|---|
TokenError
|
If using webhooks/conduits without an app access token. |
BadRequest
|
If the request parameters are invalid or websocket transport has different user subscriptions. |
Unauthorized
|
If the token is invalid, expired, or lacks required scopes. |
Forbidden
|
If subscription missing proper authorization. |
RateLimit
|
The request exceeds the number of subscriptions that you may create. |
Conflict
|
If a subscription with the same type and condition already exists. |
Examples:
Version 1::
@client.event
async def on_automod_terms_update_v1(message: Event[AutomodTermsUpdateEvent]):
...
channel_chat_clear(broadcaster_user_id, user_id, version='1')
async
¶
Subscribe to channel chat clear event.
Token and Authorization Requirements::
| Token Type | Required Scopes | Authorization Requirements |
|---|---|---|
| User Access | user:read:chat | Token holder must be moderator/broadcaster |
| App Access | user:bot | App must have user:bot + channel:bot or mod status |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
broadcaster_user_id
|
str
|
The broadcaster user ID for the channel to monitor. |
required |
user_id
|
str
|
The user ID for the user that can read chat. Must match the user ID in the access token. |
required |
version
|
Literal['1']
|
The version number that identifies the definition of the subscription's data. |
'1'
|
Returns:
| Type | Description |
|---|---|
Subscription
|
Created or existing subscription (based on ignore_conflict). |
Raises:
| Type | Description |
|---|---|
TokenError
|
If using webhooks/conduits without an app access token. |
BadRequest
|
If the request parameters are invalid or websocket transport has different user subscriptions. |
Unauthorized
|
If the token is invalid, expired, or lacks required scopes. |
Forbidden
|
If subscription missing proper authorization. |
RateLimit
|
The request exceeds the number of subscriptions that you may create. |
Conflict
|
If a subscription with the same type and condition already exists. |
Examples:
Version 1::
@client.event
async def on_channel_chat_clear_v1(message: Event[ChannelChatClearEvent]):
...
channel_chat_clear_user_messages(broadcaster_user_id, user_id, version='1')
async
¶
Subscribe to channel chat clear user messages event.
Token and Authorization Requirements::
| Token Type | Required Scopes | Authorization Requirements |
|---|---|---|
| User Access | user:read:chat | Token holder must be moderator/broadcaster |
| App Access | user:bot | App must have user:bot + channel:bot or mod status |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
broadcaster_user_id
|
str
|
The broadcaster user ID for the channel to monitor. |
required |
user_id
|
str
|
The user ID for the user that can read chat. Must match the user ID in the access token. |
required |
version
|
Literal['1']
|
The version number that identifies the definition of the subscription's data. |
'1'
|
Returns:
| Type | Description |
|---|---|
Subscription
|
Created or existing subscription (based on ignore_conflict). |
Raises:
| Type | Description |
|---|---|
TokenError
|
If using webhooks/conduits without an app access token. |
BadRequest
|
If the request parameters are invalid or websocket transport has different user subscriptions. |
Unauthorized
|
If the token is invalid, expired, or lacks required scopes. |
Forbidden
|
If subscription missing proper authorization. |
RateLimit
|
The request exceeds the number of subscriptions that you may create. |
Conflict
|
If a subscription with the same type and condition already exists. |
Examples:
Version 1::
@client.event
async def on_channel_chat_clear_user_messages_v1(message: Event[ChannelChatClearUserMessagesEvent]):
...
channel_chat_message_delete(broadcaster_user_id, user_id, version='1')
async
¶
Subscribe to channel chat message delete event.
Token and Authorization Requirements::
| Token Type | Required Scopes | Authorization Requirements |
|---|---|---|
| User Access | user:read:chat | Token holder must be moderator/broadcaster |
| App Access | user:bot | App must have user:bot + channel:bot or mod status |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
broadcaster_user_id
|
str
|
The broadcaster user ID for the channel to monitor. |
required |
user_id
|
str
|
The user ID for the user that can read chat. Must match the user ID in the access token. |
required |
version
|
Literal['1']
|
The version number that identifies the definition of the subscription's data. |
'1'
|
Returns:
| Type | Description |
|---|---|
Subscription
|
Created or existing subscription (based on ignore_conflict). |
Raises:
| Type | Description |
|---|---|
TokenError
|
If using webhooks/conduits without an app access token. |
BadRequest
|
If the request parameters are invalid or websocket transport has different user subscriptions. |
Unauthorized
|
If the token is invalid, expired, or lacks required scopes. |
Forbidden
|
If subscription missing proper authorization. |
RateLimit
|
The request exceeds the number of subscriptions that you may create. |
Conflict
|
If a subscription with the same type and condition already exists. |
Examples:
Version 1::
@client.event
async def on_channel_chat_message_delete_v1(message: Event[ChannelChatMessageDeleteEvent]):
...
channel_chat_notification(broadcaster_user_id, user_id, version='1')
async
¶
Subscribe to channel chat notification event.
Token and Authorization Requirements::
| Token Type | Required Scopes | Authorization Requirements |
|---|---|---|
| User Access | user:read:chat | Token holder must be moderator/broadcaster |
| App Access | user:bot | App must have user:bot + channel:bot or mod status |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
broadcaster_user_id
|
str
|
The broadcaster user ID for the channel to monitor. |
required |
user_id
|
str
|
The user ID for the user that can read chat. Must match the user ID in the access token. |
required |
version
|
Literal['1']
|
The version number that identifies the definition of the subscription's data. |
'1'
|
Returns:
| Type | Description |
|---|---|
Subscription
|
Created or existing subscription (based on ignore_conflict). |
Raises:
| Type | Description |
|---|---|
TokenError
|
If using webhooks/conduits without an app access token. |
BadRequest
|
If the request parameters are invalid or websocket transport has different user subscriptions. |
Unauthorized
|
If the token is invalid, expired, or lacks required scopes. |
Forbidden
|
If subscription missing proper authorization. |
RateLimit
|
The request exceeds the number of subscriptions that you may create. |
Conflict
|
If a subscription with the same type and condition already exists. |
Examples:
Version 1::
@client.event
async def on_channel_chat_notification_v1(message: Event[ChannelChatNotificationEvent]):
...
channel_chat_settings_update(broadcaster_user_id, user_id, version='1')
async
¶
Subscribe to channel chat settings update event.
Token and Authorization Requirements::
| Token Type | Required Scopes | Authorization Requirements |
|---|---|---|
| User Access | user:read:chat | Token holder must be moderator/broadcaster |
| App Access | user:bot | App must have user:bot + channel:bot or mod status |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
broadcaster_user_id
|
str
|
The broadcaster user ID for the channel to monitor. |
required |
user_id
|
str
|
The user ID for the user that can read chat. Must match the user ID in the access token. |
required |
version
|
Literal['1']
|
The version number that identifies the definition of the subscription's data. |
'1'
|
Returns:
| Type | Description |
|---|---|
Subscription
|
Created or existing subscription (based on ignore_conflict). |
Raises:
| Type | Description |
|---|---|
TokenError
|
If using webhooks/conduits without an app access token. |
BadRequest
|
If the request parameters are invalid or websocket transport has different user subscriptions. |
Unauthorized
|
If the token is invalid, expired, or lacks required scopes. |
Forbidden
|
If subscription missing proper authorization. |
RateLimit
|
The request exceeds the number of subscriptions that you may create. |
Conflict
|
If a subscription with the same type and condition already exists. |
Examples:
Version 1::
@client.event
async def on_channel_chat_settings_update_v1(message: Event[ChannelChatSettingsUpdateEvent]):
...
channel_chat_user_message_hold(broadcaster_user_id, user_id, version='1')
async
¶
Subscribe to channel chat user message hold event.
Token and Authorization Requirements::
| Token Type | Required Scopes | Authorization Requirements |
|---|---|---|
| User Access | user:read:chat | Token holder must be moderator/broadcaster |
| App Access | user:bot | App must have user:bot + channel:bot or mod status |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
broadcaster_user_id
|
str
|
The broadcaster user ID for the channel to monitor. |
required |
user_id
|
str
|
The user ID for the user that can read chat. Must match the user ID in the access token. |
required |
version
|
Literal['1']
|
The version number that identifies the definition of the subscription's data. |
'1'
|
Returns:
| Type | Description |
|---|---|
Subscription
|
Created or existing subscription (based on ignore_conflict). |
Raises:
| Type | Description |
|---|---|
TokenError
|
If using webhooks/conduits without an app access token. |
BadRequest
|
If the request parameters are invalid or websocket transport has different user subscriptions. |
Unauthorized
|
If the token is invalid, expired, or lacks required scopes. |
Forbidden
|
If subscription missing proper authorization. |
RateLimit
|
The request exceeds the number of subscriptions that you may create. |
Conflict
|
If a subscription with the same type and condition already exists. |
Examples:
Version 1::
@client.event
async def on_channel_chat_user_message_hold_v1(message: Event[ChannelChatUserMessageHoldEvent]):
...
channel_chat_user_message_update(broadcaster_user_id, user_id, version='1')
async
¶
Subscribe to channel chat user message update event.
Token and Authorization Requirements::
| Token Type | Required Scopes | Authorization Requirements |
|---|---|---|
| User Access | user:read:chat | Token holder must be moderator/broadcaster |
| App Access | user:bot | App must have user:bot + channel:bot or mod status |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
broadcaster_user_id
|
str
|
The broadcaster user ID for the channel to monitor. |
required |
user_id
|
str
|
The user ID for the user that can read chat. Must match the user ID in the access token. |
required |
version
|
Literal['1']
|
The version number that identifies the definition of the subscription's data. |
'1'
|
Returns:
| Type | Description |
|---|---|
Subscription
|
Created or existing subscription (based on ignore_conflict). |
Raises:
| Type | Description |
|---|---|
TokenError
|
If using webhooks/conduits without an app access token. |
BadRequest
|
If the request parameters are invalid or websocket transport has different user subscriptions. |
Unauthorized
|
If the token is invalid, expired, or lacks required scopes. |
Forbidden
|
If subscription missing proper authorization. |
RateLimit
|
The request exceeds the number of subscriptions that you may create. |
Conflict
|
If a subscription with the same type and condition already exists. |
Examples:
Version 1::
@client.event
async def on_channel_chat_user_message_update_v1(message: Event[ChannelChatUserMessageUpdateEvent]):
...
channel_raid(from_broadcaster_user_id=None, to_broadcaster_user_id=None, version='1')
async
¶
Subscribe to channel raid event.
Token and Authorization Requirements::
| Token Type | Required Scopes | Authorization Requirements |
|---|---|---|
| User Access | None | None |
| App Access | None | None |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
from_broadcaster_user_id
|
Optional[str]
|
The broadcaster user ID that created the raid. Optional. |
None
|
to_broadcaster_user_id
|
Optional[str]
|
The broadcaster user ID that received the raid. Optional. |
None
|
version
|
Literal['1']
|
The version number that identifies the definition of the subscription's data. |
'1'
|
Returns:
| Type | Description |
|---|---|
Subscription
|
Created or existing subscription (based on ignore_conflict). |
Raises:
| Type | Description |
|---|---|
TokenError
|
If using webhooks/conduits without an app access token. |
BadRequest
|
If the request parameters are invalid or websocket transport has different user subscriptions. |
Unauthorized
|
If the token is invalid, expired, or lacks required scopes. |
Forbidden
|
If subscription missing proper authorization. |
RateLimit
|
The request exceeds the number of subscriptions that you may create. |
Conflict
|
If a subscription with the same type and condition already exists. |
Examples:
Version 1::
@client.event
async def on_channel_raid_v1(message: Event[ChannelRaidEvent]):
...
channel_shared_chat_begin(broadcaster_user_id, version='1')
async
¶
Subscribe to channel shared chat begin event.
Token and Authorization Requirements::
| Token Type | Required Scopes | Authorization Requirements |
|---|---|---|
| User Access | None | None |
| App Access | None | None |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
broadcaster_user_id
|
str
|
The broadcaster user ID for the channel to monitor. |
required |
version
|
Literal['1']
|
The version number that identifies the definition of the subscription's data. |
'1'
|
Returns:
| Type | Description |
|---|---|
Subscription
|
Created or existing subscription (based on ignore_conflict). |
Raises:
| Type | Description |
|---|---|
TokenError
|
If using webhooks/conduits without an app access token. |
BadRequest
|
If the request parameters are invalid or websocket transport has different user subscriptions. |
Unauthorized
|
If the token is invalid, expired, or lacks required scopes. |
Forbidden
|
If subscription missing proper authorization. |
RateLimit
|
The request exceeds the number of subscriptions that you may create. |
Conflict
|
If a subscription with the same type and condition already exists. |
Examples:
Version 1::
@client.event
async def on_channel_shared_chat_begin_v1(message: Event[ChannelSharedChatBeginEvent]):
...
channel_shared_chat_end(broadcaster_user_id, version='1')
async
¶
Subscribe to channel shared chat end event.
Token and Authorization Requirements::
| Token Type | Required Scopes | Authorization Requirements |
|---|---|---|
| User Access | None | None |
| App Access | None | None |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
broadcaster_user_id
|
str
|
The broadcaster user ID for the channel to monitor. |
required |
version
|
Literal['1']
|
The version number that identifies the definition of the subscription's data. |
'1'
|
Returns:
| Type | Description |
|---|---|
Subscription
|
Created or existing subscription (based on ignore_conflict). |
Raises:
| Type | Description |
|---|---|
TokenError
|
If using webhooks/conduits without an app access token. |
BadRequest
|
If the request parameters are invalid or websocket transport has different user subscriptions. |
Unauthorized
|
If the token is invalid, expired, or lacks required scopes. |
Forbidden
|
If subscription missing proper authorization. |
RateLimit
|
The request exceeds the number of subscriptions that you may create. |
Conflict
|
If a subscription with the same type and condition already exists. |
Examples:
Version 1::
@client.event
async def on_channel_shared_chat_end_v1(message: Event[ChannelSharedChatEndEvent]):
...
channel_shared_chat_update(broadcaster_user_id, version='1')
async
¶
Subscribe to channel shared chat update event.
Token and Authorization Requirements::
| Token Type | Required Scopes | Authorization Requirements |
|---|---|---|
| User Access | None | None |
| App Access | None | None |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
broadcaster_user_id
|
str
|
The broadcaster user ID for the channel to monitor. |
required |
version
|
Literal['1']
|
The version number that identifies the definition of the subscription's data. |
'1'
|
Returns:
| Type | Description |
|---|---|
Subscription
|
Created or existing subscription (based on ignore_conflict). |
Raises:
| Type | Description |
|---|---|
TokenError
|
If using webhooks/conduits without an app access token. |
BadRequest
|
If the request parameters are invalid or websocket transport has different user subscriptions. |
Unauthorized
|
If the token is invalid, expired, or lacks required scopes. |
Forbidden
|
If subscription missing proper authorization. |
RateLimit
|
The request exceeds the number of subscriptions that you may create. |
Conflict
|
If a subscription with the same type and condition already exists. |
Examples:
Version 1::
@client.event
async def on_channel_shared_chat_update_v1(message: Event[ChannelSharedChatUpdateEvent]):
...
channel_update(broadcaster_user_id, version='2')
async
¶
Subscribe to channel update event.
Token and Authorization Requirements::
| Token Type | Required Scopes | Authorization Requirements |
|---|---|---|
| User Access | None | None |
| App Access | None | None |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
broadcaster_user_id
|
str
|
The broadcaster user ID for the channel to monitor. |
required |
version
|
Literal['2']
|
The version number that identifies the definition of the subscription's data. |
'2'
|
Returns:
| Type | Description |
|---|---|
Subscription
|
Created or existing subscription (based on ignore_conflict). |
Raises:
| Type | Description |
|---|---|
TokenError
|
If using webhooks/conduits without an app access token. |
BadRequest
|
If the request parameters are invalid or websocket transport has different user subscriptions. |
Unauthorized
|
If the token is invalid, expired, or lacks required scopes. |
Forbidden
|
If subscription missing proper authorization. |
RateLimit
|
The request exceeds the number of subscriptions that you may create. |
Conflict
|
If a subscription with the same type and condition already exists. |
Examples:
Version 2::
@client.event
async def on_channel_update_v2(message: Event[ChannelUpdateEvent]):
...
chat_message(broadcaster_user_id, user_id, version='1')
async
¶
Subscribe to channel chat message event.
Token and Authorization Requirements::
| Token Type | Required Scopes | Authorization Requirements |
|---|---|---|
| User Access | user:read:chat | Token holder must be moderator/broadcaster |
| App Access | user:bot | App must have user:bot + channel:bot or mod status |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
broadcaster_user_id
|
str
|
The broadcaster user ID for the channel to monitor. |
required |
user_id
|
str
|
The user ID for the user that can read chat. Must match the user ID in the access token. |
required |
version
|
Literal['1']
|
The version number that identifies the definition of the subscription's data. |
'1'
|
Returns:
| Type | Description |
|---|---|
Subscription
|
Created or existing subscription (based on ignore_conflict). |
Raises:
| Type | Description |
|---|---|
TokenError
|
If using webhooks/conduits without an app access token. |
BadRequest
|
If the request parameters are invalid or websocket transport has different user subscriptions. |
Unauthorized
|
If the token is invalid, expired, or lacks required scopes. |
Forbidden
|
If subscription missing proper authorization. |
RateLimit
|
The request exceeds the number of subscriptions that you may create. |
Conflict
|
If a subscription with the same type and condition already exists. |
Examples:
Version 1::
@client.event
async def on_chat_message_v1(message: Event[ChannelChatMessageEvent]):
...
conduit_shard_disabled(conduit_id=None, version='1')
async
¶
Subscribe to conduit shard disabled event.
Token and Authorization Requirements::
| Token Type | Required Scopes | Authorization Requirements |
|---|---|---|
| App Access | None | Client must own conduit if specified |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
conduit_id
|
Optional[str]
|
The conduit ID. Optional. |
None
|
version
|
Literal['1']
|
The version number that identifies the definition of the subscription's data. |
'1'
|
Returns:
| Type | Description |
|---|---|
Subscription
|
Created or existing subscription (based on ignore_conflict). |
Raises:
| Type | Description |
|---|---|
TokenError
|
If using webhooks/conduits without an app access token. |
BadRequest
|
If the request parameters are invalid or websocket transport has different user subscriptions. |
Unauthorized
|
If the token is invalid, expired, or lacks required scopes. |
Forbidden
|
If subscription missing proper authorization. |
RateLimit
|
The request exceeds the number of subscriptions that you may create. |
Conflict
|
If a subscription with the same type and condition already exists. |
Examples:
Version 1::
@client.event
async def on_conduit_shard_disabled_v1(message: Event[Dict[str, Any]]):
...
drop_entitlement_grant(organization_id, category_id=None, campaign_id=None, version='1')
async
¶
Subscribe to drop entitlement grant event.
Token and Authorization Requirements::
| Token Type | Required Scopes | Authorization Requirements |
|---|---|---|
| App Access | None | Client owned by org |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
organization_id
|
str
|
The organization ID. |
required |
category_id
|
Optional[str]
|
The category ID. Optional. |
None
|
campaign_id
|
Optional[str]
|
The campaign ID. Optional. |
None
|
version
|
Literal['1']
|
The version number that identifies the definition of the subscription's data. |
'1'
|
Returns:
| Type | Description |
|---|---|
Subscription
|
Created or existing subscription (based on ignore_conflict). |
Raises:
| Type | Description |
|---|---|
TokenError
|
If using webhooks/conduits without an app access token. |
BadRequest
|
If the request parameters are invalid or websocket transport has different user subscriptions. |
Unauthorized
|
If the token is invalid, expired, or lacks required scopes. |
Forbidden
|
If subscription missing proper authorization. |
RateLimit
|
The request exceeds the number of subscriptions that you may create. |
Conflict
|
If a subscription with the same type and condition already exists. |
Examples:
Version 1::
@client.event
async def on_drop_entitlement_grant_v1(message: Event[DropEntitlementGrantEvent]):
...
stream_offline(broadcaster_user_id, version='1')
async
¶
Subscribe to stream offline event.
Token and Authorization Requirements::
| Token Type | Required Scopes | Authorization Requirements |
|---|---|---|
| User Access | None | None |
| App Access | None | None |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
broadcaster_user_id
|
str
|
The broadcaster user ID for the channel to monitor. |
required |
version
|
Literal['1']
|
The version number that identifies the definition of the subscription's data. |
'1'
|
Returns:
| Type | Description |
|---|---|
Subscription
|
Created or existing subscription (based on ignore_conflict). |
Raises:
| Type | Description |
|---|---|
TokenError
|
If using webhooks/conduits without an app access token. |
BadRequest
|
If the request parameters are invalid or websocket transport has different user subscriptions. |
Unauthorized
|
If the token is invalid, expired, or lacks required scopes. |
Forbidden
|
If subscription missing proper authorization. |
RateLimit
|
The request exceeds the number of subscriptions that you may create. |
Conflict
|
If a subscription with the same type and condition already exists. |
Examples:
Version 1::
@client.event
async def on_stream_offline_v1(message: Event[StreamOfflineEvent]):
...
stream_online(broadcaster_user_id, version='1')
async
¶
Subscribe to stream online event.
Token and Authorization Requirements::
| Token Type | Required Scopes | Authorization Requirements |
|---|---|---|
| User Access | None | None |
| App Access | None | None |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
broadcaster_user_id
|
str
|
The broadcaster user ID for the channel to monitor. |
required |
version
|
Literal['1']
|
The version number that identifies the definition of the subscription's data. |
'1'
|
Returns:
| Type | Description |
|---|---|
Subscription
|
Created or existing subscription (based on ignore_conflict). |
Raises:
| Type | Description |
|---|---|
TokenError
|
If using webhooks/conduits without an app access token. |
BadRequest
|
If the request parameters are invalid or websocket transport has different user subscriptions. |
Unauthorized
|
If the token is invalid, expired, or lacks required scopes. |
Forbidden
|
If subscription missing proper authorization. |
RateLimit
|
The request exceeds the number of subscriptions that you may create. |
Conflict
|
If a subscription with the same type and condition already exists. |
Examples:
Version 1::
@client.event
async def on_stream_online_v1(message: Event[StreamOnlineEvent]):
...
user_authorization_grant(client_id=None, version='1')
async
¶
Subscribe to user authorization grant event.
Token and Authorization Requirements::
| Token Type | Required Scopes | Authorization Requirements |
|---|---|---|
| App Access | None | None |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
client_id
|
Optional[str]
|
The client ID. |
None
|
version
|
Literal['1']
|
The version number that identifies the definition of the subscription's data. |
'1'
|
Returns:
| Type | Description |
|---|---|
Subscription
|
Created or existing subscription (based on ignore_conflict). |
Raises:
| Type | Description |
|---|---|
TokenError
|
If using webhooks/conduits without an app access token. |
BadRequest
|
If the request parameters are invalid or websocket transport has different user subscriptions. |
Unauthorized
|
If the token is invalid, expired, or lacks required scopes. |
Forbidden
|
If subscription missing proper authorization. |
RateLimit
|
The request exceeds the number of subscriptions that you may create. |
Conflict
|
If a subscription with the same type and condition already exists. |
Examples:
Version 1::
@client.event
async def on_user_authorization_grant_v1(message: Event[UserAuthorizationGrantEvent]):
...
user_authorization_revoke(client_id=None, version='1')
async
¶
Subscribe to user authorization revoke event.
Token and Authorization Requirements::
| Token Type | Required Scopes | Authorization Requirements |
|---|---|---|
| App Access | None | None |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
client_id
|
Optional[str]
|
The client ID. |
None
|
version
|
Literal['1']
|
The version number that identifies the definition of the subscription's data. |
'1'
|
Returns:
| Type | Description |
|---|---|
Subscription
|
Created or existing subscription (based on ignore_conflict). |
Raises:
| Type | Description |
|---|---|
TokenError
|
If using webhooks/conduits without an app access token. |
BadRequest
|
If the request parameters are invalid or websocket transport has different user subscriptions. |
Unauthorized
|
If the token is invalid, expired, or lacks required scopes. |
Forbidden
|
If subscription missing proper authorization. |
RateLimit
|
The request exceeds the number of subscriptions that you may create. |
Conflict
|
If a subscription with the same type and condition already exists. |
Examples:
Version 1::
@client.event
async def on_user_authorization_revoke_v1(message: Event[UserAuthorizationRevokeEvent]):
...
user_update(user_id, version='1')
async
¶
Subscribe to user update event.
Token and Authorization Requirements::
| Token Type | Required Scopes | Authorization Requirements |
|---|---|---|
| User Access | None | None |
| App Access | None | None |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
user_id
|
str
|
The user ID to monitor. |
required |
version
|
Literal['1']
|
The version number that identifies the definition of the subscription's data. |
'1'
|
Returns:
| Type | Description |
|---|---|
Subscription
|
Created or existing subscription (based on ignore_conflict). |
Raises:
| Type | Description |
|---|---|
TokenError
|
If using webhooks/conduits without an app access token. |
BadRequest
|
If the request parameters are invalid or websocket transport has different user subscriptions. |
Unauthorized
|
If the token is invalid, expired, or lacks required scopes. |
Forbidden
|
If subscription missing proper authorization. |
RateLimit
|
The request exceeds the number of subscriptions that you may create. |
Conflict
|
If a subscription with the same type and condition already exists. |
Examples:
Version 1::
@client.event
async def on_user_update_v1(message: Event[UserUpdateEvent]):
...
UserEvents
¶
Bases: _BaseEvents
Event handler for user-based event subscriptions.
channel_ad_break_begin(broadcaster_user_id=None, version='1')
async
¶
Subscribe to channel ad break begin event.
Token and Authorization Requirements::
| Token Type | Required Scopes | Authorization Requirements |
|---|---|---|
| User Access | channel:read:ads | Token holder must be broadcaster |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
broadcaster_user_id
|
Optional[str]
|
The broadcaster user ID for the channel to monitor. |
None
|
version
|
Literal['1']
|
The version number that identifies the definition of the subscription's data. |
'1'
|
Returns:
| Type | Description |
|---|---|
Subscription
|
Created or existing subscription (based on ignore_conflict). |
Raises:
| Type | Description |
|---|---|
TokenError
|
If using webhooks/conduits without an app access token. |
BadRequest
|
If the request parameters are invalid or websocket transport has different user subscriptions. |
Unauthorized
|
If the token is invalid, expired, or lacks required scopes. |
Forbidden
|
If subscription missing proper authorization. |
RateLimit
|
The request exceeds the number of subscriptions that you may create. |
Conflict
|
If a subscription with the same type and condition already exists. |
Examples:
Version 1::
@client.event
async def on_channel_ad_break_begin_v1(message: Event[ChannelAdBreakBeginEvent]):
...
channel_ban(broadcaster_user_id=None, version='1')
async
¶
Subscribe to channel ban event.
Token and Authorization Requirements::
| Token Type | Required Scopes | Authorization Requirements |
|---|---|---|
| User Access | channel:moderate | Token holder must be moderator/broadcaster |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
broadcaster_user_id
|
Optional[str]
|
The broadcaster user ID for the channel to monitor. |
None
|
version
|
Literal['1']
|
The version number that identifies the definition of the subscription's data. |
'1'
|
Returns:
| Type | Description |
|---|---|
Subscription
|
Created or existing subscription (based on ignore_conflict). |
Raises:
| Type | Description |
|---|---|
TokenError
|
If using webhooks/conduits without an app access token. |
BadRequest
|
If the request parameters are invalid or websocket transport has different user subscriptions. |
Unauthorized
|
If the token is invalid, expired, or lacks required scopes. |
Forbidden
|
If subscription missing proper authorization. |
RateLimit
|
The request exceeds the number of subscriptions that you may create. |
Conflict
|
If a subscription with the same type and condition already exists. |
Examples:
Version 1::
@client.event
async def on_channel_ban_v1(message: Event[ChannelBanEvent]):
...
channel_bits_use(broadcaster_user_id=None, version='1')
async
¶
Subscribe to channel bits use event.
Token and Authorization Requirements::
| Token Type | Required Scopes | Authorization Requirements |
|---|---|---|
| User Access | bits:read | Token holder must be broadcaster |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
broadcaster_user_id
|
Optional[str]
|
The broadcaster user ID for the channel to monitor. |
None
|
version
|
Literal['1']
|
The version number that identifies the definition of the subscription's data. |
'1'
|
Returns:
| Type | Description |
|---|---|
Subscription
|
Created or existing subscription (based on ignore_conflict). |
Raises:
| Type | Description |
|---|---|
TokenError
|
If using webhooks/conduits without an app access token. |
BadRequest
|
If the request parameters are invalid or websocket transport has different user subscriptions. |
Unauthorized
|
If the token is invalid, expired, or lacks required scopes. |
Forbidden
|
If subscription missing proper authorization. |
RateLimit
|
The request exceeds the number of subscriptions that you may create. |
Conflict
|
If a subscription with the same type and condition already exists. |
Examples:
Version 1::
@client.event
async def on_channel_bits_use_v1(message: Event[ChannelBitsUseEvent]):
...
channel_charity_campaign_donate(broadcaster_user_id=None, version='1')
async
¶
Subscribe to channel charity campaign donate event.
Token and Authorization Requirements::
| Token Type | Required Scopes | Authorization Requirements |
|---|---|---|
| User Access | channel:read:charity | Token holder must be broadcaster |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
broadcaster_user_id
|
Optional[str]
|
The broadcaster user ID for the channel to monitor. |
None
|
version
|
Literal['1']
|
The version number that identifies the definition of the subscription's data. |
'1'
|
Returns:
| Type | Description |
|---|---|
Subscription
|
Created or existing subscription (based on ignore_conflict). |
Raises:
| Type | Description |
|---|---|
TokenError
|
If using webhooks/conduits without an app access token. |
BadRequest
|
If the request parameters are invalid or websocket transport has different user subscriptions. |
Unauthorized
|
If the token is invalid, expired, or lacks required scopes. |
Forbidden
|
If subscription missing proper authorization. |
RateLimit
|
The request exceeds the number of subscriptions that you may create. |
Conflict
|
If a subscription with the same type and condition already exists. |
Examples:
Version 1::
@client.event
async def on_channel_charity_donate_v1(message: Event[ChannelCharityCampaignDonationEvent]):
...
channel_charity_campaign_progress(broadcaster_user_id=None, version='1')
async
¶
Subscribe to channel charity campaign progress event.
Token and Authorization Requirements::
| Token Type | Required Scopes | Authorization Requirements |
|---|---|---|
| User Access | channel:read:charity | Token holder must be broadcaster |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
broadcaster_user_id
|
Optional[str]
|
The broadcaster user ID for the channel to monitor. |
None
|
version
|
Literal['1']
|
The version number that identifies the definition of the subscription's data. |
'1'
|
Returns:
| Type | Description |
|---|---|
Subscription
|
Created or existing subscription (based on ignore_conflict). |
Raises:
| Type | Description |
|---|---|
TokenError
|
If using webhooks/conduits without an app access token. |
BadRequest
|
If the request parameters are invalid or websocket transport has different user subscriptions. |
Unauthorized
|
If the token is invalid, expired, or lacks required scopes. |
Forbidden
|
If subscription missing proper authorization. |
RateLimit
|
The request exceeds the number of subscriptions that you may create. |
Conflict
|
If a subscription with the same type and condition already exists. |
Examples:
Version 1::
@client.event
async def on_channel_charity_progress_v1(message: Event[ChannelCharityCampaignProgressEvent]):
...
channel_charity_campaign_start(broadcaster_user_id=None, version='1')
async
¶
Subscribe to channel charity campaign start event.
Token and Authorization Requirements::
| Token Type | Required Scopes | Authorization Requirements |
|---|---|---|
| User Access | channel:read:charity | Token holder must be broadcaster |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
broadcaster_user_id
|
Optional[str]
|
The broadcaster user ID for the channel to monitor. |
None
|
version
|
Literal['1']
|
The version number that identifies the definition of the subscription's data. |
'1'
|
Returns:
| Type | Description |
|---|---|
Subscription
|
Created or existing subscription (based on ignore_conflict). |
Raises:
| Type | Description |
|---|---|
TokenError
|
If using webhooks/conduits without an app access token. |
BadRequest
|
If the request parameters are invalid or websocket transport has different user subscriptions. |
Unauthorized
|
If the token is invalid, expired, or lacks required scopes. |
Forbidden
|
If subscription missing proper authorization. |
RateLimit
|
The request exceeds the number of subscriptions that you may create. |
Conflict
|
If a subscription with the same type and condition already exists. |
Examples:
Version 1::
@client.event
async def on_channel_charity_start_v1(message: Event[ChannelCharityCampaignStartEvent]):
...
channel_charity_campaign_stop(broadcaster_user_id=None, version='1')
async
¶
Subscribe to channel charity campaign stop event.
Token and Authorization Requirements::
| Token Type | Required Scopes | Authorization Requirements |
|---|---|---|
| User Access | channel:read:charity | Token holder must be broadcaster |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
broadcaster_user_id
|
Optional[str]
|
The broadcaster user ID for the channel to monitor. |
None
|
version
|
Literal['1']
|
The version number that identifies the definition of the subscription's data. |
'1'
|
Returns:
| Type | Description |
|---|---|
Subscription
|
Created or existing subscription (based on ignore_conflict). |
Raises:
| Type | Description |
|---|---|
TokenError
|
If using webhooks/conduits without an app access token. |
BadRequest
|
If the request parameters are invalid or websocket transport has different user subscriptions. |
Unauthorized
|
If the token is invalid, expired, or lacks required scopes. |
Forbidden
|
If subscription missing proper authorization. |
RateLimit
|
The request exceeds the number of subscriptions that you may create. |
Conflict
|
If a subscription with the same type and condition already exists. |
Examples:
Version 1::
@client.event
async def on_channel_charity_stop_v1(message: Event[ChannelCharityCampaignStopEvent]):
...
channel_cheer(broadcaster_user_id=None, version='1')
async
¶
Subscribe to channel cheer event.
Token and Authorization Requirements::
| Token Type | Required Scopes | Authorization Requirements |
|---|---|---|
| User Access | bits:read | Token holder must be broadcaster |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
broadcaster_user_id
|
Optional[str]
|
The broadcaster user ID for the channel to monitor. |
None
|
version
|
Literal['1']
|
The version number that identifies the definition of the subscription's data. |
'1'
|
Returns:
| Type | Description |
|---|---|
Subscription
|
Created or existing subscription (based on ignore_conflict). |
Raises:
| Type | Description |
|---|---|
TokenError
|
If using webhooks/conduits without an app access token. |
BadRequest
|
If the request parameters are invalid or websocket transport has different user subscriptions. |
Unauthorized
|
If the token is invalid, expired, or lacks required scopes. |
Forbidden
|
If subscription missing proper authorization. |
RateLimit
|
The request exceeds the number of subscriptions that you may create. |
Conflict
|
If a subscription with the same type and condition already exists. |
Examples:
Version 1::
@client.event
async def on_channel_cheer_v1(message: Event[ChannelCheerEvent]):
...
channel_follow(broadcaster_user_id=None, moderator_user_id=None, version='2')
async
¶
Subscribe to channel follow event.
Token and Authorization Requirements::
| Token Type | Required Scopes | Authorization Requirements |
|---|---|---|
| User Access | moderator:read:followers | Token holder must be moderator/broadcaster |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
broadcaster_user_id
|
Optional[str]
|
The broadcaster user ID for the channel to monitor. |
None
|
moderator_user_id
|
Optional[str]
|
The moderator user ID. Must match the user ID in the access token. |
None
|
version
|
Literal['2']
|
The version number that identifies the definition of the subscription's data. |
'2'
|
Returns:
| Type | Description |
|---|---|
Subscription
|
Created or existing subscription (based on ignore_conflict). |
Raises:
| Type | Description |
|---|---|
TokenError
|
If using webhooks/conduits without an app access token. |
BadRequest
|
If the request parameters are invalid or websocket transport has different user subscriptions. |
Unauthorized
|
If the token is invalid, expired, or lacks required scopes. |
Forbidden
|
If subscription missing proper authorization. |
RateLimit
|
The request exceeds the number of subscriptions that you may create. |
Conflict
|
If a subscription with the same type and condition already exists. |
Examples:
Version 2::
@client.event
async def on_channel_follow_v2(message: Event[ChannelFollowEvent]):
...
channel_goal_begin(broadcaster_user_id=None, version='1')
async
¶
Subscribe to channel goal begin event.
Token and Authorization Requirements::
| Token Type | Required Scopes | Authorization Requirements |
|---|---|---|
| User Access | channel:read:goals | Token holder must be broadcaster |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
broadcaster_user_id
|
Optional[str]
|
The broadcaster user ID for the channel to monitor. |
None
|
version
|
Literal['1']
|
The version number that identifies the definition of the subscription's data. |
'1'
|
Returns:
| Type | Description |
|---|---|
Subscription
|
Created or existing subscription (based on ignore_conflict). |
Raises:
| Type | Description |
|---|---|
TokenError
|
If using webhooks/conduits without an app access token. |
BadRequest
|
If the request parameters are invalid or websocket transport has different user subscriptions. |
Unauthorized
|
If the token is invalid, expired, or lacks required scopes. |
Forbidden
|
If subscription missing proper authorization. |
RateLimit
|
The request exceeds the number of subscriptions that you may create. |
Conflict
|
If a subscription with the same type and condition already exists. |
Examples:
Version 1::
@client.event
async def on_channel_goal_begin_v1(message: Event[ChannelGoalBeginEvent]):
...
channel_goal_end(broadcaster_user_id=None, version='1')
async
¶
Subscribe to channel goal end event.
Token and Authorization Requirements::
| Token Type | Required Scopes | Authorization Requirements |
|---|---|---|
| User Access | channel:read:goals | Token holder must be broadcaster |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
broadcaster_user_id
|
Optional[str]
|
The broadcaster user ID for the channel to monitor. |
None
|
version
|
Literal['1']
|
The version number that identifies the definition of the subscription's data. |
'1'
|
Returns:
| Type | Description |
|---|---|
Subscription
|
Created or existing subscription (based on ignore_conflict). |
Raises:
| Type | Description |
|---|---|
TokenError
|
If using webhooks/conduits without an app access token. |
BadRequest
|
If the request parameters are invalid or websocket transport has different user subscriptions. |
Unauthorized
|
If the token is invalid, expired, or lacks required scopes. |
Forbidden
|
If subscription missing proper authorization. |
RateLimit
|
The request exceeds the number of subscriptions that you may create. |
Conflict
|
If a subscription with the same type and condition already exists. |
Examples:
Version 1::
@client.event
async def on_channel_goal_end_v1(message: Event[ChannelGoalEndEvent]):
...
channel_goal_progress(broadcaster_user_id=None, version='1')
async
¶
Subscribe to channel goal progress event.
Token and Authorization Requirements::
| Token Type | Required Scopes | Authorization Requirements |
|---|---|---|
| User Access | channel:read:goals | Token holder must be broadcaster |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
broadcaster_user_id
|
Optional[str]
|
The broadcaster user ID for the channel to monitor. |
None
|
version
|
Literal['1']
|
The version number that identifies the definition of the subscription's data. |
'1'
|
Returns:
| Type | Description |
|---|---|
Subscription
|
Created or existing subscription (based on ignore_conflict). |
Raises:
| Type | Description |
|---|---|
TokenError
|
If using webhooks/conduits without an app access token. |
BadRequest
|
If the request parameters are invalid or websocket transport has different user subscriptions. |
Unauthorized
|
If the token is invalid, expired, or lacks required scopes. |
Forbidden
|
If subscription missing proper authorization. |
RateLimit
|
The request exceeds the number of subscriptions that you may create. |
Conflict
|
If a subscription with the same type and condition already exists. |
Examples:
Version 1::
@client.event
async def on_channel_goal_progress_v1(message: Event[ChannelGoalProgressEvent]):
...
channel_guest_star_guest_update(broadcaster_user_id=None, moderator_user_id=None, version='beta')
async
¶
Subscribe to channel guest star guest update event (beta).
Token and Authorization Requirements::
| Token Type | Required Scopes | Authorization Requirements |
|---|---|---|
| User Access | channel:read:guest_star | Token holder must be moderator/broadcaster |
| channel:manage:guest_star | ||
| moderator:read:guest_star | ||
| moderator:manage:guest_star |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
broadcaster_user_id
|
Optional[str]
|
The broadcaster user ID for the channel to monitor. |
None
|
moderator_user_id
|
Optional[str]
|
The moderator user ID. Must match the user ID in the access token. |
None
|
version
|
Literal['beta']
|
The version number that identifies the definition of the subscription's data. |
'beta'
|
Returns:
| Type | Description |
|---|---|
Subscription
|
Created or existing subscription (based on ignore_conflict). |
Raises:
| Type | Description |
|---|---|
TokenError
|
If using webhooks/conduits without an app access token. |
BadRequest
|
If the request parameters are invalid or websocket transport has different user subscriptions. |
Unauthorized
|
If the token is invalid, expired, or lacks required scopes. |
Forbidden
|
If subscription missing proper authorization. |
RateLimit
|
The request exceeds the number of subscriptions that you may create. |
Conflict
|
If a subscription with the same type and condition already exists. |
Examples:
Beta::
@client.event
async def on_channel_guest_star_guest_update_beta(message: Event[Dict[str, Any]]):
...
channel_guest_star_session_begin(broadcaster_user_id=None, moderator_user_id=None, version='beta')
async
¶
Subscribe to channel guest star session begin event (beta).
Token and Authorization Requirements::
| Token Type | Required Scopes | Authorization Requirements |
|---|---|---|
| User Access | channel:read:guest_star | Token holder must be moderator/broadcaster |
| channel:manage:guest_star | ||
| moderator:read:guest_star | ||
| moderator:manage:guest_star |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
broadcaster_user_id
|
Optional[str]
|
The broadcaster user ID for the channel to monitor. |
None
|
moderator_user_id
|
Optional[str]
|
The moderator user ID. Must match the user ID in the access token. |
None
|
version
|
Literal['beta']
|
The version number that identifies the definition of the subscription's data. |
'beta'
|
Returns:
| Type | Description |
|---|---|
Subscription
|
Created or existing subscription (based on ignore_conflict). |
Raises:
| Type | Description |
|---|---|
TokenError
|
If using webhooks/conduits without an app access token. |
BadRequest
|
If the request parameters are invalid or websocket transport has different user subscriptions. |
Unauthorized
|
If the token is invalid, expired, or lacks required scopes. |
Forbidden
|
If subscription missing proper authorization. |
RateLimit
|
The request exceeds the number of subscriptions that you may create. |
Conflict
|
If a subscription with the same type and condition already exists. |
Examples:
Beta::
@client.event
async def on_channel_guest_star_session_begin_beta(message: Event[Dict[str, Any]]):
...
channel_guest_star_session_end(broadcaster_user_id=None, moderator_user_id=None, version='beta')
async
¶
Subscribe to channel guest star session end event (beta).
Token and Authorization Requirements::
| Token Type | Required Scopes | Authorization Requirements |
|---|---|---|
| User Access | channel:read:guest_star | Token holder must be moderator/broadcaster |
| channel:manage:guest_star | ||
| moderator:read:guest_star | ||
| moderator:manage:guest_star |
channel:manage:guest_star or moderator:read:guest_star or moderator:manage:guest_star
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
broadcaster_user_id
|
Optional[str]
|
The broadcaster user ID for the channel to monitor. |
None
|
moderator_user_id
|
Optional[str]
|
The moderator user ID. Must match the user ID in the access token. |
None
|
version
|
Literal['beta']
|
The version number that identifies the definition of the subscription's data. |
'beta'
|
Returns:
| Type | Description |
|---|---|
Subscription
|
Created or existing subscription (based on ignore_conflict). |
Raises:
| Type | Description |
|---|---|
TokenError
|
If using webhooks/conduits without an app access token. |
BadRequest
|
If the request parameters are invalid or websocket transport has different user subscriptions. |
Unauthorized
|
If the token is invalid, expired, or lacks required scopes. |
Forbidden
|
If subscription missing proper authorization. |
RateLimit
|
The request exceeds the number of subscriptions that you may create. |
Conflict
|
If a subscription with the same type and condition already exists. |
Examples:
Beta::
@client.event
async def on_channel_guest_star_session_end_beta(message: Event[Dict[str, Any]]):
...
channel_guest_star_settings_update(broadcaster_user_id=None, moderator_user_id=None, version='beta')
async
¶
Subscribe to channel guest star settings update event (beta).
Token and Authorization Requirements::
| Token Type | Required Scopes | Authorization Requirements |
|---|---|---|
| User Access | channel:read:guest_star | Token holder must be moderator/broadcaster |
| channel:manage:guest_star | ||
| moderator:read:guest_star | ||
| moderator:manage:guest_star |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
broadcaster_user_id
|
Optional[str]
|
The broadcaster user ID for the channel to monitor. |
None
|
moderator_user_id
|
Optional[str]
|
The moderator user ID. Must match the user ID in the access token. |
None
|
version
|
Literal['beta']
|
The version number that identifies the definition of the subscription's data. |
'beta'
|
Returns:
| Type | Description |
|---|---|
Subscription
|
Created or existing subscription (based on ignore_conflict). |
Raises:
| Type | Description |
|---|---|
TokenError
|
If using webhooks/conduits without an app access token. |
BadRequest
|
If the request parameters are invalid or websocket transport has different user subscriptions. |
Unauthorized
|
If the token is invalid, expired, or lacks required scopes. |
Forbidden
|
If subscription missing proper authorization. |
RateLimit
|
The request exceeds the number of subscriptions that you may create. |
Conflict
|
If a subscription with the same type and condition already exists. |
Examples:
Beta::
@client.event
async def on_channel_guest_star_settings_update_beta(message: Event[Dict[str, Any]]):
...
channel_hype_train_begin(broadcaster_user_id=None, version='2')
async
¶
Subscribe to channel hype train begin event.
Token and Authorization Requirements::
| Token Type | Required Scopes | Authorization Requirements |
|---|---|---|
| User Access | channel:read:hype_train | Token holder must be broadcaster |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
broadcaster_user_id
|
Optional[str]
|
The broadcaster user ID for the channel to monitor. |
None
|
version
|
Literal['2']
|
The version number that identifies the definition of the subscription's data. |
'2'
|
Returns:
| Type | Description |
|---|---|
Subscription
|
Created or existing subscription (based on ignore_conflict). |
Raises:
| Type | Description |
|---|---|
TokenError
|
If using webhooks/conduits without an app access token. |
BadRequest
|
If the request parameters are invalid or websocket transport has different user subscriptions. |
Unauthorized
|
If the token is invalid, expired, or lacks required scopes. |
Forbidden
|
If subscription missing proper authorization. |
RateLimit
|
The request exceeds the number of subscriptions that you may create. |
Conflict
|
If a subscription with the same type and condition already exists. |
Examples:
Version 1::
@client.event
async def on_channel_hype_train_begin_v2(message: Event[Dict[str, Any]]):
...
channel_hype_train_end(broadcaster_user_id=None, version='2')
async
¶
Subscribe to channel hype train end event.
Token and Authorization Requirements::
| Token Type | Required Scopes | Authorization Requirements |
|---|---|---|
| User Access | channel:read:hype_train | Token holder must be broadcaster |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
broadcaster_user_id
|
Optional[str]
|
The broadcaster user ID for the channel to monitor. |
None
|
version
|
Literal['2']
|
The version number that identifies the definition of the subscription's data. |
'2'
|
Returns:
| Type | Description |
|---|---|
Subscription
|
Created or existing subscription (based on ignore_conflict). |
Raises:
| Type | Description |
|---|---|
TokenError
|
If using webhooks/conduits without an app access token. |
BadRequest
|
If the request parameters are invalid or websocket transport has different user subscriptions. |
Unauthorized
|
If the token is invalid, expired, or lacks required scopes. |
Forbidden
|
If subscription missing proper authorization. |
RateLimit
|
The request exceeds the number of subscriptions that you may create. |
Conflict
|
If a subscription with the same type and condition already exists. |
Examples:
Version 2::
@client.event
async def on_channel_hype_train_end_v2(message: Event[Dict[str, Any]]):
...
channel_hype_train_progress(broadcaster_user_id=None, version='2')
async
¶
Subscribe to channel hype train progress event.
Token and Authorization Requirements::
| Token Type | Required Scopes | Authorization Requirements |
|---|---|---|
| User Access | channel:read:hype_train | Token holder must be broadcaster |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
broadcaster_user_id
|
Optional[str]
|
The broadcaster user ID for the channel to monitor. |
None
|
version
|
Literal['2']
|
The version number that identifies the definition of the subscription's data. |
'2'
|
Returns:
| Type | Description |
|---|---|
Subscription
|
Created or existing subscription (based on ignore_conflict). |
Raises:
| Type | Description |
|---|---|
TokenError
|
If using webhooks/conduits without an app access token. |
BadRequest
|
If the request parameters are invalid or websocket transport has different user subscriptions. |
Unauthorized
|
If the token is invalid, expired, or lacks required scopes. |
Forbidden
|
If subscription missing proper authorization. |
RateLimit
|
The request exceeds the number of subscriptions that you may create. |
Conflict
|
If a subscription with the same type and condition already exists. |
Examples:
Version 2::
@client.event
async def on_channel_hype_train_progress_v2(message: Event[Dict[str, Any]]):
...
channel_moderate(broadcaster_user_id=None, moderator_user_id=None, version='2')
async
¶
Subscribe to channel moderate event.
Token and Authorization Requirements::
| Token Type | Required Scopes | Authorization Requirements |
|---|---|---|
| User Access | channel:moderate | Token holder must be moderator/broadcaster |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
broadcaster_user_id
|
Optional[str]
|
The broadcaster user ID for the channel to monitor. |
None
|
moderator_user_id
|
Optional[str]
|
The moderator user ID. Must match the user ID in the access token. Required for version 2. |
None
|
version
|
Literal['1', '2']
|
The version number that identifies the definition of the subscription's data. |
'2'
|
Returns:
| Type | Description |
|---|---|
Subscription
|
Created or existing subscription (based on ignore_conflict). |
Raises:
| Type | Description |
|---|---|
TokenError
|
If using webhooks/conduits without an app access token. |
BadRequest
|
If the request parameters are invalid or websocket transport has different user subscriptions. |
Unauthorized
|
If the token is invalid, expired, or lacks required scopes. |
Forbidden
|
If subscription missing proper authorization. |
RateLimit
|
The request exceeds the number of subscriptions that you may create. |
Conflict
|
If a subscription with the same type and condition already exists. |
Examples:
Version 1::
@client.event
async def on_channel_moderate_v1(message: Event[ChannelModerateEventV1]):
...
Version 2::
@client.event
async def on_channel_moderate_v2(message: Event[ChannelModerateEventV2]):
...
channel_moderator_add(broadcaster_user_id=None, version='1')
async
¶
Subscribe to channel moderator add event.
Token and Authorization Requirements::
| Token Type | Required Scopes | Authorization Requirements |
|---|---|---|
| User Access | moderation:read | Token holder must be broadcaster |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
broadcaster_user_id
|
Optional[str]
|
The broadcaster user ID for the channel to monitor. |
None
|
version
|
Literal['1']
|
The version number that identifies the definition of the subscription's data. |
'1'
|
Returns:
| Type | Description |
|---|---|
Subscription
|
Created or existing subscription (based on ignore_conflict). |
Raises:
| Type | Description |
|---|---|
TokenError
|
If using webhooks/conduits without an app access token. |
BadRequest
|
If the request parameters are invalid or websocket transport has different user subscriptions. |
Unauthorized
|
If the token is invalid, expired, or lacks required scopes. |
Forbidden
|
If subscription missing proper authorization. |
RateLimit
|
The request exceeds the number of subscriptions that you may create. |
Conflict
|
If a subscription with the same type and condition already exists. |
Examples:
Version 1::
@client.event
async def on_channel_moderator_add_v1(message: Event[ChannelModeratorAddEvent]):
...
channel_moderator_remove(broadcaster_user_id=None, version='1')
async
¶
Subscribe to channel moderator remove event.
Token and Authorization Requirements::
| Token Type | Required Scopes | Authorization Requirements |
|---|---|---|
| User Access | moderation:read | Token holder must be broadcaster |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
broadcaster_user_id
|
Optional[str]
|
The broadcaster user ID for the channel to monitor. |
None
|
version
|
Literal['1']
|
The version number that identifies the definition of the subscription's data. |
'1'
|
Returns:
| Type | Description |
|---|---|
Subscription
|
Created or existing subscription (based on ignore_conflict). |
Raises:
| Type | Description |
|---|---|
TokenError
|
If using webhooks/conduits without an app access token. |
BadRequest
|
If the request parameters are invalid or websocket transport has different user subscriptions. |
Unauthorized
|
If the token is invalid, expired, or lacks required scopes. |
Forbidden
|
If subscription missing proper authorization. |
RateLimit
|
The request exceeds the number of subscriptions that you may create. |
Conflict
|
If a subscription with the same type and condition already exists. |
Examples:
Version 1::
@client.event
async def on_channel_moderator_remove_v1(message: Event[ChannelModeratorRemoveEvent]):
...
channel_points_automatic_reward_redemption_add(broadcaster_user_id=None, version='2')
async
¶
Subscribe to channel points automatic reward redemption add event.
Token and Authorization Requirements::
| Token Type | Required Scopes | Authorization Requirements |
|---|---|---|
| User Access | channel:read:redemptions | Token holder must be broadcaster |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
broadcaster_user_id
|
Optional[str]
|
The broadcaster user ID for the channel to monitor. |
None
|
version
|
Literal['1', '2']
|
The version number that identifies the definition of the subscription's data. |
'2'
|
Returns:
| Type | Description |
|---|---|
Subscription
|
Created or existing subscription (based on ignore_conflict). |
Raises:
| Type | Description |
|---|---|
TokenError
|
If using webhooks/conduits without an app access token. |
BadRequest
|
If the request parameters are invalid or websocket transport has different user subscriptions. |
Unauthorized
|
If the token is invalid, expired, or lacks required scopes. |
Forbidden
|
If subscription missing proper authorization. |
RateLimit
|
The request exceeds the number of subscriptions that you may create. |
Conflict
|
If a subscription with the same type and condition already exists. |
Examples:
Version 1::
@client.event
async def on_channel_points_automatic_reward_redemption_add_v1(
message: Event[ChannelPointsAutomaticRewardRedemptionAddEventV1]):
...
Version 2::
@client.event
async def on_channel_points_automatic_reward_redemption_add_v2(
message: Event[ChannelPointsAutomaticRewardRedemptionAddEventV2]):
...
channel_points_custom_reward_add(broadcaster_user_id=None, version='1')
async
¶
Subscribe to channel points custom reward add event.
Token and Authorization Requirements::
| Token Type | Required Scopes | Authorization Requirements |
|---|---|---|
| User Access | channel:read:redemptions | Token holder must be broadcaster |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
broadcaster_user_id
|
Optional[str]
|
The broadcaster user ID for the channel to monitor. |
None
|
version
|
Literal['1']
|
The version number that identifies the definition of the subscription's data. |
'1'
|
Returns:
| Type | Description |
|---|---|
Subscription
|
Created or existing subscription (based on ignore_conflict). |
Raises:
| Type | Description |
|---|---|
TokenError
|
If using webhooks/conduits without an app access token. |
BadRequest
|
If the request parameters are invalid or websocket transport has different user subscriptions. |
Unauthorized
|
If the token is invalid, expired, or lacks required scopes. |
Forbidden
|
If subscription missing proper authorization. |
RateLimit
|
The request exceeds the number of subscriptions that you may create. |
Conflict
|
If a subscription with the same type and condition already exists. |
Examples:
Version 1::
@client.event
async def on_channel_points_custom_reward_add_v1(message: Event[ChannelPointsCustomRewardAddEvent]):
...
channel_points_custom_reward_redemption_add(broadcaster_user_id=None, reward_id=None, version='1')
async
¶
Subscribe to channel points custom reward redemption add event.
Token and Authorization Requirements::
| Token Type | Required Scopes | Authorization Requirements |
|---|---|---|
| User Access | channel:read:redemptions | Token holder must be broadcaster |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
broadcaster_user_id
|
Optional[str]
|
The broadcaster user ID for the channel to monitor. |
None
|
reward_id
|
Optional[str]
|
The reward ID to monitor specific rewards. Optional. |
None
|
version
|
Literal['1']
|
The version number that identifies the definition of the subscription's data. |
'1'
|
Returns:
| Type | Description |
|---|---|
Subscription
|
Created or existing subscription (based on ignore_conflict). |
Raises:
| Type | Description |
|---|---|
TokenError
|
If using webhooks/conduits without an app access token. |
BadRequest
|
If the request parameters are invalid or websocket transport has different user subscriptions. |
Unauthorized
|
If the token is invalid, expired, or lacks required scopes. |
Forbidden
|
If subscription missing proper authorization. |
RateLimit
|
The request exceeds the number of subscriptions that you may create. |
Conflict
|
If a subscription with the same type and condition already exists. |
Examples:
Version 1::
@client.event
async def on_channel_points_custom_reward_redemption_add_v1(
message: Event[ChannelPointsCustomRewardRedemptionAddEvent]):
...
channel_points_custom_reward_redemption_update(broadcaster_user_id=None, reward_id=None, version='1')
async
¶
Subscribe to channel points custom reward redemption update event.
Token and Authorization Requirements::
| Token Type | Required Scopes | Authorization Requirements |
|---|---|---|
| User Access | channel:read:redemptions | Token holder must be broadcaster |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
broadcaster_user_id
|
Optional[str]
|
The broadcaster user ID for the channel to monitor. |
None
|
reward_id
|
Optional[str]
|
The reward ID to monitor specific rewards. Optional. |
None
|
version
|
Literal['1']
|
The version number that identifies the definition of the subscription's data. |
'1'
|
Returns:
| Type | Description |
|---|---|
Subscription
|
Created or existing subscription (based on ignore_conflict). |
Raises:
| Type | Description |
|---|---|
TokenError
|
If using webhooks/conduits without an app access token. |
BadRequest
|
If the request parameters are invalid or websocket transport has different user subscriptions. |
Unauthorized
|
If the token is invalid, expired, or lacks required scopes. |
Forbidden
|
If subscription missing proper authorization. |
RateLimit
|
The request exceeds the number of subscriptions that you may create. |
Conflict
|
If a subscription with the same type and condition already exists. |
Examples:
Version 1::
@client.event
async def on_channel_points_custom_reward_redemption_update_v1(
message: Event[ChannelPointsCustomRewardRedemptionUpdateEvent]):
...
channel_points_custom_reward_remove(broadcaster_user_id=None, reward_id=None, version='1')
async
¶
Subscribe to channel points custom reward remove event.
Token and Authorization Requirements::
| Token Type | Required Scopes | Authorization Requirements |
|---|---|---|
| User Access | channel:read:redemptions | Token holder must be broadcaster |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
broadcaster_user_id
|
Optional[str]
|
The broadcaster user ID for the channel to monitor. |
None
|
reward_id
|
Optional[str]
|
The reward ID to monitor specific rewards. Optional. |
None
|
version
|
Literal['1']
|
The version number that identifies the definition of the subscription's data. |
'1'
|
Returns:
| Type | Description |
|---|---|
Subscription
|
Created or existing subscription (based on ignore_conflict). |
Raises:
| Type | Description |
|---|---|
TokenError
|
If using webhooks/conduits without an app access token. |
BadRequest
|
If the request parameters are invalid or websocket transport has different user subscriptions. |
Unauthorized
|
If the token is invalid, expired, or lacks required scopes. |
Forbidden
|
If subscription missing proper authorization. |
RateLimit
|
The request exceeds the number of subscriptions that you may create. |
Conflict
|
If a subscription with the same type and condition already exists. |
Examples:
Version 1::
@client.event
async def on_channel_points_custom_reward_remove_v1(message: Event[ChannelPointsCustomRewardRemoveEvent]):
...
channel_points_custom_reward_update(broadcaster_user_id=None, reward_id=None, version='1')
async
¶
Subscribe to channel points custom reward update event.
Token and Authorization Requirements::
| Token Type | Required Scopes | Authorization Requirements |
|---|---|---|
| User Access | channel:read:redemptions | Token holder must be broadcaster |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
broadcaster_user_id
|
Optional[str]
|
The broadcaster user ID for the channel to monitor. |
None
|
reward_id
|
Optional[str]
|
The reward ID to monitor specific rewards. Optional. |
None
|
version
|
Literal['1']
|
The version number that identifies the definition of the subscription's data. |
'1'
|
Returns:
| Type | Description |
|---|---|
Subscription
|
Created or existing subscription (based on ignore_conflict). |
Raises:
| Type | Description |
|---|---|
TokenError
|
If using webhooks/conduits without an app access token. |
BadRequest
|
If the request parameters are invalid or websocket transport has different user subscriptions. |
Unauthorized
|
If the token is invalid, expired, or lacks required scopes. |
Forbidden
|
If subscription missing proper authorization. |
RateLimit
|
The request exceeds the number of subscriptions that you may create. |
Conflict
|
If a subscription with the same type and condition already exists. |
Examples:
Version 1::
@client.event
async def on_channel_points_custom_reward_update_v1(message: Event[ChannelPointsCustomRewardUpdateEvent]):
...
channel_poll_begin(broadcaster_user_id=None, version='1')
async
¶
Subscribe to channel poll begin event.
Token and Authorization Requirements::
| Token Type | Required Scopes | Authorization Requirements |
|---|---|---|
| User Access | channel:read:polls | Token holder must be broadcaster |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
broadcaster_user_id
|
Optional[str]
|
The broadcaster user ID for the channel to monitor. |
None
|
version
|
Literal['1']
|
The version number that identifies the definition of the subscription's data. |
'1'
|
Returns:
| Type | Description |
|---|---|
Subscription
|
Created or existing subscription (based on ignore_conflict). |
Raises:
| Type | Description |
|---|---|
TokenError
|
If using webhooks/conduits without an app access token. |
BadRequest
|
If the request parameters are invalid or websocket transport has different user subscriptions. |
Unauthorized
|
If the token is invalid, expired, or lacks required scopes. |
Forbidden
|
If subscription missing proper authorization. |
RateLimit
|
The request exceeds the number of subscriptions that you may create. |
Conflict
|
If a subscription with the same type and condition already exists. |
Examples:
Version 1::
@client.event
async def on_channel_poll_begin_v1(message: Event[ChannelPollBeginEvent]):
...
channel_poll_end(broadcaster_user_id=None, version='1')
async
¶
Subscribe to channel poll end event.
Token and Authorization Requirements::
| Token Type | Required Scopes | Authorization Requirements |
|---|---|---|
| User Access | channel:read:polls | Token holder must be broadcaster |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
broadcaster_user_id
|
Optional[str]
|
The broadcaster user ID for the channel to monitor. |
None
|
version
|
Literal['1']
|
The version number that identifies the definition of the subscription's data. |
'1'
|
Returns:
| Type | Description |
|---|---|
Subscription
|
Created or existing subscription (based on ignore_conflict). |
Raises:
| Type | Description |
|---|---|
TokenError
|
If using webhooks/conduits without an app access token. |
BadRequest
|
If the request parameters are invalid or websocket transport has different user subscriptions. |
Unauthorized
|
If the token is invalid, expired, or lacks required scopes. |
Forbidden
|
If subscription missing proper authorization. |
RateLimit
|
The request exceeds the number of subscriptions that you may create. |
Conflict
|
If a subscription with the same type and condition already exists. |
Examples:
Version 1::
@client.event
async def on_channel_poll_end_v1(message: Event[ChannelPollEndEvent]):
...
channel_poll_progress(broadcaster_user_id=None, version='1')
async
¶
Subscribe to channel poll progress event.
Token and Authorization Requirements::
| Token Type | Required Scopes | Authorization Requirements |
|---|---|---|
| User Access | channel:read:polls | Token holder must be broadcaster |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
broadcaster_user_id
|
Optional[str]
|
The broadcaster user ID for the channel to monitor. |
None
|
version
|
Literal['1']
|
The version number that identifies the definition of the subscription's data. |
'1'
|
Returns:
| Type | Description |
|---|---|
Subscription
|
Created or existing subscription (based on ignore_conflict). |
Raises:
| Type | Description |
|---|---|
TokenError
|
If using webhooks/conduits without an app access token. |
BadRequest
|
If the request parameters are invalid or websocket transport has different user subscriptions. |
Unauthorized
|
If the token is invalid, expired, or lacks required scopes. |
Forbidden
|
If subscription missing proper authorization. |
RateLimit
|
The request exceeds the number of subscriptions that you may create. |
Conflict
|
If a subscription with the same type and condition already exists. |
Examples:
Version 1::
@client.event
async def on_channel_poll_progress_v1(message: Event[ChannelPollProgressEvent]):
...
channel_prediction_begin(broadcaster_user_id=None, version='1')
async
¶
Subscribe to channel prediction begin event.
Token and Authorization Requirements::
| Token Type | Required Scopes | Authorization Requirements |
|---|---|---|
| User Access | channel:read:predictions | Token holder must be broadcaster |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
broadcaster_user_id
|
Optional[str]
|
The broadcaster user ID for the channel to monitor. |
None
|
version
|
Literal['1']
|
The version number that identifies the definition of the subscription's data. |
'1'
|
Returns:
| Type | Description |
|---|---|
Subscription
|
Created or existing subscription (based on ignore_conflict). |
Raises:
| Type | Description |
|---|---|
TokenError
|
If using webhooks/conduits without an app access token. |
BadRequest
|
If the request parameters are invalid or websocket transport has different user subscriptions. |
Unauthorized
|
If the token is invalid, expired, or lacks required scopes. |
Forbidden
|
If subscription missing proper authorization. |
RateLimit
|
The request exceeds the number of subscriptions that you may create. |
Conflict
|
If a subscription with the same type and condition already exists. |
Examples:
Version 1::
@client.event
async def on_channel_prediction_begin_v1(message: Event[ChannelPredictionBeginEvent]):
...
channel_prediction_end(broadcaster_user_id=None, version='1')
async
¶
Subscribe to channel prediction end event.
Token and Authorization Requirements::
| Token Type | Required Scopes | Authorization Requirements |
|---|---|---|
| User Access | channel:read:predictions | Token holder must be broadcaster |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
broadcaster_user_id
|
Optional[str]
|
The broadcaster user ID for the channel to monitor. |
None
|
version
|
Literal['1']
|
The version number that identifies the definition of the subscription's data. |
'1'
|
Returns:
| Type | Description |
|---|---|
Subscription
|
Created or existing subscription (based on ignore_conflict). |
Raises:
| Type | Description |
|---|---|
TokenError
|
If using webhooks/conduits without an app access token. |
BadRequest
|
If the request parameters are invalid or websocket transport has different user subscriptions. |
Unauthorized
|
If the token is invalid, expired, or lacks required scopes. |
Forbidden
|
If subscription missing proper authorization. |
RateLimit
|
The request exceeds the number of subscriptions that you may create. |
Conflict
|
If a subscription with the same type and condition already exists. |
Examples:
Version 1::
@client.event
async def on_channel_prediction_end_v1(message: Event[ChannelPredictionEndEvent]):
...
channel_prediction_lock(broadcaster_user_id=None, version='1')
async
¶
Subscribe to channel prediction lock event.
Token and Authorization Requirements::
| Token Type | Required Scopes | Authorization Requirements |
|---|---|---|
| User Access | channel:read:predictions | Token holder must be broadcaster |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
broadcaster_user_id
|
Optional[str]
|
The broadcaster user ID for the channel to monitor. |
None
|
version
|
Literal['1']
|
The version number that identifies the definition of the subscription's data. |
'1'
|
Returns:
| Type | Description |
|---|---|
Subscription
|
Created or existing subscription (based on ignore_conflict). |
Raises:
| Type | Description |
|---|---|
TokenError
|
If using webhooks/conduits without an app access token. |
BadRequest
|
If the request parameters are invalid or websocket transport has different user subscriptions. |
Unauthorized
|
If the token is invalid, expired, or lacks required scopes. |
Forbidden
|
If subscription missing proper authorization. |
RateLimit
|
The request exceeds the number of subscriptions that you may create. |
Conflict
|
If a subscription with the same type and condition already exists. |
Examples:
Version 1::
@client.event
async def on_channel_prediction_lock_v1(message: Event[ChannelPredictionLockEvent]):
...
channel_prediction_progress(broadcaster_user_id=None, version='1')
async
¶
Subscribe to channel prediction progress event.
Token and Authorization Requirements::
| Token Type | Required Scopes | Authorization Requirements |
|---|---|---|
| User Access | channel:read:predictions | Token holder must be broadcaster |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
broadcaster_user_id
|
Optional[str]
|
The broadcaster user ID for the channel to monitor. |
None
|
version
|
Literal['1']
|
The version number that identifies the definition of the subscription's data. |
'1'
|
Returns:
| Type | Description |
|---|---|
Subscription
|
Created or existing subscription (based on ignore_conflict). |
Raises:
| Type | Description |
|---|---|
TokenError
|
If using webhooks/conduits without an app access token. |
BadRequest
|
If the request parameters are invalid or websocket transport has different user subscriptions. |
Unauthorized
|
If the token is invalid, expired, or lacks required scopes. |
Forbidden
|
If subscription missing proper authorization. |
RateLimit
|
The request exceeds the number of subscriptions that you may create. |
Conflict
|
If a subscription with the same type and condition already exists. |
Examples:
Version 1::
@client.event
async def on_channel_prediction_progress_v1(message: Event[ChannelPredictionProgressEvent]):
...
channel_shield_mode_begin(broadcaster_user_id=None, moderator_user_id=None, version='1')
async
¶
Subscribe to channel shield mode begin event.
Token and Authorization Requirements::
| Token Type | Required Scopes | Authorization Requirements |
|---|---|---|
| User Access | moderator:read:shield_mode | Token holder must be moderator/broadcaster |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
broadcaster_user_id
|
Optional[str]
|
The broadcaster user ID for the channel to monitor. |
None
|
moderator_user_id
|
Optional[str]
|
The moderator user ID. Must match the user ID in the access token. |
None
|
version
|
Literal['1']
|
The version number that identifies the definition of the subscription's data. |
'1'
|
Returns:
| Type | Description |
|---|---|
Subscription
|
Created or existing subscription (based on ignore_conflict). |
Raises:
| Type | Description |
|---|---|
TokenError
|
If using webhooks/conduits without an app access token. |
BadRequest
|
If the request parameters are invalid or websocket transport has different user subscriptions. |
Unauthorized
|
If the token is invalid, expired, or lacks required scopes. |
Forbidden
|
If subscription missing proper authorization. |
RateLimit
|
The request exceeds the number of subscriptions that you may create. |
Conflict
|
If a subscription with the same type and condition already exists. |
Examples:
Version 1::
@client.event
async def on_channel_shield_mode_begin_v1(message: Event[ChannelShieldModeBeginEvent]):
...
channel_shield_mode_end(broadcaster_user_id=None, moderator_user_id=None, version='1')
async
¶
Subscribe to channel shield mode end event.
Token and Authorization Requirements::
| Token Type | Required Scopes | Authorization Requirements |
|---|---|---|
| User Access | moderator:read:shield_mode | Token holder must be moderator/broadcaster |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
broadcaster_user_id
|
Optional[str]
|
The broadcaster user ID for the channel to monitor. |
None
|
moderator_user_id
|
Optional[str]
|
The moderator user ID. Must match the user ID in the access token. |
None
|
version
|
Literal['1']
|
The version number that identifies the definition of the subscription's data. |
'1'
|
Returns:
| Type | Description |
|---|---|
Subscription
|
Created or existing subscription (based on ignore_conflict). |
Raises:
| Type | Description |
|---|---|
TokenError
|
If using webhooks/conduits without an app access token. |
BadRequest
|
If the request parameters are invalid or websocket transport has different user subscriptions. |
Unauthorized
|
If the token is invalid, expired, or lacks required scopes. |
Forbidden
|
If subscription missing proper authorization. |
RateLimit
|
The request exceeds the number of subscriptions that you may create. |
Conflict
|
If a subscription with the same type and condition already exists. |
Examples:
Version 1::
@client.event
async def on_channel_shield_mode_end_v1(message: Event[ChannelShieldModeEndEvent]):
...
channel_shoutout_create(broadcaster_user_id=None, moderator_user_id=None, version='1')
async
¶
Subscribe to channel shoutout create event.
Token and Authorization Requirements::
| Token Type | Required Scopes | Authorization Requirements |
|---|---|---|
| User Access | moderator:read:shoutouts | Token holder must be moderator/broadcaster |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
broadcaster_user_id
|
Optional[str]
|
The broadcaster user ID for the channel to monitor. |
None
|
moderator_user_id
|
Optional[str]
|
The moderator user ID. Must match the user ID in the access token. |
None
|
version
|
Literal['1']
|
The version number that identifies the definition of the subscription's data. |
'1'
|
Returns:
| Type | Description |
|---|---|
Subscription
|
Created or existing subscription (based on ignore_conflict). |
Raises:
| Type | Description |
|---|---|
TokenError
|
If using webhooks/conduits without an app access token. |
BadRequest
|
If the request parameters are invalid or websocket transport has different user subscriptions. |
Unauthorized
|
If the token is invalid, expired, or lacks required scopes. |
Forbidden
|
If subscription missing proper authorization. |
RateLimit
|
The request exceeds the number of subscriptions that you may create. |
Conflict
|
If a subscription with the same type and condition already exists. |
Examples:
Version 1::
@client.event
async def on_channel_shoutout_create_v1(message: Event[ChannelShoutoutCreateEvent]):
...
channel_shoutout_receive(broadcaster_user_id=None, moderator_user_id=None, version='1')
async
¶
Subscribe to channel shoutout receive event.
Token and Authorization Requirements::
| Token Type | Required Scopes | Authorization Requirements |
|---|---|---|
| User Access | moderator:read:shoutouts | Token holder must be moderator/broadcaster |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
broadcaster_user_id
|
Optional[str]
|
The broadcaster user ID for the channel to monitor. |
None
|
moderator_user_id
|
Optional[str]
|
The moderator user ID. Must match the user ID in the access token. |
None
|
version
|
Literal['1']
|
The version number that identifies the definition of the subscription's data. |
'1'
|
Returns:
| Type | Description |
|---|---|
Subscription
|
Created or existing subscription (based on ignore_conflict). |
Raises:
| Type | Description |
|---|---|
TokenError
|
If using webhooks/conduits without an app access token. |
BadRequest
|
If the request parameters are invalid or websocket transport has different user subscriptions. |
Unauthorized
|
If the token is invalid, expired, or lacks required scopes. |
Forbidden
|
If subscription missing proper authorization. |
RateLimit
|
The request exceeds the number of subscriptions that you may create. |
Conflict
|
If a subscription with the same type and condition already exists. |
Examples:
Version 1::
@client.event
async def on_channel_shoutout_receive_v1(message: Event[ChannelShoutoutReceiveEvent]):
...
channel_subscribe(broadcaster_user_id=None, version='1')
async
¶
Subscribe to channel subscribe event.
Token and Authorization Requirements::
| Token Type | Required Scopes | Authorization Requirements |
|---|---|---|
| User Access | channel:read:subscriptions | Token holder must be broadcaster |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
broadcaster_user_id
|
Optional[str]
|
The broadcaster user ID for the channel to monitor. |
None
|
version
|
Literal['1']
|
The version number that identifies the definition of the subscription's data. |
'1'
|
Returns:
| Type | Description |
|---|---|
Subscription
|
Created or existing subscription (based on ignore_conflict). |
Raises:
| Type | Description |
|---|---|
TokenError
|
If using webhooks/conduits without an app access token. |
BadRequest
|
If the request parameters are invalid or websocket transport has different user subscriptions. |
Unauthorized
|
If the token is invalid, expired, or lacks required scopes. |
Forbidden
|
If subscription missing proper authorization. |
RateLimit
|
The request exceeds the number of subscriptions that you may create. |
Conflict
|
If a subscription with the same type and condition already exists. |
Examples:
Version 1::
@client.event
async def on_channel_subscribe_v1(message: Event[ChannelSubscribeEvent]):
...
channel_subscription_end(broadcaster_user_id=None, version='1')
async
¶
Subscribe to channel subscription end event.
Token and Authorization Requirements::
| Token Type | Required Scopes | Authorization Requirements |
|---|---|---|
| User Access | channel:read:subscriptions | Token holder must be broadcaster |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
broadcaster_user_id
|
Optional[str]
|
The broadcaster user ID for the channel to monitor. |
None
|
version
|
Literal['1']
|
The version number that identifies the definition of the subscription's data. |
'1'
|
Returns:
| Type | Description |
|---|---|
Subscription
|
Created or existing subscription (based on ignore_conflict). |
Raises:
| Type | Description |
|---|---|
TokenError
|
If using webhooks/conduits without an app access token. |
BadRequest
|
If the request parameters are invalid or websocket transport has different user subscriptions. |
Unauthorized
|
If the token is invalid, expired, or lacks required scopes. |
Forbidden
|
If subscription missing proper authorization. |
RateLimit
|
The request exceeds the number of subscriptions that you may create. |
Conflict
|
If a subscription with the same type and condition already exists. |
Examples:
Version 1::
@client.event
async def on_channel_subscription_end_v1(message: Event[ChannelSubscriptionEndEvent]):
...
channel_subscription_gift(broadcaster_user_id=None, version='1')
async
¶
Subscribe to channel subscription gift event.
Token and Authorization Requirements::
| Token Type | Required Scopes | Authorization Requirements |
|---|---|---|
| User Access | channel:read:subscriptions | Token holder must be broadcaster |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
broadcaster_user_id
|
Optional[str]
|
The broadcaster user ID for the channel to monitor. |
None
|
version
|
Literal['1']
|
The version number that identifies the definition of the subscription's data. |
'1'
|
Returns:
| Type | Description |
|---|---|
Subscription
|
Created or existing subscription (based on ignore_conflict). |
Raises:
| Type | Description |
|---|---|
TokenError
|
If using webhooks/conduits without an app access token. |
BadRequest
|
If the request parameters are invalid or websocket transport has different user subscriptions. |
Unauthorized
|
If the token is invalid, expired, or lacks required scopes. |
Forbidden
|
If subscription missing proper authorization. |
RateLimit
|
The request exceeds the number of subscriptions that you may create. |
Conflict
|
If a subscription with the same type and condition already exists. |
Examples:
Version 1::
@client.event
async def on_channel_subscription_gift_v1(message: Event[ChannelSubscriptionGiftEvent]):
...
channel_subscription_message(broadcaster_user_id=None, version='1')
async
¶
Subscribe to channel subscription message event.
Token and Authorization Requirements::
| Token Type | Required Scopes | Authorization Requirements |
|---|---|---|
| User Access | channel:read:subscriptions | Token holder must be broadcaster |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
broadcaster_user_id
|
Optional[str]
|
The broadcaster user ID for the channel to monitor. |
None
|
version
|
Literal['1']
|
The version number that identifies the definition of the subscription's data. |
'1'
|
Returns:
| Type | Description |
|---|---|
Subscription
|
Created or existing subscription (based on ignore_conflict). |
Raises:
| Type | Description |
|---|---|
TokenError
|
If using webhooks/conduits without an app access token. |
BadRequest
|
If the request parameters are invalid or websocket transport has different user subscriptions. |
Unauthorized
|
If the token is invalid, expired, or lacks required scopes. |
Forbidden
|
If subscription missing proper authorization. |
RateLimit
|
The request exceeds the number of subscriptions that you may create. |
Conflict
|
If a subscription with the same type and condition already exists. |
Examples:
Version 1::
@client.event
async def on_channel_subscription_message_v1(message: Event[ChannelSubscriptionMessageEvent]):
...
channel_suspicious_user_message(broadcaster_user_id=None, moderator_user_id=None, version='1')
async
¶
Subscribe to channel suspicious user message event.
Token and Authorization Requirements::
| Token Type | Required Scopes | Authorization Requirements |
|---|---|---|
| User Access | moderator:read:suspicious_users | Token holder must be moderator/broadcaster |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
broadcaster_user_id
|
Optional[str]
|
The broadcaster user ID for the channel to monitor. |
None
|
moderator_user_id
|
Optional[str]
|
The moderator user ID. Must match the user ID in the access token. |
None
|
version
|
Literal['1']
|
The version number that identifies the definition of the subscription's data. |
'1'
|
Returns:
| Type | Description |
|---|---|
Subscription
|
Created or existing subscription (based on ignore_conflict). |
Raises:
| Type | Description |
|---|---|
TokenError
|
If using webhooks/conduits without an app access token. |
BadRequest
|
If the request parameters are invalid or websocket transport has different user subscriptions. |
Unauthorized
|
If the token is invalid, expired, or lacks required scopes. |
Forbidden
|
If subscription missing proper authorization. |
RateLimit
|
The request exceeds the number of subscriptions that you may create. |
Conflict
|
If a subscription with the same type and condition already exists. |
Examples:
Version 1::
@client.event
async def on_channel_suspicious_user_message_v1(message: Event[ChannelSuspiciousUserMessageEvent]):
...
channel_suspicious_user_update(broadcaster_user_id=None, moderator_user_id=None, version='1')
async
¶
Subscribe to channel suspicious user update event.
Token and Authorization Requirements::
| Token Type | Required Scopes | Authorization Requirements |
|---|---|---|
| User Access | moderator:read:suspicious_users | Token holder must be moderator/broadcaster |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
broadcaster_user_id
|
Optional[str]
|
The broadcaster user ID for the channel to monitor. |
None
|
moderator_user_id
|
Optional[str]
|
The moderator user ID. Must match the user ID in the access token. |
None
|
version
|
Literal['1']
|
The version number that identifies the definition of the subscription's data. |
'1'
|
Returns:
| Type | Description |
|---|---|
Subscription
|
Created or existing subscription (based on ignore_conflict). |
Raises:
| Type | Description |
|---|---|
TokenError
|
If using webhooks/conduits without an app access token. |
BadRequest
|
If the request parameters are invalid or websocket transport has different user subscriptions. |
Unauthorized
|
If the token is invalid, expired, or lacks required scopes. |
Forbidden
|
If subscription missing proper authorization. |
RateLimit
|
The request exceeds the number of subscriptions that you may create. |
Conflict
|
If a subscription with the same type and condition already exists. |
Examples:
Version 1::
@client.event
async def on_channel_suspicious_user_update_v1(message: Event[ChannelSuspiciousUserUpdateEvent]):
...
channel_unban(broadcaster_user_id=None, version='1')
async
¶
Subscribe to channel unban event.
Token and Authorization Requirements::
| Token Type | Required Scopes | Authorization Requirements |
|---|---|---|
| User Access | channel:moderate | Token holder must be moderator/broadcaster |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
broadcaster_user_id
|
Optional[str]
|
The broadcaster user ID for the channel to monitor. |
None
|
version
|
Literal['1']
|
The version number that identifies the definition of the subscription's data. |
'1'
|
Returns:
| Type | Description |
|---|---|
Subscription
|
Created or existing subscription (based on ignore_conflict). |
Raises:
| Type | Description |
|---|---|
TokenError
|
If using webhooks/conduits without an app access token. |
BadRequest
|
If the request parameters are invalid or websocket transport has different user subscriptions. |
Unauthorized
|
If the token is invalid, expired, or lacks required scopes. |
Forbidden
|
If subscription missing proper authorization. |
RateLimit
|
The request exceeds the number of subscriptions that you may create. |
Conflict
|
If a subscription with the same type and condition already exists. |
Examples:
Version 1::
@client.event
async def on_channel_unban_v1(message: Event[ChannelUnbanEvent]):
...
channel_unban_request_create(broadcaster_user_id=None, moderator_user_id=None, version='1')
async
¶
Subscribe to channel unban request create event.
Token and Authorization Requirements::
| Token Type | Required Scopes | Authorization Requirements |
|---|---|---|
| User Access | moderator:read:unban_requests | Token holder must be mod/bc |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
broadcaster_user_id
|
Optional[str]
|
The broadcaster user ID for the channel to monitor. |
None
|
moderator_user_id
|
Optional[str]
|
The moderator user ID. Must match the user ID in the access token. |
None
|
version
|
Literal['1']
|
The version number that identifies the definition of the subscription's data. |
'1'
|
Returns:
| Type | Description |
|---|---|
Subscription
|
Created or existing subscription (based on ignore_conflict). |
Raises:
| Type | Description |
|---|---|
TokenError
|
If using webhooks/conduits without an app access token. |
BadRequest
|
If the request parameters are invalid or websocket transport has different user subscriptions. |
Unauthorized
|
If the token is invalid, expired, or lacks required scopes. |
Forbidden
|
If subscription missing proper authorization. |
RateLimit
|
The request exceeds the number of subscriptions that you may create. |
Conflict
|
If a subscription with the same type and condition already exists. |
Examples:
Version 1::
@client.event
async def on_channel_unban_request_create_v1(message: Event[ChannelUnbanRequestCreateEvent]):
...
channel_unban_request_resolve(broadcaster_user_id=None, moderator_user_id=None, version='1')
async
¶
Subscribe to channel unban request resolve event.
Token and Authorization Requirements::
| Token Type | Required Scopes | Authorization Requirements |
|---|---|---|
| User Access | moderator:read:unban_requests | Token holder must be mod/bc |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
broadcaster_user_id
|
Optional[str]
|
The broadcaster user ID for the channel to monitor. |
None
|
moderator_user_id
|
Optional[str]
|
The moderator user ID. Must match the user ID in the access token. |
None
|
version
|
Literal['1']
|
The version number that identifies the definition of the subscription's data. |
'1'
|
Returns:
| Type | Description |
|---|---|
Subscription
|
Created or existing subscription (based on ignore_conflict). |
Raises:
| Type | Description |
|---|---|
TokenError
|
If using webhooks/conduits without an app access token. |
BadRequest
|
If the request parameters are invalid or websocket transport has different user subscriptions. |
Unauthorized
|
If the token is invalid, expired, or lacks required scopes. |
Forbidden
|
If subscription missing proper authorization. |
RateLimit
|
The request exceeds the number of subscriptions that you may create. |
Conflict
|
If a subscription with the same type and condition already exists. |
Examples:
Version 1::
@client.event
async def on_channel_unban_request_resolve_v1(message: Event[ChannelUnbanRequestResolveEvent]):
...
channel_vip_add(broadcaster_user_id=None, version='1')
async
¶
Subscribe to channel vip add event.
Token and Authorization Requirements::
| Token Type | Required Scopes | Authorization Requirements |
|---|---|---|
| User Access | moderator:read:vips | Token holder must be broadcaster |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
broadcaster_user_id
|
Optional[str]
|
The broadcaster user ID for the channel to monitor. |
None
|
version
|
Literal['1']
|
The version number that identifies the definition of the subscription's data. |
'1'
|
Returns:
| Type | Description |
|---|---|
Subscription
|
Created or existing subscription (based on ignore_conflict). |
Raises:
| Type | Description |
|---|---|
TokenError
|
If using webhooks/conduits without an app access token. |
BadRequest
|
If the request parameters are invalid or websocket transport has different user subscriptions. |
Unauthorized
|
If the token is invalid, expired, or lacks required scopes. |
Forbidden
|
If subscription missing proper authorization. |
RateLimit
|
The request exceeds the number of subscriptions that you may create. |
Conflict
|
If a subscription with the same type and condition already exists. |
Examples:
Version 1::
@client.event
async def on_channel_vip_add_v1(message: Event[ChannelVipAddEvent]):
...
channel_vip_remove(broadcaster_user_id=None, version='1')
async
¶
Subscribe to channel vip remove event.
Token and Authorization Requirements::
| Token Type | Required Scopes | Authorization Requirements |
|---|---|---|
| User Access | moderator:read:vips | Token holder must be broadcaster |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
broadcaster_user_id
|
Optional[str]
|
The broadcaster user ID for the channel to monitor. |
None
|
version
|
Literal['1']
|
The version number that identifies the definition of the subscription's data. |
'1'
|
Returns:
| Type | Description |
|---|---|
Subscription
|
Created or existing subscription (based on ignore_conflict). |
Raises:
| Type | Description |
|---|---|
TokenError
|
If using webhooks/conduits without an app access token. |
BadRequest
|
If the request parameters are invalid or websocket transport has different user subscriptions. |
Unauthorized
|
If the token is invalid, expired, or lacks required scopes. |
Forbidden
|
If subscription missing proper authorization. |
RateLimit
|
The request exceeds the number of subscriptions that you may create. |
Conflict
|
If a subscription with the same type and condition already exists. |
Examples:
Version 1::
@client.event
async def on_channel_vip_remove_v1(message: Event[ChannelVipRemoveEvent]):
...
channel_warning_acknowledge(broadcaster_user_id=None, moderator_user_id=None, version='1')
async
¶
Subscribe to channel warning acknowledge event.
Token and Authorization Requirements::
| Token Type | Required Scopes | Authorization Requirements |
|---|---|---|
| User Access | moderator:read:warnings | Token holder must be moderator/broadcaster |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
broadcaster_user_id
|
Optional[str]
|
The broadcaster user ID for the channel to monitor. |
None
|
moderator_user_id
|
Optional[str]
|
The moderator user ID. Must match the user ID in the access token. |
None
|
version
|
Literal['1']
|
The version number that identifies the definition of the subscription's data. |
'1'
|
Returns:
| Type | Description |
|---|---|
Subscription
|
Created or existing subscription (based on ignore_conflict). |
Raises:
| Type | Description |
|---|---|
TokenError
|
If using webhooks/conduits without an app access token. |
BadRequest
|
If the request parameters are invalid or websocket transport has different user subscriptions. |
Unauthorized
|
If the token is invalid, expired, or lacks required scopes. |
Forbidden
|
If subscription missing proper authorization. |
RateLimit
|
The request exceeds the number of subscriptions that you may create. |
Conflict
|
If a subscription with the same type and condition already exists. |
Examples:
Version 1::
@client.event
async def on_channel_warning_acknowledge_v1(message: Event[ChannelWarningAcknowledgeEvent]):
...
channel_warning_send(broadcaster_user_id=None, moderator_user_id=None, version='1')
async
¶
Subscribe to channel warning send event.
Token and Authorization Requirements::
| Token Type | Required Scopes | Authorization Requirements |
|---|---|---|
| User Access | moderator:manage:warnings | Token holder must be moderator/broadcaster |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
broadcaster_user_id
|
Optional[str]
|
The broadcaster user ID for the channel to monitor. |
None
|
moderator_user_id
|
Optional[str]
|
The moderator user ID. Must match the user ID in the access token. |
None
|
version
|
Literal['1']
|
The version number that identifies the definition of the subscription's data. |
'1'
|
Returns:
| Type | Description |
|---|---|
Subscription
|
Created or existing subscription (based on ignore_conflict). |
Raises:
| Type | Description |
|---|---|
TokenError
|
If using webhooks/conduits without an app access token. |
BadRequest
|
If the request parameters are invalid or websocket transport has different user subscriptions. |
Unauthorized
|
If the token is invalid, expired, or lacks required scopes. |
Forbidden
|
If subscription missing proper authorization. |
RateLimit
|
The request exceeds the number of subscriptions that you may create. |
Conflict
|
If a subscription with the same type and condition already exists. |
Examples:
Version 1::
@client.event
async def on_channel_warning_send_v1(message: Event[ChannelWarningSendEvent]):
...
extension_bits_transaction_create(extension_client_id, version='1')
async
¶
Subscribe to extension bits transaction create event.
Token and Authorization Requirements::
| Token Type | Required Scopes | Authorization Requirements |
|---|---|---|
| User Access | None | Token client ID must match extension |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
extension_client_id
|
str
|
The extension client ID. |
required |
version
|
Literal['1']
|
The version number that identifies the definition of the subscription's data. |
'1'
|
Returns:
| Type | Description |
|---|---|
Subscription
|
Created or existing subscription (based on ignore_conflict). |
Raises:
| Type | Description |
|---|---|
TokenError
|
If using webhooks/conduits without an app access token. |
BadRequest
|
If the request parameters are invalid or websocket transport has different user subscriptions. |
Unauthorized
|
If the token is invalid, expired, or lacks required scopes. |
Forbidden
|
If subscription missing proper authorization. |
RateLimit
|
The request exceeds the number of subscriptions that you may create. |
Conflict
|
If a subscription with the same type and condition already exists. |
Examples:
Version 1::
@client.event
async def on_extension_bits_transaction_create_v1(message: Event[ExtensionBitsTransactionCreateEvent]):
...
user_whisper_message(user_id=None, version='1')
async
¶
Subscribe to user whisper message event.
Token and Authorization Requirements::
| Token Type | Required Scopes | Authorization Requirements |
|---|---|---|
| User Access | user:read:whispers | None |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
user_id
|
Optional[str]
|
The user ID to monitor. |
None
|
version
|
Literal['1']
|
The version number that identifies the definition of the subscription's data. |
'1'
|
Returns:
| Type | Description |
|---|---|
Subscription
|
Created or existing subscription (based on ignore_conflict). |
Raises:
| Type | Description |
|---|---|
TokenError
|
If using webhooks/conduits without an app access token. |
BadRequest
|
If the request parameters are invalid or websocket transport has different user subscriptions. |
Unauthorized
|
If the token is invalid, expired, or lacks required scopes. |
Forbidden
|
If subscription missing proper authorization. |
RateLimit
|
The request exceeds the number of subscriptions that you may create. |
Conflict
|
If a subscription with the same type and condition already exists. |
Examples:
Version 1::
@client.event
async def on_user_whisper_message_v1(message: Event[UserWhisperMessageEvent]):
...
Event
¶
Bases: NamedTuple
EventSub event.
Attributes:
| Name | Type | Description |
|---|---|---|
event |
T
|
The Eventsub event |
subscription |
Subscription
|
The subscription that triggered this event |
metadata |
Metadata
|
Metadata about the EventSub message |
id
property
¶
Direct access to message ID.
Note
No built-in duplicate message checking is provided. Check the messages on your own if you want accuracy.
Provides a unique identifier for each event message. Messages are delivered at least once, and may be duplicated if delivery confirmation is uncertain. Duplicate messages will share the same ID, allowing for deduplication.
Returns:
| Type | Description |
|---|---|
str
|
The unique message ID from the metadata. |
Metadata
¶
Bases: NamedTuple
EventSub metadata.
Attributes:
| Name | Type | Description |
|---|---|---|
message_id |
str
|
Unique identifier for the message. |
message_type |
str
|
Type of the EventSub message. |
message_timestamp |
datetime
|
Timestamp when the message was created. |
raw |
MappingProxyType[str, Any]
|
A MappingProxyType-wrapped dictionary representing the original event payload. |
Notes
Twitch guarantees at-least-once delivery for EventSub notifications. Duplicate messages retain the same message_id for deduplication.
from_data(data)
classmethod
¶
Create Metadata instance from EventSub data.
Shard
¶
Individual shard connection handler for multi-shard EventSub WebSocket clients.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
conduit_id
|
str
|
The conduit ID this shard belongs to. |
required |
shard_id
|
int
|
The unique identifier for this shard. |
required |
ws
|
EventSubWebSocket
|
The WebSocket connection for this shard. |
required |
client
|
MultiShardClientApp
|
The parent multi-shard client instance. |
required |
queue_put
|
Callable[[_QueueItem], None]
|
Function to put items into the parent's event queue. |
required |
reconnect
|
bool
|
Whether this shard should attempt automatic reconnection on failures. |
required |
id
property
¶
Get the shard's unique identifier.
Returns:
| Type | Description |
|---|---|
int
|
The shard ID assigned to this shard instance. |
is_running
property
¶
Check if the shard worker task is currently running.
Returns:
| Type | Description |
|---|---|
bool
|
True if the worker task exists and is not done, False otherwise. |
close()
async
¶
Close the shard connection and clean up resources.
Cancels the worker task and closes the WebSocket connection with a clean shutdown code.
disconnect()
async
¶
Gracefully disconnect the shard and dispatch disconnect events.
launch()
¶
Launch the shard worker task.
Warning
This method should only be called once per shard instance. Multiple calls will cancel the previous task.
Creates and starts an asyncio task that handles event polling for this shard's WebSocket connection.
reconnect(gateway=None)
async
¶
worker()
async
¶
Main worker loop for handling WebSocket events.