UNPKG

@biskyjs/framework

Version:
95 lines 3.15 kB
import type { AliasPieceJSON, AliasPieceOptions } from "@sapphire/pieces"; import type { ResultError } from "@sapphire/result"; import type { NonNullObject } from "@sapphire/utilities"; import type { UserError } from "../../errors/user"; import type { Command } from "../../lib/structures/command"; import type { FlagStrategyOptions } from "../strategies/flag-unordered-strategy"; import type { BitwisePermissionFlags, DiscordMessage } from "@biscuitland/api-types"; export type CommandMetadata = string | CommandMetadataObject; export interface CommandMetadataObject extends NonNullObject { } export interface CommandOptions extends AliasPieceOptions, FlagStrategyOptions { /** * Command description. */ description?: string; /** * Extra data for the command, such as help, more information, etc. Useful for help commands. * TypeScript users can augment the CommandMetadata interface to add their own data. * @see [TypeScript Augment](https://www.typescriptlang.org/docs/handbook/declaration-merging.html) */ metadata?: CommandMetadata; /** * Command category. * The command category can be used to categorize the commands in a help command, etc. */ category?: string; /** * Mark commands as NSFW. */ nsfw?: boolean; /** * Client Permissions * Permissions that the client (bot) needs to execute the action. * @since 1.1.3 */ clientPermissions?: BitwisePermissionFlags[]; /** * User Permissions * Permissions that the user (author of message) needs to execute the action. * @since 1.1.3 */ userPermissions?: BitwisePermissionFlags[]; /** * The quotes accepted by this command, pass `[]` to disable them. * @since 1.1.4 * @default * [ * ['"', '"'], // Double quotes * ['“', '”'], // Fancy quotes (on iOS) * ['「', '」'] // Corner brackets (CJK) * ['«', '»'] // French quotes (guillemets) * ] */ quotes?: [string, string][]; } export interface CommandJSON extends AliasPieceJSON { description: string | null; category: string | null; metadata: CommandMetadata; } export interface CommandPreAcceptedPayload extends CommandParsePayload { command: Command; message: DiscordMessage; parameters: string; } export interface CommandDeniedPayload extends CommandPreAcceptedPayload { error: UserError; } export interface CommandAcceptedPayload extends CommandPreAcceptedPayload { context: CommandRunContext; } export interface CommandErrorPayload { command: Command; message: DiscordMessage; error: ResultError<unknown>; } export interface CommandNameNotFoundPayload { message: DiscordMessage; commandName: string; } export interface CommandParsePayload { message: DiscordMessage; prefix: string; } export interface CommandNotFoundPayload extends CommandNameNotFoundPayload { } export interface CommandContext { commandName: string; prefix: string; } export interface CommandRunContext { commandName: string; prefix: string; } //# sourceMappingURL=command.d.ts.map