This commit is contained in:
Tutur33
2024-02-23 21:13:06 +01:00
parent 66b669a0e1
commit d85c18f7ed
5 changed files with 95 additions and 4 deletions
+5 -1
View File
@@ -12,7 +12,11 @@ module.exports = function loadEvents(client, dir) {
try {
delete require.cache[require.resolve(filePath)];
const command = require(filePath);
client.commands.set(command.name, command);
const fileName = file.replace('.js', '');
command.name = fileName;
const parentDir = path.basename(path.dirname(filePath));
command.category = parentDir === 'commands' ? 'other' : parentDir;
client.commands.set(fileName, command);
if (command.aliases) {
command.aliases.forEach(alias => {
client.commands.set(alias, command);