@ayanaware/bentocord
Version:
Bentocord is a Bento plugin designed to rapidly build fully functional Discord Bots.
23 lines (22 loc) • 1.14 kB
TypeScript
import { AnyCommandContext } from '../CommandContext';
import { OptionType } from '../constants/OptionType';
import type { CommandOptionChoiceCallable, CommandOptionValue } from '../interfaces/CommandOption';
import { Resolver } from '../interfaces/Resolver';
export declare type NumberOption = NumberOptionWithChoices | NumberOptionWithMinMax | NumberOptionWithAutocomplete;
export interface NumberOptionWithChoices extends CommandOptionValue<OptionType.NUMBER, number> {
/** Array of Number choices */
choices?: CommandOptionChoiceCallable<number>;
}
export interface NumberOptionWithMinMax extends CommandOptionValue<OptionType.NUMBER, number> {
min?: number;
max?: number;
}
export interface NumberOptionWithAutocomplete extends CommandOptionValue<OptionType.NUMBER, number> {
autocomplete?: true;
}
export declare class NumberOptionResolver implements Resolver<number> {
option: OptionType;
convert: 10;
resolve(ctx: AnyCommandContext, option: NumberOption, text: string): Promise<number>;
help(ctx: AnyCommandContext, option: NumberOption, data: Map<string, string>): Promise<Map<string, string>>;
}