mirror of
https://github.com/tiramisulabs/seyfert.git
synced 2025-07-05 14:36:09 +00:00
fix options unavailable (#123)
This commit is contained in:
parent
edef7989fe
commit
f5ae94543d
@ -72,7 +72,7 @@ export interface LinkButtonComponent {
|
|||||||
export interface SelectMenuComponent {
|
export interface SelectMenuComponent {
|
||||||
type: MessageComponentTypes.SelectMenu;
|
type: MessageComponentTypes.SelectMenu;
|
||||||
customId: string;
|
customId: string;
|
||||||
options: SelectMenuOption[];
|
options?: SelectMenuOption[];
|
||||||
placeholder?: string;
|
placeholder?: string;
|
||||||
minValue?: number;
|
minValue?: number;
|
||||||
maxValue?: number;
|
maxValue?: number;
|
||||||
@ -157,14 +157,18 @@ export class SelectMenu extends BaseComponent implements SelectMenuComponent {
|
|||||||
this.session = session;
|
this.session = session;
|
||||||
this.type = data.type as MessageComponentTypes.SelectMenu;
|
this.type = data.type as MessageComponentTypes.SelectMenu;
|
||||||
this.customId = data.custom_id!;
|
this.customId = data.custom_id!;
|
||||||
this.options = data.options!.map(option => {
|
|
||||||
return {
|
if ('options' in data) {
|
||||||
label: option.label,
|
this.options = data.options?.map(option => {
|
||||||
description: option.description,
|
return {
|
||||||
emoji: option.emoji ? new Emoji(session, option.emoji) : undefined,
|
label: option.label,
|
||||||
value: option.value,
|
description: option.description,
|
||||||
} as SelectMenuOption;
|
emoji: option.emoji ? new Emoji(session, option.emoji) : undefined,
|
||||||
});
|
value: option.value,
|
||||||
|
} as SelectMenuOption;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
this.placeholder = data.placeholder;
|
this.placeholder = data.placeholder;
|
||||||
this.minValues = data.min_values;
|
this.minValues = data.min_values;
|
||||||
this.maxValues = data.max_values;
|
this.maxValues = data.max_values;
|
||||||
@ -174,7 +178,7 @@ export class SelectMenu extends BaseComponent implements SelectMenuComponent {
|
|||||||
readonly session: Session;
|
readonly session: Session;
|
||||||
override type: MessageComponentTypes.SelectMenu;
|
override type: MessageComponentTypes.SelectMenu;
|
||||||
customId: string;
|
customId: string;
|
||||||
options: SelectMenuOption[];
|
options?: SelectMenuOption[];
|
||||||
placeholder?: string;
|
placeholder?: string;
|
||||||
minValues?: number;
|
minValues?: number;
|
||||||
maxValues?: number;
|
maxValues?: number;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user