UNPKG

simplify-cord

Version:

SimplifyCord is an unofficial extension of the 'discord.js' library. Our extension aims to simplify the development of Discord bots, promoting cleaner code and easier maintenance.

18 lines (17 loc) • 1.13 kB
import { ApplicationCommandOption, ApplicationCommandType, AutocompleteInteraction, CommandInteraction, UserContextMenuCommandInteraction, MessageContextMenuCommandInteraction } from "discord.js"; import { bootstrapApp } from "../../class/Client"; export declare const slashCommandHandlers: Map<any, any>; type CommandInteractionType<T> = T extends ApplicationCommandType.ChatInput ? CommandInteraction : T extends ApplicationCommandType.User ? UserContextMenuCommandInteraction : T extends ApplicationCommandType.Message ? MessageContextMenuCommandInteraction : never; export interface ISlashCommandHandler<T extends ApplicationCommandType = ApplicationCommandType> { name: string; description?: T extends ApplicationCommandType.ChatInput ? string : undefined; type: T; options?: ApplicationCommandOption[]; autocomplete?: (interaction: AutocompleteInteraction) => any; run: (client: bootstrapApp, interaction: CommandInteractionType<T>) => any; } export default class SlashCommand<T extends ApplicationCommandType> { constructor(data: ISlashCommandHandler<T>); static loadLogs(): void; } export {};