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

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

* occurance 2
(cherry picked from commit d15011e2c5)

Co-authored-by: Kreus Amredes <67752638+Kreusada@users.noreply.github.com>

Co-authored-by: Kreus Amredes <67752638+Kreusada@users.noreply.github.com>
This commit is contained in:
Red-GitHubBot
2021-09-08 21:46:55 +02:00
committed by GitHub
parent a95d65c316
commit b9d9ae3103

View File

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