A powerful and extendable Discord bot, with it's own module system :3 thevoid.cafe/projects/voidy
at develop 24 lines 656 B view raw
1import type { ClientEvents } from "discord.js"; 2import type { EventContext } from "../core/context"; 3 4export interface EventOptions { 5 id: string; 6 name: keyof ClientEvents; 7 once?: boolean; 8 execute: (ctx: EventContext, ...args: unknown[]) => Promise<void>; 9} 10 11export class Event { 12 readonly type = "event" as const; 13 readonly id: string; 14 readonly name: keyof ClientEvents; 15 readonly once?: boolean; 16 readonly execute: (ctx: EventContext, ...args: unknown[]) => Promise<void>; 17 18 constructor(options: EventOptions) { 19 this.id = options.id; 20 this.name = options.name; 21 this.once = options.once; 22 this.execute = options.execute; 23 } 24}