Type Definitions#

enum twitchAPI.type.AnalyticsReportType(value)#

Bases: Enum

Enum of all Analytics report types

Valid values are as follows:

V1 = <AnalyticsReportType.V1: 'overview_v1'>#
V2 = <AnalyticsReportType.V2: 'overview_v2'>#
enum twitchAPI.type.AuthScope(value)#

Bases: Enum

Enum of Authentication scopes

Valid values are as follows:

ANALYTICS_READ_EXTENSION = <AuthScope.ANALYTICS_READ_EXTENSION: 'analytics:read:extensions'>#
ANALYTICS_READ_GAMES = <AuthScope.ANALYTICS_READ_GAMES: 'analytics:read:games'>#
BITS_READ = <AuthScope.BITS_READ: 'bits:read'>#
CHANNEL_READ_SUBSCRIPTIONS = <AuthScope.CHANNEL_READ_SUBSCRIPTIONS: 'channel:read:subscriptions'>#
CHANNEL_READ_STREAM_KEY = <AuthScope.CHANNEL_READ_STREAM_KEY: 'channel:read:stream_key'>#
CHANNEL_EDIT_COMMERCIAL = <AuthScope.CHANNEL_EDIT_COMMERCIAL: 'channel:edit:commercial'>#
CHANNEL_READ_HYPE_TRAIN = <AuthScope.CHANNEL_READ_HYPE_TRAIN: 'channel:read:hype_train'>#
CHANNEL_MANAGE_BROADCAST = <AuthScope.CHANNEL_MANAGE_BROADCAST: 'channel:manage:broadcast'>#
CHANNEL_READ_REDEMPTIONS = <AuthScope.CHANNEL_READ_REDEMPTIONS: 'channel:read:redemptions'>#
CHANNEL_MANAGE_REDEMPTIONS = <AuthScope.CHANNEL_MANAGE_REDEMPTIONS: 'channel:manage:redemptions'>#
CHANNEL_READ_CHARITY = <AuthScope.CHANNEL_READ_CHARITY: 'channel:read:charity'>#
CLIPS_EDIT = <AuthScope.CLIPS_EDIT: 'clips:edit'>#
USER_EDIT = <AuthScope.USER_EDIT: 'user:edit'>#
USER_EDIT_BROADCAST = <AuthScope.USER_EDIT_BROADCAST: 'user:edit:broadcast'>#
USER_READ_BROADCAST = <AuthScope.USER_READ_BROADCAST: 'user:read:broadcast'>#
USER_READ_EMAIL = <AuthScope.USER_READ_EMAIL: 'user:read:email'>#
USER_EDIT_FOLLOWS = <AuthScope.USER_EDIT_FOLLOWS: 'user:edit:follows'>#
CHANNEL_MODERATE = <AuthScope.CHANNEL_MODERATE: 'channel:moderate'>#
CHAT_EDIT = <AuthScope.CHAT_EDIT: 'chat:edit'>#
CHAT_READ = <AuthScope.CHAT_READ: 'chat:read'>#
WHISPERS_READ = <AuthScope.WHISPERS_READ: 'whispers:read'>#
WHISPERS_EDIT = <AuthScope.WHISPERS_EDIT: 'whispers:edit'>#
MODERATION_READ = <AuthScope.MODERATION_READ: 'moderation:read'>#
CHANNEL_SUBSCRIPTIONS = <AuthScope.CHANNEL_SUBSCRIPTIONS: 'channel_subscriptions'>#
CHANNEL_READ_EDITORS = <AuthScope.CHANNEL_READ_EDITORS: 'channel:read:editors'>#
CHANNEL_MANAGE_VIDEOS = <AuthScope.CHANNEL_MANAGE_VIDEOS: 'channel:manage:videos'>#
USER_READ_BLOCKED_USERS = <AuthScope.USER_READ_BLOCKED_USERS: 'user:read:blocked_users'>#
USER_MANAGE_BLOCKED_USERS = <AuthScope.USER_MANAGE_BLOCKED_USERS: 'user:manage:blocked_users'>#
USER_READ_SUBSCRIPTIONS = <AuthScope.USER_READ_SUBSCRIPTIONS: 'user:read:subscriptions'>#
USER_READ_FOLLOWS = <AuthScope.USER_READ_FOLLOWS: 'user:read:follows'>#
CHANNEL_READ_GOALS = <AuthScope.CHANNEL_READ_GOALS: 'channel:read:goals'>#
CHANNEL_READ_POLLS = <AuthScope.CHANNEL_READ_POLLS: 'channel:read:polls'>#
CHANNEL_MANAGE_POLLS = <AuthScope.CHANNEL_MANAGE_POLLS: 'channel:manage:polls'>#
CHANNEL_READ_PREDICTIONS = <AuthScope.CHANNEL_READ_PREDICTIONS: 'channel:read:predictions'>#
CHANNEL_MANAGE_PREDICTIONS = <AuthScope.CHANNEL_MANAGE_PREDICTIONS: 'channel:manage:predictions'>#
MODERATOR_MANAGE_AUTOMOD = <AuthScope.MODERATOR_MANAGE_AUTOMOD: 'moderator:manage:automod'>#
CHANNEL_MANAGE_SCHEDULE = <AuthScope.CHANNEL_MANAGE_SCHEDULE: 'channel:manage:schedule'>#
MODERATOR_MANAGE_CHAT_SETTINGS = <AuthScope.MODERATOR_MANAGE_CHAT_SETTINGS: 'moderator:manage:chat_settings'>#
MODERATOR_MANAGE_BANNED_USERS = <AuthScope.MODERATOR_MANAGE_BANNED_USERS: 'moderator:manage:banned_users'>#
MODERATOR_READ_BLOCKED_TERMS = <AuthScope.MODERATOR_READ_BLOCKED_TERMS: 'moderator:read:blocked_terms'>#
MODERATOR_MANAGE_BLOCKED_TERMS = <AuthScope.MODERATOR_MANAGE_BLOCKED_TERMS: 'moderator:manage:blocked_terms'>#
CHANNEL_MANAGE_RAIDS = <AuthScope.CHANNEL_MANAGE_RAIDS: 'channel:manage:raids'>#
MODERATOR_MANAGE_ANNOUNCEMENTS = <AuthScope.MODERATOR_MANAGE_ANNOUNCEMENTS: 'moderator:manage:announcements'>#
MODERATOR_MANAGE_CHAT_MESSAGES = <AuthScope.MODERATOR_MANAGE_CHAT_MESSAGES: 'moderator:manage:chat_messages'>#
USER_MANAGE_CHAT_COLOR = <AuthScope.USER_MANAGE_CHAT_COLOR: 'user:manage:chat_color'>#
CHANNEL_MANAGE_MODERATORS = <AuthScope.CHANNEL_MANAGE_MODERATORS: 'channel:manage:moderators'>#
CHANNEL_READ_VIPS = <AuthScope.CHANNEL_READ_VIPS: 'channel:read:vips'>#
CHANNEL_MANAGE_VIPS = <AuthScope.CHANNEL_MANAGE_VIPS: 'channel:manage:vips'>#
USER_MANAGE_WHISPERS = <AuthScope.USER_MANAGE_WHISPERS: 'user:manage:whispers'>#
MODERATOR_READ_CHATTERS = <AuthScope.MODERATOR_READ_CHATTERS: 'moderator:read:chatters'>#
MODERATOR_READ_SHIELD_MODE = <AuthScope.MODERATOR_READ_SHIELD_MODE: 'moderator:read:shield_mode'>#
MODERATOR_MANAGE_SHIELD_MODE = <AuthScope.MODERATOR_MANAGE_SHIELD_MODE: 'moderator:manage:shield_mode'>#
MODERATOR_READ_AUTOMOD_SETTINGS = <AuthScope.MODERATOR_READ_AUTOMOD_SETTINGS: 'moderator:read:automod_settings'>#
MODERATOR_MANAGE_AUTOMOD_SETTINGS = <AuthScope.MODERATOR_MANAGE_AUTOMOD_SETTINGS: 'moderator:manage:automod_settings'>#
MODERATOR_READ_FOLLOWERS = <AuthScope.MODERATOR_READ_FOLLOWERS: 'moderator:read:followers'>#
MODERATOR_MANAGE_SHOUTOUTS = <AuthScope.MODERATOR_MANAGE_SHOUTOUTS: 'moderator:manage:shoutouts'>#
MODERATOR_READ_SHOUTOUTS = <AuthScope.MODERATOR_READ_SHOUTOUTS: 'moderator:read:shoutouts'>#
CHANNEL_BOT = <AuthScope.CHANNEL_BOT: 'channel:bot'>#
USER_BOT = <AuthScope.USER_BOT: 'user:bot'>#
USER_READ_CHAT = <AuthScope.USER_READ_CHAT: 'user:read:chat'>#
CHANNEL_READ_ADS = <AuthScope.CHANNEL_READ_ADS: 'channel:read:ads'>#
CHANNEL_MANAGE_ADS = <AuthScope.CHANNEL_MANAGE_ADS: 'channel:manage:ads'>#
USER_WRITE_CHAT = <AuthScope.USER_WRITE_CHAT: 'user:write:chat'>#
USER_READ_MODERATED_CHANNELS = <AuthScope.USER_READ_MODERATED_CHANNELS: 'user:read:moderated_channels'>#
USER_READ_EMOTES = <AuthScope.USER_READ_EMOTES: 'user:read:emotes'>#
enum twitchAPI.type.ModerationEventType(value)#

Bases: Enum

Enum of moderation event types

Valid values are as follows:

BAN = <ModerationEventType.BAN: 'moderation.user.ban'>#
UNBAN = <ModerationEventType.UNBAN: 'moderation.user.unban'>#
UNKNOWN = <ModerationEventType.UNKNOWN: ''>#
enum twitchAPI.type.TimePeriod(value)#

Bases: Enum

Enum of valid Time periods

Valid values are as follows:

ALL = <TimePeriod.ALL: 'all'>#
DAY = <TimePeriod.DAY: 'day'>#
WEEK = <TimePeriod.WEEK: 'week'>#
MONTH = <TimePeriod.MONTH: 'month'>#
YEAR = <TimePeriod.YEAR: 'year'>#
enum twitchAPI.type.SortMethod(value)#

Bases: Enum

Enum of valid sort methods

Valid values are as follows:

TIME = <SortMethod.TIME: 'time'>#
TRENDING = <SortMethod.TRENDING: 'trending'>#
VIEWS = <SortMethod.VIEWS: 'views'>#
enum twitchAPI.type.HypeTrainContributionMethod(value)#

Bases: Enum

Enum of valid Hype Train contribution types

Valid values are as follows:

BITS = <HypeTrainContributionMethod.BITS: 'BITS'>#
SUBS = <HypeTrainContributionMethod.SUBS: 'SUBS'>#
OTHER = <HypeTrainContributionMethod.OTHER: 'OTHER'>#
UNKNOWN = <HypeTrainContributionMethod.UNKNOWN: ''>#
enum twitchAPI.type.VideoType(value)#

