aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--discord/ext/commands/core.py14
1 files changed, 6 insertions, 8 deletions
diff --git a/discord/ext/commands/core.py b/discord/ext/commands/core.py
index 8c086603..20930408 100644
--- a/discord/ext/commands/core.py
+++ b/discord/ext/commands/core.py
@@ -657,13 +657,6 @@ class Command(_BaseCommand):
if not view.eof:
raise TooManyArguments('Too many arguments passed to ' + self.qualified_name)
- async def _verify_checks(self, ctx):
- if not self.enabled:
- raise DisabledCommand('{0.name} command is disabled'.format(self))
-
- if not await self.can_run(ctx):
- raise CheckFailure('The check functions for command {0.qualified_name} failed.'.format(self))
-
async def call_before_hooks(self, ctx):
# now that we're done preparing we can call the pre-command hooks
# first, call the command local hook:
@@ -713,7 +706,9 @@ class Command(_BaseCommand):
async def prepare(self, ctx):
ctx.command = self
- await self._verify_checks(ctx)
+
+ if not await self.can_run(ctx):
+ raise CheckFailure('The check functions for command {0.qualified_name} failed.'.format(self))
if self.cooldown_after_parsing:
await self._parse_arguments(ctx)
@@ -950,6 +945,9 @@ class Command(_BaseCommand):
A boolean indicating if the command can be invoked.
"""
+ if not self.enabled:
+ raise DisabledCommand('{0.name} command is disabled'.format(self))
+
original = ctx.command
ctx.command = self