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
+18
View File
@@ -0,0 +1,18 @@
const fs = require('node:fs')
const path = require('node:path')
module.exports = (client) => {
const eventsPath = path.join(__dirname, '../events')
const eventFiles = fs.readdirSync(eventsPath).filter(file => file.endsWith('.js'))
for (const file of eventFiles) {
const filePath = path.join(eventsPath, file)
const event = require(filePath)
if (event.once) {
client.once(event.name, (...args) => event.execute(...args))
// added client to commomerate global usage
} else {
client.on(event.name, (...args) => event.execute(...args))
// added client to commomerate global usage
}
}
}