discord-bot-cli
Version:
An easy way to build a command-based discord bot with discord.js.
36 lines (35 loc) • 1.04 kB
TypeScript
import { Command } from "./Command";
import { ArgDefinition } from "./definition/ArgDefinition";
import { FlagDefinition } from "./definition/FlagDefinition";
export declare type CommandResult = {
readonly status: "ok";
readonly command: Command;
readonly result: any;
} | {
readonly status: "error";
readonly error: any;
} | {
readonly status: "no executor" | "guild only" | "dev only" | "unauthorized user" | "throttling" | "client permissions";
readonly command: Command;
} | {
readonly status: "not prefixed" | "command not found";
} | ({
readonly status: "parsing error";
} & (({
readonly type: "arg";
readonly arg: Readonly<ArgDefinition>;
} & ({
readonly reason: "invalid value";
readonly got: string;
} | {
readonly reason: "missing argument";
})) | ({
readonly type: "flag";
} & ({
readonly reason: "unknown flag";
readonly name: string;
} | {
readonly reason: "invalid value";
readonly flag: Readonly<FlagDefinition>;
readonly got: string;
}))));