Recently, I came to know about the Autocomplete feature in discord.js@13.6.0 and I wanted to try it out. I was able to do the basics by seeing the answer on this post => How to use AutoComplete in Discord.js v13
I was able to set up the autocomplete and was also able to respond to the autocomplete interaction by using:
client.on('interactionCreate', interaction => {
if (interaction.isAutocomplete()) {
interaction.respond([
{
name: 'Command Help',
value: 'help'
}
]);
}
})
But my doubt is that is there any way to get the string which the user typed which caused the autocomplete interaction. For example: there is an array of options, and based on what the user typed, I would be able to filter the options and then show the correct ones?