aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Dennis Pham <[email protected]>2020-07-14 22:23:05 -0400
committerGravatar GitHub <[email protected]>2020-07-14 22:23:05 -0400
commit5bc961d6052ddb3c05996cc09a974ba4068b930b (patch)
tree40f7459bb45ab17e40f208d527ce60bbeb7327d0
parentHelpChannels: remove cooldown info from available message (diff)
parentMerge branch 'master' into bug/info/1050/remove-help-reactions-404 (diff)
Merge pull request #1051 from python-discord/bug/info/1050/remove-help-reactions-404
Suppress NotFound when removing help command reactions
-rw-r--r--bot/cogs/help.py13
1 files changed, 6 insertions, 7 deletions
diff --git a/bot/cogs/help.py b/bot/cogs/help.py
index 832f6ea6b..70e62d590 100644
--- a/bot/cogs/help.py
+++ b/bot/cogs/help.py
@@ -36,13 +36,12 @@ async def help_cleanup(bot: Bot, author: Member, message: Message) -> None:
await message.add_reaction(DELETE_EMOJI)
- try:
- await bot.wait_for("reaction_add", check=check, timeout=300)
- await message.delete()
- except TimeoutError:
- await message.remove_reaction(DELETE_EMOJI, bot.user)
- except NotFound:
- pass
+ with suppress(NotFound):
+ try:
+ await bot.wait_for("reaction_add", check=check, timeout=300)
+ await message.delete()
+ except TimeoutError:
+ await message.remove_reaction(DELETE_EMOJI, bot.user)
class HelpQueryNotFound(ValueError):