Skip to main content

Syntax maker for discord.py's command

Project description

PyPI - Version PyPI - Downloads readthedocs

dpy-syntaxer

Syntax maker for discord.py's command.

How to use

python3 -m pip install dpy-syntaxer

from typing import Optional

from discord.ext import commands, syntaxer


@commands.command()
async def command(ctx, arg1: Optional[int], arg2, *, arg3):
    """
    Command description
    arg_first: Description of arg1
    arg_second: Description of arg2
    arg_third: Description of arg3
    """
    pass


syntax = syntaxer.Syntax(command)
str(syntax)
# => 'command <arg_first> <arg_second> <arg_third'
syntax[0]
# => CommandName(name='command', parent=None)
syntax[1]
# => CommandArgument(name='arg_first', required=False, description='Description of arg1', format='[arg_first]', flag=<ArgumentType.optional: 2>, default=<class 'inspect._empty'>)
syntax[2]
# => CommandArgument(name='arg_second', required=True, description='Description of arg2', format='<arg_second>', flag=<ArgumentType.required: 1>, default=None)
syntax[3]
# => CommandArgument(name='arg_third', required=True, description='Description of arg3', format='<arg_third', flag=<ArgumentType.kwarg|required: 9>, default=None)

Please read the documentation for more information.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dpy_syntaxer-1.0.0-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file dpy_syntaxer-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: dpy_syntaxer-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 4.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/54.1.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

File hashes

Hashes for dpy_syntaxer-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8daa67706d8f44ffb65149879d795de493cfe5a44d70044c3b94bca9e2eceb8f
MD5 668e682884b42d804c7df1ff7de9080e
BLAKE2b-256 807b1001e2da4565adb4646a8f836c1d63e6d76cc603c5653b8e7b906d3b9c86

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page