moved to subdir

This commit is contained in:
2026-04-06 20:07:58 +02:00
parent f1f9d95685
commit 5e8fb7e729
28 changed files with 83 additions and 77 deletions
+28
View File
@@ -0,0 +1,28 @@
const fs = require('node:fs')
const path = require('node:path')
module.exports = (client) => {
const legacyFoldersPath = path.join(__dirname, '../commands/legacy');
const legacyCommandFolders = fs.readdirSync(legacyFoldersPath);
let legacyCount = 0
let aliasCount = 0
for (const folder of legacyCommandFolders) {
const commandsPath = path.join(legacyFoldersPath, folder);
const commandFiles = fs.readdirSync(commandsPath).filter(file => file.endsWith('.js'));
for (const file of commandFiles) {
legacyCount++
const filePath = path.join(commandsPath, file);
const command = require(filePath);
if ('execute' in command) {
client.legacyCommands.set(command.name, command);
}
if (command.aliases && Array.isArray(command.aliases)) {
command.aliases.forEach(alias => {
aliasCount++
client.aliases.set(alias, command.name)
})
}
}
}
console.log(`[${aliasCount}] Aliase(s) initialized`)
console.log(`[${legacyCount}] Legacy Command(s) initialized`)
}
@@ -5,7 +5,7 @@ const path = require('node:path')
module.exports = (client) => {
let commands = [] // only used for REST API
const foldersPath = path.join(__dirname, '../commands');
const foldersPath = path.join(__dirname, '../commands/slash');
const commandFolders = fs.readdirSync(foldersPath);
for (const folder of commandFolders) {
// Grab all the command files from the commands directory you created earlier
-29
View File
@@ -1,29 +0,0 @@
const fs = require('node:fs')
const path = require('node:path')
module.exports = (client) => {
// const legacyFoldersPath = path.join(__dirname, '../legacyCommands');
// const legacyCommandFolders = fs.readdirSync(legacyFoldersPath);
// let legacyCount = 0
// let aliasCount = 0
// for (const folder of legacyCommandFolders) {
// const commandsPath = path.join(legacyFoldersPath, folder);
// const commandFiles = fs.readdirSync(commandsPath).filter(file => file.endsWith('.js'));
// for (const file of commandFiles) {
// legacyCount++
// const filePath = path.join(commandsPath, file);
// const command = require(filePath);
// if ('execute' in command) {
// client.legacyCommands.set(command.name, command);
// }
// if (command.aliases && Array.isArray(command.aliases)) {
// command.aliases.forEach(alias => {
// aliasCount++
// client.aliases.set(alias, command.name)
// })
// }
// }
// }
// console.log(`[${aliasCount}] Aliase(s) initialized`)
// console.log(`[${legacyCount}] Legacy Command(s) initialized`)
}