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
No description
No description
No description
No description
No description
24 Replies
d.js toolkit
d.js toolkit5mo 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!
Syjalo
Syjalo5mo ago
You commented out your commands read code in the first screenshot. Please follow the guide
goose
goose5mo ago
in your register commands file you defined the function but it was never executed
MattTheOfficial
MattTheOfficialOP5mo ago
the commands are registered on the server but when i try to use them i get no reply
goose
goose5mo ago
try if (!interaction.isChatInputCommand() return; on the very beginning of the event listener
MattTheOfficial
MattTheOfficialOP5mo ago
i still got the same issue the bot doesnt respond on the server i tried so many ways with different code examples nothing works
Retro
Retro5mo ago
@MattTheOfficial could you try console logging the interaction? see what you get
MattTheOfficial
MattTheOfficialOP5mo ago
i added a console.log(interaction); but no message in console
Retro
Retro5mo ago
did your ready event fire?
MattTheOfficial
MattTheOfficialOP5mo ago
yes
Retro
Retro5mo ago
hmm
MattTheOfficial
MattTheOfficialOP5mo ago
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
treble/luna
treble/luna5mo ago
log inside your interactionCreate
MattTheOfficial
MattTheOfficialOP5mo ago
does not work @one hella fluffy wolvinny ❄ 🌈
treble/luna
treble/luna5mo ago
what does not work did yoy log anything at all and where
MattTheOfficial
MattTheOfficialOP5mo ago
the console log in interactionCreate
treble/luna
treble/luna5mo ago
okay and where is that log
MattTheOfficial
MattTheOfficialOP5mo ago
No description
treble/luna
treble/luna5mo ago
that code doesnt match the one you showed before. This is app.js, the other one was index.js. which one are you running
MattTheOfficial
MattTheOfficialOP5mo ago
i deleted everything and started new still same issue tried different node versions and discordjs versions
treble/luna
treble/luna5mo ago
and what is your current djs version
MattTheOfficial
MattTheOfficialOP5mo ago
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
treble/luna
treble/luna5mo ago
amd are you running the bot the deploy script does not start the bot
MattTheOfficial
MattTheOfficialOP5mo ago
yes the bot is running but it does not react on interactionCreate i tried some other events like ThreadCreate and bot reacts on that
Want results from more Discord servers?
Add your server