[Downloader] Suppress NotFound errors in [p]cog update command (#5109)

* [Downloader] Suppress NotFound errors when cog update message is deleted

* occurance 2
This commit is contained in:
Kreus Amredes 2021-08-31 22:19:15 +01:00 committed by GitHub
parent f05debc923
commit d15011e2c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1652,11 +1652,13 @@ class Downloader(commands.Cog):
try:
await ctx.bot.wait_for(event, check=pred, timeout=30)
except asyncio.TimeoutError:
with contextlib.suppress(discord.NotFound):
await query.delete()
return
if not pred.result:
if can_react:
with contextlib.suppress(discord.NotFound):
await query.delete()
else:
await ctx.send(_("OK then."))