mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-06 03:08:55 -05:00
[customcom] properly catch TimeoutErrors
This commit is contained in:
parent
3e6a73ae8c
commit
7d6662e6b1
@ -164,7 +164,7 @@ class CommandObj:
|
||||
pred = MessagePredicate.yes_or_no(ctx)
|
||||
try:
|
||||
await self.bot.wait_for("message", check=pred, timeout=30)
|
||||
except TimeoutError:
|
||||
except asyncio.TimeoutError:
|
||||
await ctx.send(_("Response timed out, please try again later."))
|
||||
return
|
||||
if pred.result is True:
|
||||
@ -175,7 +175,7 @@ class CommandObj:
|
||||
resp = await self.bot.wait_for(
|
||||
"message", check=MessagePredicate.same_context(ctx), timeout=180
|
||||
)
|
||||
except TimeoutError:
|
||||
except asyncio.TimeoutError:
|
||||
await ctx.send(_("Response timed out, please try again later."))
|
||||
return
|
||||
response = resp.content
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user