import { ClientEvents } from "discord.js"; import { PrismaClient } from "@prisma/client"; import { BaseBotCache, BaseEntry, BaseGuildCache } from "../"; export default abstract class BaseEvent

, BC extends BaseBotCache, N extends keyof ClientEvents> { /** * The name of the event * * @example "messageCreate" */ abstract name: N; /** * Middleware to run before the {@link execute} method is called */ abstract middleware: EventMiddleware[]; /** * The method that is called when the event is emitted * * @param botCache The BotCache to possibly fetch a GuildCache * @param args The args of the client event */ abstract execute(botCache: BC, ...args: ClientEvents[N]): Promise; } export type iEventMiddleware

, BC extends BaseBotCache, N extends keyof ClientEvents, EM extends EventMiddleware> = new () => EM; export declare abstract class EventMiddleware

, BC extends BaseBotCache, N extends keyof ClientEvents> { /** * The function that should handle the event * * @param botCache The BotCache to possibly fetch a GuildCache * @param args The args of the client event */ abstract handler(botCache: BC, ...args: ClientEvents[N]): boolean | Promise; }