rework twitchIOMessage statement

This commit is contained in:
2025-11-17 17:59:47 +01:00
parent e7801287c2
commit 5806cb08e1

View File

@@ -1,6 +1,5 @@
from twitchio.ext import commands from twitchio.ext import commands
from twitchio.web import AiohttpAdapter from twitchio.web import AiohttpAdapter
from twitchio import Message as TwitchIOMessage
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):
@@ -31,7 +30,7 @@ class TwitchBot(commands.Bot):
"""Called once when the bot goes online.""" """Called once when the bot goes online."""
print(f"Listener ready for #{self.channel_name}") print(f"Listener ready for #{self.channel_name}")
async def event_message(self, message: TwitchIOMessage): async def event_message(self, message):
"""Runs every time a message is sent in chat.""" """Runs every time a message is sent in chat."""
# This is CRITICAL when overriding a listener in commands.Bot # This is CRITICAL when overriding a listener in commands.Bot
# to ensure the bot can still process commands if any are added. # to ensure the bot can still process commands if any are added.