Swapping mapping for websocket return traffic

This commit is contained in:
2025-11-17 15:55:18 +01:00
parent 6b2d296774
commit 7f22cec452
2 changed files with 4 additions and 2 deletions

View File

@@ -2,8 +2,9 @@ from twitchio.ext import commands
from twitchio.web import AiohttpAdapter
class TwitchBot(commands.Bot):
def __init__(self, access_token: str, client_id: str, client_secret: str, bot_id: str, channel_name: str, websocket_manager):
def __init__(self, access_token: str, client_id: str, client_secret: str, bot_id: str, channel_name: str, websocket_manager, owner_id: int):
self.websocket_manager = websocket_manager
self.owner_id = owner_id
# Configure the internal web adapter to use a non-standard, high port
# to avoid conflicts during development and hot-reloading.

View File

@@ -30,7 +30,8 @@ class ListenerManager:
client_id=settings.TWITCH_CLIENT_ID,
client_secret=settings.TWITCH_CLIENT_SECRET,
bot_id=user.platform_user_id,
websocket_manager=websocket_manager
websocket_manager=websocket_manager,
owner_id=user.id
)
task = asyncio.create_task(bot.start())
self.active_listeners[user.id] = task