Skip to content

Commit

Permalink
fixed false positives on thank you
Browse files Browse the repository at this point in the history
  • Loading branch information
Mole1424 committed Oct 13, 2023
1 parent 4773688 commit 23398f2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cogs/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,10 @@ async def process_thanks(self, message: Message):
# can only thank replies to bot
return
thanks = ["thx", "thanks", "thank you", "ty"]
if not any(word in message.content.lower() for word in thanks):
# not a thank you
# only heart if thanks matches word in message
if not any(
search(r"\b" + thank + r"\b", message.content.lower()) for thank in thanks
):
return
return await message.add_reaction("💜")

Expand Down

0 comments on commit 23398f2

Please sign in to comment.