UNPKG

fast-discord-js

Version:

FastDiscordJS 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.

20 lines (16 loc) 667 B
import { ApplicationCommandOption, ApplicationCommandType, AutocompleteInteraction, CommandInteraction } from "discord.js"; import { Client } from "."; export const slashCommandHandlers = new Map(); export interface ISlashCommandHandler { name: string, description: string, type: ApplicationCommandType, run: (client: Client, interaction: CommandInteraction) => any, options?: ApplicationCommandOption[], autocomplete?: (client: Client, interaction: AutocompleteInteraction) => any, } export default class { constructor(options: ISlashCommandHandler){ slashCommandHandlers.set(options.name, options); } }