Don't trigger on all replies

This commit is contained in:
Joakim Hellsén 2024-07-21 16:11:01 +02:00
commit 3f31c3ea4e
No known key found for this signature in database
GPG key ID: D196AE66FEBE1DC9

View file

@ -124,8 +124,8 @@ async def on_message(message: discord.Message) -> None:
if bot.user: if bot.user:
things_to_notify_on.extend((f"<@!{bot.user.id}>", f"<@{bot.user.id}>")) things_to_notify_on.extend((f"<@!{bot.user.id}>", f"<@{bot.user.id}>"))
# Only respond to messages that mention the bot or are a reply to a bot message # Only respond to messages that mention the bot
if any(thing.lower() in message_content for thing in things_to_notify_on) or message.reference: if any(thing.lower() in message_content for thing in things_to_notify_on):
if message.reference: if message.reference:
# Get the message that the current message is replying to # Get the message that the current message is replying to
message_id: int | None = message.reference.message_id message_id: int | None = message.reference.message_id