Error Loading the src/commands/slashCommands/Other Command files.
So in the register commands file it doesnt register the src/command/slashCommands/Other
If it's okay for you, it would be great if you could simply correct the code so that it works and then tell me what you changed (so that I can learn). Because in many other servers, people just talked around the issue (so they knew what was wrong but didn't help me clearly enough).
23 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!
- ✅
Marked as resolved by OP#rules 3, we are not gonna fix it for you
Also
Its also fine if u tell me whats wrong
if you would read the tag i would be able to help
you are just setting the commands in client.commands. That does not register thel
For that you'd have a separate script
(and that code can be simplified)
But the Moderation commands are getting registered tho
Because you probably registered them before
So what do I do?
Register your commands the proper way
you probably have a separate file for thar
I have the same project with just one Slash Command folder. And there the same file (like in the sourcebin link) looks like this:
well, you dont have that code in the sourcebin you showed
Thats the proper way to register commands
Ye bc thats the other project
Where I just have to register files in one folder
well yeah, you never even register your commands in the first place
but how do I do that all files getting registered in /src/commands/slashCommands/Moderation and /src/commands/slashCommands/Other
Thats not really djs related, its just reading files
I know
bruh
But I asked how
you can just iterate over your slashCommands folder
and then check those subfolders
So if I use this code for the Project with multiple subfolders it will work?
No it doesnt work it just says: [11/27/2023, 1:19:03 PM] ✅ Registered 0 commands globally
yes, assuming you properly iterate over them