@@ -503,7 +503,7 @@ def error(self, coro):
503503 The coroutine passed is not actually a coroutine.
504504 """
505505
506- if not asyncio .iscoroutinefunction (coro ):
506+ if not inspect .iscoroutinefunction (coro ):
507507 raise TypeError ("The error handler must be a coroutine." )
508508
509509 self .on_error = coro
@@ -532,7 +532,7 @@ def before_invoke(self, coro):
532532 TypeError
533533 The coroutine passed is not actually a coroutine.
534534 """
535- if not asyncio .iscoroutinefunction (coro ):
535+ if not inspect .iscoroutinefunction (coro ):
536536 raise TypeError ("The pre-invoke hook must be a coroutine." )
537537
538538 self ._before_invoke = coro
@@ -557,7 +557,7 @@ def after_invoke(self, coro):
557557 TypeError
558558 The coroutine passed is not actually a coroutine.
559559 """
560- if not asyncio .iscoroutinefunction (coro ):
560+ if not inspect .iscoroutinefunction (coro ):
561561 raise TypeError ("The post-invoke hook must be a coroutine." )
562562
563563 self ._after_invoke = coro
@@ -734,7 +734,7 @@ def __new__(cls, *args, **kwargs) -> SlashCommand:
734734
735735 def __init__ (self , func : Callable , * args , ** kwargs ) -> None :
736736 super ().__init__ (func , ** kwargs )
737- if not asyncio .iscoroutinefunction (func ):
737+ if not inspect .iscoroutinefunction (func ):
738738 raise TypeError ("Callback must be a coroutine." )
739739 self .callback = func
740740
@@ -1125,7 +1125,7 @@ async def invoke_autocomplete_callback(self, ctx: AutocompleteContext):
11251125 else :
11261126 result = option .autocomplete (ctx )
11271127
1128- if asyncio .iscoroutinefunction (option .autocomplete ):
1128+ if inspect .iscoroutinefunction (option .autocomplete ):
11291129 result = await result
11301130
11311131 choices = [
@@ -1653,7 +1653,7 @@ def __new__(cls, *args, **kwargs) -> ContextMenuCommand:
16531653
16541654 def __init__ (self , func : Callable , * args , ** kwargs ) -> None :
16551655 super ().__init__ (func , ** kwargs )
1656- if not asyncio .iscoroutinefunction (func ):
1656+ if not inspect .iscoroutinefunction (func ):
16571657 raise TypeError ("Callback must be a coroutine." )
16581658 self .callback = func
16591659
0 commit comments