mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-06 11:18:54 -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)
|
pred = MessagePredicate.yes_or_no(ctx)
|
||||||
try:
|
try:
|
||||||
await self.bot.wait_for("message", check=pred, timeout=30)
|
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."))
|
await ctx.send(_("Response timed out, please try again later."))
|
||||||
return
|
return
|
||||||
if pred.result is True:
|
if pred.result is True:
|
||||||
@ -175,7 +175,7 @@ class CommandObj:
|
|||||||
resp = await self.bot.wait_for(
|
resp = await self.bot.wait_for(
|
||||||
"message", check=MessagePredicate.same_context(ctx), timeout=180
|
"message", check=MessagePredicate.same_context(ctx), timeout=180
|
||||||
)
|
)
|
||||||
except TimeoutError:
|
except asyncio.TimeoutError:
|
||||||
await ctx.send(_("Response timed out, please try again later."))
|
await ctx.send(_("Response timed out, please try again later."))
|
||||||
return
|
return
|
||||||
response = resp.content
|
response = resp.content
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user