[commands] Add ThreadConverter

This commit is contained in:
Alex Nørgaard
2021-07-05 05:40:57 +01:00
committed by GitHub
parent c1c6457598
commit 5a7cfb3ce6
2 changed files with 57 additions and 0 deletions

View File

@@ -47,6 +47,7 @@ __all__ = (
'GuildNotFound',
'UserNotFound',
'ChannelNotFound',
'ThreadNotFound',
'ChannelNotReadable',
'BadColourArgument',
'BadColorArgument',
@@ -336,6 +337,22 @@ class ChannelNotFound(BadArgument):
self.argument = argument
super().__init__(f'Channel "{argument}" not found.')
class ThreadNotFound(BadArgument):
"""Exception raised when the bot can not find the thread.
This inherits from :exc:`BadArgument`
..versionadded:: 2.0
Attributes
-----------
argument: :class:`str`
The thread supplied by the caller that was not found
"""
def __init__(self, argument):
self.argument = argument
super().__init__(f'Thread "{argument}" not found.')
class BadColourArgument(BadArgument):
"""Exception raised when the colour is not valid.