Bases: Enum

Enum of valid video types

Valid values are as follows:

ALL = <VideoType.ALL: 'all'>#
UPLOAD = <VideoType.UPLOAD: 'upload'>#
ARCHIVE = <VideoType.ARCHIVE: 'archive'>#
HIGHLIGHT = <VideoType.HIGHLIGHT: 'highlight'>#
UNKNOWN = <VideoType.UNKNOWN: ''>#
enum twitchAPI.type.AuthType(value)#

Bases: Enum

Type of authentication required. Only internal use

Valid values are as follows:

NONE = <AuthType.NONE: 0>#
USER = <AuthType.USER: 1>#
APP = <AuthType.APP: 2>#
EITHER = <AuthType.EITHER: 3>#
enum twitchAPI.type.StatusCode(value)#

Bases: Enum

Enum Code Status, see https://dev.twitch.tv/docs/api/reference#get-code-status for more documentation

Valid values are as follows:

SUCCESSFULLY_REDEEMED = <StatusCode.SUCCESSFULLY_REDEEMED: 'SUCCESSFULLY_REDEEMED'>#
ALREADY_CLAIMED = <StatusCode.ALREADY_CLAIMED: 'ALREADY_CLAIMED'>#
EXPIRED = <StatusCode.EXPIRED: 'EXPIRED'>#
USER_NOT_ELIGIBLE = <StatusCode.USER_NOT_ELIGIBLE: 'USER_NOT_ELIGIBLE'>#
NOT_FOUND = <StatusCode.NOT_FOUND: 'NOT_FOUND'>#
INACTIVE = <StatusCode.INACTIVE: 'INACTIVE'>#
UNUSED = <StatusCode.UNUSED: 'UNUSED'>#
INCORRECT_FORMAT = <StatusCode.INCORRECT_FORMAT: 'INCORRECT_FORMAT'>#
INTERNAL_ERROR = <StatusCode.INTERNAL_ERROR: 'INTERNAL_ERROR'>#
UNKNOWN_VALUE = <StatusCode.UNKNOWN_VALUE: ''>#
enum twitchAPI.type.PubSubResponseError(value)#

