Skip to content

Commit

Permalink
Fixed spam checking null messages
Browse files Browse the repository at this point in the history
  • Loading branch information
yiays committed May 29, 2024
1 parent b0fb66b commit 80ff86a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions extensions/confessions.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,11 +194,11 @@ def check_image(self, guild_id:int, image:disnake.Attachment) -> bool:
return False
raise commands.BadArgument

def check_spam(self, content:str):
def check_spam(self, content:str | None):
""" Verify message doesn't contain spam as defined in [confessions] spam_flags """

for spamflag in self.config.get('spam_flags', fallback=None).splitlines():
if re.match(spamflag, content):
if content and re.match(spamflag, content):
return False
return True

Expand Down

0 comments on commit 80ff86a

Please sign in to comment.