Updated events

This commit is contained in:
2025-03-02 21:38:54 +01:00
parent 0f4d317935
commit 25139f3db5
4 changed files with 9 additions and 2 deletions

View File

@@ -11,8 +11,12 @@ export default async function loadEvents(client: Client, ft: FileType) {
const eventName = eventDir
for (const eventFile of eventFiles) {
const eventPath = path.join(serverDir, eventDir, eventFile)
const { default: event } = await import("file://" + eventPath)
client.on(eventName, event)
const { default: event, once } = await import("file://" + eventPath)
if (once && once === true) {
client.once(eventName, event)
} else {
client.on(eventName, event)
}
}
}
}