mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-06 11:18:54 -05:00
[Mutes] Fix NotFound error when trying to delete message (#5163)
* [Mutes] Fix NotFound error when trying to delete message * other occurances
This commit is contained in:
parent
299d6c57d9
commit
c34f1e2f01
@ -1030,12 +1030,14 @@ class Mutes(VoiceMutes, commands.Cog, metaclass=CompositeMetaClass):
|
|||||||
try:
|
try:
|
||||||
await ctx.bot.wait_for(event, check=pred, timeout=30)
|
await ctx.bot.wait_for(event, check=pred, timeout=30)
|
||||||
except asyncio.TimeoutError:
|
except asyncio.TimeoutError:
|
||||||
await query.delete()
|
with contextlib.suppress(discord.NotFound):
|
||||||
|
await query.delete()
|
||||||
return False
|
return False
|
||||||
|
|
||||||
if not pred.result:
|
if not pred.result:
|
||||||
if can_react:
|
if can_react:
|
||||||
await query.delete()
|
with contextlib.suppress(discord.NotFound):
|
||||||
|
await query.delete()
|
||||||
else:
|
else:
|
||||||
await ctx.send(_("OK then."))
|
await ctx.send(_("OK then."))
|
||||||
|
|
||||||
@ -1242,12 +1244,14 @@ class Mutes(VoiceMutes, commands.Cog, metaclass=CompositeMetaClass):
|
|||||||
try:
|
try:
|
||||||
await ctx.bot.wait_for(event, check=pred, timeout=30)
|
await ctx.bot.wait_for(event, check=pred, timeout=30)
|
||||||
except asyncio.TimeoutError:
|
except asyncio.TimeoutError:
|
||||||
await query.delete()
|
with contextlib.suppress(discord.NotFound):
|
||||||
|
await query.delete()
|
||||||
return
|
return
|
||||||
|
|
||||||
if not pred.result:
|
if not pred.result:
|
||||||
if can_react:
|
if can_react:
|
||||||
await query.delete()
|
with contextlib.suppress(discord.NotFound):
|
||||||
|
await query.delete()
|
||||||
else:
|
else:
|
||||||
await ctx.send(_("OK then."))
|
await ctx.send(_("OK then."))
|
||||||
return
|
return
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user