Autocompletion in Slash commands
Auto ocmpletion code:
Here is the code in Interacton event:
Any tips on what todo? dosnt seem like the code executes at all depsite autocomplete beeing active?
5 Replies
- 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!if (!interaction.isChatInputCommand()) return;
an interaction won't be both a slash command interaction and an autocomplete interactionNow i just get "command.autocomplete is not a function" any tips there aswell?
sounds like the object
command
doesn't have a method autocomplete
seeing as this method exists in the first file you've shown, I'd guess the issue has more to do with how you're reading and storing the commands in <Client>.commands
but I'm unable to diagnose further with just the information providedThis is the command handler, it should hopefully add the command to the collection, but it dosnt seem to read autocomplete function i assume this is where the problem lays, however i'm a bit unsure why ot only imports the execute command?
I fixed it, apprently it was checking the wrong interaction name so it was checking the wrong command, thanks for the help