[commands] Raise CheckFailure if all bot "check once" fail

Fix #2643
This commit is contained in:
Rapptz 2020-04-06 21:45:16 -04:00
parent 8874aa3dd2
commit 874c2cd3c9

View File

@ -890,6 +890,8 @@ class BotBase(GroupMixin):
try:
if await self.can_run(ctx, call_once=True):
await ctx.command.invoke(ctx)
else:
raise errors.CheckFailure('The global check once functions failed.')
except errors.CommandError as exc:
await ctx.command.dispatch_error(ctx, exc)
else: