🐛 Fixed clear reactions bug

Gwendolyn used to throw an error when trying to remove messages from
DMs. Now she just doesn't try :thumbs-up:
This commit is contained in:
NikolajDanger
2021-04-12 15:37:34 +02:00
parent 78d8575e15
commit 648308831d
2 changed files with 40 additions and 9 deletions

View File

@ -50,16 +50,26 @@ class EventHandler():
imdbID = None
else:
imdbID = imdbIds[moviePick-1]
await message.clear_reactions()
await self.bot.other.bedreNetflix.addMovie(message, imdbID)
if isinstance(channel, discord.DMChannel):
await message.delete()
await self.bot.other.bedreNetflix.addMovie(message, imdbID, False)
else:
await message.clear_reactions()
await self.bot.other.bedreNetflix.addMovie(message, imdbID)
elif bedreNetflixMessage and not addMovie:
showPick = emojiToCommand(reaction.emoji)
if showPick == "none":
imdbName = None
else:
imdbName = imdbIds[showPick-1]
await message.clear_reactions()
await self.bot.other.bedreNetflix.addShow(message, imdbName)
if isinstance(channel, discord.DMChannel):
await message.delete()
await self.bot.other.bedreNetflix.addShow(message, imdbName, False)
else:
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")