Skip to content

Commit

Permalink
[Def] Parse message replies too
Browse files Browse the repository at this point in the history
  • Loading branch information
Twentysix26 committed Jun 9, 2023
1 parent 095e621 commit de8f67e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions defender/core/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
import logging
import asyncio

ALLOWED_MESSAGE_TYPES = (MessageType.default, MessageType.reply)

log = logging.getLogger("red.x26cogs.defender")

class Events(MixinMeta, metaclass=CompositeMetaClass): # type: ignore
Expand All @@ -42,7 +44,7 @@ async def on_message(self, message: discord.Message):
return
if author.bot:
return
if message.type != MessageType.default:
if message.type not in ALLOWED_MESSAGE_TYPES:
return
if not await self.config.guild(guild).enabled():
return
Expand Down Expand Up @@ -153,7 +155,7 @@ async def on_message_edit(self, message_before: discord.Message, message: discor
return
if author.bot:
return
if message.type != MessageType.default:
if message.type not in ALLOWED_MESSAGE_TYPES:
return
if message_before.content == message.content:
return
Expand Down Expand Up @@ -233,7 +235,7 @@ async def on_message_delete(self, message: discord.Message):
return
if author.bot:
return
if message.type != MessageType.default:
if message.type not in ALLOWED_MESSAGE_TYPES:
return

if not await self.config.guild(guild).enabled():
Expand Down

0 comments on commit de8f67e

Please sign in to comment.