seyfert 2.2.1-dev-12941890207.0 → 2.2.1-dev-13162061448.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,4 @@
|
|
|
1
1
|
import type { EmojiResolvable, RestOrArray } from '../common';
|
|
2
|
-
import type { ChannelSelectMenuInteraction, ComponentInteraction, MentionableSelectMenuInteraction, RoleSelectMenuInteraction, UserSelectMenuInteraction } from '../structures';
|
|
3
2
|
import { type APIChannelSelectComponent, type APIMentionableSelectComponent, type APIRoleSelectComponent, type APISelectMenuComponent, type APISelectMenuOption, type APIStringSelectComponent, type APIUserSelectComponent, type ChannelType, SelectMenuDefaultValueType } from '../types';
|
|
4
3
|
import { BaseComponentBuilder, type OptionValuesLength } from './Base';
|
|
5
4
|
export type BuilderSelectMenus = RoleSelectMenu | UserSelectMenu | MentionableSelectMenu | ChannelSelectMenu | StringSelectMenu;
|
|
@@ -8,11 +7,11 @@ export type BuilderSelectMenus = RoleSelectMenu | UserSelectMenu | MentionableSe
|
|
|
8
7
|
* @template Select - The type of APISelectMenuComponent.
|
|
9
8
|
* @template Interaction - The type of interaction.
|
|
10
9
|
* @example
|
|
11
|
-
* const selectMenu = new SelectMenu<APIUserSelectComponent
|
|
10
|
+
* const selectMenu = new SelectMenu<APIUserSelectComponent>();
|
|
12
11
|
* selectMenu.setCustomId("user-select-menu");
|
|
13
12
|
* selectMenu.setPlaceholder("Select a user");
|
|
14
13
|
*/
|
|
15
|
-
export declare class SelectMenu<Select extends APISelectMenuComponent = APISelectMenuComponent
|
|
14
|
+
export declare class SelectMenu<Select extends APISelectMenuComponent = APISelectMenuComponent> extends BaseComponentBuilder<Select> {
|
|
16
15
|
/**
|
|
17
16
|
* Sets the custom ID for the select menu.
|
|
18
17
|
* @param id - The custom ID for the select menu.
|
|
@@ -45,7 +44,7 @@ export declare class SelectMenu<Select extends APISelectMenuComponent = APISelec
|
|
|
45
44
|
* userSelectMenu.setCustomId("user-select");
|
|
46
45
|
* userSelectMenu.addDefaultUsers("123456789", "987654321");
|
|
47
46
|
*/
|
|
48
|
-
export declare class UserSelectMenu extends SelectMenu<APIUserSelectComponent
|
|
47
|
+
export declare class UserSelectMenu extends SelectMenu<APIUserSelectComponent> {
|
|
49
48
|
constructor(data?: Partial<APIUserSelectComponent>);
|
|
50
49
|
/**
|
|
51
50
|
* Adds default selected users to the select menu.
|
|
@@ -67,7 +66,7 @@ export declare class UserSelectMenu extends SelectMenu<APIUserSelectComponent, U
|
|
|
67
66
|
* roleSelectMenu.setCustomId("role-select");
|
|
68
67
|
* roleSelectMenu.addDefaultRoles("123456789", "987654321");
|
|
69
68
|
*/
|
|
70
|
-
export declare class RoleSelectMenu extends SelectMenu<APIRoleSelectComponent
|
|
69
|
+
export declare class RoleSelectMenu extends SelectMenu<APIRoleSelectComponent> {
|
|
71
70
|
constructor(data?: Partial<APIRoleSelectComponent>);
|
|
72
71
|
/**
|
|
73
72
|
* Adds default selected roles to the select menu.
|
|
@@ -92,7 +91,7 @@ export type MentionableDefaultElement = {
|
|
|
92
91
|
* const mentionableSelectMenu = new MentionableSelectMenu();
|
|
93
92
|
* mentionableSelectMenu.setCustomId("mentionable-select");
|
|
94
93
|
*/
|
|
95
|
-
export declare class MentionableSelectMenu extends SelectMenu<APIMentionableSelectComponent
|
|
94
|
+
export declare class MentionableSelectMenu extends SelectMenu<APIMentionableSelectComponent> {
|
|
96
95
|
constructor(data?: Partial<APIMentionableSelectComponent>);
|
|
97
96
|
/**
|
|
98
97
|
* Sets the default selected roles or users for the select menu.
|
|
@@ -115,7 +114,7 @@ export declare class MentionableSelectMenu extends SelectMenu<APIMentionableSele
|
|
|
115
114
|
* channelSelectMenu.addDefaultChannels("123456789", "987654321");
|
|
116
115
|
* channelSelectMenu.setChannelTypes([ChannelType.GuildText, ChannelType.GuildVoice]);
|
|
117
116
|
*/
|
|
118
|
-
export declare class ChannelSelectMenu extends SelectMenu<APIChannelSelectComponent
|
|
117
|
+
export declare class ChannelSelectMenu extends SelectMenu<APIChannelSelectComponent> {
|
|
119
118
|
constructor(data?: Partial<APIChannelSelectComponent>);
|
|
120
119
|
/**
|
|
121
120
|
* Adds default selected channels to the select menu.
|
|
@@ -19,7 +19,7 @@ function mappedDefault(ids, type) {
|
|
|
19
19
|
* @template Select - The type of APISelectMenuComponent.
|
|
20
20
|
* @template Interaction - The type of interaction.
|
|
21
21
|
* @example
|
|
22
|
-
* const selectMenu = new SelectMenu<APIUserSelectComponent
|
|
22
|
+
* const selectMenu = new SelectMenu<APIUserSelectComponent>();
|
|
23
23
|
* selectMenu.setCustomId("user-select-menu");
|
|
24
24
|
* selectMenu.setPlaceholder("Select a user");
|
|
25
25
|
*/
|
package/lib/deps/mixer.js
CHANGED
|
@@ -26,11 +26,8 @@ function getNodeDescriptors(c) {
|
|
|
26
26
|
const result = [];
|
|
27
27
|
while (proto) {
|
|
28
28
|
const descriptors = Object.getOwnPropertyDescriptors(proto);
|
|
29
|
-
// @ts-expect-error this is not a function in all cases
|
|
30
|
-
if (descriptors.valueOf.configurable)
|
|
31
|
-
break;
|
|
32
29
|
result.push(descriptors);
|
|
33
|
-
proto = proto
|
|
30
|
+
proto = Object.getPrototypeOf(proto);
|
|
34
31
|
}
|
|
35
32
|
return result;
|
|
36
33
|
}
|
|
@@ -45,32 +42,29 @@ function getDescriptors(c) {
|
|
|
45
42
|
* @returns The mixed class.
|
|
46
43
|
*/
|
|
47
44
|
function Mixin(...args) {
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
for (const
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
continue;
|
|
58
|
-
if (descriptorK in MixedClass.prototype && descriptorK !== 'toString')
|
|
59
|
-
continue;
|
|
60
|
-
const descriptor = j[descriptorK];
|
|
61
|
-
if (descriptor.value) {
|
|
62
|
-
if (descriptorK === 'toString' && ignoreOverwriteToString) {
|
|
63
|
-
MixedClass.prototype[descriptorK] = args[0].prototype.toString;
|
|
45
|
+
const Base = args[0];
|
|
46
|
+
class MixedClass extends Base {
|
|
47
|
+
constructor(...constructorArgs) {
|
|
48
|
+
super(...constructorArgs);
|
|
49
|
+
for (const mixin of args.slice(1)) {
|
|
50
|
+
const descriptors = getDescriptors(mixin).reverse();
|
|
51
|
+
for (const desc of descriptors) {
|
|
52
|
+
for (const key in desc) {
|
|
53
|
+
if (key === 'constructor')
|
|
64
54
|
continue;
|
|
55
|
+
if (key in mixin.prototype)
|
|
56
|
+
continue;
|
|
57
|
+
const descriptor = desc[key];
|
|
58
|
+
if (descriptor.value) {
|
|
59
|
+
// @ts-expect-error
|
|
60
|
+
MixedClass.prototype[key] = descriptor.value;
|
|
61
|
+
}
|
|
62
|
+
else if (descriptor.get || descriptor.set) {
|
|
63
|
+
Object.defineProperty(MixedClass.prototype, key, {
|
|
64
|
+
get: descriptor.get,
|
|
65
|
+
set: descriptor.set,
|
|
66
|
+
});
|
|
65
67
|
}
|
|
66
|
-
MixedClass.prototype[descriptorK] = descriptor.value;
|
|
67
|
-
continue;
|
|
68
|
-
}
|
|
69
|
-
if (descriptor.get || descriptor.set) {
|
|
70
|
-
Object.defineProperty(MixedClass.prototype, descriptorK, {
|
|
71
|
-
get: descriptor.get,
|
|
72
|
-
set: descriptor.set,
|
|
73
|
-
});
|
|
74
68
|
}
|
|
75
69
|
}
|
|
76
70
|
}
|
|
@@ -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").
|
|
4
|
+
export declare const INTERACTION_CREATE: (self: UsingClient, data: GatewayInteractionCreateDispatchData) => import("../../structures").ChatInputCommandInteraction<boolean> | import("../../structures").UserCommandInteraction<boolean> | import("../../structures").MessageCommandInteraction<boolean> | import("../../structures").ButtonInteraction | import("../../structures").StringSelectMenuInteraction<string[]> | import("../../structures").UserSelectMenuInteraction | import("../../structures").RoleSelectMenuInteraction | import("../../structures").MentionableSelectMenuInteraction | import("../../structures").ChannelSelectMenuInteraction | import("../../structures").ModalSubmitInteraction<boolean> | import("../../structures").AutocompleteInteraction<boolean> | BaseInteraction<boolean, import("../../types").APIPingInteraction>;
|
|
@@ -50,7 +50,7 @@ export declare class BaseInteraction<FromGuild extends boolean = boolean, Type e
|
|
|
50
50
|
isAutocomplete(): this is AutocompleteInteraction;
|
|
51
51
|
isModal(): this is ModalSubmitInteraction;
|
|
52
52
|
isEntryPoint(): this is EntryPointInteraction;
|
|
53
|
-
static from(client: UsingClient, gateway: GatewayInteractionCreateDispatchData, __reply?: __InternalReplyFunction):
|
|
53
|
+
static from(client: UsingClient, gateway: GatewayInteractionCreateDispatchData, __reply?: __InternalReplyFunction): ChatInputCommandInteraction<boolean> | UserCommandInteraction<boolean> | MessageCommandInteraction<boolean> | ButtonInteraction | StringSelectMenuInteraction<string[]> | UserSelectMenuInteraction | RoleSelectMenuInteraction | MentionableSelectMenuInteraction | ChannelSelectMenuInteraction | ModalSubmitInteraction<boolean> | AutocompleteInteraction<boolean> | BaseInteraction<boolean, import("../types").APIPingInteraction>;
|
|
54
54
|
fetchGuild(mode?: 'rest' | 'flow'): Promise<GuildStructure<'cached' | 'api'> | undefined>;
|
|
55
55
|
fetchGuild(mode: 'cache'): ReturnCache<GuildStructure<'cached'> | undefined>;
|
|
56
56
|
}
|