detritus-client
Version:
A Typescript NodeJS library to interact with Discord's API, both Rest and Gateway.
41 lines (40 loc) • 1.42 kB
TypeScript
import { RequestTypes } from 'detritus-client-rest';
import { BaseSet } from '../../collections/baseset';
import { MessageComponentTypes } from '../../constants';
import { Structure } from '../../structures/basestructure';
import { Emoji } from '../../structures/emoji';
import { ComponentOnError, ComponentRun } from './components';
import { ComponentContext } from './context';
import { ComponentSelectMenuOptionData } from './selectmenu';
export declare type ComponentEmojiData = {
animated?: boolean;
id?: null | string;
name: string;
} | string | Emoji;
export interface ComponentActionData {
custom_id?: string;
customId?: string;
disabled?: boolean;
emoji?: ComponentEmojiData;
label?: string;
max_values?: number;
maxValues?: number;
min_values?: number;
minValues?: number;
options?: Array<ComponentSelectMenuOptionData>;
placeholder?: string;
style?: number;
type?: number;
url?: string;
run?: ComponentRun;
onError?: ComponentOnError;
}
export declare class ComponentActionBase extends Structure {
readonly _keys: BaseSet<string>;
customId?: null | string;
type: MessageComponentTypes;
run?(context: ComponentContext): Promise<any> | any;
onError?(context: ComponentContext, error: Error): Promise<any> | any;
constructor(data?: ComponentActionData);
toJSON(): RequestTypes.RawChannelMessageComponent;
}