From 9d2bd53da3e36ed1611c981eaf84052296695918 Mon Sep 17 00:00:00 2001 From: Snipy7374 <100313469+Snipy7374@users.noreply.github.com> Date: Wed, 11 Oct 2023 22:19:57 +0200 Subject: [PATCH] document Option and update docstrings --- changelog/1112.doc.rst | 2 +- disnake/app_commands.py | 2 +- disnake/ext/commands/slash_core.py | 1 + docs/api/app_commands.rst | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/changelog/1112.doc.rst b/changelog/1112.doc.rst index 90923e13d3..e510f78951 100644 --- a/changelog/1112.doc.rst +++ b/changelog/1112.doc.rst @@ -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`. diff --git a/disnake/app_commands.py b/disnake/app_commands.py index 17c3fd713a..15e205ee18 100644 --- a/disnake/app_commands.py +++ b/disnake/app_commands.py @@ -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. diff --git a/disnake/ext/commands/slash_core.py b/disnake/ext/commands/slash_core.py index 203ff73867..63a64bde7a 100644 --- a/disnake/ext/commands/slash_core.py +++ b/disnake/ext/commands/slash_core.py @@ -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( diff --git a/docs/api/app_commands.rst b/docs/api/app_commands.rst index 1d26bee539..a55e3670ab 100644 --- a/docs/api/app_commands.rst +++ b/docs/api/app_commands.rst @@ -97,7 +97,7 @@ Option .. attributetable:: Option -.. autoclass:: Option() +.. autoclass:: Option :members: OptionChoice