This commit is contained in:
2026-01-29 12:26:13 +01:00
parent ba0f116bc2
commit 6dbcadcaee
79 changed files with 2795 additions and 657 deletions

24
src/events/types.ts Normal file
View File

@@ -0,0 +1,24 @@
/**
* Event types and interfaces
*/
import type { ClientEvents } from "discord.js";
import type { BotClient } from "../core/client";
export interface EventHandler<K extends keyof ClientEvents = keyof ClientEvents> {
/** Event name to listen for */
name: K;
/** Whether to only run once */
once?: boolean;
/** Execute the event handler */
execute: (client: BotClient, ...args: ClientEvents[K]) => Promise<void> | void;
}
// Type-safe event handler that can be stored in an array
export type AnyEventHandler = {
name: keyof ClientEvents;
once?: boolean;
execute: (client: BotClient, ...args: any[]) => Promise<void> | void;
};