event_messenger

This commit is contained in:
2025-11-17 17:41:32 +01:00
parent 31f7e00538
commit 3e604a9816

View File

@@ -33,10 +33,14 @@ class TwitchBot(commands.Bot):
async def event_message(self, message: TwitchIOMessage):
"""Runs every time a message is sent in chat."""
# The 'echo' check is temporarily disabled to allow self-messaging for testing.
# if message.echo:
# return # Ignore messages sent by the bot itself
# This is CRITICAL when overriding a listener in commands.Bot
# to ensure the bot can still process commands if any are added.
await super().event_message(message)
# Ignore messages sent by the bot itself to prevent loops.
if message.echo:
return
# Prepare the message data to be sent to the frontend
chat_data = {
"author": message.author.name,