🐛 Fixed message deletion bug

Fixed bug where the bedreNetflix commands would delete the old response
instead of editing it
This commit is contained in:
NikolajDanger
2021-04-06 15:49:33 +02:00
parent bf9bdeb19c
commit cc0e65311f
2 changed files with 18 additions and 15 deletions

View File

@ -23,7 +23,7 @@ class EventHandler():
game = discord.Game("Use /help for commands")
await self.bot.change_presence(activity=game, status = discord.Status.online)
async def on_reaction_add(self, reaction, user):
async def on_reaction_add(self, reaction : discord.Reaction, user):
if user.bot == False:
message = reaction.message
channel = message.channel
@ -40,20 +40,21 @@ class EventHandler():
await self.bot.games.connectFour.placePiece(message, f"#{user.id}", column-1)
elif bedreNetflixMessage and addMovie:
moviePick = emojiToCommand(reaction.emoji)
await message.delete()
if moviePick == "none":
imdbID = None
else:
imdbID = imdbIds[moviePick-1]
await self.bot.other.bedreNetflix.addMovie(channel,imdbID)
await message.clear_reactions()
await self.bot.other.bedreNetflix.addMovie(message, imdbID)
elif bedreNetflixMessage and not addMovie:
showPick = emojiToCommand(reaction.emoji)
await message.delete()
if showPick == "none":
imdbName = None
else:
imdbName = imdbIds[showPick-1]
await self.bot.other.bedreNetflix.addShow(channel,imdbName)
await message.clear_reactions()
await self.bot.other.bedreNetflix.addShow(message, imdbName)
elif self.bot.databaseFuncs.hangmanReactionTest(channel, message, f"#{user.id}"):
self.bot.log("They reacted to the hangman message")
if ord(reaction.emoji) in range(127462,127488):