aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRapptz <[email protected]>2020-12-17 22:17:49 -0500
committerRapptz <[email protected]>2020-12-17 22:21:45 -0500
commitf9dd200314440da738477ce3a22cfef6e0c63035 (patch)
tree6214715e7e928280ed75836ddd4b4fc06c4652c8
parentAdd versionadded string for Emoji.url_as (diff)
downloaddiscord.py-f9dd200314440da738477ce3a22cfef6e0c63035.tar.xz
discord.py-f9dd200314440da738477ce3a22cfef6e0c63035.zip
[commands] max_concurrency comes before cooldowns
Fix #6172
-rw-r--r--discord/ext/commands/core.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/discord/ext/commands/core.py b/discord/ext/commands/core.py
index fc1b932c..4f36ab9a 100644
--- a/discord/ext/commands/core.py
+++ b/discord/ext/commands/core.py
@@ -778,6 +778,9 @@ class Command(_BaseCommand):
if not await self.can_run(ctx):
raise CheckFailure('The check functions for command {0.qualified_name} failed.'.format(self))
+ if self._max_concurrency is not None:
+ await self._max_concurrency.acquire(ctx)
+
if self.cooldown_after_parsing:
await self._parse_arguments(ctx)
self._prepare_cooldowns(ctx)
@@ -785,9 +788,6 @@ class Command(_BaseCommand):
self._prepare_cooldowns(ctx)
await self._parse_arguments(ctx)
- if self._max_concurrency is not None:
- await self._max_concurrency.acquire(ctx)
-
await self.call_before_hooks(ctx)
def is_on_cooldown(self, ctx):