import type { ChatInputCommandInteraction, SlashCommandBuilder, SlashCommandSubcommandBuilder, SlashCommandOptionsOnlyBuilder, } from "discord.js"; import type { Context } from "../core/context"; import type { Middleware } from "../types/Middleware"; export interface CommandOptions { id: string; data: SlashCommandBuilder | SlashCommandSubcommandBuilder | SlashCommandOptionsOnlyBuilder; use?: Middleware[]; execute: (ctx: Context) => Promise; } export class Command { readonly type = "command" as const; readonly id: string; readonly data: SlashCommandBuilder | SlashCommandSubcommandBuilder | SlashCommandOptionsOnlyBuilder; readonly use?: Middleware[]; readonly execute: (ctx: Context) => Promise; constructor(options: CommandOptions) { this.id = options.id; this.data = options.data; this.use = options.use; this.execute = options.execute; } }