Adding twitchio port 8123

This commit is contained in:
2025-11-17 15:47:23 +01:00
parent d1c4c931ef
commit 6b2d296774

View File

@@ -1,8 +1,14 @@
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):
self.websocket_manager = websocket_manager
# Configure the internal web adapter to use a non-standard, high port
# to avoid conflicts during development and hot-reloading.
adapter = AiohttpAdapter(host="localhost", port=8123)
super().__init__(
token=access_token,
prefix='!', # A prefix is required but won't be used for reading chat
@@ -13,9 +19,8 @@ class TwitchBot(commands.Bot):
# The 'bot_id' is the Twitch ID of the user account the bot is running as
bot_id=bot_id, id=bot_id,
# Explicitly disable the internal web server to prevent port conflicts
eventsub_url=None,
# Ensure no web adapter is initialized
web_adapter=None
# Pass our custom-configured adapter.
web_server_adapter=adapter
)
self.channel_name = channel_name