@@ -365,7 +365,7 @@ async def prepare(self, ctx: ApplicationContext) -> None:
365
365
await self ._max_concurrency .release (ctx ) # type: ignore # ctx instead of non-existent message
366
366
raise
367
367
368
- def is_on_cooldown (self , ctx : ApplicationContext ) -> bool :
368
+ async def is_on_cooldown (self , ctx : ApplicationContext ) -> bool :
369
369
"""Checks whether the command is currently on cooldown.
370
370
371
371
.. note::
@@ -385,7 +385,7 @@ def is_on_cooldown(self, ctx: ApplicationContext) -> bool:
385
385
if not self ._buckets .valid :
386
386
return False
387
387
388
- bucket = self ._buckets .get_bucket (ctx ) # type: ignore
388
+ bucket = await self ._buckets .get_bucket (ctx ) # type: ignore
389
389
current = utcnow ().timestamp ()
390
390
return bucket .get_tokens (current ) == 0
391
391
@@ -920,9 +920,7 @@ def _match_option_param_names(self, params, options):
920
920
def _is_typing_union (self , annotation ):
921
921
return getattr (annotation , "__origin__" , None ) is Union or type (
922
922
annotation
923
- ) is getattr (
924
- types , "UnionType" , Union
925
- ) # type: ignore
923
+ ) is getattr (types , "UnionType" , Union ) # type: ignore
926
924
927
925
def _is_typing_optional (self , annotation ):
928
926
return self ._is_typing_union (annotation ) and type (None ) in annotation .__args__ # type: ignore
0 commit comments