InteractionCreate for autocomplete won't fire on some commands

Below is my code. There are no errors at all - on some commands the autocomplete works, on others nothing even prints for Events.InteractionCreate. My options have .setAutocomplete(true). Here is the map option. The code for it is the exact same for both of my commands:
.addStringOption((option) =>
option
.setName('map')
.setDescription('Name of the map')
.setRequired(true)
.setAutocomplete(true)
)
.addStringOption((option) =>
option
.setName('map')
.setDescription('Name of the map')
.setRequired(true)
.setAutocomplete(true)
)
Here is the top of the of the InteractionCreate event handler, the rest doesn't matter as it doesn't even reach the console.log statement
client.on(discord.Events.InteractionCreate, async (interaction) => {
console.log(`Interaction received for ${interaction.commandName} with type ${interaction.type}`)
try {
if (interaction.isAutocomplete()) {
console.log(`Autocomplete interaction received for ${interaction.commandName}`)
client.on(discord.Events.InteractionCreate, async (interaction) => {
console.log(`Interaction received for ${interaction.commandName} with type ${interaction.type}`)
try {
if (interaction.isAutocomplete()) {
console.log(`Autocomplete interaction received for ${interaction.commandName}`)
In pic 1 and 2 you can see that it cannot load any options, and in fact nothing even prints. No errors either. In pic 3 and 4 I used a different command which has the exact same option yet the event fires for it and it works What could be the issue?
No description
No description
No description
No description
13 Replies
d.js toolkit
d.js toolkit2mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button! - Marked as resolved by OP
Max
MaxOP2mo ago
[email protected] node v22.12.0
sphere
sphere2mo ago
same here
Max
MaxOP2mo ago
oh phew, I thought I was insane and spent hours trying to look into it, thinking it was an error on my part wonder if it could be a discord API thing
sphere
sphere2mo ago
yeah thats what im thinking just really weird that i touched Nothing and it just started randomly happening LOL
Max
MaxOP2mo ago
dang I was refactoring my code which is a terrible coincidence because it made me think I broke it oh well
sphere
sphere2mo ago
To see if that's the issue try to reproduce the bug on your web browser, then look at the network tab for an error like this:
No description
Max
MaxOP2mo ago
yup, I have it
No description
Max
MaxOP2mo ago
ty for letting me know, hopefully they fix it soon
sphere
sphere2mo ago
np
CrackedPotato
CrackedPotato2mo ago
Same here
Max
MaxOP2mo ago
GitHub
Application command auto-complete validation bug · Issue #7350 · di...
Description If you create an application command with an auto-complete option as the first argument, and an argument with set choices as another argument, auto-complete requests for the first argum...

Did you find this page helpful?