better-options-description 1.0
Discord.py extension to keep your slash commands options neat and tidy.
Example Usage (Only for slash commands)
# With discord-ext-better-options-description
...
from discord.ext.better_options_description import parse_doc
@parse_doc
@bot.tree.command(name="dice", description="Roll one or more dice.")
async def dice_commands(interaction: discord.Interaction, number: int,
sides: int = 6, bonus: int = 0):
"""
number: "The number of dice to roll (max: 25)."
sides: "The number of sides each die will have."
bonus: "A fixed number to add to the total roll."
"""
if number > 25:
await interaction.response.send_message("No more than 25 dice can be rolled at once.")
return
if sides > 100:
await interaction.response.send_message("The dice cannot have more than 100 sides.")
return
rolls = [random.randint(1, sides) for _ in range(number)]
await interaction.response.send_message(
" + ".join(f"{r}" for r in rolls)
+ (f" + {bonus} (bonus)" if bonus else "")
+ f" = **{sum(rolls) + bonus:,}**"
)
# Without discord-ext-better-options-description
...
from discord import app_commands
@app_commands.describe(number="The number of dice to roll (max: 25).", sides="The number of sides each die will have.",
bonus="A fixed number to add to the total roll.")
@bot.tree.command(name="dice", description="Roll one or more dice.")
async def dice_commands(interaction: discord.Interaction, number: int,
sides: int = 6, bonus: int = 0):
if number > 25:
await interaction.response.send_message("No more than 25 dice can be rolled at once.")
return
if sides > 100:
await interaction.response.send_message("The dice cannot have more than 100 sides.")
return
rolls = [random.randint(1, sides) for _ in range(number)]
await interaction.response.send_message(
" + ".join(f"{r}" for r in rolls)
+ (f" + {bonus} (bonus)" if bonus else "")
+ f" = **{sum(rolls) + bonus:,}**"
)
Metadata
Release files for discord-ext-better-options-description 1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| discord-ext-better-options-description-1.0.tar.gz | 3.1 kB | Without provenance | Details for discord-ext-better-options-description-1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| discord_ext_better_options_description-1.0-py3-none-any.whl | Python 3 | none | any | Details for discord_ext_better_options_description-1.0-py3-none-any.whl |
Total release size: 6.8 kB
Release files / discord-ext-better-options-description-1.0.tar.gz
| Download URL | discord-ext-better-options-description-1.0.tar.gz |
|---|---|
| Size | 3.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ac4e7829c140aa99fa7a54fb12276596ae47d511b70fb2eb8e0f7a081e43d51b
|
|
BLAKE2b-256 checksum How to use checksums |
e643d21f982a2eacfec6fe1c7907d332d73453c3e9e1256f023a6d682477b89b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.2
|
Release files / discord_ext_better_options_description-1.0-py3-none-any.whl
| Download URL | discord_ext_better_options_description-1.0-py3-none-any.whl |
|---|---|
| Size | 3.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f8332e25b9abe692d5365fb0b400fe2a3e8acdbe861b1a47b6e05bcbbd1be6e0
|
|
BLAKE2b-256 checksum How to use checksums |
1fa891509377c78f832850ba2514f9c5fd73add1b7b67150e867c826469a791f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.2
|
Security for discord-ext-better-options-description 1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.