Skip to content

Commit

Permalink
document Option and update docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
Snipy7374 committed Oct 11, 2023
1 parent 0bd92dd commit 9d2bd53
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion changelog/1112.doc.rst
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Document the ``description`` and ``options`` properties for :class:`.ext.commands.InvokableSlashCommand` and the ``description`` property for :class:`.ext.commands.SubCommand`.
Document the :class:`.Option` attributes, the ``description`` and ``options`` properties for :class:`.ext.commands.InvokableSlashCommand` and the ``description`` and ``body`` properties for :class:`.ext.commands.SubCommand`.
2 changes: 1 addition & 1 deletion disnake/app_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def localize(self, store: LocalizationProtocol) -> None:
class Option:
"""Represents a slash command option.
Parameters
Attributes
----------
name: Union[:class:`str`, :class:`.Localized`]
The option's name.
Expand Down
1 change: 1 addition & 0 deletions disnake/ext/commands/slash_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,7 @@ def description(self) -> str:

@property
def body(self) -> Option:
""":class:`.Option`: The API representation for this slash sub command. Shorthand for :attr:`.SubCommand.option`"""
return self.option

async def _call_autocompleter(
Expand Down
2 changes: 1 addition & 1 deletion docs/api/app_commands.rst
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ Option

.. attributetable:: Option

.. autoclass:: Option()
.. autoclass:: Option
:members:

OptionChoice
Expand Down

0 comments on commit 9d2bd53

Please sign in to comment.