Discord-Js-Handler-Template
Discord-Js-Handler-Template copied to clipboard
Issue with "IntChoices" + fix
While trying to set up a simple int choice I've noticed that IntChoices
wasn't working as intended and continued to return an error, I went to where the error was and noticed the type that was being returned was "3" String instead of "4" Integer. So I looked in the SlashCommand handler and noticed that for both StringChoices
and IntChoices
you're adding a string option instead of an intoption
to fix simply change
} else if(option.IntChoices && option.IntChoices.name && option.IntChoices.description && option.IntChoices.choices && option.IntChoices.choices.length > 0){
subcommand.addStringOption((op) =>
to
} else if(option.IntChoices && option.IntChoices.name && option.IntChoices.description && option.IntChoices.choices && option.IntChoices.choices.length > 0){
subcommand.addIntegerOption((op) =>
Made a pull request #6