support once too

This commit is contained in:
Mylloon 2023-02-04 20:25:12 +01:00
parent 8a5778d8b9
commit b9ddfc5c22
Signed by: Anri
GPG key ID: A82D63DFF8D1317F

View file

@ -29,6 +29,12 @@ export default async (client: Client) => {
const event_type = event_type_ext.join(".");
if (event_category == "player") {
if (once) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
return client.player.once(event_type as keyof PlayerEvents, (...args: any) =>
execute(...args, client)
);
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
return client.player.on(event_type as keyof PlayerEvents, (...args: any) =>
execute(...args, client)