class twitchio.AutomodMessageHold

Represents an automod message hold event. Both V1 and V2.

broadcaster

The broadcaster specified in the request.

Type

PartialUser

user

The user who sent the message.

Type

PartialUser

message_id

The ID of the message that was flagged by automod.

Type

str

text

The text content of the message.

Type

str

level

The level of severity. Measured between 1 to 4. This is None if the V2 endpoint is used and the reason is blocked_term.

Type

int | None

category

The category of the message. This is None if the V2 endpoint is used and the reason is blocked_term.

Type

str | None

held_at

The datetime of when automod saved the message.

Type

datetime.datetime

fragments

List of chat message fragments.

Type

list[ChatMessageFragment]

reason

The reason for the message being held. This is only populated for the V2 endpoint.

Type

Literal[“automod”, “blocked_term”] | None

boundaries

The start and end index of the words caught by automod. This is only populated for the V2 endpoint and when the reason is automod.

Type

list[Boundary]

property emotes: list[twitchio.models.eventsub_.ChatMessageEmote]

A property that lists all of the emotes of a message. If no emotes are in the message this will return an empty list.

Returns

A list of ChatMessageEmote objects.

Return type

list[ChatMessageEmote]

property cheermotes: list[twitchio.models.eventsub_.ChatMessageCheermote]

A property that lists all of the cheermotes of a message. If no cheermotes are in the message this will return an empty list.

Returns

A list of ChatMessageCheermote objects.

Return type

list[ChatMessageCheermote]

Attributes
class twitchio.AutomodBlockedTerm

Represents a blocked term from AutoMod.

id

The id of the blocked term found.

Type

str

owner

The broadcaster who has blocked the term.

Type

PartialUser

boundary

The start and end indexes of the blocked term in the message.

Type

Boundary

Attributes
class twitchio.Boundary

NamedTuple that represents the boundaries of caught automod words.

start

Index in the message for the start of the problem (0 indexed, inclusive).

Type

int

end

Index in the message for the end of the problem (0 indexed, inclusive).

Type

int

class twitchio.AutomodMessageUpdate

Represents an automod message update event. Both V1 and V2.

broadcaster

The broadcaster specified in the request.

Type

PartialUser

moderator

The moderator who approved or denied the message.

Type

PartialUser

user

The user who sent the message.

Type

PartialUser

message_id

The ID of the message that was flagged by automod.

Type

str

text

The text content of the message.

Type

str

level

The level of severity. Measured between 1 to 4. This is None if the V2 endpoint is used and the reason is blocked_term.

Type

int | None

category

The category of the message. This is None if the V2 endpoint is used and the reason is blocked_term.

Type

str | None

held_at

The datetime of when automod saved the message.

Type

datetime.datetime

emotes

List of emotes in the message.

Type

list[ChatMessageEmote]

cheermotes

List of cheermotes in the message.

Type

list[ChatMessageCheermote]

fragments

List of chat message fragments.

Type

list[ChatMessageFragment]

status

The message’s status. Possible values are:

  • Approved

  • Denied

  • Expired

Type

Literal[“Approved”, “Denied”, “Expired”]

reason

The reason for the message being held. This is only populated for the V2 endpoint.

Type

Literal[“automod”, “blocked_term”] | None

boundaries

The start and end index of the words caught by automod. This is only populated for the V2 endpoint and when the reason is automod.

Type

list[Boundary]

class twitchio.AutomodSettingsUpdate

Represents an automod settings update event.

broadcaster

The broadcaster who had their automod settings updated.

Type

PartialUser

moderator

The moderator who changed the channel settings.

Type

PartialUser

overall_level

The default AutoMod level for the broadcaster. This is None if the broadcaster has set one or more of the individual settings.

Type

int | None

disability

The Automod level for discrimination against disability.

Type

int

aggression

The Automod level for hostility involving aggression.

Type

int

misogyny

The Automod level for discrimination against women.

Type

int

bullying

The Automod level for hostility involving name calling or insults.

Type

int

swearing

The Automod level for profanity.

Type

int

race_ethnicity_or_religion

The Automod level for racial discrimination.

Type

int

sex_based_terms

The Automod level for sexual content.

Type

int

sexuality_sex_or_gender

The AutoMod level for discrimination based on sexuality, sex, or gender.

Type

int

class twitchio.AutomodTermsUpdate

Represents an automod terms update event.

broadcaster

The broadcaster specified in the request.

Type

PartialUser

moderator

The moderator who changed the channel settings.

Type

PartialUser

action

The status change applied to the terms. Possible options are:

  • add_permitted

  • remove_permitted

  • add_blocked

  • remove_blocked

Type

Literal[“add_permitted”, “remove_permitted”, “add_blocked”, “remove_blocked”]

automod

Whether this term was added due to an Automod message approve/deny action

Type

bool

terms

The list of terms that had a status change.

Type

list[str]

class twitchio.AutoRedeemReward

Represents a reward on an automatic redeem.

type

The type of the reward. V2 does not cover Power-ups e.g. gigantify_an_emote, celebration, and message_effect.

Type

Literal[“single_message_bypass_sub_mode”, “send_highlighted_message”, “random_sub_emote_unlock”, “chosen_sub_emote_unlock”, “chosen_modified_sub_emote_unlock”, “message_effect”, “gigantify_an_emote”, “celebration”]

channel_points

Number of channel points used. This is also covers cost when using V1.

Type

int

emote

The human readable emote token.

Type

UnlockedEmote | None

class twitchio.ChannelUpdate

Represents a channel update event.

broadcaster

An ID that identifies the emote set that the emote belongs to.

Type

PartialUser

title

The channel’s stream title.

Type

str

language

The channel’s broadcast language.

Type

str

category_id

The channel’s category ID.

Type

str

category_name

The category name.

Type

str

content_classification_labels

List of content classification label IDs currently applied on the Channel.

Type

list[str]

class twitchio.ChannelFollow

Represents a channel follow event.

broadcaster

The requested broadcaster to listen to follows for.

Type

PartialUser

user

The user that is now following the specified channel.

Type

PartialUser

followed_at

Datetime when the follow occurred.

Type

datetime.datetime

class twitchio.ChannelAdBreakBegin

Represents a channel ad break event.

broadcaster

The broadcaster the ad was run on.

Type

PartialUser

requester

The user that requested the ad.

Type

PartialUser

duration

Length in seconds of the mid-roll ad break requested.

Type

int

automatic

Indicates if the ad was automatically scheduled via Ads Manager.

Type

bool

started_at

Datetime when the follow occurred.

Type

datetime.datetime

class twitchio.ChannelBitsUse

Represents a channel bits use event.

broadcaster

The broadcastter / channel where the Bits were redeemed.

Type

PartialUser

user

The redeeming user.

Type

PartialUser

bits

The number of Bits used.

Type

int

type

What the Bits were used for.

Type

Literal[“cheer”, “power_up”]

text

The chat message in plain text. Is None if no chat message was used.

Type

str | None

fragments

The ordered list of chat message fragments. Is None if no chat message was used.

Type

list[ChatMessageFragment]

power_up

Data about Power-up. Is None if a Power-up is not used.

Type

PowerUp | None

Attributes
class twitchio.ChannelChatClear

Represents a channel chat clear event.

broadcaster

The broadcaster’s chat that was cleared.

Type

PartialUser

Attributes
class twitchio.ChannelChatClearUserMessages

Represents a user’s channel chat clear event.

broadcaster

The broadcaster’s chat that had the user’s messages cleared.

Type

PartialUser

user

The user that was banned or put in a timeout and had all their messaged deleted.

Type

PartialUser

Attributes
class twitchio.BaseChatMessage
property emotes: list[twitchio.models.eventsub_.ChatMessageEmote]

A property that lists all of the emotes of a message. If no emotes are in the message this will return an empty list.

Returns

A list of ChatMessageEmote objects.

Return type

list[ChatMessageEmote]

property cheermotes: list[twitchio.models.eventsub_.ChatMessageCheermote]

A property that lists all of the cheermotes of a message. If no cheermotes are in the message this will return an empty list.

Returns

A list of ChatMessageCheermote objects.

Return type

list[ChatMessageCheermote]

class twitchio.ChatMessageReply

Represents a chat message reply.

parent_message_id

An ID that uniquely identifies the parent message that this message is replying to.

Type

str

parent_message_body

The message body of the parent message.

Type

str

parent_user

The sender of the parent message.

Type

PartialUser

thread_message_id

An ID that identifies the parent message of the reply thread.

Type

str

thread_user

The sender of the thread’s parent message.

Type

PartialUser

Attributes
class twitchio.ChatMessageCheer

Represents a chat message cheer.

bits

The amount of Bits the user cheered.

Type

int

Attributes
class twitchio.ChatMessageBadge

Represents a chat message badge.

set_id

An ID that identifies this set of chat badges. For example, Bits or Subscriber.

Type

str

