Updated event layout

This commit is contained in:
2025-01-03 15:46:34 +01:00
parent 02d7178fa2
commit 022694396e
11 changed files with 122 additions and 173 deletions

View File

@@ -8,12 +8,11 @@ export default async function loadEvents(client: Client, ft: FileType) {
const eventDirs = fs.readdirSync(serverDir)
for (const eventDir of eventDirs) {
const eventFiles = fs.readdirSync(path.join(serverDir, eventDir)).filter(file => file.endsWith(ft))
const eventName = eventDir
for (const eventFile of eventFiles) {
const eventPath = path.join(serverDir, eventDir, eventFile)
const { default: event } = await import("file://" + eventPath)
if (!event.disabled) {
client.on(event.event, event.execute)
}
client.on(eventName, event)
}
}
}