Autocomplete not working
new SlashCommandBuilder()
.setName('create')
.setDescription('Cria uma ficha de Breed')
.addStringOption(option =>
option.setName('dinoname')
.setDescription('Dino que sera breedado')
.setRequired(true)
.setAutocomplete(true)),
async autocomplete(interaction){
const focusedValue = interaction.options.getFocused();
const choices = ['Giga', 'Stego', 'Charca', 'Carbo', 'Tape', 'Velona', 'Snow', 'Baryonix', 'Tuso', 'Desmodus', 'Shadow', 'Astro', 'Theri', 'Stalker', 'Racer', 'Rex', 'Basilo', 'FjordHawk', 'Andrewsarchus', 'Amargasaurus', 'Noglin', 'Basilisk',
'Griffin', 'Daeodon', 'Thyla', 'Mantis', 'Voidwyrm', 'Deino', 'Yutirannus', 'LightWyvern']
const filtered = choices.filter(choice => choice.startsWith(focusedValue));
await interaction.respond(
filtered.map(choice => ({ name: choice, value: choice })),
);
},
new SlashCommandBuilder()
.setName('create')
.setDescription('Cria uma ficha de Breed')
.addStringOption(option =>
option.setName('dinoname')
.setDescription('Dino que sera breedado')
.setRequired(true)
.setAutocomplete(true)),
async autocomplete(interaction){
const focusedValue = interaction.options.getFocused();
const choices = ['Giga', 'Stego', 'Charca', 'Carbo', 'Tape', 'Velona', 'Snow', 'Baryonix', 'Tuso', 'Desmodus', 'Shadow', 'Astro', 'Theri', 'Stalker', 'Racer', 'Rex', 'Basilo', 'FjordHawk', 'Andrewsarchus', 'Amargasaurus', 'Noglin', 'Basilisk',
'Griffin', 'Daeodon', 'Thyla', 'Mantis', 'Voidwyrm', 'Deino', 'Yutirannus', 'LightWyvern']
const filtered = choices.filter(choice => choice.startsWith(focusedValue));
await interaction.respond(
filtered.map(choice => ({ name: choice, value: choice })),
);
},
1 Reply
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View