UNPKG

@twitchfy/chatbot

Version:

A powerful node module to make your own Twitch ChatBot

33 lines (32 loc) 1.18 kB
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<T>[] | undefined; run?(ctx: import("../structures").TwitchContext<OptionsRecord | undefined, T>): any; onPermissionFallback?(ctx: import("../structures").TwitchContext<OptionsRecord | undefined, T>, permissions: import("../types").RequiredPerms): any; }; } & K;