I've been trying to add a description for my slash command arguments in nextcord, I can't seem to firgure out how.
This is my code:
@__Bot__.slash_command(description="Retrieve a Quran verse.")
async def hello(interaction: nextcord.Interaction, start: str, verse: str, end: Optional[int]):
VerseCommand = [(start, verse, end)]
....
This is what I am hoping to achieve. "Page Number"
I tried using from nextcord import Options
but it doesn't work.
There are multiple ways to achieve this.
Option 1 -
SlashOption
You can add additional settings for slash command options including the description, choices, and value ranges by setting a default value using the
SlashOption
class. See the Application Command Docs and more examples.Option 2 - Numpy-style, Google-style, or Sphinx-style docstrings
You can find examples of each supported style in PR 480.
Example using Google-style docstrings (replace "Enter start value", "Enter verse value", etc with your descriptions)
Example using Numpy-style docstrings:
Example using Sphinx-style docstrings: