import { When } from './base'; import { TValidator } from './definitions'; import { ICQCode } from '../cqcode'; /** A class that represents conditions that determines whether a session should start ot not */ export declare class BotWhen extends When { private config; init({ operators, prefixes, self }: { operators: number[]; prefixes: string[]; self: number; }): this; private derive; /** Return a When instance with no conditions */ ever(): BotWhen; /** Add the raw message to the parsed result */ raw(): BotWhen; /** * Add a custom matcher * @param condition the matcher * @param failMessage message that'll be sent to user when invalid */ match(condition: { [x: string]: any; }, ...failMessage: (string | ICQCode)[]): BotWhen; /** * Check if a message contains one of the keywords * @param keywords the keywords */ contain(...keywords: (RegExp | string)[]): BotWhen; /** * Specify expected content types * @param type The expected content type(s) */ type(...types: string[]): BotWhen; /** * Specify the required role * @param role The role * @param failMessage message that'll be sent to user when invalid */ role(role: 'everyone' | 'admin' | 'owner' | 'operator', ...failMessage: (string | ICQCode)[]): BotWhen; /** * Use a command for the conditions * @param names the commands' names * @param params the parameters' declaration * @param config the config object */ command(names: string | string[], params?: string, { withPrefixes, types, prompts, validators }?: { withPrefixes?: boolean; types?: { [param: string]: any; }; prompts?: string | { [params: string]: string; }; validators?: { [params: string]: TValidator; }; }): BotWhen; /** * At only * @param failMessage message that'll be sent to user when invalid */ at(...failMessage: (string | ICQCode)[]): BotWhen; }