trying to handle music

This commit is contained in:
DeSqBlocki
2024-08-02 13:25:06 +02:00
parent a74e19be5a
commit 2925fb59dd
42 changed files with 3708 additions and 1 deletions
+20
View File
@@ -0,0 +1,20 @@
const fs = require('node:fs')
const path = require('node:path')
module.exports = (client) => {
const selectMenusFoldersPath = path.join(__dirname, '../selectMenus');
const selectMenusFolders = fs.readdirSync(selectMenusFoldersPath);
let selectMenuCount = 0
for (const folder of selectMenusFolders) {
const Path = path.join(selectMenusFoldersPath, folder);
const Files = fs.readdirSync(Path).filter(file => file.endsWith('.js'));
for (const file of Files) {
selectMenuCount++
const filePath = path.join(Path, file);
const button = require(filePath);
if ('execute' in button) {
client.selectMenus.set(button.name, button);
}
}
}
console.log(`[${selectMenuCount}] Select Menu(s) initialized`)
}