Bases: Enum

Valid values are as follows:

BAD_MESSAGE = <PubSubResponseError.BAD_MESSAGE: 'ERR_BADMESSAGE'>#
BAD_AUTH = <PubSubResponseError.BAD_AUTH: 'ERR_BADAUTH'>#
SERVER = <PubSubResponseError.SERVER: 'ERR_SERVER'>#
BAD_TOPIC = <PubSubResponseError.BAD_TOPIC: 'ERR_BADTOPIC'>#
NONE = <PubSubResponseError.NONE: ''>#
UNKNOWN = <PubSubResponseError.UNKNOWN: 'unknown error'>#
enum twitchAPI.type.CustomRewardRedemptionStatus(value)#

Bases: Enum

Valid values are as follows:

UNFULFILLED = <CustomRewardRedemptionStatus.UNFULFILLED: 'UNFULFILLED'>#
FULFILLED = <CustomRewardRedemptionStatus.FULFILLED: 'FULFILLED'>#
CANCELED = <CustomRewardRedemptionStatus.CANCELED: 'CANCELED'>#
enum twitchAPI.type.SortOrder(value)#

Bases: Enum

Valid values are as follows:

OLDEST = <SortOrder.OLDEST: 'OLDEST'>#
NEWEST = <SortOrder.NEWEST: 'NEWEST'>#
enum twitchAPI.type.BlockSourceContext(value)#

Bases: Enum

Valid values are as follows:

CHAT = <BlockSourceContext.CHAT: 'chat'>#
WHISPER = <BlockSourceContext.WHISPER: 'whisper'>#
enum twitchAPI.type.BlockReason(value)#

Bases: Enum

Valid values are as follows:

SPAM = <BlockReason.SPAM: 'spam'>#
HARASSMENT = <BlockReason.HARASSMENT: 'harassment'>#
OTHER = <BlockReason.OTHER: 'other'>#
enum twitchAPI.type.EntitlementFulfillmentStatus(value)#

Bases: Enum

Valid values are as follows:

CLAIMED = <EntitlementFulfillmentStatus.CLAIMED: 'CLAIMED'>#
FULFILLED = <EntitlementFulfillmentStatus.FULFILLED: 'FULFILLED'>#
enum twitchAPI.type.PollStatus(value)#

Bases: Enum

Valid values are as follows:

