Revert "Merge pull request #12" (#56)

This reverts commit 42c0a8d8a5.
This commit was merged in pull request #56.
This commit is contained in:
Gnome! authored and GitHub committed 2021-09-05 10:37:51 -07:00
1 parent 65640ddfc7
commit 53a6b2cb45
9 files changed
+84 -74

No files matched your search

+9 -7
View File
@@ -43,7 +43,6 @@ from .context import Context
from . import errors
from .help import HelpCommand, DefaultHelpCommand
from .cog import Cog
from discord.utils import raise_expected_coro
if TYPE_CHECKING:
import importlib.machinery
@@ -425,9 +424,11 @@ class BotBase(GroupMixin):
TypeError
The coroutine passed is not actually a coroutine.
"""
return raise_expected_coro(
coro, 'The pre-invoke hook must be a coroutine.'
)
if not asyncio.iscoroutinefunction(coro):
raise TypeError('The pre-invoke hook must be a coroutine.')
self._before_invoke = coro
return coro
def after_invoke(self, coro: CFT) -> CFT:
r"""A decorator that registers a coroutine as a post-invoke hook.
@@ -456,10 +457,11 @@ class BotBase(GroupMixin):
TypeError
The coroutine passed is not actually a coroutine.
"""
return raise_expected_coro(
coro, 'The post-invoke hook must be a coroutine.'
)
if not asyncio.iscoroutinefunction(coro):
raise TypeError('The post-invoke hook must be a coroutine.')
self._after_invoke = coro
return coro
# listener registration