[commands] Add CategoryChannelConverter

This commit is contained in:
Rapptz
2017-09-13 17:17:04 -04:00
parent 7df8897e3d
commit e614f6b4cd
3 changed files with 72 additions and 25 deletions

View File

@ -152,6 +152,12 @@ Converters
.. autoclass:: discord.ext.commands.TextChannelConverter
:members:
.. autoclass:: discord.ext.commands.VoiceChannelConverter
:members:
.. autoclass:: discord.ext.commands.CategoryChannelConverter
:members:
.. autoclass:: discord.ext.commands.InviteConverter
:members:
@ -164,9 +170,6 @@ Converters
.. autoclass:: discord.ext.commands.ColourConverter
:members:
.. autoclass:: discord.ext.commands.VoiceChannelConverter
:members:
.. autoclass:: discord.ext.commands.EmojiConverter
:members:

View File

@ -305,6 +305,7 @@ A lot of discord models work out of the gate as a parameter:
- :class:`User`
- :class:`TextChannel`
- :class:`VoiceChannel`
- :class:`CategoryChannel`
- :class:`Role`
- :class:`Invite`
- :class:`Game`
@ -317,27 +318,29 @@ specify.
Under the hood, these are implemented by the :ref:`ext_commands_adv_converters` interface. A table of the equivalent
converter is given below:
+-----------------------+----------------------------------------------+
| Discord Class | Converter |
+-----------------------+----------------------------------------------+
| :class:`Member` | :class:`~ext.commands.MemberConverter` |
+-----------------------+----------------------------------------------+
| :class:`User` | :class:`~ext.commands.UserConverter` |
+-----------------------+----------------------------------------------+
| :class:`TextChannel` | :class:`~ext.commands.TextChannelConverter` |
+-----------------------+----------------------------------------------+
| :class:`VoiceChannel` | :class:`~ext.commands.VoiceChannelConverter` |
+-----------------------+----------------------------------------------+
| :class:`Role` | :class:`~ext.commands.RoleConverter` |
+-----------------------+----------------------------------------------+
| :class:`Invite` | :class:`~ext.commands.InviteConverter` |
+-----------------------+----------------------------------------------+
| :class:`Game` | :class:`~ext.commands.GameConverter` |
+-----------------------+----------------------------------------------+
| :class:`Emoji` | :class:`~ext.commands.EmojiConverter` |
+-----------------------+----------------------------------------------+
| :class:`Colour` | :class:`~ext.commands.ColourConverter` |
+-----------------------+----------------------------------------------+
+-----------------------+-------------------------------------------------+
| Discord Class | Converter |
+-----------------------+-------------------------------------------------+
| :class:`Member` | :class:`~ext.commands.MemberConverter` |
+-----------------------+-------------------------------------------------+
| :class:`User` | :class:`~ext.commands.UserConverter` |
+-----------------------+-------------------------------------------------+
| :class:`TextChannel` | :class:`~ext.commands.TextChannelConverter` |
+-----------------------+-------------------------------------------------+
| :class:`VoiceChannel` | :class:`~ext.commands.VoiceChannelConverter` |
+-----------------------+-------------------------------------------------+
| :class:`VoiceChannel` | :class:`~ext.commands.CategoryChannelConverter` |
+-----------------------+-------------------------------------------------+
| :class:`Role` | :class:`~ext.commands.RoleConverter` |
+-----------------------+-------------------------------------------------+
| :class:`Invite` | :class:`~ext.commands.InviteConverter` |
+-----------------------+-------------------------------------------------+
| :class:`Game` | :class:`~ext.commands.GameConverter` |
+-----------------------+-------------------------------------------------+
| :class:`Emoji` | :class:`~ext.commands.EmojiConverter` |
+-----------------------+-------------------------------------------------+
| :class:`Colour` | :class:`~ext.commands.ColourConverter` |
+-----------------------+-------------------------------------------------+
By providing the converter it allows us to use them as building blocks for another converter: