UNPKG

slash-create-modify

Version:

Create and sync Discord slash commands!

55 lines (54 loc) 3.13 kB
import { ApplicationCommand, ApplicationCommandPermissions, BulkUpdateCommand, GuildApplicationCommandPermissions, PartialApplicationCommand, PartialApplicationCommandPermissions } from './constants'; import { SlashCreator } from './creator'; /** The API handler for {@link SlashCreator}. */ export declare class SlashCreatorAPI { /** The parent creator. */ private readonly _creator; /** @param creator The instantiating creator. */ constructor(creator: SlashCreator); /** * Gets the commands from an applicaton. * @param guildID The guild ID to get commands from. If undefined, global commands are fetched. * @param withLocalizations Whether to include localizations within the commands. */ getCommands(guildID?: string, withLocalizations?: boolean): Promise<ApplicationCommand[]>; /** * Creates a command. * @param command The command to create. * @param guildID The guild ID to put the command on. If undefined, the command is global. */ createCommand(command: PartialApplicationCommand, guildID?: string): Promise<ApplicationCommand>; /** * Updates a command. * @param commandID The command ID to update. * @param command The payload to update the command to. * @param guildID The guild ID to put the command on. If undefined, the global command is updated. */ updateCommand(commandID: string, command: PartialApplicationCommand, guildID?: string): Promise<ApplicationCommand>; /** * Updates multiple commands. * @param commands The payload to update the commands to. * @param guildID The guild ID to put the command on. If undefined, the global command is updated. */ updateCommands(commands: BulkUpdateCommand[], guildID?: string): Promise<ApplicationCommand[]>; /** * Deletes a command. * @param commandID The command ID to delete. * @param guildID The guild ID to delete the command. If undefined, the global command is deleted. */ deleteCommand(commandID: string, guildID?: string): Promise<unknown>; getGuildCommandPermissions(guildID: string): Promise<GuildApplicationCommandPermissions[]>; getCommandPermissions(guildID: string, commandID: string): Promise<GuildApplicationCommandPermissions>; updateCommandPermissions(guildID: string, commandID: string, permissions: ApplicationCommandPermissions[]): Promise<GuildApplicationCommandPermissions>; /** @deprecated Command permissions have been deprecated: https://link.snaz.in/sc-cpd */ bulkUpdateCommandPermissions(guildID: string, commands: PartialApplicationCommandPermissions[]): Promise<GuildApplicationCommandPermissions[]>; /** * Responds to an interaction. * @param interactionID The interaction's ID. * @param interactionToken The interaction's token. * @param body The body to send. * @param files The files to send. */ interactionCallback(interactionID: string, interactionToken: string, body: any, files?: any[]): Promise<unknown>; } export declare const API: typeof SlashCreatorAPI;