Skip to content

Commit

Permalink
accept all variants of roll commands from mudae
Browse files Browse the repository at this point in the history
  • Loading branch information
mralext20 committed Jul 3, 2024
1 parent 1c8d33a commit 622c38c
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions alexBot/cogs/mudae.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
MENTION_ROLE = 1251159714532691979
MUDAE_BOT = 432610292342587392


# result of the bash expansion for `{m,h,w}{,x,g,b,a}`
ROLL_COMMANDS = "m mx mg mb ma h hx hg hb ha w wx wg wb wa".split()

SERIES_REGEX = regex.compile(r'\*\*\d{1,3} - (.+)\*\*')


Expand Down Expand Up @@ -144,18 +148,11 @@ async def on_message(self, message: discord.Message):
if message.channel.id != PRIMARY_COMMAND_CHANNEL:
return
rolling_message = False
if message.content.lower() in ["$m", "$mg", "$ma"]:
if message.content.lower()[1:] in ROLL_COMMANDS:
self.bot.loop.create_task(self.message_series_detector(message))
rolling_message = True
elif (
message.author.id == MUDAE_BOT
and message.interaction
and message.interaction.name
in [
"mx",
"mg",
"ma",
]
message.author.id == MUDAE_BOT and message.interaction and message.interaction.name in ROLL_COMMANDS
): # if mudae posts a message from an interaction for the slash command versions of the mudae commands, do the things too
self.bot.loop.create_task(self.message_series_detector(message, actual_message=message))
rolling_message = True
Expand Down

0 comments on commit 622c38c

Please sign in to comment.