id

An ID that identifies this version of the badge. The ID can be any value. For example, for Bits, the ID is the Bits tier level, but for World of Warcraft, it could be Alliance or Horde.

Type

str

info

Contains metadata related to the chat badges in the badges tag. Currently, this tag contains metadata only for subscriber badges, to indicate the number of months the user has been a subscriber.

Type

str

Attributes
Methods
class twitchio.ChatMessageEmote

Represents a chat message emote.

set_id

An ID that identifies the emote set that the emote belongs to.

Type

str | None

id

An ID that uniquely identifies this emote.

Type

str

owner

The broadcaster who owns the emote.

Type

PartialUser | None

format

The formats that the emote is available in. For example, if the emote is available only as a static PNG, the array contains only static. But if the emote is available as a static PNG and an animated GIF, the array contains static and animated. The possible formats are:

  • animated - An animated GIF is available for this emote.

  • static - A static PNG file is available for this emote.

Type

list[Literal[“static”, “animated”]]

async fetch_emote_set(*, token_for: str | twitchio.user.PartialUser | None = None) EmoteSet

This function is a coroutine.

Fetches emotes for this emote set.

Parameters

token_for (str | PartialUser | None) – An optional user token to use instead of the default app token.

Returns

A list of EmoteSet objects.

Return type

EmoteSet

Attributes
class twitchio.ChatMessageCheermote

Represents a chat message cheermote.

prefix

The name portion of the Cheermote string that you use in chat to cheer Bits. The full Cheermote string is the concatenation of {prefix} + {number of Bits}. For example, if the prefix is “Cheer” and you want to cheer 100 Bits, the full Cheermote string is Cheer100. When the Cheermote string is entered in chat, Twitch converts it to the image associated with the Bits tier that was cheered.

Type

str

bits

The amount of bits cheered.

Type

int

tier

The tier level of the cheermote.

Type

int

class twitchio.ChatMessageFragment

Represents a chat message’s fragments.

text

The chat message in plain text.

Type

str

type

The type of message fragment. Possible values:

  • text

  • cheermote

  • emote

  • mention

Type

Literal[“text”, “cheermote”, “emote”, “mention”]

mention

The user that is mentioned, if one is mentioned.

Type

PartialUser | None

cheermote

Cheermote data if a cheermote is sent.

Type

ChatMessageCheermote | None

emote

Emote data if a cheermote is sent.

Type

ChatMessageEmote | None

class twitchio.ChatMessage

Represents a chat message.

broadcaster

The broadcaster whose room recieved the message.

Type

PartialUser

chatter

The user / chatter who sent the message.

Type

PartialUser

id

A UUID that identifies the message.

Type

str

text

The chat message in plain text.

Type

str

reply

Data regarding parent message and thread, if this message is a reply.

Type

ChatMessageReply | None

type

The type of message. Possible values:

  • text

  • channel_points_highlighted

  • channel_points_sub_only

  • user_intro

  • power_ups_message_effect

  • power_ups_gigantified_emote

Type

Literal[“text”, “channel_points_highlighted”, “channel_points_sub_only”, “user_intro”, “power_ups_message_effect”, “power_ups_gigantified_emote”]

fragments

The chat message fragments.

Type

ChatMessageFragment

colour

The colour of the user’s name in the chat room.

Type

Colour | None

channel_points_id

The ID of a channel points custom reward that was redeemed.

Type

str | None

channel_points_animation_id

An ID for the type of animation selected as part of an “animate my message” redemption.

Type

str | None

cheer

Data for a cheer, if received.

Type

ChatMessageCheer | None

badges

List of ChatMessageBadge for chat badges.

Type

list[ChatMessageBadge]

source_broadcaster

The broadcaster of the channel the message was sent from. Is None when the message happens in the same channel as the broadcaster. Is not None when in a shared chat session, and the action happens in the channel of a participant other than the broadcaster.

Type

PartialUser | None

source_id

The source message ID from the channel the message was sent from. Is None when the message happens in the same channel as the broadcaster. Is not None when in a shared chat session, and the action happens in the channel of a participant other than the broadcaster.

Type

str | None

source_badges

The list of chat badges for the chatter in the channel the message was sent from. Is None when the message happens in the same channel as the broadcaster. Is not None when in a shared chat session, and the action happens in the channel of a participant other than the broadcaster.

Type

list[ChatMessageBadge]

source_only

Whether a message delivered during a shared chat session is only sent to the source channel. This is None when not in a shared chat.

Type

bool | None

property mentions: list[twitchio.user.PartialUser]

List of PartialUsers of chatters who were mentioned in the message.

property color: twitchio.utils.Colour | None

An alias for colour

Attributes
class twitchio.ChatSub

Represents a chat subscription.

tier

The type of subscription plan being used.

Type

Description

1000

First level of paid or Prime subscription.

2000

Second level of paid subscription.

3000

Third level of paid subscription.

Type

Literal[“1000”, “2000”, “3000”]

prime

Indicates if the subscription was obtained through Amazon Prime.

Type

bool

months

The number of months the subscription is for.

Type

int

class twitchio.ChatResub

Represents a chat resubscription.

tier

The type of subscription plan being used.

Type

Description

1000

First level of paid or Prime subscription.

2000

Second level of paid subscription.

3000

Third level of paid subscription.

Type

Literal[“1000”, “2000”, “3000”]

prime

Indicates if the subscription was obtained through Amazon Prime.

Type

bool

months

The number of months the subscription is for.

Type

int

cumulative_months

The total number of months the user has subscribed.

Type

int

streak_months

The number of consecutive months the user’s current subscription has been active. This is None if the user has opted out of sharing this information.

Type

int

gift

Whether or not the resub was a result of a gift.

Type

bool

anonymous

Whether or not the gift was anonymous.

Type

bool | None

gifter

The user who gifted the subscription.

Type

PartialUser | None

class twitchio.ChatSubGift

Represents a chat subscription gift.

tier

The type of subscription plan being used.

Type

Description

1000

First level of paid or Prime subscription.

2000

Second level of paid subscription.

3000

Third level of paid subscription.

Type

Literal[“1000”, “2000”, “3000”]

months

The number of months the subscription is for.

Type

int

cumulative_total

The amount of gifts the gifter has given in this channel. None if anonymous.

Type

int | None

community_gift_id

The ID of the associated community gift. Mone if not associated with a community gift.

Type

int | None

recipient

The user who received the gift subscription.

Type

PartialUser

class twitchio.ChatCommunitySubGift

Represents a chat community subscription gift.

tier

The type of subscription plan being used.

Type

Description

1000

First level of paid or Prime subscription.

2000

Second level of paid subscription.

3000

Third level of paid subscription.

Type

Literal[“1000”, “2000”, “3000”]

total

Number of subscriptions being gifted.

Type

int

cumulative_total

