@twitchfy/chatbot
Version:
A powerful node module to make your own Twitch ChatBot
31 lines (30 loc) • 1.22 kB
TypeScript
import type { DefaultConnection, OptionsRecord } from '../types';
import type { EventSubConnection } from '../enums';
import type { ChatCommand } from '../structures';
/**
* The options to build up a command.
*/
export interface CommandOptions {
/**
* The name of the command.
*/
name: string;
/**
* The options of the command.
*/
options?: OptionsRecord;
}
/**
* Define the command.
* @param {CommandOptions} options The options to build up the command.
* @returns {Function} The decorator function.
*/
export declare function SetCommand<T extends EventSubConnection = DefaultConnection>(options: CommandOptions): <K extends new (...args: any[]) => ChatCommand<T>>(target: K) => {
new (...args: any[]): {
name: string;
options: OptionsRecord | undefined;
readonly permissions?: import("types/PermissionOrArray").PermissionOrArray<T>[] | undefined;
run?(ctx: import("structures/TwitchContext").TwitchContext<OptionsRecord | undefined, T>): any;
onPermissionFallback?(ctx: import("structures/TwitchContext").TwitchContext<OptionsRecord | undefined, T>, permissions: import("types/RequiredPerms").RequiredPerms): any;
};
} & K;