aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--discord/ext/commands/bot.py18
-rw-r--r--discord/ext/commands/core.py18
2 files changed, 18 insertions, 18 deletions
diff --git a/discord/ext/commands/bot.py b/discord/ext/commands/bot.py
index 4b9c8e00..35667559 100644
--- a/discord/ext/commands/bot.py
+++ b/discord/ext/commands/bot.py
@@ -321,11 +321,11 @@ class BotBase(GroupMixin):
Raises
-------
- :exc:`.ClientException`
- The coroutine is not actually a coroutine.
+ TypeError
+ The coroutine passed is not actually a coroutine.
"""
if not asyncio.iscoroutinefunction(coro):
- raise discord.ClientException('The pre-invoke hook must be a coroutine.')
+ raise TypeError('The pre-invoke hook must be a coroutine.')
self._before_invoke = coro
return coro
@@ -354,11 +354,11 @@ class BotBase(GroupMixin):
Raises
-------
- :exc:`.ClientException`
- The coroutine is not actually a coroutine.
+ TypeError
+ The coroutine passed is not actually a coroutine.
"""
if not asyncio.iscoroutinefunction(coro):
- raise discord.ClientException('The post-invoke hook must be a coroutine.')
+ raise TypeError('The post-invoke hook must be a coroutine.')
self._after_invoke = coro
return coro
@@ -390,7 +390,7 @@ class BotBase(GroupMixin):
name = func.__name__ if name is None else name
if not asyncio.iscoroutinefunction(func):
- raise discord.ClientException('Listeners must be coroutines')
+ raise TypeError('Listeners must be coroutines')
if name in self.extra_events:
self.extra_events[name].append(func)
@@ -443,7 +443,7 @@ class BotBase(GroupMixin):
Raises
-------
- :exc:`.ClientException`
+ TypeError
The function being listened to is not a coroutine.
"""
@@ -720,7 +720,7 @@ class BotBase(GroupMixin):
def help_command(self, value):
if value is not None:
if not isinstance(value, HelpCommand):
- raise discord.ClientException('help_command must be a subclass of HelpCommand')
+ raise TypeError('help_command must be a subclass of HelpCommand')
if self._help_command is not None:
self._help_command._remove_from_bot(self)
self._help_command = value
diff --git a/discord/ext/commands/core.py b/discord/ext/commands/core.py
index 9f4ef00e..e0357f38 100644
--- a/discord/ext/commands/core.py
+++ b/discord/ext/commands/core.py
@@ -728,12 +728,12 @@ class Command(_BaseCommand):
Raises
-------
- discord.ClientException
- The coroutine is not actually a coroutine.
+ TypeError
+ The coroutine passed is not actually a coroutine.
"""
if not asyncio.iscoroutinefunction(coro):
- raise discord.ClientException('The error handler must be a coroutine.')
+ raise TypeError('The error handler must be a coroutine.')
self.on_error = coro
return coro
@@ -756,11 +756,11 @@ class Command(_BaseCommand):
Raises
-------
- :exc:`.ClientException`
- The coroutine is not actually a coroutine.
+ TypeError
+ The coroutine passed is not actually a coroutine.
"""
if not asyncio.iscoroutinefunction(coro):
- raise discord.ClientException('The pre-invoke hook must be a coroutine.')
+ raise TypeError('The pre-invoke hook must be a coroutine.')
self._before_invoke = coro
return coro
@@ -783,11 +783,11 @@ class Command(_BaseCommand):
Raises
-------
- :exc:`.ClientException`
- The coroutine is not actually a coroutine.
+ TypeError
+ The coroutine passed is not actually a coroutine.
"""
if not asyncio.iscoroutinefunction(coro):
- raise discord.ClientException('The post-invoke hook must be a coroutine.')
+ raise TypeError('The post-invoke hook must be a coroutine.')
self._after_invoke = coro
return coro