import { ChatInputCommandInteraction, AutocompleteInteraction, PermissionResolvable, Client } from 'discord.js'; export type SlashExecutor = (interaction: ChatInputCommandInteraction) => Promise | void; export type AutocompleteExecutor = (interaction: AutocompleteInteraction) => Promise | void; export interface SlashOptionConfig { name: string; description: string; type: 'string' | 'integer' | 'number' | 'boolean' | 'user' | 'channel' | 'role' | 'mentionable' | 'attachment'; required?: boolean; choices?: { name: string; value: string | number; }[]; autocomplete?: boolean; minValue?: number; maxValue?: number; minLength?: number; maxLength?: number; } export interface SlashSubcommandConfig { name: string; description: string; options?: SlashOptionConfig[]; execute: SlashExecutor; autocomplete?: AutocompleteExecutor; } export interface SlashCommandConfig { name: string; description: string; options?: SlashOptionConfig[]; subcommands?: SlashSubcommandConfig[]; permissions?: PermissionResolvable[]; /** Default member permissions (shown in server settings) */ defaultMemberPermissions?: PermissionResolvable; /** Disable in DMs. Default: true */ guildOnly?: boolean; execute?: SlashExecutor; autocomplete?: AutocompleteExecutor; } export interface SlashHandlerConfig { /** Discord application (client) ID */ clientId: string; /** Bot token */ token: string; /** Register commands in a specific guild (instant). Omit for global (up to 1hr propagation). */ guildId?: string; } export declare class SlashHandler { private commands; private readonly cfg; constructor(config: SlashHandlerConfig); /** * Register a slash command definition. * @returns `this` for chaining */ command(config: SlashCommandConfig): this; /** * Deploy all registered commands to Discord via the REST API. * Call once at startup (or whenever commands change). */ deploy(): Promise; /** * Handle an incoming interaction. Wire this to your `interactionCreate` event. */ handle(interaction: ChatInputCommandInteraction | AutocompleteInteraction): Promise; /** Attach interactionCreate listener directly to a Client */ attach(client: Client): this; } //# sourceMappingURL=slash.d.ts.map