Dont understand the guide
so im tryna learn how to code a bot discord but i need several help haha... so im at that screen in the steps, and i dont understand where i need to put those, and why when im tryna /ping w my bot that dosnt work
6 Replies
- What's your exact discord.js
npm list discord.js
and node node -v
version?
- Post the full error stack trace, not just the top part!
- Show your code!
- Explain what exactly your issue is.
- Not a discord.js issue? Check out #useful-servers.
- Issue solved? Press the button!maybe im just dumb idk
Top code block should be a file in your commands directory
Bottom code block should be in your index file
thanks man
i dont really understand the point of the second block
can you explain ? :/
When someone uses a slash command (creates a chat input command interaction), it searches your
client.commands
collection to find the file where you handle that specific command, and it calls that file's execute()
method to run the code in that file (like replying to the interaction)thanks thats clear now