Dataclass Reference#
ActiveExtension#
AdSchedule#
- class twitchio.AdSchedule(data: dict)#
Represents a channel’s ad schedule.
- next_ad_at#
When the next ad will roll. Will be
None
if the streamer does not schedule ads, or is not live.- Type
Optional[
datetime.datetime
]
- last_ad_at#
When the last ad rolled. Will be
None
if the streamer has not rolled an ad. Will always beNone
when this comes from snoozing an ad.- Type
Optional[
datetime.datetime
]
- preroll_freeze_time#
The amount of pre-roll free time remaining for the channel in seconds. Will be 0 if the streamer is not pre-roll free. Will be
None
when this comes from snoozing an ad.- Type
Optional[
int
]
- snooze_refresh_at#
When the streamer will gain another snooze.
- Type
AutomodCheckMessage#
AutomodCheckResponse#
Ban#
- class twitchio.Ban(http: TwitchHTTP, data: dict)#
Represents a ban for a broadcaster / channel
- broadcaster#
The broadcaster whose chat room the user was banned from chatting in.
- Type
- moderator#
The moderator that banned the user.
- Type
- user#
The user that was banned.
- Type
- created_at#
Date and time of when the ban was created.
- Type
BanEvent#
- class twitchio.BanEvent(http: TwitchHTTP, data: dict, broadcaster: Optional[Union[PartialUser, User]])#
This has been deprecated.
Represents a user being banned from a channel.
- timestamp#
The time the action occurred at.
- Type
- broadcaster#
The user whose channel the ban/unban occurred on.
- Type
- user#
The user who was banned/unbanned.
- Type
PartialUser
- moderator#
The user who performed the action.
- Type
- expires_at#
When the ban expires.
- Type
Optional[
datetime.datetime
]
BitLeaderboardUser#
BitsLeaderboard#
- class twitchio.BitsLeaderboard(http: TwitchHTTP, data: dict)#
Represents a Bits leaderboard from the twitch API.
- started_at#
The time the leaderboard started.
- Type
Optional[
datetime.datetime
]
- ended_at#
The time the leaderboard ended.
- Type
Optional[
datetime.datetime
]
- leaders#
The current leaders of the Leaderboard.
- Type
List[
BitLeaderboardUser
]
Channel#
- asyncfetch_bits_leaderboard
- defget_chatter
- asyncsend
- asyncuser
- asyncwhisper
- class twitchio.Channel(name: str, websocket: WSConnection)#
- coroutine fetch_bits_leaderboard(token: str, period: str = 'all', user_id: Optional[int] = None, started_at: Optional[datetime] = None) BitsLeaderboard #
This function is a coroutine.
Fetches the bits leaderboard for the channel. This requires an OAuth token with the bits:read scope.
- Parameters
token (
str
) – the OAuth token with the bits:read scopeperiod (Optional[
str
]) – one of day, week, month, year, or all, defaults to allstarted_at (Optional[
datetime.datetime
]) – the timestamp to start the period at. This is ignored if the period is alluser_id (Optional[
int
]) – the id of the user to fetch for
- get_chatter(name: str) Optional[Union[Chatter, PartialChatter]] #
Retrieve a chatter from the channels user cache.
- Parameters
name (str) – The chatter’s name to try and retrieve.
- Returns
Union[
twitchio.chatter.Chatter
,twitchio.chatter.PartialChatter
] – Could be atwitchio.user.PartialChatter
depending on how the user joined the channel. Returns None if no user was found.
- coroutine send(content: str)#
This function is a coroutine.
Send a message to the destination associated with the dataclass.
Destination will either be a channel or user.
- Parameters
content (str) – The content you wish to send as a message. The content must be a string.
- Raises
InvalidContent – Invalid content.
- coroutine user(force=False) User #
This function is a coroutine.
Fetches the User from the api.
- Parameters
force (
bool
) – Whether to force a fetch from the api, or try and pull from the cache. Defaults to False- Returns
twitchio.User
the user associated with the channel
ChannelEmote#
ChannelFollowerEvent#
ChannelFollowingEvent#
ChannelInfo#
ChannelTeams#
ChatBadge#
ChatBadgeVersions#
ChatSettings#
- class twitchio.ChatSettings(http: TwitchHTTP, data: dict)#
Represents current chat settings of a broadcaster / channel
- broadcaster#
User of the broadcaster. Only returns the ID.
- Type
- follower_mode_duration#
The length of time, in minutes, that the followers must have followed the broadcaster to participate in chat.
- Type
Optional[
int
]
- slow_mode_wait_time#
The amount of time, in seconds, that users need to wait between sending messages.
- Type
Optional[
int
]
- subscriber_mode#
Indicates whether only users that subscribe to the broadcaster’s channel can talk in chat.
- Type
- unique_chat_mode#
Indicates whether the broadcaster requires users to post only unique messages in the chat room.
- Type
- moderator#
The User of the moderator, if provided. Only returns the ID.
- Type
Optional[
PartialUser
]
Chatter#
- class twitchio.PartialChatter(websocket, **kwargs)#
- coroutine send(content: str)#
This function is a coroutine.
Send a message to the destination associated with the dataclass.
Destination will either be a channel or user.
- Parameters
content (str) – The content you wish to send as a message. The content must be a string.
- Raises
InvalidContent – Invalid content.
- coroutine user() User #
This function is a coroutine.
Fetches a
twitchio.User
object based off the chatters channel name- Returns
- property channel#
The channel associated with the user.
- property name#
The users name
- class twitchio.Chatter(websocket: WSConnection, **kwargs)#
-
- property is_broadcaster: bool#
A boolean indicating whether the User is the broadcaster of the current channel.
- property is_subscriber: bool#
A boolean indicating whether the User is a subscriber of the current channel.
Note
changed in 2.1.0: return value is no longer optional. founders will now appear as subscribers
ChatterColor#
CharityCampaign#
- class twitchio.CharityCampaign(data: dict, http: TwitchHTTP, broadcaster: PartialUser | None = None)#
Represents a Charity Campaign on a channel.
- broadcaster#
The broadcaster running the campaign.
- Type
- user#
The user who donated.
- Type
- current#
The current funds raised by this campaign.
- Type
- target#
The target funds to be raised for this campaign.
- Type
CheerEmote#
- class twitchio.CheerEmote(http: TwitchHTTP, data: dict)#
Represents a Cheer Emote
- tiers#
The tiers this Cheer Emote has
- Type
- type#
Shows whether the emote is
global_first_party
,global_third_party
,channel_custom
,display_only
, orsponsored
.- Type
- last_updated :class:`datetime.datetime`
The date this cheermote was last updated.
CheerEmoteTier#
- class twitchio.CheerEmoteTier(data: dict)#
Represents a Cheer Emote tier.
- images#
contains two dicts,
light
anddark
. Each item will have ananimated
andstatic
item, which will contain yet another dict, with sizes1
,1.5
,2
,3
, and4
. Ex.cheeremotetier.images["light"]["animated"]["1"]
- Type
- show_in_bits_card#
Indicates whether twitch hides the emote from the bits card.
- Type
:class`bool`
Clip#
- class twitchio.Clip(http: TwitchHTTP, data: dict)#
Represents a Twitch Clip
- broadcaster#
The user whose channel the clip was created on.
- Type
- creator#
The user who created the clip.
- Type
- created_at#
When the clip was created.
- Type
ContentClassificationLabel#
CustomReward#
- asyncdelete
- asyncedit
- asyncget_redemptions
- class twitchio.CustomReward(http: TwitchHTTP, obj: dict, channel: PartialUser)#
Represents a Custom Reward object, as given by the api. Use
get_custom_rewards()
to fetch these- max_per_stream#
Whether the custom reward is limited to a certain amount per stream, and how many
- max_per_user_stream#
Whether the custom reward is limited to a certain amount per user per stream, and how many
- redemptions_current_stream#
Whether the custom reward’s redemptions are only valid for the current stream
- Type
- cooldown_until#
The datetime the custom reward’s cooldown will expire
- Type
- coroutine delete(token: str)#
Deletes the custom reward
- Parameters
token –
str
the oauth token of the target channel- Returns
None
- coroutine edit(token: str, title: Optional[str] = None, prompt: Optional[str] = None, cost: Optional[int] = None, background_color: Optional[str] = None, enabled: Optional[bool] = None, input_required: Optional[bool] = None, max_per_stream_enabled: Optional[bool] = None, max_per_stream: Optional[int] = None, max_per_user_per_stream_enabled: Optional[bool] = None, max_per_user_per_stream: Optional[int] = None, global_cooldown_enabled: Optional[bool] = None, global_cooldown: Optional[int] = None, paused: Optional[bool] = None, redemptions_skip_queue: Optional[bool] = None)#
Edits the reward. Note that apps can only modify rewards they have made.
- Parameters
token (
str
) – The bearer token for the channel of the rewardtitle (Optional[
str
]) – The new title of the rewardprompt (Optional[
str
]) – The new prompt for the rewardcost (Optional[
int
]) – The new cost for the rewardbackground_color (Optional[
str
]) – The new background color for the rewardenabled (Optional[
bool
]) – Whether the reward is enabled or notinput_required (Optional[
bool
]) – Whether user input is required or notmax_per_stream_enabled (Optional[
bool
]) – Whether the stream limit should be enabledmax_per_stream (Optional[
int
]) – How many times this can be redeemed per streammax_per_user_per_stream_enabled (Optional[
bool
]) – Whether the user stream limit should be enabledmax_per_user_per_stream (Optional[
int
]) – How many times a user can redeem this reward per streamglobal_cooldown_enabled (Optional[
bool
]) – Whether the global cooldown should be enabledglobal_cooldown (Optional[
int
]) – How many seconds the global cooldown should bepaused (Optional[
bool
]) – Whether redemptions on this reward should be paused or notredemptions_skip_queue (Optional[
bool
]) – Whether redemptions skip the request queue or not
- Returns
CustomReward
itself.
- coroutine get_redemptions(token: str, status: str, sort: str = 'OLDEST', first: int = 20)#
Gets redemptions for this reward
- Parameters
token –
str
the oauth token of the target channelstatus –
str
one of UNFULFILLED, FULFILLED or CANCELEDsort – Optional[
str
] the order redemptions are returned in. One of OLDEST, NEWEST. Default: OLDEST.first –
int
Number of results to be returned when getting the paginated Custom Reward Redemption objects for a reward. Limit: 50. Default: 20.
CustomRewardRedemption#
Emote#
- defurl_for
- class twitchio.Emote(data: dict)#
Represents an Emote.
Note
It seems twitch is sometimes returning duplicate information from the emotes endpoint. To deduplicate your emotes, you can call
set()
on the list of emotes (or any other hashmap), which will remove the duplicates.my_list_of_emotes = await user.get_user_emotes(...) deduplicated_emotes = set(my_list_of_emotes)
- set_id#
The ID of the set this emote belongs to. Will be
None
if the emote doesn’t belong to a set.- Type
Optional[
str
]
- type#
The reason this emote is available to the user. Some available values (twitch hasn’t documented this properly, there might be more):
follower
subscription
bitstier
hypetrain
globals (global emotes)
- Type
- scales#
The available scaling for this emote. These are typically floats (ex. “1.0”, “2.0”).
- Type
list[
str
]
- url_for(format: Literal['static', 'animated'], theme: Literal['dark', 'light'], scale: str) str #
Returns a cdn url that can be used to download or serve the emote on a website. This function validates that the arguments passed are possible values to serve the emote.
- Parameters
format (Literal["static", "animated"]) – The format of the emote. You can check what formats are available using
format_static
andformat_animated
.theme (Literal["dark", "light"]) – The theme of the emote. You can check what themes are available using
format_dark
andformat_light
.scale (
str
) – The scale of the emote. This should be formatted in this format:"1.0"
. The scales available for this emote can be checked viascales
.
- Returns
Extension#
ExtensionBuilder#
FollowEvent#
- class twitchio.FollowEvent(http: TwitchHTTP, data: dict, from_: Optional[Union[PartialUser, User]] = None, to: Optional[Union[PartialUser, User]] = None)#
Represents a Follow Event.
- from_user#
The user that followed another user.
- Type
Union[
User
,PartialUser
]
- to_user#
The user that was followed.
- Type
Union[
User
,PartialUser
]
- followed_at#
When the follow happened.
- Type
Game#
- defart_url
GlobalEmote#
Goal#
- class twitchio.Goal(http: TwitchHTTP, data: dict)#
Represents a list of Goals for a broadcaster / channel
- broadcaster#
User of the broadcaster.
- Type
- type#
The type of goal. Valid values: follower, subscription, subscription_count, new_subscription and new_subscription_count.
- Type
- created_at#
Date and time of when the broadcaster created the goal.
- Type
HypeChatData
- class twitchio.HypeChatData(tags: dict)#
Represents information about hype chats.
- exponent#
Indicates how many decimal points this currency represents partial amounts in. Decimal points start from the right side of the value defined in pinned-chat-paid-amount.
- Type
- currency#
The currency paid in, uses ISO 4217 alphabetic currency code (eg. USD, EUR, GBP). The ISO 4217 alphabetic currency code the user has sent the Hype Chat in.
- Type
- is_system_message#
A Boolean value that determines if the message sent with the Hype Chat was filled in by the system. If True, the user entered no message and the body message was automatically filled in by the system. If False, the user provided their own message to send with the Hype Chat.
- Type
HypeTrainContribution#
- class twitchio.HypeTrainContribution(http: TwitchHTTP, data: dict)#
A Contribution to a Hype Train
- total#
Total aggregated amount of all contributions by the top contributor. If type is
BITS
, total represents aggregate amount of bits used. If type isSUBS
, aggregate total where 500, 1000, or 2500 represent tier 1, 2, or 3 subscriptions respectively. For example, if top contributor has gifted a tier 1, 2, and 3 subscription, total would be 4000.- Type
- user#
The user making the contribution.
- Type
HypeTrainEvent#
- class twitchio.HypeTrainEvent(http: TwitchHTTP, data: dict)#
Represents a Hype Train Event (progression)
- broadcaster#
The user whose channel the Hype Train is occurring on.
- Type
- timestamp#
The time the event happened at.
- Type
- cooldown_end_time#
The time that another Hype Train can happen at.
- Type
- expiry#
The time that this Hype Train expires at.
- Type
- started_at#
The time that this Hype Train started at.
- Type
- last_contribution#
The last contribution to this Hype Train.
- top_contributions#
The top contributors to the Hype Train.
- Type
List[
HypeTrainContribution
]
Marker#
MaybeActiveExtension#
Message#
- class twitchio.Message(**kwargs)#
-
- hype_chat_data#
Any hype chat information associated with the message. This will be
None
when the message is not a hype chat.- Type
Optional[
HypeChatData
]
- property author: Union[Chatter, PartialChatter]#
The User object associated with the Message.
ModEvent#
- class twitchio.ModEvent(http: TwitchHTTP, data: dict, broadcaster: Union[PartialUser, User])#
Represents a mod add/remove action
- type#
The type of the event.
- Type
ModEventEnum
- timestamp#
The timestamp of the event.
- Type
- broadcaster#
The user whose channel the event happened on.
- Type
Union[
PartialUser
,User
]
- user#
The user being removed or added as a moderator.
- Type
Poll#
- class twitchio.Poll(http: TwitchHTTP, data: dict)#
Represents a list of Polls for a broadcaster / channel
Note
Twitch have removed support for voting with bits. By default bits_votes, bits_voting_enabled and bits_per_vote will be received as either 0 or False.
- broadcaster#
User of the broadcaster.
- Type
- choices#
The poll choices.
- Type
List[
PollChoice
]
- bits_voting_enabled#
Indicates if Bits can be used for voting.
Warning
Twitch have removed support for voting with bits. This will return as False
- Type
- bits_per_vote#
Number of Bits required to vote once with Bits.
Warning
Twitch have removed support for voting with bits. This will return as 0
- Type
- channel_points_per_vote#
Number of Channel Points required to vote once with Channel Points.
- Type
- status#
Poll status. Valid values: ACTIVE, COMPLETED, TERMINATED, ARCHIVED, MODERATED, INVALID
- Type
- started_at#
Date and time the poll was started.
- Type
- ended_at#
Date and time the poll was ended.
- Type
Predictions#
- class twitchio.Prediction(http: TwitchHTTP, data: dict)#
Represents channel point predictions
- user#
The user who is streaming.
- Type
- outcomes#
List of possible outcomes for the Prediction.
- Type
List[
PredictionOutcome
]
- created_at#
Time for when the Prediction was created.
- Type
- ended_at#
Time for when the Prediction ended.
- Type
- locked_at#
Time for when the Prediction was locked.
- Type
Raid#
Schedules#
- class twitchio.Schedule(http: TwitchHTTP, data: dict)#
Represents a channel’s stream schedule
- segments#
List of segments of a channel’s stream schedule.
- Type
List[
ScheduleSegment
]
- user#
The user of the channel associated to the schedule.
- Type
- vacation#
Vacation details of stream schedule.
- Type
- class twitchio.ScheduleSegment(data: dict)#
Represents a list segments of a channel’s stream schedule
- start_time#
Scheduled start time for the scheduled broadcast
- Type
- end_time#
Scheduled end time for the scheduled broadcast
- Type
Optional[
datetime.datetime
]
- canceled_until#
Used with recurring scheduled broadcasts. Specifies the date of the next recurring broadcast.
- Type
- category#
The game or category details for the scheduled broadcast.
- Type
SearchUser#
- class twitchio.SearchUser(http: TwitchHTTP, data: dict)#
Represents a User that has been searched for.
- thumbnail_url :class:`str`
A URL to a thumbnail of the broadcaster’s profile image.
- language :class:`str`
The ISO 639-1 two-letter language code of the language used by the broadcaster. For example, en for English.
- live#
A Boolean value that determines whether the broadcaster is streaming live. Is true if the broadcaster is streaming live; otherwise, false.
- Type
- started_at#
The UTC date and time of when the broadcaster started streaming.
- Type
ShieldStatus#
- class twitchio.ShieldStatus(http: TwitchHTTP, data: dict)#
Represents a Shield Mode activation status.
- moderator#
The moderator that last activated Shield Mode.
- Type
- display_name#
The moderator’s display name. Is an empty string if Shield Mode hasn’t been previously activated.
- Type
- last_activated_at#
The UTC datetime of when Shield Mode was last activated. Is an empty string if Shield Mode hasn’t been previously activated.
- Type
Stream#
SubscriptionEvent#
- class twitchio.SubscriptionEvent(http: TwitchHTTP, data: dict, broadcaster: Optional[Union[PartialUser, User]] = None, user: Optional[Union[PartialUser, User]] = None)#
Represents a Subscription Event
- broadcaster#
The user that was subscribed to.
- Type
Union[
User
,PartialUser
]
- user#
The user who subscribed.
- Type
Union[
User
,PartialUser
]
- plan_name#
Name of the description. (twitch docs aren’t helpful, if you know what this is specifically please PR :) ).
- Type
Tag#
Team#
Timeout#
- class twitchio.Timeout(http: TwitchHTTP, data: dict)#
Represents a timeout for a broadcaster / channel
- broadcaster#
The broadcaster whose chat room the user was timed out from chatting in.
- Type
- moderator#
The moderator that timed the user out.
- Type
- user#
The user that was timed out.
- Type
- created_at#
Date and time of when the timeout was created.
- Type
- end_time#
Date and time of when the timeout will end.
- Type
User#
- asyncadd_channel_moderator
- asyncadd_channel_vip
- asyncautomod_check
- asyncban_user
- asynccancel_raid
- asyncchat_announcement
- asynccreate_clip
- asynccreate_custom_reward
- asynccreate_marker
- asynccreate_poll
- asynccreate_prediction
- asyncdelete_chat_messages
- asyncedit
- asyncend_poll
- asyncend_prediction
- asyncfetch
- asyncfetch_active_extensions
- asyncfetch_ad_schedule
- asyncfetch_ban_events
- asyncfetch_bans
- asyncfetch_bits_leaderboard
- asyncfetch_channel_emotes
- asyncfetch_channel_follower_count
- asyncfetch_channel_followers
- asyncfetch_channel_following
- asyncfetch_channel_following_count
- asyncfetch_channel_teams
- asyncfetch_channel_vips
- asyncfetch_charity_campaigns
- asyncfetch_chat_badges
- asyncfetch_chat_settings
- asyncfetch_clips
- asyncfetch_extensions
- asyncfetch_follow
- asyncfetch_followed_streams
- asyncfetch_follower_count
- asyncfetch_followers
- asyncfetch_following
- asyncfetch_following_count
- asyncfetch_goals
- asyncfetch_hypetrain_events
- asyncfetch_markers
- asyncfetch_mod_events
- asyncfetch_moderated_channels
- asyncfetch_moderators
- asyncfetch_polls
- asyncfetch_schedule
- asyncfetch_shield_mode_status
- asyncfetch_stream_key
- asyncfetch_subscriptions
- asyncfetch_tags
- asyncfetch_user_emotes
- asyncfetch_videos
- asyncfollow
- asyncget_custom_rewards
- asyncget_predictions
- asyncmodify_stream
- asyncremove_channel_moderator
- asyncremove_channel_vip
- asyncreplace_tags
- asyncsend_whisper
- asyncshoutout
- asyncsnooze_ad
- asyncstart_commercial
- asyncstart_raid
- asynctimeout_user
- asyncunban_user
- asyncunfollow
- asyncupdate_chat_settings
- asyncupdate_extensions
- asyncupdate_shield_mode_status
- class twitchio.PartialUser(http: TwitchHTTP, id: Union[int, str], name: Optional[str])#
A class that contains minimal data about a user from the API.
- name#
The user’s name. In most cases, this is provided. There are however, rare cases where it is not.
- Type
Optional[
str
]
- coroutine add_channel_moderator(token: str, user_id: int)#
This function is a coroutine.
Adds a moderator to the specified channel/broadcaster. The channel may add a maximum of 10 moderators within a 10 seconds period.
- coroutine add_channel_vip(token: str, user_id: int)#
This function is a coroutine.
Adds a VIP to the specified channel/broadcaster. The channel may add a maximum of 10 VIPs within a 10 seconds period.
- coroutine automod_check(token: str, query: list)#
This function is a coroutine.
Checks if a string passes the automod filter
- Parameters
token (
str
) – The oauth token with themoderation:read
scope.query (List[
AutomodCheckMessage
]) – A list oftwitchio.AutomodCheckMessage
- Returns
- coroutine ban_user(token: str, moderator_id: int, user_id, reason: str)#
This function is a coroutine.
Bans a user from the channel/broadcaster.
- Parameters
token (
str
) – An oauth user access token with themoderator:manage:banned_users
scopemoderator_id (
int
) – The ID of a user that has permission to moderate the broadcaster’s chat room. If the broadcaster wants to ban the user set this parameter to the broadcaster’s ID.user_id (
int
) – The ID of the user to ban.reason (
str
) – The reason for the ban.
- Returns
- coroutine cancel_raid(token: str)#
This function is a coroutine.
Cancels a raid for the channel/broadcaster. The limit is 10 requests within a 10-minute window.
- Parameters
token (
str
) – An oauth token with thechannel:manage:raids
scope Must be the broadcaster’s token.- Returns
None
- coroutine chat_announcement(token: str, moderator_id: int, message: str, color: Optional[str] = None)#
This function is a coroutine.
Sends a chat announcement to the specified channel/broadcaster.
- Parameters
token (
str
) – An oauth token with themoderator:manage:chat_settings
scope.moderator_id (
int
) – The ID of a user that has permission to moderate the broadcaster’s chat room. Requiresmoderator:manage:announcements
scope.message (
str
) – The message to be sent.color (Optional[
str
]) – The color of the message. Valid values: blue, green orange, purple. The default is primary.
- Returns
None
- coroutine create_clip(token: str, has_delay=False) dict #
This function is a coroutine.
Creates a clip on the channel. Note that clips are not created instantly, so you will have to query
get_clips()
to confirm the clip was created. Requires an OAuth token with theclips:edit
scope
- coroutine create_custom_reward(token: str, title: str, cost: int, prompt: Optional[str] = None, enabled: Optional[bool] = True, background_color: Optional[str] = None, input_required: Optional[bool] = False, max_per_stream: Optional[int] = None, max_per_user_per_stream: Optional[int] = None, global_cooldown: Optional[int] = None, redemptions_skip_queue: Optional[bool] = False) CustomReward #
This function is a coroutine.
Creates a custom reward for the user.
- Parameters
token (
str
) – An oauth token with thechannel:manage:redemptions
scopetitle (
str
) – The title of the rewardcost (
int
) – The cost of the rewardprompt (Optional[
str
]) – The prompt for the reward. Defaults to Noneenabled (Optional[
bool
]) – Whether the reward is enabled. Defaults to Truebackground_color (Optional[
str
]) – The background color of the reward. Defaults to Noneinput_required (Optional[
bool
]) – Whether the reward requires input. Defaults to Falsemax_per_stream (Optional[
int
]) – The maximum number of times the reward can be redeemed per stream. Defaults to Nonemax_per_user_per_stream (Optional[
int
]) – The maximum number of times the reward can be redeemed per user per stream. Defaults to Noneglobal_cooldown (Optional[
int
]) – The global cooldown of the reward. Defaults to Noneredemptions_skip_queue (Optional[
bool
]) – Whether the reward skips the queue when redeemed. Defaults to False
- coroutine create_marker(token: str, description: Optional[str] = None)#
This function is a coroutine.
Creates a marker on the stream. This only works if the channel is live (among other conditions)
- Parameters
- Returns
- coroutine create_poll(token: str, title: str, choices: List[str], duration: int, bits_voting_enabled: Optional[bool] = False, bits_per_vote: Optional[int] = None, channel_points_voting_enabled: Optional[bool] = False, channel_points_per_vote: Optional[int] = None)#
This function is a coroutine.
Creates a poll for the specified channel/broadcaster.
- Parameters
token (
str
) – An oauth token with thechannel:manage:polls
scope. User ID in token must match the broadcaster’s ID.title (
str
) – Question displayed for the poll.choices (List[
str
]) – List of choices for the poll. Must be between 2 and 5 choices.duration (
int
) – Total duration for the poll in seconds. Must be between 15 and 1800.bits_voting_enabled (Optional[
bool
]) – Indicates if Bits can be used for voting. Default is False.bits_per_vote (Optional[
int
]) – Number of Bits required to vote once with Bits. Max 10000.channel_points_voting_enabled (Optional[
bool
]) – Indicates if Channel Points can be used for voting. Default is False.channel_points_per_vote (Optional[
int
]) – Number of Channel Points required to vote once with Channel Points. Max 1000000.
- Returns
List[
twitchio.Poll
]
- coroutine create_prediction(token: str, title: str, blue_outcome: str, pink_outcome: str, prediction_window: int) Prediction #
This function is a coroutine.
Creates a prediction for the channel.
- Parameters
token (
str
) – An oauth token with thechannel:manage:predictions
scopetitle (
str
) – Title for the prediction (max of 45 characters)blue_outcome (
str
) – Text for the first outcome people can vote for. (max 25 characters)pink_outcome (
str
) – Text for the second outcome people can vote for. (max 25 characters)prediction_window (
int
) – Total duration for the prediction (in seconds)
- Returns
- coroutine delete_chat_messages(token: str, moderator_id: int, message_id: Optional[str] = None)#
This function is a coroutine.
Deletes a chat message, or clears chat, in the specified channel/broadcaster’s chat.
- Parameters
token (
str
) – An oauth token with themoderator:manage:chat_settings
scope.moderator_id (
int
) – The ID of a user that has permission to moderate the broadcaster’s chat room. Requiresmoderator:manage:chat_messages
scope.message_id (Optional[
str
]) – The ID of the message to be deleted. The message must have been created within the last 6 hours. The message must not belong to the broadcaster. If not specified, the request removes all messages in the broadcaster’s chat room.
- Returns
None
- coroutine edit(token: str, description: str) None #
This function is a coroutine.
Edits a channels description
- coroutine end_poll(token: str, poll_id: str, status: str)#
This function is a coroutine.
Ends a poll for the specified channel/broadcaster.
- Parameters
- Returns
- coroutine end_prediction(token: str, prediction_id: str, status: str, winning_outcome_id: Optional[str] = None) Prediction #
This function is a coroutine.
End a prediction with an outcome.
- Parameters
token (
str
) – An oauth token with thechannel:manage:predictions
scopeprediction_id (
str
) – ID of the prediction to end.status (
str
) – Status of the prediction. Valid values are: RESOLVED - Winning outcome has been choson and points distributed. CANCELED - Prediction canceled and points refunded LOCKED - Viewers can no longer make predictions.winning_outcome_id (Optional[
str
]) – ID of the winning outcome. This is required if status is RESOLVED
- Returns
- coroutine fetch(token: Optional[str] = None, force=False) User #
This function is a coroutine.
Fetches the full user from the api or cache
- Parameters
- Returns
twitchio.User
The full user associated with this PartialUser
- coroutine fetch_active_extensions(token: Optional[str] = None)#
This function is a coroutine.
Fetches active extensions the user has. Returns a dictionary containing the following keys: panel, overlay, component.
- Parameters
token (Optional[
str
]) – An oauth token with theuser:read:broadcast
oruser:edit:broadcast
scope- Returns
Dict[
str
, Dict[int
,twitchio.ActiveExtension
]]
- coroutine fetch_ad_schedule(token: str) AdSchedule #
This function is a coroutine.
Fetches the streamers’s ad schedule.
- Parameters
token (
str
) – The user’s oauth token with thechannel:read:ads
scope.- Returns
- coroutine fetch_ban_events(token: str, userids: Optional[List[int]] = None)#
This function is a coroutine.
This has been deprecated and will be removed in a future release.
Fetches ban/unban events from the User’s channel.
- Parameters
- Returns
List[
twitchio.BanEvent
]
- coroutine fetch_bans(token: str, userids: Optional[List[Union[str, int]]] = None) List[UserBan] #
This function is a coroutine.
Fetches a list of people the User has banned from their channel.
- coroutine fetch_bits_leaderboard(token: str, period: str = 'all', user_id: Optional[int] = None, started_at: Optional[datetime] = None) BitsLeaderboard #
This function is a coroutine.
Fetches the bits leaderboard for the channel. This requires an OAuth token with the
bits:read
scope.- Parameters
token (
str
) – the OAuth token with thebits:read
scopeperiod (Optional[
str
]) – one of day, week, month, year, or all, defaults to allstarted_at (Optional[
datetime.datetime
]) – the timestamp to start the period at. This is ignored if the period is alluser_id (Optional[
int
]) – the id of the user to fetch for
- coroutine fetch_channel_emotes()#
This function is a coroutine.
Fetches channel emotes from the user
- Returns
List[
twitchio.ChannelEmote
]
- coroutine fetch_channel_follower_count(token: Optional[str] = None) int #
This function is a coroutine.
Fetches the total number of users that are following this user.
- coroutine fetch_channel_followers(token: str, user_id: Optional[int] = None) List[ChannelFollowerEvent] #
This function is a coroutine.
Fetches a list of users that are following this broadcaster. Requires a user access token that includes the
moderator:read:followers
scope. The ID in the broadcaster_id query parameter must match the user ID in the access token or the user must be a moderator for the specified broadcaster.- Parameters
- Returns
List[
twitchio.FollowEvent
]
- coroutine fetch_channel_following(token: str, broadcaster_id: Optional[int] = None) List[ChannelFollowingEvent] #
This function is a coroutine.
Fetches a list of users that this user follows. Requires a user access token that includes the
user:read:follows
scope. The ID in the broadcaster_id query parameter must match the user ID in the access token or the user must be a moderator for the specified broadcaster.- Parameters
- Returns
- coroutine fetch_channel_following_count(token: str) int #
This function is a coroutine.
Fetches the total number of users that the user is following.
- coroutine fetch_channel_teams()#
This function is a coroutine.
Fetches a list of Twitch Teams of which the specified channel/broadcaster is a member.
- Returns
List[
twitchio.ChannelTeams
]
- coroutine fetch_channel_vips(token: str, first: int = 20, user_ids: Optional[List[int]] = None)#
This function is a coroutine.
Fetches the list of VIPs for the specified channel/broadcaster.
- Parameters
token (
str
) – An oauth token with thechannel:read:vips
ormoderator:manage:chat_settings
scope. Must be the broadcaster’s token.first (Optional[
int
]) – The maximum number of items to return per page in the response. The minimum page size is 1 item per page and the maximum is 100. The default is 20.user_ids (Optional[List[
int
]]) – A list of user IDs to filter the results by. The maximum number of IDs that you may specify is 100. Ignores those users in the list that aren’t VIPs.
- Returns
List[
twitchio.PartialUser
]
- coroutine fetch_charity_campaigns(token: str) List[CharityCampaign] #
This function is a coroutine.
Fetches a list of charity campaigns the broadcaster is running. Requires a user token with the
channel:read:charity
scope.- Returns
List[
twitchio.CharityCampaign
]
- coroutine fetch_chat_badges()#
This function is a coroutine.
Fetches broadcaster’s list of custom chat badges. The list is empty if the broadcaster hasn’t created custom chat badges.
- Returns
List[
twitchio.ChatBadge
]
- coroutine fetch_chat_settings(token: Optional[str] = None, moderator_id: Optional[int] = None)#
This function is a coroutine.
Fetches the current chat settings for this channel/broadcaster.
- Parameters
- Returns
- coroutine fetch_clips(started_at: Optional[datetime] = None, ended_at: Optional[datetime] = None, is_featured: Optional[bool] = None) List[Clip] #
This function is a coroutine.
Fetches clips from the api. This will only return clips from the specified user. Use
Client.fetch_clips
to fetch clips by id- Parameters
started_at (Optional[
datetime.datetime
]) – Starting date/time for returned clips. If this is specified, ended_at also should be specified; otherwise, the ended_at date/time will be 1 week after the started_at value.ended_at (Optional[
datetime.datetime
]) – Ending date/time for returned clips. If this is specified, started_at also must be specified; otherwise, the time period is ignored.is_featured (Optional[
bool
]) – Optional bool to only return only featured clips or not featured clips.
- Returns
List[
twitchio.Clip
]
- coroutine fetch_extensions(token: str)#
This function is a coroutine.
Fetches extensions the user has (active and inactive)
- Parameters
token (
str
) – An oauth token with theuser:read:broadcast
scope- Returns
List[
twitchio.Extension
]
- coroutine fetch_follow(to_user: PartialUser, token: Optional[str] = None)#
This function is a coroutine.
Check if a user follows another user or when they followed a user.
Warning
The endpoint this method uses has been deprecated by Twitch and is no longer available.
- Parameters
to_user (
PartialUser
) –token (Optional[
str
]) – An oauth token to use instead of the bots token
- Returns
- coroutine fetch_followed_streams(token: str)#
This function is a coroutine.
Fetches a list of broadcasters that the user follows and that are streaming live.
- Parameters
token (
str
) – An oauth user token with theuser:read:follows
scope.- Returns
List[
twitchio.Stream
]
- coroutine fetch_follower_count(token: Optional[str] = None) int #
This function is a coroutine.
Fetches the total number of users that are following this user.
Warning
The endpoint this method uses has been deprecated by Twitch and is no longer available.
- coroutine fetch_followers(token: Optional[str] = None)#
This function is a coroutine.
Fetches a list of users that are following this user.
Warning
The endpoint this method uses has been deprecated by Twitch and is no longer available.
- Parameters
token (Optional[
str
]) – An oauth token to use instead of the bots token- Returns
List[
twitchio.FollowEvent
]
- coroutine fetch_following(token: Optional[str] = None) List[FollowEvent] #
This function is a coroutine.
Fetches a list of users that this user is following.
Warning
The endpoint this method uses has been deprecated by Twitch and is no longer available.
- Parameters
token (Optional[
str
]) – An oauth token to use instead of the bots token- Returns
List[
twitchio.FollowEvent
]
- coroutine fetch_following_count(token: Optional[str] = None) int #
This function is a coroutine.
Fetches a list of users that this user is following.
Warning
The endpoint this method uses has been deprecated by Twitch and is no longer available.
- coroutine fetch_goals(token: str)#
This function is a coroutine.
Fetches a list of goals for the specified channel/broadcaster.
- Parameters
token (
str
) – An oauth token with thechannel:read:goals
scope- Returns
List[
twitchio.Goal
]
- coroutine fetch_hypetrain_events(id: Optional[str] = None, token: Optional[str] = None)#
This function is a coroutine.
Fetches hypetrain event from the api. Needs a token with the
channel:read:hype_train
scope.- Parameters
- Returns
List[
twitchio.HypeTrainEvent
]
- coroutine fetch_markers(token: str, video_id: Optional[str] = None)#
This function is a coroutine.
Fetches markers from the given video id, or the most recent video. The Twitch api will only return markers created by the user of the authorized token
- Parameters
- Returns
Optional[
twitchio.VideoMarkers
]
- coroutine fetch_mod_events(token: str)#
This function is a coroutine.
Fetches mod events (moderators being added and removed) for this channel.
- Parameters
token (
str
) – The oauth token with themoderation:read
scope.- Returns
List[
twitchio.ModEvent
]
- coroutine fetch_moderated_channels(token: str) List[PartialUser] #
This function is a coroutine.
Fetches channels that this user moderates.
- Parameters
token (
str
) – An oauth token for this user with theuser:read:moderated_channels
scope.- Returns
List[
twitchio.PartialUser
]
- coroutine fetch_moderators(token: str, userids: Optional[List[int]] = None)#
This function is a coroutine.
Fetches the moderators for this channel.
- Parameters
- Returns
List[
twitchio.PartialUser
]
- coroutine fetch_polls(token: str, poll_ids: Optional[List[str]] = None, first: Optional[int] = 20)#
This function is a coroutine.
Fetches a list of polls for the specified channel/broadcaster.
- Parameters
- Returns
List[
twitchio.Poll
]
- coroutine fetch_schedule(segment_ids: Optional[List[str]] = None, start_time: Optional[datetime] = None, utc_offset: Optional[int] = None, first: int = 20)#
This function is a coroutine.
Fetches the schedule of a streamer :param segment_ids: List of segment IDs of the stream schedule to return. Maximum: 100 :type segment_ids: Optional[List[
str
]] :param start_time: A datetime object to start returning stream segments from. If not specified, the current date and time is used. :type start_time: Optional[datetime.datetime
] :param utc_offset: A timezone offset for the requester specified in minutes. +4 hours from GMT would be 240 :type utc_offset: Optional[int
] :param first: Maximum number of stream segments to return. Maximum: 25. Default: 20. :type first: Optional[int
]- Returns
- coroutine fetch_shield_mode_status(token: str, moderator_id: int)#
This function is a coroutine.
Fetches the user’s Shield Mode activation status.
- Parameters
- Returns
- coroutine fetch_subscriptions(token: str, userids: Optional[List[int]] = None)#
This function is a coroutine.
Fetches the subscriptions for this channel.
- Parameters
- Returns
- coroutine fetch_tags()#
This function is a coroutine.
Fetches tags the user currently has active.
- Returns
List[
twitchio.Tag
]
- coroutine fetch_user_emotes(token: str, broadcaster: Optional[PartialUser] = None) List[Emote] #
This function is a coroutine.
Fetches emotes the user has access to. Optionally, you can filter by a broadcaster.
Note
As of writing, this endpoint seems extrememly unoptimized by twitch, and may (read: will) take a lot of API requests to load. See https://github.com/twitchdev/issues/issues/921 .
- Parameters
token (
str
) – An OAuth token belonging to this user with theuser:read:emotes
scope.broadcaster (Optional[
PartialUser
]) – A channel to filter the results with. Filtering will return all emotes available to the user on that channel, including global emotes.
- Returns
List[
Emote
]
- coroutine fetch_videos(period='all', sort='time', type='all', language=None)#
This function is a coroutine.
Fetches videos that belong to the user. If you have specific video ids use
Client.fetch_videos()
- Parameters
period (
str
) – The period for which to fetch videos. Valid values are all, day, week, month. Defaults to allsort (
str
) – Sort orders of the videos. Valid values are time, trending, views, Defaults to timetype (Optional[
str
]) – Type of the videos to fetch. Valid values are upload, archive, highlight. Defaults to alllanguage (Optional[
str
]) – Language of the videos to fetch. Must be an ISO-639-1 two letter code.
- Returns
List[
twitchio.Video
]
- coroutine follow(userid: int, token: str, *, notifications=False)#
This function is a coroutine.
Follows the user
Warning
This method is obsolete as Twitch removed the endpoint.
- coroutine get_custom_rewards(token: str, *, only_manageable=False, ids: Optional[List[int]] = None, force=False) List[CustomReward] #
This function is a coroutine.
Fetches the channels custom rewards (aka channel points) from the api.
- Parameters
- Returns
List[
twitchio.CustomReward
]
- coroutine get_predictions(token: str, prediction_id: Optional[str] = None) List[Prediction] #
This function is a coroutine.
Gets information on a prediction or the list of predictions if none is provided.
- Parameters
- Returns
- coroutine modify_stream(token: str, game_id: Optional[int] = None, language: Optional[str] = None, title: Optional[str] = None, content_classification_labels: Optional[List[Dict[str, Union[str, bool]]]] = None, is_branded_content: Optional[bool] = None)#
This function is a coroutine.
Modify stream information
- Parameters
token (
str
) – An oauth token with thechannel:manage:broadcast
scopegame_id (
int
) – Optional game ID being played on the channel. Use 0 to unset the game.language (
str
) – Optional language of the channel. A language value must be either the ISO 639-1 two-letter code for a supported stream language or “other”.title (
str
) – Optional title of the stream.content_classification_labels (List[Dict[
str
, Union[str
,bool
]]]) – List of labels that should be set as the Channel’s CCLs.is_branded_content (
bool
) –Boolean flag indicating if the channel has branded content.
Note
Example of a content classification labels .. code:: py
ccl = [{“id”: “Gambling”, “is_enabled”: False}, {“id”: “DrugsIntoxication”, “is_enabled”: False}] await my_partial_user.modify_stream(token=”abcd”, content_classification_labels=ccl)
- coroutine remove_channel_moderator(token: str, user_id: int)#
This function is a coroutine.
Removes a moderator from the specified channel/broadcaster. The channel may remove a maximum of 10 moderators within a 10 seconds period.
- coroutine remove_channel_vip(token: str, user_id: int)#
This function is a coroutine.
Removes a VIP from the specified channel/broadcaster. The channel may remove a maximum of 10 vips within a 10 seconds period.
- coroutine replace_tags(token: str, tags: List[Union[str, Tag]])#
This function is a coroutine.
Replaces the channels active tags. Tags expire 72 hours after being applied, unless the stream is live during that time period.
- Parameters
token (
str
) – An oauth token with the user:edit:broadcast scopetags (List[Union[
twitchio.Tag
,str
]]) – A list oftwitchio.Tag
or tag ids to put on the channel. Max 100
- coroutine send_whisper(token: str, user_id: int, message: str)#
This function is a coroutine.
Sends a whisper to a user. Important Notes: - The user sending the whisper must have a verified phone number. - The API may silently drop whispers that it suspects of violating Twitch policies. - You may whisper to a maximum of 40 unique recipients per day. Within the per day limit. - You may whisper a maximum of 3 whispers per second and a maximum of 100 whispers per minute.
- Parameters
token (
str
) – An oauth user token with theuser:manage:whispers
scope.user_id (
int
) – The ID of the user to send the whisper to.message (
str
) – The message to send. 500 characters if the user you’re sending the message to hasn’t whispered you before. 10,000 characters if the user you’re sending the message to has whispered you before.
- Returns
None
- coroutine shoutout(token: str, to_broadcaster_id: int, moderator_id: int)#
This function is a coroutine. Sends a Shoutout to the specified broadcaster.
Rate Limits
: The broadcaster may send a Shoutout once every 2 minutes. They may send the same broadcaster a Shoutout once every 60 minutes. Requires a user access token that includes themoderator:manage:shoutouts
scope.- Parameters
token (
str
) – An oauth user token with themoderator:manage:shoutouts
scope.to_broadcaster (
int
) – The ID of the broadcaster that is recieving the shoutout.moderator_id (
int
) – The ID of the broadcaster or a user that is one of the broadcaster’s moderators. This ID must match the user ID in the access token.
- Returns
None
- coroutine snooze_ad(token: str) List[AdSchedule] #
This function is a coroutine.
Snoozes an ad on the streamer’s channel.
Note
The resulting
AdSchedule
only has data for thesnooze_count
,snooze_refresh_at
, andnext_ad_at
attributes.- Parameters
token (
str
) – The user’s oauth token with thechannel:manage:ads
scope.- Returns
- coroutine start_commercial(token: str, length: int) dict #
This function is a coroutine.
Starts a commercial on the channel. Requires an OAuth token with the
channel:edit:commercial
scope.
- coroutine start_raid(token: str, to_broadcaster_id: int)#
This function is a coroutine.
Starts a raid for the channel/broadcaster. The UTC date and time, in RFC3339 format, when the raid request was created. A Boolean value that indicates whether the channel being raided contains mature content.
Rate Limit: The limit is 10 requests within a 10-minute window.
- Parameters
- Returns
- coroutine timeout_user(token: str, moderator_id: int, user_id: int, duration: int, reason: str)#
This function is a coroutine.
Timeouts a user from the channel/broadcaster.
- Parameters
token (
str
) – An oauth user access token with themoderator:manage:banned_users
scopemoderator_id (
int
) – The ID of a user that has permission to moderate the broadcaster’s chat room. If the broadcaster wants to timeout the user set this parameter to the broadcaster’s ID.user_id (
int
) – The ID of the user that you wish to timeout.duration (
int
) – The duration of the timeout in seconds. The minimum timeout is 1 second and the maximum is 1,209,600 seconds (2 weeks). To end a user’s timeout early, set this field to 1, or send an Unban user request.reason (
str
) – The reason for the timeout.
- Returns
- coroutine unban_user(token: str, moderator_id: int, user_id)#
This function is a coroutine.
Unbans a user or removes a timeout from the channel/broadcaster.
- Parameters
token (
str
) – An oauth user access token with themoderator:manage:banned_users
scopemoderator_id (
int
) – The ID of a user that has permission to moderate the broadcaster’s chat room. If the broadcaster wants to ban the user set this parameter to the broadcaster’s ID.user_id (
int
) – The ID of the user to unban.
- Returns
None
- coroutine unfollow(userid: int, token: str)#
This function is a coroutine.
Unfollows the user
Warning
This method is obsolete as Twitch removed the endpoint.
- coroutine update_chat_settings(token: str, moderator_id: int, emote_mode: Optional[bool] = None, follower_mode: Optional[bool] = None, follower_mode_duration: Optional[int] = None, slow_mode: Optional[bool] = None, slow_mode_wait_time: Optional[int] = None, subscriber_mode: Optional[bool] = None, unique_chat_mode: Optional[bool] = None, non_moderator_chat_delay: Optional[bool] = None, non_moderator_chat_delay_duration: Optional[int] = None)#
This function is a coroutine.
Updates the current chat settings for this channel/broadcaster.
- Parameters
token (
str
) – An oauth token with themoderator:manage:chat_settings
scope.moderator_id (
int
) – The ID of a user that has permission to moderate the broadcaster’s chat room. Requiresmoderator:manage:chat_settings
scope.emote_mode (Optional[
bool
]) – A boolean to determine whether chat must contain only emotes or not.follower_mode (Optional[
bool
]) – A boolean to determine whether chat must contain only emotes or not.follower_mode_duration (Optional[
int
]) – The length of time, in minutes, that the followers must have followed the broadcaster to participate in chat. Values: 0 (no restriction) through 129600 (3 months). The default is 0.slow_mode (Optional[
bool
]) – A boolean to determine whether the broadcaster limits how often users in the chat room are allowed to send messages.slow_mode_wait_time (Optional[
int
]) – The amount of time, in seconds, that users need to wait between sending messages. Values: 3 through 120 (2 minute delay). The default is 30 seconds.subscriber_mode (Optional[
bool
]) – A boolean to determine whether only users that subscribe to the broadcaster’s channel can talk in chat.unique_chat_mode (Optional[
bool
]) – A boolean to determine whether the broadcaster requires users to post only unique messages in chat.non_moderator_chat_delay (Optional[
bool
]) – A boolean to determine whether the broadcaster adds a short delay before chat messages appear in chat.non_moderator_chat_delay_duration (Optional[
int
]) – The amount of time, in seconds, that messages are delayed from appearing in chat. Valid values: 2, 4 and 6.
- Returns
- coroutine update_extensions(token: str, extensions: ExtensionBuilder)#
This function is a coroutine.
Updates a users extensions. See the
twitchio.ExtensionBuilder
- Parameters
token (
str
) – An oauth token withuser:edit:broadcast
scopeextensions (
twitchio.ExtensionBuilder
) – Atwitchio.ExtensionBuilder
to be given to the twitch api
- Returns
Dict[
str
, Dict[int
,twitchio.ActiveExtension
]]
- coroutine update_shield_mode_status(token: str, moderator_id: int, is_active: bool)#
This function is a coroutine.
Updates the user’s Shield Mode activation status.
- Parameters
token (
str
) – An oauth user token with themoderator:read:shield_mode
ormoderator:manage:shield_mode
scope.moderator_id (
int
) – The ID of the broadcaster or a user that is one of the broadcaster’s moderators. This ID must match the user ID in the access token.is_active (
bool
) – A Boolean value that determines whether to activate Shield Mode. Set to True to activate Shield Mode; otherwise, False to deactivate Shield Mode.
- Returns
- property channel: Optional[Channel]#
Returns the
twitchio.Channel
associated with this user. Could be None if you are not part of the channel’s chat- Returns
Optional[
twitchio.Channel
]
- class twitchio.User(http: TwitchHTTP, data: dict)#
A full user object, containing data from the users endpoint.
- display_name#
The name that is displayed in twitch chat. For the most part, this is simply a change of capitalization
- Type
- type#
The user’s type. This will normally be
none
, unless they are twitch staff or admin- Type
UserTypeEnum
- broadcaster_type#
What type of broacaster the user is. none, affiliate, or partner
- Type
BroadcasterTypeEnum
- view_count#
The amount of views this channel has
Warning
This field has been deprecated by twitch, and is no longer updated. See here for more information.
Note
This field is a tuple due to a mistake when creating the models. Due to semver principals, this cannot be fixed until version 3.0 (at which time we will be removing the field entirely).
- Type
Tuple[int]
- created_at#
When the user created their account
- Type
- email#
The user’s email. This is only returned if you have the
user:read:email
scope on the token used to make the request- Type
Optional[class:str]
UserBan#
- class twitchio.UserBan(http: TwitchHTTP, data: dict)#
Represents a banned user or one in timeout.
- created_at#
The date and time the ban was created.
- Type
- expires_at#
The date and time the timeout will expire. Is None if it’s a ban.
- Type
Optional[
datetime.datetime
]
- moderator#
The moderator that banned the user.
- Type
Video#
- asyncdelete
- class twitchio.Video(http: TwitchHTTP, data: dict, user: Optional[Union[PartialUser, User]] = None)#
Represents video information
- user#
User who owns the video.
- Type
- created_at#
Date when the video was created.
- Type
- published_at#
Date when the video was published.
- Type
- coroutine delete(token: str)#
This function is a coroutine.
Deletes the video. For bulk deletion see
Client.delete_videos()
- Parameters
token (
str
) – The users oauth token with the channel:manage:videos