UNPKG

@ayanaware/bentocord

Version:

Bentocord is a Bento plugin designed to rapidly build fully functional Discord Bots.

39 lines (38 loc) 1.33 kB
import { Component, ComponentAPI } from '@ayanaware/bento'; import { ApplicationCommand } from 'eris'; export interface SyncOptions { /** Should unspecified commands be removed */ delete?: boolean | string; /** Register in this guild or globally */ guildId?: string; } export declare class SlashManager implements Component { name: string; api: ComponentAPI; private readonly interface; private readonly discord; private readonly cm; /** * Sync Slash Commands with Discord * @param commandsIn Array of ApplicationCommand * @param opts SyncOptions * @returns Discord Slash Bulk Update Response Payload */ syncCommands(commandsIn: Array<ApplicationCommand>, opts?: SyncOptions): Promise<unknown>; /** * Convert all slash supporting Bentocord commands to Discord ApplicationCommand * @returns Array of ApplicationCommand */ convertCommands(): Promise<Array<ApplicationCommand>>; /** * Convert Bentocord Command into Discord ApplicationCommand * @param command */ private convertCommand; /** * Convert Bentocord CommandOption to Discord ApplicationCommandOption Counterpart * @param options Array of CommandOptions * @returns ApplicationCommandOption Structure */ private convertOptions; }