diff options
| author | 2020-07-14 17:07:35 -0700 | |
|---|---|---|
| committer | 2020-07-14 17:24:06 -0700 | |
| commit | 867b561a6ce4aff85451d00794c22e02793c8dac (patch) | |
| tree | e71c3f3c6f49b8a636bf8245d4b8682ec5d9aa44 | |
| parent | Merge pull request #1032 from slushiegoose/sanitize-bot-output (diff) | |
Suppress NotFound when removing help cmd reactions
The message may be deleted somehow before the wait_for times out.
Fixes #1050
Fixes BOT-6X
| -rw-r--r-- | bot/cogs/help.py | 13 | 
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):  |