From ba480e8409b58d6031c67531504d483e73e978b8 Mon Sep 17 00:00:00 2001 From: ramforth Date: Thu, 25 Dec 2025 21:22:24 +0100 Subject: [PATCH] Working on: The Twitch authentication --- chat_listener.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/chat_listener.py b/chat_listener.py index bd4f0a1..20540f2 100644 --- a/chat_listener.py +++ b/chat_listener.py @@ -22,8 +22,10 @@ class TwitchBot(twitchio.Client): logger.info(f"DIAGNOSTIC: Initializing and connecting for user {self.db_user_id}...") # The sensitive __init__ call is now inside the awaitable task. - super().__init__(token=access_token, client_id=client_id, client_secret=client_secret, - refresh_token=refresh_token, initial_channels=[channel_name], ssl=True) + # FIX: Do not pass client_secret/refresh_token to super().__init__. + # This prevents twitchio from starting its internal web server (AiohttpAdapter) on port 4343, + # which causes "Address already in use" errors when multiple bots run. + super().__init__(token=access_token, client_id=client_id, initial_channels=[channel_name], ssl=True) self.channel_name = channel_name self.is_initialized = True