diff --git a/chat_listener.py b/chat_listener.py index 433da6e..6ab5c97 100644 --- a/chat_listener.py +++ b/chat_listener.py @@ -6,8 +6,12 @@ class TwitchBot(twitchio.Client): # Store our application's database user ID to avoid conflict with twitchio's internal 'owner_id' self.db_user_id = db_user_id + # Per twitchio documentation, the token must be prefixed with 'oauth:'. + # This is a common cause of silent authentication failures. + formatted_token = f"oauth:{access_token}" + super().__init__( - token=access_token, + token=formatted_token, # The client_id and client_secret are required for the client to # identify itself with Twitch's services. client_id=client_id,