A Python 3.7 compatible implementation of the Twitch API, EventSub, PubSub and Chat
Twitch.get_stream_key()
(thanks @moralrecordings )EventSubWebsocket.stop()
not raising RuntimeException when called and socket not running.AuthScope.USER_WRITE_CHAT
AuthScope.CHANNEL_READ_ADS
AuthScope.CHANNEL_MANAGE_ADS
AuthScope.USER_READ_MODERATED_CHANNELS
Duplicate Webhook messages will now be ignored
EventSub will now recover properly from a disconnect when auth token is expired
Added the following new Topics:
Removed the deprecated version 1 of topic "Channel Follow"
ChatMessage.is_me
flag/me
chat commandAuthScope.CHANNEL_BOT
AuthScope.USER_BOT
AuthScope.USER_READ_CHAT
This is a major release, please see https://pytwitchapi.dev/en/v4.0.0/v4-migration.html for a migration guide!
UserAuthenticationStorageHelper
to cut down on common boilerplate code, check out https://pytwitchapi.dev/en/v4.0.0/tutorial/reuse-user-token.html for more infoAdded new fields ChannelInformation.is_branded_content
and ChannelInformation.content_classification_labels
to response of get_channel_information()
Added new parameters modify_channel_information.is_branded_content
and modify_channel_information.content_classification_labels
to modify_channel_information()
Added new Endpoint "Get Content Classification Labels" get_content_classification_labels()
Removed the following deprecated Endpoints:
get_polls()
now allows up to 20 poll IDs
get_channel_followers()
can now also be used without the required Scope or just with App Authentication
Added new parameter get_clips.is_featured
to get_clips()
and added object.api.Clip.is_featured
to result.
twitchAPI.eventsub
to new package twitchAPI.eventsub.webhook
and renamed it to EventSubWebhook
EventSubWebsocket
object.base.TwitchObject
based Payloads instead of raw dictionaries. See :ref:eventsub-available-topics
for a list of all available PayloadsEventSubBase.listen_channel_update_v2()
EventSubWebhook
to specify a asyncio loop via EventSubWebhook.callback_loop
in which to run all callbacks inEventSubWebsocket
to specify a asyncio loop via EventSubWebsocket.callback_loop
in which to run all callbacks in/
in EventSubWebhook.callback_url
if presentEventSubWebhook
EventSubWebhook
more easily mockable via twitch-cli
by adding EventSubWebhook.subscription_url
EventSubWebhook.revocation_handler
to EventSubWebhook
pubsub.PubSub.callback_loop
in which to run all callbacks inAdded Chat Command Middleware, a way to decide if a command should run, see https://pytwitchapi.dev/en/v4.0.0/tutorial/chat-use-middleware.html for more info.
Added the following default Chat Command Middleware:
ChannelRestriction
UserRestriction
StreamerOnly
ChannelCommandCooldown
ChannelUserCommandCooldown
GlobalCommandCooldown
Added option to specify a asyncio loop via callback_loop
in which to run all callbacks in
Fixed errors raised in callbacks not being properly reported
Added Hype Chat related fields to ChatMessage
Improved logging
Fixed KeyError when encountering some Notice events
Added new reply tags ChatMessage.reply_thread_parent_msg_id
and ChatMessage.reply_thread_parent_user_login
to ChatMessage
Reconnects no longer duplicate the channel join list
Chat.start()
now thows an error should Chat() not have been awaited
UserAuthenticationStorageHelper
, a easy plug and play way to generate user auth tokens only on demandtwitch-cli
AsyncIterTwitchObject.current_cursor()
twitchAPI.types
to twitchAPI.type
twitchAPI.object
to twitchAPI.object.api
twitchAPI
emote_mode
to response of Twitch.get_chat_settings()
and Twitch.update_chat_settings()
(https://github.com/Teekeks/pyTwitchAPI/issues/234)AttributeError: 'NoneType' object has no attribute 'get'
in NoticeEvent during reconnectChat.set_channel_prefix()
to set a custom prefix for the given channel(s)Chat.reset_channel_prefix()
to remove a custom set prefix for the given channel(s)Added new ChatBadgeVersion
related fields to the following Endpoints: (Thanks @stolenvw )
Twitch.get_chat_badges()
Twitch.get_global_chat_badges()
Twitch.set_user_authentication()
now tries to refresh the given token set if it seems to be out of date
removed the following deprecated endpoints:
Fixed condition logic when parameter first
was given for the following Endpoints:
Twitch.get_chatters()
(Thanks @d7415 )Twitch.get_soundtrack_playlist()
Twitch.get_soundtrack_playlists()
Added the following new Endpoints:
Twitch.get_channel_followers()
Twitch.get_followed_channels()
Fixed TypeError: __api_get_request() got an unexpected keyword argument 'body' (Thanks @JC-Chung )
EventSub.listen_channel_follow_v2()
Chat.is_subscriber()
(Thanks @stolenvw )ChatEvent.NOTICE
- Triggered when server sends a notice message (Thanks @stolenvw )Twitch.send_a_shoutout()
Twitch.get_users_follows()
is now marked as deprecatedtype
to Twitch.get_streams()
limit()
, with this you can limit the amount of results returned from the given AsyncGenerator to a maximum numberEventSub.listen_channel_shoutout_create()
EventSub.listen_channel_shoutout_receive()
PubSub.listen_low_trust_users()
Chat.join_room()
when joining multiple rooms per callChat.join_room()
Chat.leave_room()
Chat.is_mod()
Chat.send_message()
initial_channel
to Chat.__init__()
, with this you can auto join channels on bot startupChat.is_in_room()
Chat.log_no_registered_command_handler
, with this you can control if the "no registered handler for event" warnings should be logged or notAuthScope.MODERATOR_MANAGE_SHOUTOUTS
AuthScope.MODERATOR_READ_SHOUTOUTS
AuthScope.MODERATOR_READ_FOLLOWERS
UserAuthenticator
Twitch.get_automod_settings()
Twitch.update_automod_settings()
Twitch.session_timeout
config. With this you can optionally change the timeout behavior across the entire libraryMODERATOR_READ_AUTOMOD_SETTINGS
MODERATOR_MANAGE_AUTOMOD_SETTINGS