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
11 Replies
d.js toolkit
d.js toolkit4d 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!
Max
MaxOP4d ago
[email protected] node v22.12.0
sphere
sphere4d ago
same here
Max
MaxOP4d 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
sphere4d ago
yeah thats what im thinking just really weird that i touched Nothing and it just started randomly happening LOL
Max
MaxOP4d ago
dang I was refactoring my code which is a terrible coincidence because it made me think I broke it oh well
sphere
sphere3d 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
MaxOP3d ago
yup, I have it
No description
Max
MaxOP3d ago
ty for letting me know, hopefully they fix it soon
sphere
sphere3d ago
np

Did you find this page helpful?