remove AIOhttp

This commit is contained in:
2025-11-17 18:22:12 +01:00
parent 9b7c9e8671
commit fdda47da7b

View File

@@ -1,5 +1,4 @@
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, db_user_id: int):
@@ -7,21 +6,17 @@ class TwitchBot(commands.Bot):
# Store our application's database user ID to avoid conflict with twitchio's internal 'owner_id'
self.db_user_id = db_user_id
# 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,
# Add the adapter first to ensure priority
web_server_adapter=adapter,
prefix='!', # A prefix is required but won't be used for reading chat
initial_channels=[channel_name],
# These are now required by twitchio
client_id=client_id,
client_secret=client_secret,
# The 'bot_id' is the Twitch ID of the user account the bot is running as
bot_id=bot_id, id=bot_id
bot_id=bot_id, id=bot_id,
# Explicitly disable the internal web server to prevent all port conflicts.
eventsub_url=None
)
self.channel_name = channel_name