@twitchfy/chatbot
Version:
A powerful node module to make your own Twitch ChatBot
29 lines (28 loc) • 893 B
TypeScript
import type { CommandContext } from './CommandContext';
import type { OptionsRecord, PermissionOrArray, RequiredPerms } from '../types';
import type { EventSubConnection } from '../enums';
/**
* The command structure.
*/
export declare class Command<T extends EventSubConnection = EventSubConnection> {
/**
* The name of the command.
*/
readonly name: string;
/**
* The options of the command.
*/
readonly options: OptionsRecord;
/**
* The permissions of the command.
*/
readonly permissions: PermissionOrArray<T>[];
/**
* The run function of the command.
*/
run?(ctx: CommandContext<typeof this.options, T>): any;
/**
* The fallback function of the command if the permissions aren't satisfied.
*/
onPermissionFallback?(ctx: CommandContext<typeof this.options, T>, permissions: RequiredPerms): any;
}