feat: new select menus
fix
This commit is contained in:
8
typings/enums.d.ts
vendored
8
typings/enums.d.ts
vendored
@@ -226,6 +226,14 @@ export const enum MessageComponentTypes {
|
||||
CHANNEL_SELECT = 8,
|
||||
}
|
||||
|
||||
export const enum SelectMenuComponentTypes {
|
||||
STRING_SELECT = 3,
|
||||
USER_SELECT = 5,
|
||||
ROLE_SELECT = 6,
|
||||
MENTIONABLE_SELECT = 7,
|
||||
CHANNEL_SELECT = 8,
|
||||
}
|
||||
|
||||
export const enum ModalComponentTypes {
|
||||
ACTION_ROW = 1,
|
||||
TEXT_INPUT = 4,
|
||||
|
40
typings/index.d.ts
vendored
40
typings/index.d.ts
vendored
@@ -100,6 +100,7 @@ import {
|
||||
HypeSquadType,
|
||||
VideoQualityModes,
|
||||
SortOrderType,
|
||||
SelectMenuComponentTypes,
|
||||
} from './enums';
|
||||
import {
|
||||
RawActivityData,
|
||||
@@ -1873,8 +1874,8 @@ export type AwaitMessageCollectorOptionsParams<
|
||||
|
||||
export interface StringMappedInteractionTypes<Cached extends CacheType = CacheType> {
|
||||
BUTTON: ButtonInteraction<Cached>;
|
||||
STRING_SELECT: SelectMenuInteraction<Cached>;
|
||||
ACTION_ROW: MessageComponentInteraction<Cached>;
|
||||
STRING_SELECT: SelectMenuInteraction<Cached>;
|
||||
USER_SELECT: SelectMenuInteraction<Cached>;
|
||||
ROLE_SELECT: SelectMenuInteraction<Cached>;
|
||||
MENTIONABLE_SELECT: SelectMenuInteraction<Cached>;
|
||||
@@ -1887,9 +1888,9 @@ export type MappedInteractionTypes<Cached extends boolean = boolean> = EnumValue
|
||||
typeof MessageComponentTypes,
|
||||
{
|
||||
BUTTON: ButtonInteraction<WrapBooleanCache<Cached>>;
|
||||
STRING_SELECT: SelectMenuInteraction<WrapBooleanCache<Cached>>;
|
||||
ACTION_ROW: MessageComponentInteraction<WrapBooleanCache<Cached>>;
|
||||
TEXT_INPUT: ModalSubmitInteraction<WrapBooleanCache<Cached>>;
|
||||
STRING_SELECT: SelectMenuInteraction<WrapBooleanCache<Cached>>;
|
||||
USER_SELECT: SelectMenuInteraction<WrapBooleanCache<Cached>>;
|
||||
ROLE_SELECT: SelectMenuInteraction<WrapBooleanCache<Cached>>;
|
||||
MENTIONABLE_SELECT: SelectMenuInteraction<WrapBooleanCache<Cached>>;
|
||||
@@ -2268,11 +2269,11 @@ export class MessageSelectMenu extends BaseMessageComponent {
|
||||
public minValues: number | null;
|
||||
public options: MessageSelectOption[];
|
||||
public placeholder: string | null;
|
||||
public type: SelectMenuTypes;
|
||||
public type: SelectMenuComponentType;
|
||||
public channelTypes: ChannelTypes[];
|
||||
public addOptions(...options: MessageSelectOptionData[] | MessageSelectOptionData[][]): this;
|
||||
public setOptions(...options: MessageSelectOptionData[] | MessageSelectOptionData[][]): this;
|
||||
public setType(type: SelectMenuTypes): this;
|
||||
public setType(type: SelectMenuComponentType | SelectMenuComponentTypes): this;
|
||||
public addChannelTypes(...channelTypes: ChannelTypes[]): this;
|
||||
public setChannelTypes(...channelTypes: ChannelTypes[]): this;
|
||||
public setCustomId(customId: string): this;
|
||||
@@ -2568,8 +2569,6 @@ export class Role extends Base {
|
||||
public static comparePositions(role1: Role, role2: Role): number;
|
||||
}
|
||||
|
||||
export type SelectMenuTypes = 'STRING_SELECT' | 'USER_SELECT' | 'ROLE_SELECT' | 'MENTIONABLE_SELECT' | 'CHANNEL_SELECT';
|
||||
|
||||
export class SelectMenuInteraction<Cached extends CacheType = CacheType> extends MessageComponentInteraction<Cached> {
|
||||
public constructor(client: Client, data: RawMessageSelectMenuInteractionData);
|
||||
public readonly component: CacheTypeReducer<
|
||||
@@ -2579,7 +2578,7 @@ export class SelectMenuInteraction<Cached extends CacheType = CacheType> extends
|
||||
MessageSelectMenu | APISelectMenuComponent,
|
||||
MessageSelectMenu | APISelectMenuComponent
|
||||
>;
|
||||
public componentType: SelectMenuTypes;
|
||||
public componentType: SelectMenuComponentType;
|
||||
public values: string[];
|
||||
public inGuild(): this is SelectMenuInteraction<'raw' | 'cached'>;
|
||||
public inCachedGuild(): this is SelectMenuInteraction<'cached'>;
|
||||
@@ -3513,6 +3512,7 @@ export const Constants: {
|
||||
InteractionTypes: EnumHolder<typeof InteractionTypes>;
|
||||
InteractionResponseTypes: EnumHolder<typeof InteractionResponseTypes>;
|
||||
MessageComponentTypes: EnumHolder<typeof MessageComponentTypes>;
|
||||
SelectMenuComponentTypes: EnumHolder<typeof SelectMenuComponentTypes>;
|
||||
MessageButtonStyles: EnumHolder<typeof MessageButtonStyles>;
|
||||
ModalComponentTypes: EnumHolder<typeof ModalComponentTypes>;
|
||||
TextInputStyles: EnumHolder<typeof TextInputStyles>;
|
||||
@@ -6292,14 +6292,34 @@ export interface MessageReference {
|
||||
|
||||
export type MessageResolvable = Message | Snowflake;
|
||||
|
||||
export interface MessageSelectMenuOptions extends BaseMessageComponentOptions {
|
||||
type?: SelectMenuTypes;
|
||||
export interface BaseMessageSelectMenuOptions {
|
||||
type?: SelectMenuComponentType | SelectMenuComponentTypes;
|
||||
customId?: string;
|
||||
disabled?: boolean;
|
||||
maxValues?: number;
|
||||
minValues?: number;
|
||||
placeholder?: string;
|
||||
}
|
||||
export interface StringMessageSelectMenuOptions extends BaseMessageSelectMenuOptions {
|
||||
type?:
|
||||
| 'STRING_SELECT'
|
||||
| SelectMenuComponentTypes.STRING_SELECT;
|
||||
options?: MessageSelectOptionData[];
|
||||
}
|
||||
|
||||
export interface ChannelMessageSelectMenuOptions extends BaseMessageSelectMenuOptions {
|
||||
type?: 'CHANNEL_SELECT' | SelectMenuComponentTypes.CHANNEL_SELECT;
|
||||
channelTypes?: ChannelTypes[];
|
||||
}
|
||||
|
||||
export interface OtherMessageSelectMenuOptions extends BaseMessageSelectMenuOptions {
|
||||
type?: ExcludeEnum<typeof SelectMenuComponentTypes, 'CHANNEL_SELECT' | 'STRING_SELECT'>;
|
||||
}
|
||||
|
||||
export type MessageSelectMenuOptions =
|
||||
| StringMessageSelectMenuOptions
|
||||
| ChannelMessageSelectMenuOptions
|
||||
| OtherMessageSelectMenuOptions;
|
||||
|
||||
export interface MessageSelectOption {
|
||||
default: boolean;
|
||||
@@ -6822,6 +6842,8 @@ export type VerificationLevel = keyof typeof VerificationLevels;
|
||||
|
||||
export type VideoQualityMode = keyof typeof VideoQualityModes;
|
||||
|
||||
export type SelectMenuComponentType = keyof typeof SelectMenuComponentTypes;
|
||||
|
||||
export type VoiceBasedChannelTypes = VoiceBasedChannel['type'];
|
||||
|
||||
export type VoiceChannelResolvable = Snowflake | VoiceChannel;
|
||||
|
Reference in New Issue
Block a user