mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-10-24 18:13:00 +00:00
Correct ClientException message raised in invocation hooks.
For when the hooks are not coroutines.
This commit is contained in:
@@ -387,7 +387,7 @@ class BotBase(GroupMixin):
|
|||||||
The coroutine is not actually a coroutine.
|
The coroutine is not actually a coroutine.
|
||||||
"""
|
"""
|
||||||
if not asyncio.iscoroutinefunction(coro):
|
if not asyncio.iscoroutinefunction(coro):
|
||||||
raise discord.ClientException('The error handler must be a coroutine.')
|
raise discord.ClientException('The pre-invoke hook must be a coroutine.')
|
||||||
|
|
||||||
self._before_invoke = coro
|
self._before_invoke = coro
|
||||||
return coro
|
return coro
|
||||||
@@ -420,7 +420,7 @@ class BotBase(GroupMixin):
|
|||||||
The coroutine is not actually a coroutine.
|
The coroutine is not actually a coroutine.
|
||||||
"""
|
"""
|
||||||
if not asyncio.iscoroutinefunction(coro):
|
if not asyncio.iscoroutinefunction(coro):
|
||||||
raise discord.ClientException('The error handler must be a coroutine.')
|
raise discord.ClientException('The post-invoke hook must be a coroutine.')
|
||||||
|
|
||||||
self._after_invoke = coro
|
self._after_invoke = coro
|
||||||
return coro
|
return coro
|
||||||
|
|||||||
@@ -612,7 +612,7 @@ class Command:
|
|||||||
The coroutine is not actually a coroutine.
|
The coroutine is not actually a coroutine.
|
||||||
"""
|
"""
|
||||||
if not asyncio.iscoroutinefunction(coro):
|
if not asyncio.iscoroutinefunction(coro):
|
||||||
raise discord.ClientException('The error handler must be a coroutine.')
|
raise discord.ClientException('The pre-invoke hook must be a coroutine.')
|
||||||
|
|
||||||
self._before_invoke = coro
|
self._before_invoke = coro
|
||||||
return coro
|
return coro
|
||||||
@@ -639,7 +639,7 @@ class Command:
|
|||||||
The coroutine is not actually a coroutine.
|
The coroutine is not actually a coroutine.
|
||||||
"""
|
"""
|
||||||
if not asyncio.iscoroutinefunction(coro):
|
if not asyncio.iscoroutinefunction(coro):
|
||||||
raise discord.ClientException('The error handler must be a coroutine.')
|
raise discord.ClientException('The post-invoke hook must be a coroutine.')
|
||||||
|
|
||||||
self._after_invoke = coro
|
self._after_invoke = coro
|
||||||
return coro
|
return coro
|
||||||
|
|||||||
Reference in New Issue
Block a user