Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Metadata for command arguments #50

Open
NanderTGA opened this issue Jul 8, 2023 · 1 comment
Open

Metadata for command arguments #50

NanderTGA opened this issue Jul 8, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@NanderTGA
Copy link
Owner

Command gets a new property: arguments
Example:

client.commands.dice = {
    arguments: [
        {   // turns into <sides>
            name: "sides",
            required: true,
        }, {
            // turns into [...stuff]
            name: "stuff",
            required: false,
            rest: true,
        }
    ]
}

I also have this idea to do some validation perhaps. (Sending a user things like missing command error...).

@NanderTGA
Copy link
Owner Author

Wait we should also do overloads for better clarity.
How about we also allow this:

client.commands.random = {
    arguments: [
        [
            {
                name    : "maximum",
                required: true,
            },
        ],
        [
            {
                name    : "minimum",
                required: true,
            }, {
                name    : "maximum",
                required: true,
            },
        ],
    ],
};

Which would turn into this in the help command:

!random <maximum>
!random <minimum> <maximum>

@NanderTGA NanderTGA added the enhancement New feature or request label Jul 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Todo
Development

No branches or pull requests

1 participant