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

expected args #222

Open
DKMtomy opened this issue May 9, 2022 · 1 comment
Open

expected args #222

DKMtomy opened this issue May 9, 2022 · 1 comment

Comments

@DKMtomy
Copy link

DKMtomy commented May 9, 2022

throw new Error(WOKCommands > Command "${names[0]}" has "minArgs" property defined without "expectedArgs" property as a slash command.);
^
Error: WOKCommands > Command "gen" has "minArgs" property defined without "expectedArgs" property as a slash command.

anyone know why and when i add the expected args i get this error

 throw new DiscordAPIError(data, res.status, request);
        ^

DiscordAPIError: Invalid Form Body
options[0].name: String value did not match validation regex.

@ASPNyan
Copy link

ASPNyan commented May 16, 2022

Heyo, I think I know what's happening here.
Your code inside the export default probably looks something like this:

category: '',
description: '',

slash: true,
testOnly: true,

minArgs: 0,

callback: ({}) => {
// command code here
}

In this code, a minArgs is stated, but there are no args that exist. Simply adding a expectedArgs: will not fix it, as there needs to be args specified in this. If your command is not using any args, remove any reference to args. In the case of the code I showed, it would simply be removing the minArgs: 0,. See if removing the expectedArgs: and minArgs: 0, fixes the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants