Reload Commands
Hello,
I'd like to update my bot's commands with a command on Discord.
I've followed the instructions on this page (https://discordjs.guide/additional-features/reloading-commands.html) but when I run the
/reload ping
command I get this error.
What should I do?
Attached is a photo of how my commands are arranged and the code from the Github example of the DJS guide.discord.js Guide
Imagine a guide... that explores the many possibilities for your discord.js bot.
14 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!Your error isnt really djs related
one of your commands properties is undefined
So is it a problem in the command I performed or in the code?
one of both
Your top line shows whats wrong
Your path is wrong
I've seen this but I don't know how to define the path correctly.
I tried with the following commands but when I run it it tells me that no command was found
- /reload ./commands/informations/ping.js
- /reload commands/informations/ping.js
- /reload ./informations/ping.js
- /reload informations/ping.js
well yeah
<String>.category doesnt exist
And there's no indication in the guide of the command to be performed for the path to be correct.
so that'll always be undefined
wait
log your command
and maek sure each of your commands has a category property
The category property does not correspond to the
administration
and informations
folders located in the commands
folder?
Because in the original guide there is no category property.
It is only present in the Github version
This one
https://github.com/discordjs/guide/blob/main/code-samples/additional-features/reloading-commands/commands/utility/reload.jsyou do have to set a category
your commands wont magically have that property
just add a category property
rather basic js
Like this?
Sorry if I can't do some simple things, I'm just starting out.
no
i recommend checking out #resources as djs requires a string js understanding