Type issues with .addChoices()
I am attempting to add choices to a string option, and this error is a little confusing. See what I mean:
The error: Argument of type '{ name: string; value: string; }[]' is not assignable to parameter of type 'APIApplicationCommandOptionChoice<string>'.
Type '{ name: string; value: string; }[]' is missing the following properties from type 'APIApplicationCommandOptionChoice<string>': name, value
Solution:Jump to solution
addChoices
has a spread syntax for the array type, so remove the square brackets and it will work.6 Replies
Solution
addChoices
has a spread syntax for the array type, so remove the square brackets and it will work.i m a dumbass
Dw I forget all the
thx
is there a list of all of the events from the sapphireclient class? such as command cooldown and stuff
Should create a new post if you have more questions, but you can find them on the
Events
export from @sapphire/framework