event_messenger
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user