ACTIVE = <PollStatus.ACTIVE: 'ACTIVE'>#
COMPLETED = <PollStatus.COMPLETED: 'COMPLETED'>#
MODERATED = <PollStatus.MODERATED: 'MODERATED'>#
INVALID = <PollStatus.INVALID: 'INVALID'>#
TERMINATED = <PollStatus.TERMINATED: 'TERMINATED'>#
ARCHIVED = <PollStatus.ARCHIVED: 'ARCHIVED'>#
enum twitchAPI.type.PredictionStatus(value)#

Bases: Enum

Valid values are as follows:

ACTIVE = <PredictionStatus.ACTIVE: 'ACTIVE'>#
RESOLVED = <PredictionStatus.RESOLVED: 'RESOLVED'>#
CANCELED = <PredictionStatus.CANCELED: 'CANCELED'>#
LOCKED = <PredictionStatus.LOCKED: 'LOCKED'>#
enum twitchAPI.type.AutoModAction(value)#

Bases: Enum

Valid values are as follows:

ALLOW = <AutoModAction.ALLOW: 'ALLOW'>#
DENY = <AutoModAction.DENY: 'DENY'>#
class twitchAPI.type.AutoModCheckEntry#

Bases: TypedDict

msg_id: str#

Developer-generated identifier for mapping messages to results.

msg_text: str#

Message text

__init__(*args, **kwargs)#
__new__(**kwargs)#
clear() None.  Remove all items from D.#
copy() a shallow copy of D#
fromkeys(value=None, /)#

Create a new dictionary with keys from iterable and values set to value.

get(key, default=None, /)#

Return the value for key if key is in the dictionary, else default.

items() a set-like object providing a view on D's items#
keys() a set-like object providing a view on D's keys#
pop(k[, d]) v, remove specified key and return the corresponding value.#

If key is not found, d is returned if given, otherwise KeyError is raised

popitem()#

Remove and return a (key, value) pair as a 2-tuple.

Pairs are returned in LIFO (last-in, first-out) order. Raises KeyError if the dict is empty.

setdefault(key, default=None, /)#

Insert key with a value of default if key is not in the dictionary.

Return the value for key if key is in the dictionary, else default.

update([E, ]**F) None.  Update D from dict/iterable E and F.#

If E is present and has a .keys() method, then does: for k in E: D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]

values() an object providing a view on D's values#
enum twitchAPI.type.DropsEntitlementFulfillmentStatus(value)#

Bases: Enum

Valid values are as follows:

CLAIMED = <DropsEntitlementFulfillmentStatus.CLAIMED: 'CLAIMED'>#
FULFILLED = <DropsEntitlementFulfillmentStatus.FULFILLED: 'FULFILLED'>#
enum twitchAPI.type.ChatEvent(value)#

Bases: Enum

Represents the possible events to listen for using register_event()

Valid values are as follows:

READY = <ChatEvent.READY: 'ready'>#
MESSAGE = <ChatEvent.MESSAGE: 'message'>#
SUB = <ChatEvent.SUB: 'sub'>#
RAID = <ChatEvent.RAID: 'raid'>#
ROOM_STATE_CHANGE = <ChatEvent.ROOM_STATE_CHANGE: 'room_state_change'>#
JOIN = <ChatEvent.JOIN: 'join'>#
JOINED = <ChatEvent.JOINED: 'joined'>#
LEFT = <ChatEvent.LEFT: 'left'>#
USER_LEFT = <ChatEvent.USER_LEFT: 'user_left'>#
MESSAGE_DELETE = <ChatEvent.MESSAGE_DELETE: 'message_delete'>#
CHAT_CLEARED = <ChatEvent.CHAT_CLEARED: 'chat_cleared'>#
WHISPER = <ChatEvent.WHISPER: 'whisper'>#
NOTICE = <ChatEvent.NOTICE: 'notice'>#
class twitchAPI.type.ChatRoom#

Bases: object

ChatRoom(name: str, is_emote_only: bool, is_subs_only: bool, is_followers_only: bool, is_unique_only: bool, follower_only_delay: int, room_id: str, slow: int)

