Discord-Js-Handler-Template icon indicating copy to clipboard operation
Discord-Js-Handler-Template copied to clipboard

Issue with "IntChoices" + fix

Open Fusezion opened this issue 3 years ago • 1 comments

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) =>

Fusezion avatar Nov 30 '21 05:11 Fusezion

Made a pull request #6

Fusezion avatar Dec 01 '21 08:12 Fusezion