The amount of gifts the gifter has given in this channel. None` if anonymous.

Type

int | None

id

The ID of the associated community gift. Mone if not associated with a community gift.

Type

str

Attributes
class twitchio.ChatGiftPaidUpgrade

Represents a paid chat subscription upgrade gift.

anonymous

Whether the gift was given anonymously.

Type

bool

gifter

The user who gifted the subscription. None if anonymous.

Type

PartialUser | None

Attributes
class twitchio.ChatPrimePaidUpgrade

Represents a prime chat subscription upgrade.

tier

The type of subscription plan being used.

Type

Description

1000

First level of paid or Prime subscription.

2000

Second level of paid subscription.

3000

Third level of paid subscription.

Type

Literal[“1000”, “2000”, “3000”]

class twitchio.ChatRaid

Represents a chat raid event.

user

The user raiding this channel.

Type

PartialUser

viewer_count

The number of viewers raiding this channel from the user’s channel.

Type

int

profile_image

Profile image, as an Asset, of the user raiding this channel.

Type

Asset

Attributes
class twitchio.ChatPayItForward

Represents a pay it forward gift subscription.

anonymous

Whether the gift was given anonymously.

Type

bool

gifter

The user who gifted the subscription. None if anonymous.

Type

PartialUser | None

Attributes
class twitchio.ChatAnnouncement

Represents a pay it forward gift subscription.

colour

Colour of the announcement.

Type

Literal[“BLUE”, “PURPLE”, “ORANGE”, “GREEN”, “PRIMARY”]

property color: Literal['BLUE', 'PURPLE', 'ORANGE', 'GREEN', 'PRIMARY']

An alias for Colour

Attributes
class twitchio.ChatBitsBadgeTier

Represents a bits badge tier.

tier

The tier of the Bits badge the user just earned. For example, 100, 1000, or 10000.

Type

int

class twitchio.BaseCharityCampaign
Attributes
class twitchio.ChatCharityDonation

Represents a charity donation.

name

Name of the charity.

Type

str

amount

The amount of money donation. This includes currency and decimal places.

Type

CharityValues

class twitchio.ChatNotification

Represents a chat notification.

broadcaster

The broadcaster / channel that received the notification.

Type

PartialUser

chatter

The chatter / user that sent the message.

Type

PartialUser

anonymous

Whether or not the chatter is anonymous.

Type

bool

colour

The colour of the chatter / user’s name in the chat room.

Type

Colour

badges

A list of badges the chatter / user has.

Type

list[ChatMessageBadge]

system_message

The message Twitch shows in the chat room for this notice.

Type

str

id

The message ID (This is a UUID).

Type

str

text

The chat message in plain text.

Type

str

fragments

A list of chat fragments, each containing structured data related to the messages, such as:

  • text

  • cheermote

  • emote

  • mention

Type

list[ChatMessageFragment]

notice_type

The type of notice. Possible values are:

  • sub

  • resub

  • sub_gift

  • community_sub_gift

  • gift_paid_upgrade

  • prime_paid_upgrade

  • raid

  • unraid

  • pay_it_forward

  • announcement

  • bits_badge_tier

  • charity_donation

  • shared_chat_sub

  • shared_chat_resub

  • shared_chat_community_sub_gift

  • shared_chat_gift_paid_upgrade

  • shared_chat_prime_paid_upgrade

  • shared_chat_raid

  • shared_chat_pay_it_forward

  • shared_chat_announcement

Type

Literal[“sub”, “resub”, “sub_gift”, “community_sub_gift”, “gift_paid_upgrade”, “prime_paid_upgrade”, “raid”, “unraid”, “pay_it_forward”, “announcement”, “bits_badge_tier”, “charity_donation”, “shared_chat_sub”, “shared_chat_resub”, “shared_chat_community_sub_gift”, “shared_chat_gift_paid_upgrade”, “shared_chat_prime_paid_upgrade”, “shared_chat_raid”, “shared_chat_pay_it_forward”, “shared_chat_announcement”]

sub

Information about the sub event. None if notice_type is not sub.

Type

ChatSub | None

resub

Information about the resub event. None if notice_type is not resub.

Type

ChatResub | None

sub_gift

Information about the gift sub event. None if notice_type is not sub_gift.

Type

ChatSubGift | None

community_sub_gift

Information about the community gift sub event. None if notice_type is not community_sub_gift.

Type

ChatCommunitySubGift | None

gift_paid_upgrade

nformation about the community gift paid upgrade event. None if notice_type is not gift_paid_upgrade.

Type

ChatGiftPaidUpgrade | None

prime_paid_upgrade

Information about the Prime gift paid upgrade event. None if notice_type is not prime_paid_upgrade.

Type

ChatPrimePaidUpgrade | None

raid

Information about the raid event. None if notice_type is not raid.

Type

ChatRaid | None

unraid

Returns None as this is an empty payload. You will need to check the notice_type.

Type

None

pay_it_forward

Information about the pay it forward event. None if notice_type is not pay_it_forward

Type

ChatPayItForward | None

announcement

Information about the announcement event. None if notice_type is not announcement

Type

ChatAnnouncement | None

bits_badge_tier

Information about the bits badge tier event. None if notice_type is not bits_badge_tier

Type

ChatBitsBadgeTier | None

charity_donation

Information about the announcement event. None if notice_type is not charity_donation

Type

ChatCharityDonation

shared_sub

Information about the shared_chat_sub event. Is None if notice_type is not shared_chat_sub. This field has the same information as the sub field but for a notice that happened for a channel in a shared chat session other than the broadcaster in the subscription condition.

Type

ChatSub | None

shared_resub

Information about the shared_chat_resub event. Is None if notice_type is not shared_chat_resub. This field has the same information as the resub field but for a notice that happened for a channel in a shared chat session other than the broadcaster in the subscription condition.

Type

ChatResub | None

shared_sub_gift

Information about the shared_chat_sub_gift event. Is None if notice_type is not shared_chat_sub_gift. This field has the same information as the chat_sub_gift field but for a notice that happened for a channel in a shared chat session other than the broadcaster in the subscription condition.

Type

ChatSubGift | None

shared_community_sub_gift

Information about the shared_chat_community_sub_gift event. Is None if notice_type is not shared_chat_community_sub_gift. This field has the same information as the community_sub_gift field but for a notice that happened for a channel in a shared chat session other than the broadcaster in the subscription condition.

Type

ChatCommunitySubGift | None

shared_gift_paid_upgrade

Information about the shared_chat_gift_paid_upgrade event. Is None if notice_type is not shared_chat_gift_paid_upgrade. This field has the same information as the gift_paid_upgrade field but for a notice that happened for a channel in a shared chat session other than the broadcaster in the subscription condition.

Type

ChatGiftPaidUpgrade | None

shared_prime_paid_upgrade

Information about the shared_chat_chat_prime_paid_upgrade event. Is None if notice_type is not shared_chat_prime_paid_upgrade. This field has the same information as the prime_paid_upgrade field but for a notice that happened for a channel in a shared chat session other than the broadcaster in the subscription condition.

Type

ChatPrimePaidUpgrade | None

shared_raid

Information about the shared_chat_raid event. Is None if notice_type is not shared_chat_raid. This field has the same information as the raid field but for a notice that happened for a channel in a shared chat session other than the broadcaster in the subscription condition.

Type

ChatRaid | None

shared_pay_it_forward

Information about the shared_chat_pay_it_forward event. Is None if notice_type is not shared_chat_pay_it_forward. This field has the same information as the pay_it_forward field but for a notice that happened for a channel in a shared chat session other than the broadcaster in the subscription condition.

Type

ChatPayItForward | None

shared_announcement

Information about the shared_chat_announcement event. Is None if notice_type is not shared_chat_announcement. This field has the same information as the announcement field but for a notice that happened for a channel in a shared chat session other than the broadcaster in the subscription condition.

Type

ChatAnnouncement | None

class twitchio.ChatMessageDelete

Represents a chat message delete event.

broadcaster

The broadcaster whose channel deleted the message.

Type

PartialUser

user

The user whose message was deleted.

Type

PartialUser

message_id

The message ID of the deleted message.

Type

str

class twitchio.ChatSettingsUpdate

Represents a chat settings update event.

broadcaster

The broadcaster whose channel updated their chat settings.

Type

PartialUser

emote_mode

Whether chat messages must contain only emotes.

Type

bool

slow_mode

Whether the broadcaster limits how often users in the chat room are allowed to send messages.

Type

bool

slow_mode_wait_time

The amount of time, in seconds, that users need to wait between sending messages. None if slow_mode is False.

Type

int | None

follower_mode

Whether the broadcaster restricts the chat room to followers only, based on how long they’ve followed.

Type

bool

follower_mode_duration

The length of time, in minutes, that the followers must have followed the broadcaster to participate in the chat room. None if follower_mode is False.

Type

int | None

subscriber_mode

Whether only users that subscribe to the broadcaster’s channel can talk in the chat room.

Type

bool

unique_chat_mode

Whether the broadcaster requires users to post only unique messages in the chat room.

Type

bool

class twitchio.ChatUserMessageHold
class twitchio.ChatUserMessageUpdate
class twitchio.SharedChatSessionBegin

Represents a shared chat session begin event.

session_id

The unique identifier for the shared chat session.

Type

PartialUser

broadcaster

The user of the channel in the subscription condition which is now active in the shared chat session.

Type

PartialUser

host

The user of the host channel.

Type

PartialUser

participants

List of participants in the session.

Type

str

class twitchio.SharedChatSessionUpdate

Represents a shared chat session begin event.

session_id

The unique identifier for the shared chat session.

Type

PartialUser

broadcaster

The user of the channel in the subscription condition which is now active in the shared chat session.

Type

PartialUser

host

The user of the host channel.

Type

PartialUser

participants

List of participants in the session.

Type

str

class twitchio.SharedChatSessionEnd

Represents a shared chat session end event.

session_id

The unique identifier for the shared chat session.

Type

PartialUser

broadcaster

The user of the channel in the subscription condition which is no longer active in the shared chat session.

Type

PartialUser

host

The user of the host channel.

Type

PartialUser

Attributes
class twitchio.ChannelSubscribe

Represents a channel subscribe event.

broadcaster

The broadcaster whose channel received a subscription.

Type

PartialUser

user

The user who subscribed to the channel.

Type

PartialUser

tier

The tier of the subscription. Valid values are 1000, 2000, and 3000.

Type

Literal[“1000”, “2000”, “3000”]

gift

Whether the subscription is a gift.

Type

bool

Attributes
class twitchio.ChannelSubscriptionEnd

Represents a channel subscription end event.

broadcaster

The broadcaster whose channel had the subscription end.

Type

PartialUser

user

The user whose subscription ended.

Type

PartialUser

tier

The tier of the subscription that ended. Valid values are 1000, 2000, and 3000.

Type

Literal[“1000”, “2000”, “3000”]

gift

Whether the subscription was a gift.

Type

bool

class twitchio.ChannelSubscriptionGift

Represents a channel subscription gift event.

broadcaster

The broadcaster whose channel received the gift subscriptions.

Type

PartialUser

user

The user who sent the gift. None if it was an anonymous subscription gift.

Type

PartialUser | None

tier

The tier of the subscription that ended. Valid values are 1000, 2000, and 3000.

Type

Literal[“1000”, “2000”, “3000”]

total

The number of subscriptions in the subscription gift.

Type

int

anonymous

Whether the subscription gift was anonymous.

Type

bool

cumulative_total

The number of subscriptions gifted by this user in the channel. This is None for anonymous gifts or if the gifter has opted out of sharing this information

Type

int | None

Attributes
class twitchio.SubscribeEmote

Represents a subscription emote.

begin

The index of where the emote starts in the text.

Type

int

end

The index of where the emote ends in the text.

Type

int

id

The emote ID.

Type

str

class twitchio.ChannelSubscriptionMessage

Represents a subscription message event.

broadcaster

The broadcaster whose channel received a subscription message.

Type

PartialUser

user

The user who sent a resubscription chat message.

Type

PartialUser

tier

The tier of the user’s subscription. Valid values are 1000, 2000, and 3000.

Type

Literal[“1000”, “2000”, “3000”]

months

The month duration of the subscription.

Type

str

cumulative_months

The total number of months the user has been subscribed to the channel.

Type

int

streak_months

The number of consecutive months the user’s current subscription has been active. None if the user has opted out of sharing this information

Type

int | None

text

The text of the resubscription chat message.

Type

str

emotes

List of emote information for the subscription message. This includes start and end positions for where the emote appears in the text.

Type

list[SubscribeEmote]

class twitchio.ChannelCheer

Represents a channel cheer event.

broadcaster

The broadcaster whose channel received a cheer.

Type

PartialUser

user

The user who cheered on the specified channel. None if anonymous is true.

Type

PartialUser | None

anonymous

Whether the user cheered anonymously or not.

Type

bool

bits

The number of bits cheered.

Type

int

message

The message sent with the cheer.

Type

str

class twitchio.ChannelRaid

Represents a channel raid event.

from_broadcaster

The broadcaster whose channel started a raid.

Type

PartialUser

to_broadcaster

The broadcaster whose channel is being raided.

Type

PartialUser

viewer_count

The number of viewers in the raid.

Type

int

class twitchio.ChannelBan

Represents a channel ban event.

broadcaster

The broadcaster whose channel banned a user.

Type

PartialUser

user

The user who was banned on the specified channel.

Type

PartialUser

moderator

The moderator who banned the user.

Type

PartialUser

reason

The reason behind the ban.

Type

str

banned_at

The datetime of when the user was banned or put in a timeout.

Type

datetime.datetime

ends_at

The datetime of when the timeout ends. None if the user was banned instead of put in a timeout

Type

datetime.datetime | None

permanent

Indicates whether the ban is permanent (True) or a timeout (False). If True, ends_at will be None.

Type

bool

class twitchio.ChannelUnban

Represents a channel unban event.

broadcaster

The broadcaster whose channel unbanned a user.

Type

PartialUser

user

The user who was unbanned on the specified channel.

Type

PartialUser

moderator

The moderator who unbanned the user.

Type

PartialUser

class twitchio.ChannelUnbanRequest

Represents a channel unban request event.

broadcaster

The broadcaster whose channel received an unban request.

Type

PartialUser

user

The user that is requesting to be unbanned.

Type

PartialUser

id

The ID of the unban request.

Type

str

text

The message sent in the unban request.

Type

str

created_at

The datetime of when the unban request was created.

Type

datetime.datetime

class twitchio.ChannelUnbanRequestResolve

Represents a channel unban request resolve event.

broadcaster

The broadcaster whose channel resolved an unban request.

Type

PartialUser

user

The user that is requesting to be unbanned.

Type

PartialUser

moderator

The moderator who approved/denied the request. This is None is the user is unbanned (/unban) via chat.

Type

PartialUser | None

id

The ID of the unban request.

Type

str

text

The message sent in the unban request.

Type

str

status

Whether the unban request was approved or denied. Can be the following:

  • approved

  • canceled

  • denied

Type

Literal[“approved”, “canceled”, “denied”]

Attributes
class twitchio.ModerateFollowers

Represents data associated with the followers command.

follow_duration

The length of time, in minutes, that the followers must have followed the broadcaster to participate in the chat room.

Type

int

Attributes
class twitchio.ModerateBan

Represents data associated with the ban command.

user

The user being banned.

Type

PartialUser

reason

Reason given for the ban.

Type

str | None

Attributes
class twitchio.ModerateTimeout

Represents data associated with the timeout command.

user

The user being timed out.

Type

PartialUser

reason

Reason given for the timeout.

Type

str | None

expires_at

The time at which the timeout ends.

Type

datetime.datetime

Attributes
class twitchio.ModerateSlow

Represents data associated with the slow command.

wait_time

The amount of time, in seconds, that users need to wait between sending messages.

Type

int

Attributes
class twitchio.ModerateRaid

Represents data associated with the raid command.

user

The user being raided.

Type

PartialUser

viewer_count

The viewer count.

Type

int

Attributes
class twitchio.ModerateDelete

Represents data associated with the delete command.

user

The user whose message is being deleted.

Type

PartialUser

message_id

The ID of the message being deleted.

Type

str

text

The text of the message being deleted.

Type

str

class twitchio.ModerateAutomodTerms

Represents data associated with the automod terms changes.

action

Either “add” or “remove”.

Type

Literal[“add”, “remove”]

list

Either “blocked” or “permitted”.

Type

Literal[“blocked”, “permitted”]

terms

Terms being added or removed.

Type

list[str]

from_automod

Whether the terms were added due to an Automod message approve/deny action.

Type

bool

Attributes
class twitchio.ModerateUnbanRequest

Represents data associated with an unban request.

approved

Whether or not the unban request was approved or denied.

Type

bool

user

The banned user.

Type

PartialUser

text

The message included by the moderator explaining their approval or denial.

Type

str

Attributes
class twitchio.ModerateWarn

Represents data associated with the warn command.

user

The user being warned.

Type

PartialUser

reason

Reason given for the warning.

Type

str | None

chat_rules

Chat rules cited for the warning.

Type

list[str]

class twitchio.ChannelModerate

Represents a channel moderate event, both V1 and V2.

broadcaster

The broadcaster who had a moderate event occur.

Type

PartialUser

source_broadcaster

The channel in which the action originally occurred. Is the same as broadcaster if not in shared chat.

Type

PartialUser

moderator

The moderator who performed the action.

Type

PartialUser

followers

Information associated with the followers command.

Type

ModerateFollowers | None

slow

Information associated with the slow command.

Type

ModerateSlow | None

vip

Information associated with the vip command.

Type

PartialUser | None

unvip

Information associated with the unvip command.

Type

PartialUser | None

mod

Information associated with the mod command.

Type

PartialUser | None

unmod

Information associated with the unmod command.

Type

PartialUser | None

ban

Information associated with the ban command.

Type

ModerateBan | None

unban

Information associated with the unban command.

Type

PartialUser | None

timeout

Information associated with the timeout command.

Type

ModerateTimeout | None

untimeout

Information associated with the untimeout command.

Type

PartialUser | None

raid

Information associated with the raid command.

Type

ModerateRaid | None

unraid

Information associated with the unraid command.

Type

PartialUser | None

delete

Information associated with the delete command.

Type

ModerateDelete | None

automod_terms

Information associated with the automod terms changes.

Type

ModerateAutomodTerms | None

unban_request

Information associated with an unban request.

Type

ModerateUnbanRequest | None

shared_ban

Information about the shared_chat_ban event. Is None if action is not shared_chat_ban. This field has the same information as the ban field but for a action that happened for a channel in a shared chat session other than the broadcaster in the subscription condition.

Type

ModerateBan | None

shared_unban

Information about the shared_chat_unban event. Is None if action is not shared_chat_unban. This field has the same information as the unban field but for a action that happened for a channel in a shared chat session other than the broadcaster in the subscription condition.

Type

PartialUser | None

shared_timeout

Information about the shared_chat_timeout event. Is None if action is not shared_chat_timeout. This field has the same information as the timeout field but for a action that happened for a channel in a shared chat session other than the broadcaster in the subscription condition.

Type

ModerateTimeout | None

shared_untimeout

Information about the shared_chat_untimeout event. Is None if action is not shared_chat_untimeout. This field has the same information as the untimeout field but for a action that happened for a channel in a shared chat session other than the broadcaster in the subscription condition.

Type

PartialUser | None

shared_delete

Information about the shared_chat_delete event. Is None if action is not shared_chat_delete. This field has the same information as the delete field but for a action that happened for a channel in a shared chat session other than the broadcaster in the subscription condition.

Type

ModerateDelete | None

action

The type of action. warn is only available with V2.

  • ban

  • timeout

  • unban

  • untimeout

  • clear

  • emoteonly

  • emoteonlyoff

  • followers

  • followersoff

  • uniquechat

  • uniquechatoff

  • slow

  • slowoff

  • subscribers

  • subscribersoff

  • unraid

  • delete

  • unvip

  • vip

  • raid

  • add_blocked_term

  • add_permitted_term

  • remove_blocked_term

  • remove_permitted_term

  • mod

  • unmod

  • approve_unban_request

  • deny_unban_request

  • warn

  • shared_chat_ban

  • shared_chat_unban

  • shared_chat_timeout

  • shared_chat_untimeout

  • shared_chat_delete

Type

Literal[“ban”,”timeout”, “unban”, “untimeout”, “clear”, “emoteonly”, “emoteonlyoff”, “followers”, “followersoff”, “uniquechat”, “uniquechatoff”, “slow”, “slowoff”, “subscribers”, “subscribersoff”, “unraid”, “delete”, “unvip”, “vip”, “raid”, “add_blocked_term”, “add_permitted_term”, “remove_blocked_term”, “remove_permitted_term”, “mod”, “unmod”, “approve_unban_request”, “deny_unban_request”, “warn”, “shared_chat_ban”, “shared_chat_unban”, “shared_chat_timeout”, “shared_chat_untimeout”, “shared_chat_delete”]

Attributes
class twitchio.ChannelModeratorAdd

Represents a moderator add event.

broadcaster

The broadcaster who had a new moderator added.

Type

PartialUser

user

The new moderator.

Type

PartialUser

Attributes
class twitchio.ChannelModeratorRemove

Represents a moderator remove event.

broadcaster

The broadcaster who had a moderator removed.

Type

PartialUser

user

The removed moderator.

Type

PartialUser

Attributes
class twitchio.ChannelPointsEmote

Represents a channel points emote.

begin

The index of where the emote starts in the text.

Type

int

end

The index of where the emote ends in the text.

Type

int

id

The emote ID.

Type

str

class twitchio.ChannelPointsAutoRedeemAdd

Represents an automatic redemption of a channel points reward.

Note

This is a combination of V1 and V2.

broadcaster

The broadcaster / channel who had the reward redeemed.

Type

PartialUser

user

The user who redeemed the reward.

Type

PartialUser

id

The ID of the redemption.

Type

str

text

The text of the chat message.

Type

str

redeemed_at

The datetime object of when the reward was redeemed.

Type

datetime.datetime

reward

The details of the reward auto redeemed.

V2 does not cover Power-ups e.g. gigantify_an_emote, celebration, and message_effect. Please see ChannelBitsUseSubscription for those specific types if using V2.

Type

AutoRedeemReward

emotes

A list of ChannelPointsEmote objects that appear in the text.

  • If using V1, this is populated by Twitch.

  • If using V2, the emotes can be found in the fragments, but we calculate the index ourselves for this property.

Type

list[ChannelPointsEmote]

user_input

The text input by the user if the reward requires input. This is None when using V2. text is the preferred attribute to use.

Type

str | None

fragments

The ordered list of chat message fragments. This is only populated when using V2.

Type

list[ChatMessageFragment]

Attributes
class twitchio.CooldownSettings

NamedTuple that represents a custom reward’s cooldown settings.

enabled

Whether the stream setting is enabled or not.

Type

bool

seconds

The cooldown in seconds.

Type

int

class twitchio.ChannelPointsReward

Represents an Eventsub Custom Reward.

broadcaster

The broadcaster / channel associated with the custom reward.

Type

Partialuser

id

The reward identifier.

Type

str

title

The reward title.

Type

str

cost

The reward cost.

Type

int

prompt

The reward description.

Type

str

enabled

Whether the reward currently enabled. If False, the reward won’t show up to viewers.

Type

bool | None

paused

Whether the reward currently paused. If True, viewers can’t redeem.

Type

bool | None

in_stock

Whether the reward currently in stock. If False, viewers can’t redeem.

Type

bool | None

input_requred

Whether the viewer needs to enter information when redeeming the reward.

Type

bool | None

skip_queue

Should redemptions be set to fulfilled status immediately when redeemed and skip the request queue instead of the normal unfulfilled status.

Type

bool | None

colour

Custom background colour for the reward.

Type

Colour

cooldown_until

The cooldown expiration datetime. Is None if the reward is not on cooldown.

Type

datetime.datetime | None

max_per_stream

Whether a maximum per stream is enabled and what the maximum is.

Type

RewardLimitSettings | None

max_per_user_per_stream

Whether a maximum per user per stream is enabled and what the maximum is.

Type

RewardLimitSettings | None

global_cooldown

Whether a cooldown is enabled and what the cooldown is in seconds.

Type

CooldownSettings | None

default_image

Dictionary of default images of varying sizes for the reward.

Type

dict[str, str] | None

current_stream_redeems

The number of redemptions redeemed during the current live stream. Counts against the max_per_stream limit. Is None if the broadcasters stream isn’t live or max_per_stream isn’t enabled.

Type

int | None

property color: twitchio.utils.Colour | None

Alias for Colour.

property image: dict[str, str] | None

Dictionary of custom images for the reward. Is None if no images have been uploaded.

get_image(size: Literal['1x', '2x', '4x'] = '2x', use_default: bool = False) twitchio.assets.Asset | None

Get an image Asset for the reward at a specified size. Falls back to default images if no custom images have been uploaded or if specified.

Parameters
  • size (str) – The size key of the image. Options are “1x”, “2x”, “4x”. Defaults to “2x”.

  • use_default (bool) – Use default images instead of user uploaded images.

Returns

The Asset for the image. Falls back to default images if no custom images have been uploaded.

Return type

Asset | None

class twitchio.ChannelPointsRewardAdd

Represents an Eventsub Custom Reward that has been created for a channel.

broadcaster

The broadcaster / channel associated with the custom reward.

Type

Partialuser

id

The reward identifier.

Type

str

title

The reward title.

Type

str

cost

The reward cost.

Type

int

prompt

The reward description.

Type

str

enabled

Whether the reward currently enabled. If False, the reward won’t show up to viewers.

Type

bool

paused

Whether the reward currently paused. If True, viewers can’t redeem.

Type

bool

in_stock

Whether the reward currently in stock. If False, viewers can’t redeem.

Type

bool

input_requred

Whether the viewer needs to enter information when redeeming the reward.

Type

bool

skip_queue

Should redemptions be set to fulfilled status immediately when redeemed and skip the request queue instead of the normal unfulfilled status.

Type

bool

colour

Custom background colour for the reward.

Type

Colour

cooldown_until

The cooldown expiration datetime. Is None if the reward is not on cooldown.

Type

datetime.datetime | None

max_per_stream

Whether a maximum per stream is enabled and what the maximum is.

Type

RewardLimitSettings

max_per_user_per_stream

Whether a maximum per user per stream is enabled and what the maximum is.

Type

RewardLimitSettings

global_cooldown

Whether a cooldown is enabled and what the cooldown is in seconds.

Type

CooldownSettings

default_image

Dictionary of default images of varying sizes for the reward.

Type

dict[str, str]

current_stream_redeems

The number of redemptions redeemed during the current live stream. Counts against the max_per_stream limit. Is None if the broadcasters stream isn’t live or max_per_stream isn’t enabled.

Type

int

class twitchio.ChannelPointsRewardUpdate

Represents an Eventsub Custom Reward that has been updated for a channel.

broadcaster

The broadcaster / channel associated with the custom reward.

Type

Partialuser

id

The reward identifier.

Type

str

title

The reward title.

Type

str

cost

The reward cost.

Type

int

prompt

The reward description.

Type

str

enabled

Whether the reward currently enabled. If False, the reward won’t show up to viewers.

Type

bool

paused

Whether the reward currently paused. If True, viewers can’t redeem.

Type

bool

in_stock

Whether the reward currently in stock. If False, viewers can’t redeem.

Type

bool

input_requred

Whether the viewer needs to enter information when redeeming the reward.

Type

bool

skip_queue

Should redemptions be set to fulfilled status immediately when redeemed and skip the request queue instead of the normal unfulfilled status.

Type

bool

colour

Custom background colour for the reward.

Type

Colour

cooldown_until

The cooldown expiration datetime. Is None if the reward is not on cooldown.

Type

datetime.datetime | None

max_per_stream

Whether a maximum per stream is enabled and what the maximum is.

Type

RewardLimitSettings

max_per_user_per_stream

Whether a maximum per user per stream is enabled and what the maximum is.

Type

RewardLimitSettings

global_cooldown

Whether a cooldown is enabled and what the cooldown is in seconds.

Type

CooldownSettings

default_image

Dictionary of default images of varying sizes for the reward.

Type

dict[str, str]

current_stream_redeems

The number of redemptions redeemed during the current live stream. Counts against the max_per_stream limit. Is None if the broadcasters stream isn’t live or max_per_stream isn’t enabled.

Type

int

class twitchio.ChannelPointsRewardRemove

Represents an Eventsub Custom Reward that has been removed from a channel.

broadcaster

The broadcaster / channel associated with the custom reward.

Type

Partialuser

id

The reward identifier.

Type

str

title

The reward title.

Type

str

cost

The reward cost.

Type

int

prompt

The reward description.

Type

str

enabled

Whether the reward currently enabled. If False, the reward won’t show up to viewers.

Type

bool

paused

Whether the reward currently paused. If True, viewers can’t redeem.

Type

bool

in_stock

Whether the reward currently in stock. If False, viewers can’t redeem.

Type

bool

input_requred

Whether the viewer needs to enter information when redeeming the reward.

Type

bool

skip_queue

Should redemptions be set to fulfilled status immediately when redeemed and skip the request queue instead of the normal unfulfilled status.

Type

bool

colour

Custom background colour for the reward.

Type

Colour

cooldown_until

The cooldown expiration datetime. Is None if the reward is not on cooldown.

Type

datetime.datetime | None

max_per_stream

Whether a maximum per stream is enabled and what the maximum is.

Type

RewardLimitSettings

max_per_user_per_stream

Whether a maximum per user per stream is enabled and what the maximum is.

Type

RewardLimitSettings

global_cooldown

Whether a cooldown is enabled and what the cooldown is in seconds.

Type

CooldownSettings

default_image

Dictionary of default images of varying sizes for the reward.

Type

dict[str, str]

current_stream_redeems

The number of redemptions redeemed during the current live stream. Counts against the max_per_stream limit. Is None if the broadcasters stream isn’t live or max_per_stream isn’t enabled.

Type

int

class twitchio.ChannelPointsRedemptionAdd

Represents a channel points redemption add event.

broadcaster

The broadcaster whose channel where the reward was redeemed.

Type

PartialUser

user

The user that redeemed the reward.

Type

PartialUser

user_input

The user input provided. Empty string if not provided.

Type

str

id

The ID of the redemption.

Type

str

status

The status of the redemption. Defaults to unfulfilled.

  • unknown

  • unfulfilled

  • fulfilled

  • canceled

Type

Literal[“unknown”, “unfulfilled”, “fulfilled”, “canceled”]

redeemed_at

Datetime when the reward was redeemed.

Type

datetime.datetime

reward

Information about the reward that was redeemed, at the time it was redeemed.

Type

ChannelPointsReward

async fulfill(*, token_for: str | PartialUser) CustomRewardRedemption

This function is a coroutine.

Updates the redemption’s status to FULFILLED.

Note

Requires a user access token that includes the channel:manage:redemptions scope.

Parameters

token_for (str | PartialUser) – The user’s token that has permission manage the broadcaster’s reward redemptions.

Return type

CustomRewardRedemption

async refund(*, token_for: str | PartialUser) CustomRewardRedemption

This function is a coroutine.

Updates the redemption’s status to CANCELED.

Note

Requires a user access token that includes the channel:manage:redemptions scope.

Parameters

token_for (str | PartialUser) – The user’s token that has permission manage the broadcaster’s reward redemptions.

Return type

CustomRewardRedemption

class twitchio.ChannelPointsRedemptionUpdate

Represents a channel points redemption update event.

broadcaster

The broadcaster whose channel where the reward was redeemed.

Type

PartialUser

user

The user that redeemed the reward.

Type

PartialUser

user_input

The user input provided. Empty string if not provided.

Type

str

id

The ID of the redemption.

Type

str

status

The status of the redemption. Will be fulfilled or canceled.

  • unknown

  • unfulfilled

  • fulfilled

  • canceled

Type

Literal[“unknown”, “unfulfilled”, “fulfilled”, “canceled”]

redeemed_at

Datetime when the reward was redeemed.

Type

datetime.datetime

reward

Information about the reward that was redeemed, at the time it was redeemed.

Type

ChannelPointsReward

Attributes
class twitchio.PollVoting

NamedTuple that represents a channel poll’s voting settings.

enabled

Indicates if Channel Points can be used for voting.

Type

bool

amount

Number of Channel Points required to vote once with Channel Points.

Type

int

class twitchio.ChannelPollBegin

Represents a channel poll begin event.

broadcaster

The broadcaster whose channel started a poll.

Type

PartialUser

id

ID of the poll.

Type

str

title

Question displayed for the poll.

Type

str

choices

A list of choices for the poll.

Type

list[PollChoice]

channel_points_voting

The channel points voting settings.

Type

PollVoting

started_at

The time the poll started.

Type

datetime.datetime

ends_at

The time the poll will end.

Type

datetime.datetime

class twitchio.ChannelPollProgress

Represents a channel poll progress event.

broadcaster

The broadcaster whose channel had received a poll update.

Type

PartialUser

id

ID of the poll.

Type

str

title

Question displayed for the poll.

Type

str

choices

A list of choices for the poll.

Type

list[PollChoice]

channel_points_voting

The channel points voting settings.

Type

PollVoting

started_at

The time the poll started.

Type

datetime.datetime

ends_at

The time the poll will end.

Type

datetime.datetime

class twitchio.ChannelPollEnd

Represents a channel poll begin event.

broadcaster

The broadcaster whose channel had received a poll update.

Type

PartialUser

id

ID of the poll.

Type

str

title

Question displayed for the poll.

Type

str

choices

A list of choices for the poll.

Type

list[PollChoice]

channel_points_voting

The channel points voting settings.

Type

PollVoting

status

The status of the poll. Valid values are:

  • completed

  • archived

  • terminated

Type

Literal[“completed”, “terminated”, “archived”]

started_at

The time the poll started.

Type

datetime.datetime

ended_at

The time the poll ended.

Type

datetime.datetime

class twitchio.ChannelPredictionBegin

Represents a channel points prediction begin event.

id

ID of the prediction.

Type

str

broadcaster

The broadcaster whose channel started a prediction.

Type

PartialUser

title

Title for the channel points Prediction.

Type

str

outcomes

A list of outcomes for the predictions. Only id, title and colour will be populated.

Type

list[PredictionOutcome]

started_at

The time the prediction started.

Type

datetime.datetime

locks_at

The time the prediction will automatically lock.

Type

datetime.datetime

class twitchio.ChannelPredictionProgress

Represents a channel points prediction progress event.

id

ID of the prediction.

Type

str

broadcaster

The broadcaster whose channel started a prediction.

Type

PartialUser

title

Title for the channel points Prediction.

Type

str

outcomes

A list of outcomes for the predictions.

Type

list[PredictionOutcome]

started_at

The time the prediction started.

Type

datetime.datetime

locks_at

The time the prediction will automatically lock.

Type

datetime.datetime

class twitchio.ChannelPredictionLock

Represents a channel points prediction progress event.

id

ID of the prediction.

Type

str

broadcaster

The broadcaster whose channel started a prediction.

Type

PartialUser

title

Title for the channel points Prediction.

Type

str

outcomes

A list of outcomes for the predictions.

Type

list[PredictionOutcome]

started_at

The time the prediction started.

Type

datetime.datetime

locked_at

The time the prediction was locked.

Type

datetime.datetime

class twitchio.ChannelPredictionEnd

Represents a channel points prediction progress event.

id

ID of the prediction.

Type

str

broadcaster

The broadcaster whose channel started a prediction.

Type

PartialUser

title

Title for the channel points Prediction.

Type

str

outcomes

A list of outcomes for the predictions.

Type

list[PredictionOutcome]

winning_outcome

The winning outcome. This can be None if the prediction is deleted.

Type

PredictionOutcome | None

started_at

The time the prediction started.

Type

datetime.datetime

ended_at

The time the prediction ended.

Type

datetime.datetime

status

The status of the Channel Points Prediction. Valid values are resolved and canceled.

Type

Literal[“resolved”, “canceled”]

class twitchio.SuspiciousUserUpdate

Represents a suspicious user update event.

broadcaster

The broadcaster whose channel had the treatment for a suspicious user was updated.

Type

PartialUser

user

The suspicious user whose treatment was updated.

Type

PartialUser

moderator

The moderator that updated the treatment for a suspicious user.

Type

PartialUser

low_trust_status

The status set for the suspicious user. Can be the following:

  • none

  • active_monitoring

  • restricted

Type

Literal[“none”, “active_monitoring”, “restricted”]

class twitchio.SuspiciousUserMessage

Represents a suspicious user message event.

broadcaster

The broadcaster whose channel had the treatment for a suspicious user was updated.

Type

PartialUser

user

The user that sent the message.

Type

PartialUser

low_trust_status

The status set for the suspicious user. Can be the following:

  • none

  • active_monitoring

  • restricted

Type

Literal[“none”, “active_monitoring”, “restricted”]

banned_channels

A list of channel IDs where the suspicious user is also banned.

Type

list[str]

types

User types (if any) that apply to the suspicious user. Can be the following:

  • manually_added

  • ban_evader

  • banned_in_shared_channel

Type

list[Literal[“manually_added”, “ban_evader”, “banned_in_shared_channel”]]

evaluation

A ban evasion likelihood value (if any) that as been applied to the user automatically by Twitch. Can be:

  • unknown

  • possible

  • likely

Type

Literal[“unknown”, “possible”, “likely”]

message

The chat message.

Type

BaseChatMessage

Attributes
class twitchio.ChannelVIPAdd

Represents a channel VIP remove event.

broadcaster

The broadcaster whose channel had a VIP added.

Type

PartialUser

user

The user who was added as a VIP.

Type

PartialUser

Attributes
class twitchio.ChannelVIPRemove

Represents a channel VIP remove event.

broadcaster

The broadcaster whose channel had a VIP removed.

Type

PartialUser

user

The user who was removed as a VIP.

Type

PartialUser

Attributes
class twitchio.ChannelWarningAcknowledge

Represents a channel warning acknowledge event.

broadcaster

The broadcaster whose channel sent a warning.

Type

PartialUser

user

The user that has acknowledged their warning.

Type

PartialUser

class twitchio.ChannelWarningSend

Represents a channel warning send event.

broadcaster

The broadcaster whose channel sent a warning.

Type

PartialUser

user

The user being warned.

Type

PartialUser

moderator

The moderator who sent the warning.

Type

PartialUser

reason

The reason given for the warning.

Type

str | None

chat_rules

The chat rules cited for the warning.

Type

list[str] | None

class twitchio.CharityCampaignDonation

Represents a charity campaign donation event.

id

An ID that identifies the donation. The ID is unique across campaigns.

Type

str

broadcaster

The broadcaster that’s running the campaign.

Type

PartialUser

user

The user that donated to the campaign.

Type

PartialUser

charity

The charity associated with the campaign.

Type

BaseCharityCampaign

amount

The amount of money donated.

Type

CharityValues

class twitchio.CharityCampaignStart

Represents a charity campaign start event.

broadcaster

The broadcaster that’s running the campaign.

Type

PartialUser

id

ID that identifies the charity campaign.

Type

str

name

The name of the charity.

Type

str

description

A description of the charity.

Type

str

The charity logo as an asset.

Type

Asset

website

A URL to the charity’s website.

Type

str

current

The current amount of donations that the campaign has received.

Type

CharityValues

target

The target amount of donations that the campaign has received.

Type

CharityValues

started_at

Datetime of when the broadcaster started the campaign.

Type

datetime.datetime

class twitchio.CharityCampaignProgress

Represents a charity campaign progress event.

broadcaster

The broadcaster that’s running the campaign.

Type

PartialUser

id

ID that identifies the charity campaign.

Type

str

name

The name of the charity.

Type

str

description

A description of the charity.

Type

str

The charity logo as an asset.

Type

Asset

website

A URL to the charity’s website.

Type

str

current

The current amount of donations that the campaign has received.

Type

CharityValues

target

The target amount of donations that the campaign has received.

Type

CharityValues

class twitchio.CharityCampaignStop

Represents a charity campaign stop event.

broadcaster

The broadcaster that’s running the campaign.

Type

PartialUser

id

ID that identifies the charity campaign.

Type

str

name

The name of the charity.

Type

str

description

A description of the charity.

Type

str

The charity logo as an asset.

Type

Asset

website

A URL to the charity’s website.

Type

str

current

The current amount of donations that the campaign has received.

Type

CharityValues

target

The target amount of donations that the campaign has received.

Type

CharityValues

stopped_at

Datetime of when the broadcaster stopped the campaign.

Type

datetime.datetime

class twitchio.GoalBegin

Represents a goal begin event.

broadcaster

The broadcaster who started a goal.

Type

PartialUser

id

An ID that identifies this event.

Type

str

type

The type of goal.

type

Description

follow

The goal is to increase followers.

subscription

The goal is to increase subscriptions. This type shows the net increase or decrease in tier points associated with the subscriptions.

subscription_count

The goal is to increase subscriptions. This type shows the net increase or decrease in the number of subscriptions.

new_subscription

The goal is to increase subscriptions. This type shows only the net increase in tier points associated with the subscriptions (it does not account for users that unsubscribed since the goal started).

new_subscription_count

The goal is to increase subscriptions. This type shows only the net increase in the number of subscriptions (it does not account for users that unsubscribed since the goal started).

new_bit

The goal is to increase the amount of Bits used on the channel.

new_cheerer

The goal is to increase the number of unique Cheerers to Cheer on the channel.

Type

Literal[“follow”, “subscription”, “subscription_count”, “new_subscription”, “new_subscription_count”, “new_bit”, “new_cheerer”]

description

A description of the goal, if specified. The description may contain a maximum of 40 characters.

Type

str

current_amount

The goal’s current value. The goal’s type determines how this value is increased or decreased.

type

Description

follow

This number increases with new followers and decreases when users unfollow the broadcaster.

subscription

This number is increased and decreased by the points value associated with the subscription tier. For example, if a tier-two subscription is worth 2 points, this field is increased or decreased by 2, not 1.

subscription_count

This field is increased by 1 for each new subscription and decreased by 1 for each user that unsubscribes.

new_subscription

This field is increased by the points value associated with the subscription tier. For example, if a tier-two subscription is worth 2 points, this field is increased by 2, not 1.

new_subscription_count

This field is increased by 1 for each new subscription.

Type

int

target_amount

The goal’s target value. For example, if the broadcaster has 200 followers before creating the goal, and their goal is to double that number, this field is set to 400.

Type

int

started_at

The datetime when the broadcaster started the goal.

Type

datetime.datetime

class twitchio.GoalProgress

Represents a goal progress event.

broadcaster

The broadcaster whose goal progressed.

Type

PartialUser

id

An ID that identifies this event.

Type

str

type

The type of goal.

type

Description

follow

The goal is to increase followers.

subscription

The goal is to increase subscriptions. This type shows the net increase or decrease in tier points associated with the subscriptions.

subscription_count

The goal is to increase subscriptions. This type shows the net increase or decrease in the number of subscriptions.

new_subscription

The goal is to increase subscriptions. This type shows only the net increase in tier points associated with the subscriptions (it does not account for users that unsubscribed since the goal started).

new_subscription_count

The goal is to increase subscriptions. This type shows only the net increase in the number of subscriptions (it does not account for users that unsubscribed since the goal started).

new_bit

The goal is to increase the amount of Bits used on the channel.

new_cheerer

The goal is to increase the number of unique Cheerers to Cheer on the channel.

Type

Literal[“follow”, “subscription”, “subscription_count”, “new_subscription”, “new_subscription_count”, “new_bit”, “new_cheerer”]

description

A description of the goal, if specified. The description may contain a maximum of 40 characters.

Type

str

current_amount

The goal’s current value. The goal’s type determines how this value is increased or decreased.

type

Description

follow

This number increases with new followers and decreases when users unfollow the broadcaster.

subscription

This number is increased and decreased by the points value associated with the subscription tier. For example, if a tier-two subscription is worth 2 points, this field is increased or decreased by 2, not 1.

subscription_count

This field is increased by 1 for each new subscription and decreased by 1 for each user that unsubscribes.

new_subscription

This field is increased by the points value associated with the subscription tier. For example, if a tier-two subscription is worth 2 points, this field is increased by 2, not 1.

new_subscription_count

This field is increased by 1 for each new subscription.

Type

int

target_amount

The goal’s target value. For example, if the broadcaster has 200 followers before creating the goal, and their goal is to double that number, this field is set to 400.

Type

int

started_at

The datetime when the broadcaster started the goal.

Type

datetime.datetime

class twitchio.GoalEnd

Represents a goal end event.

broadcaster

The broadcaster whose goal ended.

Type

PartialUser

id

An ID that identifies this event.

Type

str

type

The type of goal.

type

Description

follow

The goal is to increase followers.

subscription

The goal is to increase subscriptions. This type shows the net increase or decrease in tier points associated with the subscriptions.

subscription_count

The goal is to increase subscriptions. This type shows the net increase or decrease in the number of subscriptions.

new_subscription

The goal is to increase subscriptions. This type shows only the net increase in tier points associated with the subscriptions (it does not account for users that unsubscribed since the goal started).

new_subscription_count

The goal is to increase subscriptions. This type shows only the net increase in the number of subscriptions (it does not account for users that unsubscribed since the goal started).

new_bit

The goal is to increase the amount of Bits used on the channel.

new_cheerer

The goal is to increase the number of unique Cheerers to Cheer on the channel.

Type

Literal[“follow”, “subscription”, “subscription_count”, “new_subscription”, “new_subscription_count”, “new_bit”, “new_cheerer”]

description

A description of the goal, if specified. The description may contain a maximum of 40 characters.

Type

str

current_amount

The goal’s current value. The goal’s type determines how this value is increased or decreased.

type

Description

follow

This number increases with new followers and decreases when users unfollow the broadcaster.

subscription

This number is increased and decreased by the points value associated with the subscription tier. For example, if a tier-two subscription is worth 2 points, this field is increased or decreased by 2, not 1.

subscription_count

This field is increased by 1 for each new subscription and decreased by 1 for each user that unsubscribes.

new_subscription

This field is increased by the points value associated with the subscription tier. For example, if a tier-two subscription is worth 2 points, this field is increased by 2, not 1.

new_subscription_count

This field is increased by 1 for each new subscription.

Type

int

target_amount

The goal’s target value. For example, if the broadcaster has 200 followers before creating the goal, and their goal is to double that number, this field is set to 400.

Type

int

started_at

The datetime when the broadcaster started the goal.

Type

datetime.datetime

ended_at

The datetime when the broadcaster ended the goal.

Type

datetime.datetime

achieved

Whether the broadcaster achieved their goal. Is True if the goal was achieved; otherwise, False.

Type

bool

class twitchio.HypeTrainBegin

Represents a hype train begin event.

broadcaster

The broadcaster who has a hype train begin.

Type

PartialUser

id

The hype train ID.

Type

str

level

The starting level of the hype train.

Type

int

total

Total points contributed to the hype train.

Type

int

progress

The number of points contributed to the hype train at the current level.

Type

int

goal

The number of points required to reach the next level.

Type

int

top_contributions

The contributors with the most points contributed.

Type

list[HypeTrainContribution]

last_contribution

The most recent contribution.

Type

HypeTrainContribution

started_at

The datetime of when the hype train started.

Type

datetime.datetime

expires_at

The datetime when the hype train expires. The expiration is extended when the hype train reaches a new level.

Type

datetime.datetime

golden_kappa

Indicates if the hype train is a Golden Kappa Train.

Type

bool

class twitchio.HypeTrainProgress

Represents a hype train progress event.

broadcaster

The broadcaster whose hype train progressed.

Type

PartialUser

id

The hype train ID.

Type

str

level

The current level of the hype train.

Type

int

total

Total points contributed to the hype train.

Type

int

progress

The number of points contributed to the hype train at the current level.

Type

int

goal

The number of points required to reach the next level.

Type

int

top_contributions

The contributors with the most points contributed.

Type

list[HypeTrainContribution]

last_contribution

The most recent contribution.

Type

HypeTrainContribution

started_at

The datetime of when the hype train started.

Type

datetime.datetime

expires_at

The datetime when the hype train expires. The expiration is extended when the hype train reaches a new level.

Type

datetime.datetime

golden_kappa

Indicates if the hype train is a Golden Kappa Train.

Type

bool

class twitchio.HypeTrainEnd

Represents a hype train end event.

broadcaster

The broadcaster whose hype train has ended.

Type

PartialUser

id

The hype train ID.

Type

str

level

The final level of the hype train.

Type

int

total

Total points contributed to the hype train.

Type

int

top_contributions

The contributors with the most points contributed.

Type

list[HypeTrainContribution]

started_at

The datetime of when the hype train started.

Type

datetime.datetime

ended_at

The datetime of when the hype train ended.

Type

datetime.datetime

cooldown_until

The datetime when the hype train cooldown ends so that the next hype train can start.

Type

datetime.datetime

golden_kappa

Indicates if the hype train is a Golden Kappa Train.

Type

bool

class twitchio.PowerUp

Represents a PowerUp on a channel bits use event.

emote

Emote associated with the reward. Is None if no emote was used.

Type

PowerUpEmote | None

type

The type of Power-up redeemed.

  • message_effect

  • celebration

  • gigantify_an_emote

Type

Literal[“message_effect”, “celebration”, “gigantify_an_emote”]

message_effect_id

The ID of the message effect. Is None if no message effect was used.

Type

str | None

Attributes
class twitchio.PowerUpEmote

Represents a PowerUp Emote on a channel bits use event.

id

The ID that uniquely identifies this emote.

Type

str

name

The human readable emote token.

Type

str

class twitchio.ShieldModeBegin

Represents a shield mode begin event.

broadcaster

The broadcaster whose shield mode status was updated.

Type

PartialUser

moderator

The moderator that updated the shield mode status. This will be the same as the broadcaster if the broadcaster updated the status.

Type

PartialUser

started_at

The UTC datetime of when the moderator activated shield mode.

Type

datetime.datetime

class twitchio.ShieldModeEnd

Represents a shield mode end event.

broadcaster

The broadcaster whose shield mode status was updated.

Type

PartialUser

moderator

The moderator that updated the shield mode status. This will be the same as the broadcaster if the broadcaster updated the status.

Type

PartialUser

ended_at

The UTC datetime of when the moderator deactivated shield mode.

Type

datetime.datetime

class twitchio.ShoutoutCreate

Represents a shoutout create event.

broadcaster

The broadcaster that sent the shoutout.

Type

PartialUser

moderator

The moderator that sent the shoutout. This may be the same as the broadcaster.

Type

PartialUser

to_broadcaster

The broadcaster that received the shoutout.

Type

PartialUser

viewer_count

The number of users that were watching the broadcaster’s stream at the time of the shoutout.

Type

int

started_at

The UTC datetime of when the moderator sent the shoutout.

Type

datetime.datetime

cooldown_until

The UTC datetime of when the broadcaster may send a shoutout to a different broadcaster.

Type

datetime.datetime

target_cooldown_until

The UTC datetime of when the broadcaster may send another shoutout to the to_broadcaster again.

Type

datetime.datetime

class twitchio.ShoutoutReceive

Represents a shoutout received event.

broadcaster

The broadcaster that received the shoutout.

Type

PartialUser

from_broadcaster

The broadcaster that sent the shoutout.

Type

PartialUser

viewer_count

The number of users that were watching the from_broadcaster’s stream at the time of the shoutout.

Type

int

started_at

The UTC datetime of when the moderator sent the shoutout.

Type

datetime.datetime

class twitchio.StreamOnline

Represents a stream online event.

broadcaster

The user whose stream is now online.

Type

PartialUser

id

The ID of the stream.

Type

str

type

The stream type. Valid values are:

  • live

  • playlist

  • watch_party

  • premiere

  • rerun

Type

Literal[“live”, “playlist”, “watch_party”, “premiere”, “rerun”]

started_at

The datetime of when the stream started.

Type

datetime.datetime

Attributes
class twitchio.StreamOffline

Represents a stream offline event.

broadcaster

The user whose stream is now offline.

Type

PartialUser

class twitchio.SubscriptionRevoked

Represents a revoked eventsub subscription by Twitch.

id

The ID of the subscription that has been revoked.

Type

str

raw

The raw payload of the revoked subscription as a TypedDict.

Type

RevocationSubscription

status

The status provides the reason as to why the subscription was revoked by Twitch.

Type

RevocationReason

type

The type of subscription that was revoked e.g. channel.follow.

Type

str

version

The version of the subscription e.g. 1 or 2.

Type

str

cost

The cost of the subscription.

Type

int

transport_method

The transport method of the subscription.

Type

TransportMethod

transport_data

The data pertaining to the transport of the subscription. This will contain session_id or callback url depending on the transport method.

Type

RevocationTransport

created_at

The datetime that the subscription was created.

Type

datetime.datetime

Attributes
class twitchio.UserAuthorizationGrant

Represents a user authorisation grant event.

Note

This subscription type is only supported by webhooks, and cannot be used with WebSockets.

client_id

The client_id of the application that was granted user access.

Type

str

user

The user who has granted authorization for your client id.

Type

PartialUser

Attributes
class twitchio.UserAuthorizationRevoke

Represents a user authorisation reoke event.

Note

This subscription type is only supported by webhooks, and cannot be used with WebSockets.

The user.id will always be populated but user.name can be None if the user no longer exists.

client_id

The client_id of the application with revoked user access.

Type

str

user

The user who has revoked authorization for your client id.

Type

PartialUser

Attributes
class twitchio.UnlockedEmote

Represents an Unlocked Emote on an automatic redeem.

id

The ID that uniquely identifies this emote.

Type

str

name

The human readable emote token.

Type

str

class twitchio.UserUpdate

Represents a user update event.

Note

The email attribute requires the user:read:email scope otherwise it is None.

user

The user who has updated their account.

Type

PartialUser

verified

Whether Twitch has verified the user’s email address.

Type

bool

description

The user’s description.

Type

str

email

The user’s email address. Requires the user:read:email scope for the user.

Type

str | None

Attributes
class twitchio.Whisper

Represents a whisper event.

sender

The user sending the whisper.

Type

PartialUser

recipient

The user receiving the whisper.

Type

PartialUser

id

The whisper ID.

Type

str

text

The message text.

Type

str