name: str#
is_emote_only: bool#
is_subs_only: bool#
is_followers_only: bool#
is_unique_only: bool#
follower_only_delay: int#
room_id: str#
slow: int#
__init__(name, is_emote_only, is_subs_only, is_followers_only, is_unique_only, follower_only_delay, room_id, slow)#
exception twitchAPI.type.TwitchAPIException#

Bases: Exception

Base Twitch API Exception

__init__(*args, **kwargs)#
__new__(**kwargs)#
args#
with_traceback()#

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception twitchAPI.type.InvalidRefreshTokenException#

Bases: TwitchAPIException

used User Refresh Token is invalid

__init__(*args, **kwargs)#
__new__(**kwargs)#
args#
with_traceback()#

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception twitchAPI.type.InvalidTokenException#

Bases: TwitchAPIException

Used if a invalid token is set for the client

__init__(*args, **kwargs)#
__new__(**kwargs)#
args#
with_traceback()#

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception twitchAPI.type.NotFoundException#

Bases: TwitchAPIException

Resource was not found with the given parameter

__init__(*args, **kwargs)#
__new__(**kwargs)#
args#
with_traceback()#

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception twitchAPI.type.TwitchAuthorizationException#

Bases: TwitchAPIException

Exception in the Twitch Authorization

__init__(*args, **kwargs)#
__new__(**kwargs)#
args#
with_traceback()#

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception twitchAPI.type.UnauthorizedException#

Bases: TwitchAuthorizationException

Not authorized to use this

__init__(*args, **kwargs)#
__new__(**kwargs)#
args#
with_traceback()#

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception twitchAPI.type.MissingScopeException#

Bases: TwitchAuthorizationException

authorization is missing scope

__init__(*args, **kwargs)#
__new__(**kwargs)#
args#
with_traceback()#

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception twitchAPI.type.TwitchBackendException#

Bases: TwitchAPIException

when the Twitch API itself is down

__init__(*args, **kwargs)#
__new__(**kwargs)#
args#
with_traceback()#

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception twitchAPI.type.PubSubListenTimeoutException#

Bases: TwitchAPIException

when a a PubSub listen command times out

__init__(*args, **kwargs)#
__new__(**kwargs)#
args#
with_traceback()#

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception twitchAPI.type.MissingAppSecretException#

Bases: TwitchAPIException

When the app secret is not set but app authorization is attempted

__init__(*args, **kwargs)#
__new__(**kwargs)#
args#
with_traceback()#

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception twitchAPI.type.EventSubSubscriptionTimeout#

Bases: TwitchAPIException

When the waiting for a confirmed EventSub subscription timed out

__init__(*args, **kwargs)#
__new__(**kwargs)#
args#
with_traceback()#

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception twitchAPI.type.EventSubSubscriptionConflict#

Bases: TwitchAPIException

When you try to subscribe to a EventSub subscription that already exists

__init__(*args, **kwargs)#
__new__(**kwargs)#
args#
with_traceback()#

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception twitchAPI.type.EventSubSubscriptionError#

Bases: TwitchAPIException

if the subscription request was invalid

__init__(*args, **kwargs)#
__new__(**kwargs)#
args#
with_traceback()#

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception twitchAPI.type.DeprecatedError#

Bases: TwitchAPIException

If something has been marked as deprecated by the Twitch API

__init__(*args, **kwargs)#
__new__(**kwargs)#
args#
with_traceback()#

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception twitchAPI.type.TwitchResourceNotFound#

Bases: TwitchAPIException

If a requested resource was not found

__init__(*args, **kwargs)#
__new__(**kwargs)#
args#
with_traceback()#

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception twitchAPI.type.ForbiddenError#

Bases: TwitchAPIException

If you are not allowed to do that

__init__(*args, **kwargs)#
__new__(**kwargs)#
args#
with_traceback()#

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.