mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-06-04 19:12:37 +00:00
Document that docstrings can be used to document parameters
This commit is contained in:
parent
5039b967a0
commit
288f2d169e
@ -2094,6 +2094,23 @@ def describe(**parameters: Union[str, locale_str]) -> Callable[[T], T]:
|
||||
async def ban(interaction: discord.Interaction, member: discord.Member):
|
||||
await interaction.response.send_message(f'Banned {member}')
|
||||
|
||||
Alternatively, you can describe parameters using Google, Sphinx, or Numpy style docstrings.
|
||||
|
||||
Example:
|
||||
|
||||
.. code-block:: python3
|
||||
|
||||
@app_commands.command()
|
||||
async def ban(interaction: discord.Interaction, member: discord.Member):
|
||||
\"\"\"Bans a member
|
||||
|
||||
Parameters
|
||||
-----------
|
||||
member: discord.Member
|
||||
the member to ban
|
||||
\"\"\"
|
||||
await interaction.response.send_message(f'Banned {member}')
|
||||
|
||||
Parameters
|
||||
-----------
|
||||
\*\*parameters: Union[:class:`str`, :class:`locale_str`]
|
||||
|
Loading…
x
Reference in New Issue
Block a user