@ayanaware/bentocord
Version:
Bentocord is a Bento plugin designed to rapidly build fully functional Discord Bots.
26 lines (25 loc) • 1.23 kB
TypeScript
import { SelectMenu, SelectMenuOptions } from 'eris';
import { AnyContext } from '../../contexts/AnyContext';
import { ComponentHandler, SelectHandler } from '../interfaces/ComponentHandler';
import { BaseComponent } from './BaseComponent';
import { PossiblyTranslatable } from '../../interfaces/Translatable';
export declare type SelectOption = SelectMenuOptions;
export interface SelectOptionTranslatable extends Omit<SelectOption, 'label' | 'description'> {
label: PossiblyTranslatable;
description?: PossiblyTranslatable;
}
export declare class Select extends BaseComponent {
definition: SelectMenu;
handler?: ComponentHandler;
readonly maxOptions = 25;
constructor(ctx: AnyContext, customId: string, handler?: SelectHandler);
clearOptions(): this;
setOptions(options: Array<SelectOption>): this;
setOptionsTranslated(options: Array<SelectOptionTranslatable>): Promise<this>;
addOptions(options: Array<SelectMenuOptions>): this;
addOption(option: SelectMenuOptions): this;
placeholder(placeholder: string): this;
placeholderTranslated(key: string, repl?: Record<string, unknown>, backup?: string): Promise<this>;
min(min: number): this;
max(max: number): this;
}