[commands] add ScheduledEvent converter

This commit is contained in:
z03h
2022-03-09 14:56:50 -08:00
committed by GitHub
parent bf3eb0a7fe
commit 93fba264ad
4 changed files with 94 additions and 1 deletions

View File

@ -419,6 +419,9 @@ Converters
.. autoclass:: discord.ext.commands.GuildStickerConverter
:members:
.. autoclass:: discord.ext.commands.ScheduledEventConverter
:members:
.. autoclass:: discord.ext.commands.clean_content
:members:
@ -547,6 +550,9 @@ Exceptions
.. autoexception:: discord.ext.commands.GuildStickerNotFound
:members:
.. autoexception:: discord.ext.commands.ScheduledEventNotFound
:members:
.. autoexception:: discord.ext.commands.BadBoolArgument
:members:
@ -631,6 +637,7 @@ Exception Hierarchy
- :exc:`~.commands.BadInviteArgument`
- :exc:`~.commands.EmojiNotFound`
- :exc:`~.commands.GuildStickerNotFound`
- :exc:`~.commands.ScheduledEventNotFound`
- :exc:`~.commands.PartialEmojiConversionFailure`
- :exc:`~.commands.BadBoolArgument`
- :exc:`~.commands.ThreadNotFound`

View File

@ -393,6 +393,8 @@ A lot of discord models work out of the gate as a parameter:
- :class:`Emoji`
- :class:`PartialEmoji`
- :class:`Thread` (since v2.0)
- :class:`GuildSticker` (since v2.0)
- :class:`ScheduledEvent` (since v2.0)
Having any of these set as the converter will intelligently convert the argument to the appropriate target type you
specify.
@ -441,6 +443,10 @@ converter is given below:
+--------------------------+-------------------------------------------------+
| :class:`Thread` | :class:`~ext.commands.ThreadConverter` |
+--------------------------+-------------------------------------------------+
| :class:`GuildSticker` | :class:`~ext.commands.GuildStickerConverter` |
+--------------------------+-------------------------------------------------+
| :class:`ScheduledEvent` | :class:`~ext.commands.ScheduledEventConverter` |
+--------------------------+-------------------------------------------------+
By providing the converter it allows us to use them as building blocks for another converter: