event_messenger
This commit is contained in:
@@ -33,10 +33,14 @@ class TwitchBot(commands.Bot):
|
|||||||
|
|
||||||
async def event_message(self, message: TwitchIOMessage):
|
async def event_message(self, message: TwitchIOMessage):
|
||||||
"""Runs every time a message is sent in chat."""
|
"""Runs every time a message is sent in chat."""
|
||||||
# The 'echo' check is temporarily disabled to allow self-messaging for testing.
|
# This is CRITICAL when overriding a listener in commands.Bot
|
||||||
# if message.echo:
|
# to ensure the bot can still process commands if any are added.
|
||||||
# return # Ignore messages sent by the bot itself
|
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
|
# Prepare the message data to be sent to the frontend
|
||||||
chat_data = {
|
chat_data = {
|
||||||
"author": message.author.name,
|
"author": message.author.name,
|
||||||
|
|||||||
Reference in New Issue
Block a user