discordjs / Commando

Official command framework for discord.js
Apache License 2.0
497 stars 243 forks source link

Question using subfolders in commands #407

Closed crazytechkid closed 2 years ago

crazytechkid commented 3 years ago

say I have a lot of moderation commands in my command group. I tried to split them up into subfolders like warnSystem and Punishments. but when I put them in the moderation folder they are no longer detected. Is there something im missing. I couldnt find any documentation on how this works so I am kinda stuck at this point. I dont want to have 20 files in my root moderation directory.

S222em commented 3 years ago

You can do it like this

.registerCommandsIn(path.join(__dirname, 'commands'));
.registerCommandsIn(path.join(__dirname, 'commands/moderation'));

Commando expects to find groups in /commands (like /commands/moderation), and then all the commands in that subdirectory. So by using commands/moderation you basically move a directory down. Hope this is only a temporary workaround. I will have a look into this, and maybe bring up a fix

Update: view #409