remove AIOhttp
This commit is contained in:
@@ -1,27 +1,22 @@
|
|||||||
from twitchio.ext import commands
|
from twitchio.ext import commands
|
||||||
from twitchio.web import AiohttpAdapter
|
|
||||||
|
|
||||||
class TwitchBot(commands.Bot):
|
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):
|
def __init__(self, access_token: str, client_id: str, client_secret: str, bot_id: str, channel_name: str, websocket_manager, db_user_id: int):
|
||||||
self.websocket_manager = websocket_manager
|
self.websocket_manager = websocket_manager
|
||||||
# Store our application's database user ID to avoid conflict with twitchio's internal 'owner_id'
|
# Store our application's database user ID to avoid conflict with twitchio's internal 'owner_id'
|
||||||
self.db_user_id = db_user_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__(
|
super().__init__(
|
||||||
token=access_token,
|
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
|
prefix='!', # A prefix is required but won't be used for reading chat
|
||||||
initial_channels=[channel_name],
|
initial_channels=[channel_name],
|
||||||
# These are now required by twitchio
|
# These are now required by twitchio
|
||||||
client_id=client_id,
|
client_id=client_id,
|
||||||
client_secret=client_secret,
|
client_secret=client_secret,
|
||||||
# The 'bot_id' is the Twitch ID of the user account the bot is running as
|
# 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
|
self.channel_name = channel_name
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user