Skip to content

Commit

Permalink
thanks now reponds to ty and apollo
Browse files Browse the repository at this point in the history
  • Loading branch information
Mole1424 committed Oct 12, 2023
1 parent 8bd8dcd commit 48998c7
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions cogs/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ async def on_message(self, message: Message):
)
if reply:
await message.channel.send(reply)
elif "th" in message.content.lower():
elif "t" in message.content.lower():
# if maybe some kind of thanks, process it
await self.process_thanks(message)

Expand All @@ -82,10 +82,13 @@ async def process_thanks(self, message: Message):
previous_message = [
message async for message in message.channel.history(limit=2)
][1]
if previous_message.author.id != self.bot.user.id:
if (
previous_message.author.id != self.bot.user.id
and "apollo" not in message.content.lower()
):
# can only thank replies to bot
return
thanks = ["thx", "thanks", "thank you"]
thanks = ["thx", "thanks", "thank you", "ty"]
if not any(word in message.content.lower() for word in thanks):
# not a thank you
return
Expand Down

0 comments on commit 48998c7

Please sign in to comment.