seyfert 2.1.1-dev-11535421049.0 → 2.1.1-dev-11537652481.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { EmojiResolvable, RestOrArray
|
|
2
|
-
import type { ChannelSelectMenuInteraction, ComponentInteraction, MentionableSelectMenuInteraction, RoleSelectMenuInteraction,
|
|
1
|
+
import type { EmojiResolvable, RestOrArray } from '../common';
|
|
2
|
+
import type { ChannelSelectMenuInteraction, ComponentInteraction, MentionableSelectMenuInteraction, RoleSelectMenuInteraction, UserSelectMenuInteraction } from '../structures';
|
|
3
3
|
import { type APIChannelSelectComponent, type APIMentionableSelectComponent, type APIRoleSelectComponent, type APISelectMenuComponent, type APISelectMenuOption, type APIStringSelectComponent, type APIUserSelectComponent, type ChannelType, SelectMenuDefaultValueType } from '../types';
|
|
4
4
|
import { BaseComponentBuilder, type OptionValuesLength } from './Base';
|
|
5
5
|
export type BuilderSelectMenus = RoleSelectMenu | UserSelectMenu | MentionableSelectMenu | ChannelSelectMenu | StringSelectMenu;
|
|
@@ -11,9 +11,6 @@ export type BuilderSelectMenus = RoleSelectMenu | UserSelectMenu | MentionableSe
|
|
|
11
11
|
* const selectMenu = new SelectMenu<APIUserSelectComponent, UserSelectMenuInteraction>();
|
|
12
12
|
* selectMenu.setCustomId("user-select-menu");
|
|
13
13
|
* selectMenu.setPlaceholder("Select a user");
|
|
14
|
-
* selectMenu.run((interaction) => {
|
|
15
|
-
* // Handle select menu interaction
|
|
16
|
-
* });
|
|
17
14
|
*/
|
|
18
15
|
export declare class SelectMenu<Select extends APISelectMenuComponent = APISelectMenuComponent, Interaction = ComponentInteraction> extends BaseComponentBuilder<Select> {
|
|
19
16
|
/**
|
|
@@ -139,7 +136,6 @@ export declare class ChannelSelectMenu extends SelectMenu<APIChannelSelectCompon
|
|
|
139
136
|
*/
|
|
140
137
|
setChannelTypes(types: ChannelType[]): this;
|
|
141
138
|
}
|
|
142
|
-
declare const StringSelectMenu_base: ToClass<Omit<SelectMenu<APIStringSelectComponent, StringSelectMenuInteraction<string[]>>, "data" | "toJSON">, StringSelectMenu>;
|
|
143
139
|
/**
|
|
144
140
|
* Represents a Select Menu for selecting string options.
|
|
145
141
|
* @example
|
|
@@ -151,7 +147,7 @@ declare const StringSelectMenu_base: ToClass<Omit<SelectMenu<APIStringSelectComp
|
|
|
151
147
|
* { label: "Option 3", value: "option_3" },
|
|
152
148
|
* ]);
|
|
153
149
|
*/
|
|
154
|
-
export declare class StringSelectMenu extends
|
|
150
|
+
export declare class StringSelectMenu extends SelectMenu {
|
|
155
151
|
data: Omit<APIStringSelectComponent, 'options'> & {
|
|
156
152
|
options: StringSelectOption[];
|
|
157
153
|
};
|
|
@@ -214,4 +210,3 @@ export declare class StringSelectOption {
|
|
|
214
210
|
*/
|
|
215
211
|
toJSON(): APISelectMenuOption;
|
|
216
212
|
}
|
|
217
|
-
export {};
|
|
@@ -22,9 +22,6 @@ function mappedDefault(ids, type) {
|
|
|
22
22
|
* const selectMenu = new SelectMenu<APIUserSelectComponent, UserSelectMenuInteraction>();
|
|
23
23
|
* selectMenu.setCustomId("user-select-menu");
|
|
24
24
|
* selectMenu.setPlaceholder("Select a user");
|
|
25
|
-
* selectMenu.run((interaction) => {
|
|
26
|
-
* // Handle select menu interaction
|
|
27
|
-
* });
|
|
28
25
|
*/
|
|
29
26
|
class SelectMenu extends Base_1.BaseComponentBuilder {
|
|
30
27
|
/**
|
|
@@ -219,7 +216,7 @@ exports.ChannelSelectMenu = ChannelSelectMenu;
|
|
|
219
216
|
class StringSelectMenu extends SelectMenu {
|
|
220
217
|
constructor(data = {}) {
|
|
221
218
|
super({ ...data, type: types_1.ComponentType.StringSelect });
|
|
222
|
-
this.data.options =
|
|
219
|
+
this.data.options = data.options?.map(x => new StringSelectOption(x)) ?? [];
|
|
223
220
|
}
|
|
224
221
|
/**
|
|
225
222
|
* Adds options to the string select menu.
|
|
@@ -243,7 +240,7 @@ class StringSelectMenu extends SelectMenu {
|
|
|
243
240
|
const { options, ...raw } = this.data;
|
|
244
241
|
return {
|
|
245
242
|
...raw,
|
|
246
|
-
options:
|
|
243
|
+
options: options.map(x => x.toJSON()),
|
|
247
244
|
};
|
|
248
245
|
}
|
|
249
246
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { UsingClient } from '../../commands';
|
|
2
2
|
import { BaseInteraction } from '../../structures';
|
|
3
3
|
import type { GatewayInteractionCreateDispatchData } from '../../types';
|
|
4
|
-
export declare const INTERACTION_CREATE: (self: UsingClient, data: GatewayInteractionCreateDispatchData) => import("../../structures").RoleSelectMenuInteraction | import("../../structures").UserSelectMenuInteraction | import("../../structures").MentionableSelectMenuInteraction | import("../../structures").ChannelSelectMenuInteraction | import("../../structures").
|
|
4
|
+
export declare const INTERACTION_CREATE: (self: UsingClient, data: GatewayInteractionCreateDispatchData) => import("../../structures").RoleSelectMenuInteraction | import("../../structures").UserSelectMenuInteraction | import("../../structures").MentionableSelectMenuInteraction | import("../../structures").ChannelSelectMenuInteraction | import("../../structures").ChatInputCommandInteraction<boolean> | import("../../structures").UserCommandInteraction<boolean> | import("../../structures").MessageCommandInteraction<boolean> | import("../../structures").ButtonInteraction | import("../../structures").StringSelectMenuInteraction<string[]> | import("../../structures").ModalSubmitInteraction<boolean> | import("../../structures").AutocompleteInteraction<boolean> | BaseInteraction<boolean, import("../../types").APIPingInteraction>;
|
|
@@ -49,7 +49,7 @@ export declare class BaseInteraction<FromGuild extends boolean = boolean, Type e
|
|
|
49
49
|
isAutocomplete(): this is AutocompleteInteraction;
|
|
50
50
|
isModal(): this is ModalSubmitInteraction;
|
|
51
51
|
isEntryPoint(): this is EntryPointInteraction;
|
|
52
|
-
static from(client: UsingClient, gateway: GatewayInteractionCreateDispatchData, __reply?: __InternalReplyFunction): RoleSelectMenuInteraction | UserSelectMenuInteraction | MentionableSelectMenuInteraction | ChannelSelectMenuInteraction |
|
|
52
|
+
static from(client: UsingClient, gateway: GatewayInteractionCreateDispatchData, __reply?: __InternalReplyFunction): RoleSelectMenuInteraction | UserSelectMenuInteraction | MentionableSelectMenuInteraction | ChannelSelectMenuInteraction | ChatInputCommandInteraction<boolean> | UserCommandInteraction<boolean> | MessageCommandInteraction<boolean> | ButtonInteraction | StringSelectMenuInteraction<string[]> | ModalSubmitInteraction<boolean> | AutocompleteInteraction<boolean> | BaseInteraction<boolean, import("../types").APIPingInteraction>;
|
|
53
53
|
fetchGuild(force?: boolean): Promise<import("./Guild").Guild<"api">> | undefined;
|
|
54
54
|
}
|
|
55
55
|
export type AllInteractions = AutocompleteInteraction | ChatInputCommandInteraction | UserCommandInteraction | MessageCommandInteraction | ComponentInteraction | SelectMenuInteraction | ModalSubmitInteraction | EntryPointInteraction | BaseInteraction;
|