From 3e604a9816309c5b32655067bbee73e3d08c6a4e Mon Sep 17 00:00:00 2001 From: ramforth Date: Mon, 17 Nov 2025 17:41:32 +0100 Subject: [PATCH] event_messenger --- chat_listener.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/chat_listener.py b/chat_listener.py index 8102820..567de2d 100644 --- a/chat_listener.py +++ b/chat_listener.py @@ -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,