Skip to content

Commit

Permalink
cleaned up keypad.py
Browse files Browse the repository at this point in the history
  • Loading branch information
nfearnley committed May 21, 2024
1 parent 723d68f commit 513caa1
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions sizebot/cogs/keypad.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from sizebot.lib.constants import emojis
from sizebot.lib.types import BotContext

inputdict = {
_inputdict = {
"1️⃣": "1",
"2️⃣": "2",
"3️⃣": "3",
Expand Down Expand Up @@ -38,10 +38,10 @@ async def keypad(self, ctx: BotContext):
def check(reaction: discord.Reaction, reacter: discord.Member | discord.User) -> bool:
return reaction.message.id == outputmsg.id \
and reacter.id == author.id \
and (str(reaction.emoji) in inputdict.keys()
and (str(reaction.emoji) in _inputdict.keys()
or str(reaction.emoji) == emojis.cancel)

for emoji in inputdict.keys():
for emoji in _inputdict.keys():
await outputmsg.add_reaction(emoji)
await outputmsg.add_reaction(emojis.cancel)

Expand All @@ -55,8 +55,8 @@ def check(reaction: discord.Reaction, reacter: discord.Member | discord.User) ->
listening = False
break

if str(reaction.emoji) in inputdict.keys():
await outputmsg.edit(content = outputmsg.content + inputdict[str(reaction.emoji)])
if str(reaction.emoji) in _inputdict.keys():
await outputmsg.edit(content = outputmsg.content + _inputdict[str(reaction.emoji)])
# PERMISSION: requires manage_messages
await reaction.remove(user)
if str(reaction.emoji) == emojis.cancel:
Expand Down

0 comments on commit 513caa1

Please sign in to comment.