Closed
Description
Issue description
The value of an autocomplete interaction is dynamic and may be a number. However, this is incorrect. The value of an autocomplete interaction is always a string
.
Code sample
declare const interaction: APIApplicationCommandAutocompleteInteraction;
if (interaction.data.options[0]?.type === ApplicationCommandOptionType.String) {
const { value } = interaction.data.options[0]; // String. Correct.
}
if (interaction.data.options[0]?.type === ApplicationCommandOptionType.Integer) {
const { value } = interaction.data.options[0]; // Number. Incorrect.
}
if (interaction.data.options[0]?.type === ApplicationCommandOptionType.Number) {
const { value } = interaction.data.options[0]; // Number. Incorrect.
}
Package version
main
Runtime
Node.js
Runtime version
N/A
Priority this issue should have
Medium (should be fixed soon)