@@ -354,8 +354,8 @@ def __new__(cls, *args: Any, **kwargs: Any) -> Self:
354354 def __init__ (
355355 self ,
356356 func : Union [
357- Callable [Concatenate [CogT , ContextT , P ], Coro [T ]],
358- Callable [Concatenate [ContextT , P ], Coro [T ]],
357+ Callable [Concatenate [CogT , Context [ Any ] , P ], Coro [T ]],
358+ Callable [Concatenate [Context [ Any ] , P ], Coro [T ]],
359359 ],
360360 / ,
361361 ** kwargs : Any ,
@@ -399,7 +399,7 @@ def __init__(
399399 except AttributeError :
400400 checks = kwargs .get ('checks' , [])
401401
402- self .checks : List [UserCheck [ContextT ]] = checks
402+ self .checks : List [UserCheck [Context [ Any ] ]] = checks
403403
404404 try :
405405 cooldown = func .__commands_cooldown__
@@ -479,7 +479,7 @@ def callback(
479479
480480 self .params : Dict [str , Parameter ] = get_signature_parameters (function , globalns )
481481
482- def add_check (self , func : UserCheck [ContextT ], / ) -> None :
482+ def add_check (self , func : UserCheck [Context [ Any ] ], / ) -> None :
483483 """Adds a check to the command.
484484
485485 This is the non-decorator interface to :func:`.check`.
@@ -500,7 +500,7 @@ def add_check(self, func: UserCheck[ContextT], /) -> None:
500500
501501 self .checks .append (func )
502502
503- def remove_check (self , func : UserCheck [ContextT ], / ) -> None :
503+ def remove_check (self , func : UserCheck [Context [ Any ] ], / ) -> None :
504504 """Removes a check from the command.
505505
506506 This function is idempotent and will not raise an exception
@@ -1249,7 +1249,7 @@ async def can_run(self, ctx: Context[BotT], /) -> bool:
12491249 # since we have no checks, then we just return True.
12501250 return True
12511251
1252- return await discord .utils .async_all (predicate (ctx ) for predicate in predicates ) # type: ignore
1252+ return await discord .utils .async_all (predicate (ctx ) for predicate in predicates )
12531253 finally :
12541254 ctx .command = original
12551255
@@ -1448,7 +1448,7 @@ def command(
14481448 def command (
14491449 self : GroupMixin [CogT ],
14501450 name : str = ...,
1451- cls : Type [CommandT ] = ...,
1451+ cls : Type [CommandT ] = ..., # type: ignore # previous overload handles case where cls is not set
14521452 * args : Any ,
14531453 ** kwargs : Any ,
14541454 ) -> Callable [
@@ -1508,7 +1508,7 @@ def group(
15081508 def group (
15091509 self : GroupMixin [CogT ],
15101510 name : str = ...,
1511- cls : Type [GroupT ] = ...,
1511+ cls : Type [GroupT ] = ..., # type: ignore # previous overload handles case where cls is not set
15121512 * args : Any ,
15131513 ** kwargs : Any ,
15141514 ) -> Callable [
@@ -1700,7 +1700,7 @@ def command(
17001700@overload
17011701def command (
17021702 name : str = ...,
1703- cls : Type [CommandT ] = ...,
1703+ cls : Type [CommandT ] = ..., # type: ignore # previous overload handles case where cls is not set
17041704 ** attrs : Any ,
17051705) -> Callable [
17061706 [
@@ -1770,7 +1770,7 @@ def group(
17701770@overload
17711771def group (
17721772 name : str = ...,
1773- cls : Type [GroupT ] = ...,
1773+ cls : Type [GroupT ] = ..., # type: ignore # previous overload handles case where cls is not set
17741774 ** attrs : Any ,
17751775) -> Callable [
17761776 [
@@ -1878,9 +1878,9 @@ async def only_me(ctx):
18781878 The predicate to check if the command should be invoked.
18791879 """
18801880
1881- def decorator (func : Union [Command , CoroFunc ]) -> Union [Command , CoroFunc ]:
1881+ def decorator (func : Union [Command [ Any , ..., Any ], CoroFunc ]) -> Union [Command [ Any , ..., Any ] , CoroFunc ]:
18821882 if isinstance (func , Command ):
1883- func .checks .append (predicate )
1883+ func .checks .append (predicate ) # type: ignore
18841884 else :
18851885 if not hasattr (func , '__commands_checks__' ):
18861886 func .__commands_checks__ = []
0 commit comments