|
|
|
@ -427,7 +427,7 @@ class Command(_BaseCommand, Generic[CogT, P, T]): |
|
|
|
/, |
|
|
|
**kwargs: Unpack[_CommandKwargs], |
|
|
|
) -> None: |
|
|
|
if not asyncio.iscoroutinefunction(func): |
|
|
|
if not discord.utils._iscoroutinefunction(func): |
|
|
|
raise TypeError('Callback must be a coroutine.') |
|
|
|
|
|
|
|
name = kwargs.get('name') or func.__name__ |
|
|
|
@ -1102,7 +1102,7 @@ class Command(_BaseCommand, Generic[CogT, P, T]): |
|
|
|
The coroutine passed is not actually a coroutine. |
|
|
|
""" |
|
|
|
|
|
|
|
if not asyncio.iscoroutinefunction(coro): |
|
|
|
if not discord.utils._iscoroutinefunction(coro): |
|
|
|
raise TypeError('The error handler must be a coroutine.') |
|
|
|
|
|
|
|
self.on_error: Error[CogT, Any] = coro |
|
|
|
@ -1140,7 +1140,7 @@ class Command(_BaseCommand, Generic[CogT, P, T]): |
|
|
|
TypeError |
|
|
|
The coroutine passed is not actually a coroutine. |
|
|
|
""" |
|
|
|
if not asyncio.iscoroutinefunction(coro): |
|
|
|
if not discord.utils._iscoroutinefunction(coro): |
|
|
|
raise TypeError('The pre-invoke hook must be a coroutine.') |
|
|
|
|
|
|
|
self._before_invoke = coro |
|
|
|
@ -1171,7 +1171,7 @@ class Command(_BaseCommand, Generic[CogT, P, T]): |
|
|
|
TypeError |
|
|
|
The coroutine passed is not actually a coroutine. |
|
|
|
""" |
|
|
|
if not asyncio.iscoroutinefunction(coro): |
|
|
|
if not discord.utils._iscoroutinefunction(coro): |
|
|
|
raise TypeError('The post-invoke hook must be a coroutine.') |
|
|
|
|
|
|
|
self._after_invoke = coro |
|
|
|
|