dressed
Version:
A sleek, serverless-ready Discord bot framework.
30 lines (29 loc) • 1.05 kB
TypeScript
import type { APISelectMenuComponent, APISelectMenuOption, ComponentType } from "discord-api-types/v10";
declare const SelectType: {
Channel: number;
Mentionable: number;
Role: number;
String: number;
User: number;
};
type SelectMap = {
[Key in keyof typeof ComponentType]: Extract<APISelectMenuComponent, {
type: (typeof ComponentType)[Key];
}>;
};
/**
* Creates a select menu component
*
* Select menu for picking from defined text options, or a user, role, channel, or mentionable
*/
export declare function SelectMenu<K extends keyof typeof SelectType>(config: Omit<SelectMap[`${K}Select`], "type"> & {
type: K;
}): SelectMap[`${K}Select`];
/**
* Creates an option to be used in a select menu
*
* @param label - The user-facing name of the option (max 100 chars)
* @param vale - The dev-defined value of the option (max 100 chars)
*/
export declare function SelectMenuOption(label: string, value: string, config?: Omit<APISelectMenuOption, "label" | "value">): APISelectMenuOption;
export {};