Adding Slash commands
Hey i need some help i am trying to add a simple Slash Command but i always get no awnser from the bot. I registered the command on the server but never get an awnser. i tried two ways (see in pictures )
$ npm list discord.js
└─ [email protected]
Done in 0.10s.
$ node -v
v20.13.1
24 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!You commented out your commands read code in the first screenshot. Please follow the guide
in your register commands file you defined the function but it was never executed
the commands are registered on the server but when i try to use them i get no reply
try
if (!interaction.isChatInputCommand() return;
on the very beginning of the event listeneri still got the same issue the bot doesnt respond on the server
i tried so many ways with different code examples nothing works
@MattTheOfficial could you try console logging the
interaction
?
see what you geti added a
console.log(interaction);
but no message in consoledid your ready event fire?
yes
hmm
the bot runs and shows the activity
do you maybe have a code example on git that i can clone an try
i am programming react for multiple years but this gives me headaches
log inside your interactionCreate
does not work @one hella fluffy wolvinny ❄ 🌈
what does not work
did yoy log anything at all
and where
the console log in interactionCreate
okay
and where is that log
that code doesnt match the one you showed before. This is app.js, the other one was index.js. which one are you running
i deleted everything and started new
still same issue
tried different node versions and discordjs versions
and what is your current djs version
14.15.3
the deploy commands script works but the interactionCreate in the bot itself does not
@here maybe somebody can help me in a call
amd are you running the bot
the deploy script does not start the bot
yes the bot is running
but it does not react on interactionCreate
i tried some other events like ThreadCreate and bot reacts on that