seyfert 1.1.0 → 1.2.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.
- package/lib/api/Routes/applications.d.ts +2 -2
- package/lib/api/Routes/channels.d.ts +2 -2
- package/lib/api/Routes/gateway.d.ts +2 -2
- package/lib/api/Routes/guilds.d.ts +2 -1
- package/lib/api/Routes/interactions.d.ts +2 -2
- package/lib/api/Routes/invites.d.ts +2 -2
- package/lib/api/Routes/stage-instances.d.ts +2 -2
- package/lib/api/Routes/stickers.d.ts +2 -2
- package/lib/api/Routes/users.d.ts +2 -2
- package/lib/api/Routes/voice.d.ts +2 -2
- package/lib/api/Routes/webhooks.d.ts +2 -2
- package/lib/builders/ActionRow.d.ts +2 -1
- package/lib/builders/ActionRow.js +3 -3
- package/lib/builders/Base.d.ts +1 -1
- package/lib/builders/Button.d.ts +2 -1
- package/lib/builders/Button.js +2 -2
- package/lib/builders/Embed.d.ts +2 -1
- package/lib/builders/Modal.d.ts +9 -2
- package/lib/builders/Modal.js +12 -3
- package/lib/builders/SelectMenu.d.ts +18 -1
- package/lib/builders/SelectMenu.js +36 -12
- package/lib/builders/index.d.ts +1 -1
- package/lib/builders/index.js +9 -9
- package/lib/builders/types.d.ts +1 -1
- package/lib/cache/adapters/types.d.ts +23 -23
- package/lib/cache/index.d.ts +5 -5
- package/lib/cache/index.js +3 -3
- package/lib/cache/resources/default/base.d.ts +10 -10
- package/lib/cache/resources/default/guild-based.d.ts +7 -7
- package/lib/cache/resources/default/guild-based.js +2 -1
- package/lib/cache/resources/default/guild-related.d.ts +9 -9
- package/lib/cache/resources/default/guild-related.js +2 -1
- package/lib/cache/resources/presence.d.ts +1 -1
- package/lib/cache/resources/stage-instances.d.ts +1 -1
- package/lib/cache/resources/voice-states.d.ts +1 -1
- package/lib/client/base.d.ts +19 -12
- package/lib/client/base.js +45 -7
- package/lib/client/client.d.ts +7 -4
- package/lib/client/client.js +21 -9
- package/lib/client/httpclient.d.ts +2 -1
- package/lib/client/httpclient.js +3 -3
- package/lib/client/oninteractioncreate.js +18 -19
- package/lib/client/onmessagecreate.js +6 -4
- package/lib/client/workerclient.d.ts +11 -5
- package/lib/client/workerclient.js +18 -11
- package/lib/commands/applications/chat.d.ts +4 -4
- package/lib/commands/applications/chat.js +17 -9
- package/lib/commands/applications/chatcontext.d.ts +7 -10
- package/lib/commands/applications/chatcontext.js +6 -17
- package/lib/commands/applications/menu.d.ts +2 -1
- package/lib/commands/applications/menu.js +7 -5
- package/lib/commands/applications/menucontext.d.ts +5 -9
- package/lib/commands/applications/menucontext.js +8 -21
- package/lib/commands/applications/shared.d.ts +5 -4
- package/lib/commands/basecontex.d.ts +15 -0
- package/lib/commands/basecontex.js +34 -0
- package/lib/commands/decorators.d.ts +3 -2
- package/lib/commands/decorators.js +5 -5
- package/lib/commands/handler.d.ts +6 -0
- package/lib/commands/handler.js +10 -4
- package/lib/commands/optionresolver.d.ts +3 -3
- package/lib/commands/optionresolver.js +14 -14
- package/lib/common/index.d.ts +0 -1
- package/lib/common/index.js +0 -1
- package/lib/common/it/constants.d.ts +3 -1
- package/lib/common/it/constants.js +2 -0
- package/lib/common/it/utils.d.ts +1 -0
- package/lib/common/it/utils.js +2 -1
- package/lib/common/shorters/channels.d.ts +1 -1
- package/lib/common/shorters/channels.js +4 -4
- package/lib/common/shorters/guilds.d.ts +1 -1
- package/lib/common/shorters/guilds.js +6 -1
- package/lib/common/shorters/members.d.ts +6 -1
- package/lib/common/shorters/members.js +25 -2
- package/lib/common/shorters/messages.d.ts +1 -1
- package/lib/common/shorters/messages.js +1 -1
- package/lib/common/shorters/users.d.ts +0 -6
- package/lib/common/shorters/users.js +0 -34
- package/lib/common/shorters/webhook.d.ts +2 -2
- package/lib/common/types/resolvables.d.ts +2 -1
- package/lib/common/types/util.d.ts +4 -1
- package/lib/common/types/write.d.ts +1 -1
- package/lib/components/ActionRow.d.ts +4 -3
- package/lib/components/ActionRow.js +6 -3
- package/lib/components/BaseComponent.d.ts +18 -0
- package/lib/components/BaseComponent.js +21 -0
- package/lib/components/BaseSelectMenuComponent.d.ts +10 -0
- package/lib/components/BaseSelectMenuComponent.js +22 -0
- package/lib/components/ButtonComponent.d.ts +14 -14
- package/lib/components/ButtonComponent.js +36 -25
- package/lib/components/ChannelSelectMenuComponent.d.ts +4 -4
- package/lib/components/ChannelSelectMenuComponent.js +6 -5
- package/lib/components/MentionableSelectMenuComponent.d.ts +3 -2
- package/lib/components/MentionableSelectMenuComponent.js +4 -1
- package/lib/components/RoleSelectMenuComponent.d.ts +3 -2
- package/lib/components/RoleSelectMenuComponent.js +4 -1
- package/lib/components/StringSelectMenuComponent.d.ts +3 -4
- package/lib/components/StringSelectMenuComponent.js +3 -5
- package/lib/components/TextInputComponent.d.ts +10 -5
- package/lib/components/TextInputComponent.js +24 -7
- package/lib/components/UserSelectMenuComponent.d.ts +3 -2
- package/lib/components/UserSelectMenuComponent.js +4 -1
- package/lib/components/command.d.ts +6 -5
- package/lib/components/command.js +4 -0
- package/lib/components/componentcontext.d.ts +42 -0
- package/lib/components/componentcontext.js +79 -0
- package/lib/components/handler.d.ts +22 -6
- package/lib/components/handler.js +19 -12
- package/lib/components/index.d.ts +2 -2
- package/lib/components/index.js +9 -9
- package/lib/events/handler.d.ts +12 -3
- package/lib/events/handler.js +6 -8
- package/lib/events/hooks/application_command.d.ts +2 -2
- package/lib/events/hooks/auto_moderation.d.ts +4 -4
- package/lib/events/hooks/channel.d.ts +1 -1
- package/lib/events/hooks/dispatch.d.ts +1 -1
- package/lib/events/hooks/entitlement.d.ts +4 -4
- package/lib/events/hooks/guild.d.ts +42 -42
- package/lib/events/hooks/integration.d.ts +19 -19
- package/lib/events/hooks/interactions.d.ts +2 -2
- package/lib/events/hooks/invite.d.ts +5 -5
- package/lib/events/hooks/message.d.ts +6 -5
- package/lib/events/hooks/presence.d.ts +7 -7
- package/lib/events/hooks/stage.d.ts +4 -4
- package/lib/events/hooks/thread.d.ts +49 -49
- package/lib/events/hooks/typing.d.ts +2 -2
- package/lib/events/hooks/user.d.ts +1 -1
- package/lib/events/hooks/voice.d.ts +2 -2
- package/lib/events/hooks/webhook.d.ts +1 -1
- package/lib/index.d.ts +3 -6
- package/lib/index.js +6 -7
- package/lib/langs/handler.d.ts +10 -1
- package/lib/langs/handler.js +1 -0
- package/lib/structures/AutoModerationRule.d.ts +3 -2
- package/lib/structures/ClientUser.d.ts +1 -1
- package/lib/structures/Guild.d.ts +27 -27
- package/lib/structures/GuildEmoji.d.ts +2 -1
- package/lib/structures/GuildMember.d.ts +16 -6
- package/lib/structures/GuildMember.js +35 -6
- package/lib/structures/GuildPreview.d.ts +1 -1
- package/lib/structures/GuildRole.d.ts +2 -1
- package/lib/structures/GuildTemplate.d.ts +3 -2
- package/lib/structures/Interaction.d.ts +5 -5
- package/lib/structures/Interaction.js +34 -34
- package/lib/structures/Message.d.ts +6 -5
- package/lib/structures/Sticker.d.ts +2 -1
- package/lib/structures/User.d.ts +7 -3
- package/lib/structures/User.js +5 -0
- package/lib/structures/Webhook.d.ts +63 -4
- package/lib/structures/Webhook.js +53 -0
- package/lib/structures/channels.d.ts +4 -4
- package/lib/structures/extra/BaseGuild.d.ts +2 -1
- package/lib/structures/extra/BaseGuild.js +3 -3
- package/lib/structures/extra/BitField.d.ts +2 -2
- package/lib/structures/extra/BitField.js +2 -2
- package/lib/structures/extra/Permissions.d.ts +1 -1
- package/lib/structures/extra/functions.d.ts +2 -1
- package/lib/structures/extra/functions.js +2 -1
- package/lib/types/index.d.ts +1 -0
- package/lib/types/index.js +17 -0
- package/lib/websocket/SharedTypes.d.ts +2 -1
- package/lib/websocket/SharedTypes.js +1 -0
- package/lib/websocket/discord/shard.d.ts +2 -1
- package/lib/websocket/discord/shard.js +30 -41
- package/lib/websocket/discord/sharder.d.ts +3 -2
- package/lib/websocket/discord/sharder.js +7 -6
- package/lib/websocket/discord/shared.d.ts +2 -1
- package/lib/websocket/discord/worker.d.ts +1 -1
- package/lib/websocket/discord/workermanager.d.ts +3 -2
- package/lib/websocket/discord/workermanager.js +1 -1
- package/package.json +2 -2
package/lib/commands/handler.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CommandHandler = void 0;
|
|
4
|
+
const v10_1 = require("discord-api-types/v10");
|
|
4
5
|
const node_path_1 = require("node:path");
|
|
5
6
|
const common_1 = require("../common");
|
|
6
7
|
const chat_1 = require("./applications/chat");
|
|
@@ -39,6 +40,7 @@ class CommandHandler extends common_1.BaseHandler {
|
|
|
39
40
|
for (const command of result) {
|
|
40
41
|
let commandInstance;
|
|
41
42
|
try {
|
|
43
|
+
//@ts-expect-error abstract class
|
|
42
44
|
commandInstance = new command.file();
|
|
43
45
|
}
|
|
44
46
|
catch (e) {
|
|
@@ -55,6 +57,7 @@ class CommandHandler extends common_1.BaseHandler {
|
|
|
55
57
|
if (commandInstance instanceof menu_1.ContextMenuCommand) {
|
|
56
58
|
this.values.push(commandInstance);
|
|
57
59
|
commandInstance.__filePath = command.path;
|
|
60
|
+
await this.__callback?.(commandInstance);
|
|
58
61
|
continue;
|
|
59
62
|
}
|
|
60
63
|
if (!(commandInstance instanceof chat_1.Command)) {
|
|
@@ -62,7 +65,7 @@ class CommandHandler extends common_1.BaseHandler {
|
|
|
62
65
|
}
|
|
63
66
|
commandInstance.__filePath = command.path;
|
|
64
67
|
commandInstance.options ??= [];
|
|
65
|
-
if (commandInstance.
|
|
68
|
+
if (commandInstance.__autoload) {
|
|
66
69
|
//@AutoLoad
|
|
67
70
|
const options = await this.getFiles((0, node_path_1.dirname)(command.path));
|
|
68
71
|
for (const option of options) {
|
|
@@ -70,8 +73,10 @@ class CommandHandler extends common_1.BaseHandler {
|
|
|
70
73
|
continue;
|
|
71
74
|
}
|
|
72
75
|
try {
|
|
76
|
+
//@ts-expect-error abstract class
|
|
73
77
|
const subCommand = new (result.find(x => x.path === option).file)();
|
|
74
78
|
if (subCommand instanceof chat_1.SubCommand) {
|
|
79
|
+
subCommand.__filePath = option;
|
|
75
80
|
commandInstance.options.push(subCommand);
|
|
76
81
|
}
|
|
77
82
|
}
|
|
@@ -102,6 +107,7 @@ class CommandHandler extends common_1.BaseHandler {
|
|
|
102
107
|
this.__parseCommandLocales(i, client);
|
|
103
108
|
}
|
|
104
109
|
}
|
|
110
|
+
await this.__callback?.(commandInstance);
|
|
105
111
|
}
|
|
106
112
|
return this.values;
|
|
107
113
|
}
|
|
@@ -111,7 +117,7 @@ class CommandHandler extends common_1.BaseHandler {
|
|
|
111
117
|
command.description_localizations = {};
|
|
112
118
|
for (const locale of Object.keys(client.langs.values)) {
|
|
113
119
|
const locales = this.client.langs.aliases.find(x => x[0] === locale)?.[1] ?? [];
|
|
114
|
-
if (Object.values(
|
|
120
|
+
if (Object.values(v10_1.Locale).includes(locale))
|
|
115
121
|
locales.push(locale);
|
|
116
122
|
if (command.__t.name) {
|
|
117
123
|
for (const i of locales) {
|
|
@@ -136,7 +142,7 @@ class CommandHandler extends common_1.BaseHandler {
|
|
|
136
142
|
options.description_localizations = {};
|
|
137
143
|
for (const locale of Object.keys(client.langs.values)) {
|
|
138
144
|
const locales = this.client.langs.aliases.find(x => x[0] === locale)?.[1] ?? [];
|
|
139
|
-
if (Object.values(
|
|
145
|
+
if (Object.values(v10_1.Locale).includes(locale))
|
|
140
146
|
locales.push(locale);
|
|
141
147
|
if (options.locales.name) {
|
|
142
148
|
for (const i of locales) {
|
|
@@ -158,7 +164,7 @@ class CommandHandler extends common_1.BaseHandler {
|
|
|
158
164
|
command.groups = {};
|
|
159
165
|
for (const locale of Object.keys(client.langs.values)) {
|
|
160
166
|
const locales = this.client.langs.aliases.find(x => x[0] === locale)?.[1] ?? [];
|
|
161
|
-
if (Object.values(
|
|
167
|
+
if (Object.values(v10_1.Locale).includes(locale))
|
|
162
168
|
locales.push(locale);
|
|
163
169
|
for (const group in command.__tGroups) {
|
|
164
170
|
command.groups[group] ??= {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { type APIApplicationCommandInteractionDataOption, type APIAttachment, type APIGuildMember, type APIInteractionDataResolvedChannel, type APIInteractionGuildMember, type APIRole, type APIUser, ApplicationCommandOptionType } from 'discord-api-types/v10';
|
|
1
2
|
import { Attachment, GuildMember } from '..';
|
|
2
|
-
import type {
|
|
3
|
-
import { ApplicationCommandOptionType } from '../common';
|
|
3
|
+
import type { MakeRequired } from '../common';
|
|
4
4
|
import type { AllChannels } from '../structures';
|
|
5
5
|
import { GuildRole, InteractionGuildMember, User } from '../structures';
|
|
6
6
|
import type { Command, CommandAutocompleteOption, SubCommand } from './applications/chat';
|
|
@@ -31,7 +31,7 @@ export declare class OptionResolver {
|
|
|
31
31
|
getGroup(): string | null;
|
|
32
32
|
get(name: string): OptionResolved | undefined;
|
|
33
33
|
getHoisted(name: string): OptionResolved | undefined;
|
|
34
|
-
getValue(name: string): string | number | boolean | Attachment | GuildRole | GuildMember | User | import("..").BaseChannel<import("discord-api-types/
|
|
34
|
+
getValue(name: string): string | number | boolean | Attachment | GuildRole | GuildMember | User | import("..").BaseChannel<import("discord-api-types/v10").ChannelType> | import("..").DMChannel | import("..").CategoryChannel | InteractionGuildMember | undefined;
|
|
35
35
|
private getTypedOption;
|
|
36
36
|
getChannel(name: string, required?: true): AllChannels;
|
|
37
37
|
getString(name: string, required?: true): string;
|
|
@@ -4,8 +4,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.OptionResolver = void 0;
|
|
7
|
+
const v10_1 = require("discord-api-types/v10");
|
|
7
8
|
const __1 = require("..");
|
|
8
|
-
const common_1 = require("../common");
|
|
9
9
|
const structures_1 = require("../structures");
|
|
10
10
|
const channels_1 = __importDefault(require("../structures/channels"));
|
|
11
11
|
class OptionResolver {
|
|
@@ -23,11 +23,11 @@ class OptionResolver {
|
|
|
23
23
|
this.guildId = guildId;
|
|
24
24
|
this.resolved = resolved;
|
|
25
25
|
this.hoistedOptions = this.options = options.map(option => this.transformOption(option, resolved));
|
|
26
|
-
if (this.hoistedOptions[0]?.type ===
|
|
26
|
+
if (this.hoistedOptions[0]?.type === v10_1.ApplicationCommandOptionType.Subcommand) {
|
|
27
27
|
this.subCommand = this.hoistedOptions[0].name;
|
|
28
28
|
this.hoistedOptions = this.hoistedOptions[0].options ?? [];
|
|
29
29
|
}
|
|
30
|
-
if (this.hoistedOptions[0]?.type ===
|
|
30
|
+
if (this.hoistedOptions[0]?.type === v10_1.ApplicationCommandOptionType.SubcommandGroup) {
|
|
31
31
|
this.group = this.hoistedOptions[0].name;
|
|
32
32
|
this.subCommand = this.hoistedOptions[0].options[0].name;
|
|
33
33
|
this.hoistedOptions = this.hoistedOptions[0].options[0].options ?? [];
|
|
@@ -69,22 +69,22 @@ class OptionResolver {
|
|
|
69
69
|
return;
|
|
70
70
|
}
|
|
71
71
|
switch (option.type) {
|
|
72
|
-
case
|
|
72
|
+
case v10_1.ApplicationCommandOptionType.Attachment:
|
|
73
73
|
return option.attachment;
|
|
74
|
-
case
|
|
74
|
+
case v10_1.ApplicationCommandOptionType.Boolean:
|
|
75
75
|
return option.value;
|
|
76
|
-
case
|
|
76
|
+
case v10_1.ApplicationCommandOptionType.Channel:
|
|
77
77
|
return option.channel;
|
|
78
|
-
case
|
|
79
|
-
case
|
|
78
|
+
case v10_1.ApplicationCommandOptionType.Integer:
|
|
79
|
+
case v10_1.ApplicationCommandOptionType.Number:
|
|
80
80
|
return option.value;
|
|
81
|
-
case
|
|
81
|
+
case v10_1.ApplicationCommandOptionType.Role:
|
|
82
82
|
return option.role;
|
|
83
|
-
case
|
|
83
|
+
case v10_1.ApplicationCommandOptionType.String:
|
|
84
84
|
return option.value;
|
|
85
|
-
case
|
|
85
|
+
case v10_1.ApplicationCommandOptionType.User:
|
|
86
86
|
return option.member ?? option.user;
|
|
87
|
-
case
|
|
87
|
+
case v10_1.ApplicationCommandOptionType.Mentionable:
|
|
88
88
|
return option.member ?? option.user ?? option.role;
|
|
89
89
|
default:
|
|
90
90
|
return;
|
|
@@ -101,11 +101,11 @@ class OptionResolver {
|
|
|
101
101
|
return option;
|
|
102
102
|
}
|
|
103
103
|
getChannel(name) {
|
|
104
|
-
const option = this.getTypedOption(name, [
|
|
104
|
+
const option = this.getTypedOption(name, [v10_1.ApplicationCommandOptionType.Channel]);
|
|
105
105
|
return option.channel;
|
|
106
106
|
}
|
|
107
107
|
getString(name) {
|
|
108
|
-
const option = this.getTypedOption(name, [
|
|
108
|
+
const option = this.getTypedOption(name, [v10_1.ApplicationCommandOptionType.String]);
|
|
109
109
|
return option.value;
|
|
110
110
|
}
|
|
111
111
|
transformOption(option, resolved) {
|
package/lib/common/index.d.ts
CHANGED
package/lib/common/index.js
CHANGED
|
@@ -17,7 +17,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./it/constants"), exports);
|
|
18
18
|
__exportStar(require("./it/utils"), exports);
|
|
19
19
|
//
|
|
20
|
-
__exportStar(require("discord-api-types/v10"), exports);
|
|
21
20
|
__exportStar(require("./it/colors"), exports);
|
|
22
21
|
__exportStar(require("./it/logger"), exports);
|
|
23
22
|
__exportStar(require("./shorters/channels"), exports);
|
|
@@ -28,7 +28,9 @@ export declare enum EmbedColors {
|
|
|
28
28
|
Blurple = 5793266,
|
|
29
29
|
Greyple = 10070709,
|
|
30
30
|
DarkButNotBlack = 2895667,
|
|
31
|
-
NotQuiteBlack = 2303786
|
|
31
|
+
NotQuiteBlack = 2303786,
|
|
32
|
+
DiscordDark = 3224376,
|
|
33
|
+
DiscordLight = 16382457
|
|
32
34
|
}
|
|
33
35
|
export declare const DiscordEpoch = 1420070400000n;
|
|
34
36
|
export declare const BASE_HOST = "https://discord.com";
|
|
@@ -33,6 +33,8 @@ var EmbedColors;
|
|
|
33
33
|
EmbedColors[EmbedColors["Greyple"] = 10070709] = "Greyple";
|
|
34
34
|
EmbedColors[EmbedColors["DarkButNotBlack"] = 2895667] = "DarkButNotBlack";
|
|
35
35
|
EmbedColors[EmbedColors["NotQuiteBlack"] = 2303786] = "NotQuiteBlack";
|
|
36
|
+
EmbedColors[EmbedColors["DiscordDark"] = 3224376] = "DiscordDark";
|
|
37
|
+
EmbedColors[EmbedColors["DiscordLight"] = 16382457] = "DiscordLight";
|
|
36
38
|
})(EmbedColors || (exports.EmbedColors = EmbedColors = {}));
|
|
37
39
|
exports.DiscordEpoch = 1420070400000n;
|
|
38
40
|
exports.BASE_HOST = 'https://discord.com';
|
package/lib/common/it/utils.d.ts
CHANGED
|
@@ -40,6 +40,7 @@ export declare function filterSplit<Element, Predicate extends (value: Element)
|
|
|
40
40
|
*/
|
|
41
41
|
export declare class BaseHandler {
|
|
42
42
|
protected logger: Logger;
|
|
43
|
+
__callback?: (...args: any[]) => any;
|
|
43
44
|
/**
|
|
44
45
|
* Initializes a new instance of the BaseHandler class.
|
|
45
46
|
* @param logger The logger instance.
|
package/lib/common/it/utils.js
CHANGED
|
@@ -95,6 +95,7 @@ exports.filterSplit = filterSplit;
|
|
|
95
95
|
*/
|
|
96
96
|
class BaseHandler {
|
|
97
97
|
logger;
|
|
98
|
+
__callback;
|
|
98
99
|
/**
|
|
99
100
|
* Initializes a new instance of the BaseHandler class.
|
|
100
101
|
* @param logger The logger instance.
|
|
@@ -241,7 +242,7 @@ async function magicImport(path) {
|
|
|
241
242
|
}
|
|
242
243
|
catch {
|
|
243
244
|
// biome-ignore lint/security/noGlobalEval: modules import broke
|
|
244
|
-
return eval('((path) => import(`file:///${path}`))')(path.split('\\').join('\\\\'));
|
|
245
|
+
return eval('((path) => import(`file:///${path}?update=${Date.now()}`))')(path.split('\\').join('\\\\'));
|
|
245
246
|
}
|
|
246
247
|
}
|
|
247
248
|
exports.magicImport = magicImport;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type RESTPatchAPIChannelJSONBody } from '
|
|
1
|
+
import { type RESTPatchAPIChannelJSONBody } from 'discord-api-types/v10';
|
|
2
2
|
import { Message, type GuildMember, type GuildRole } from '../../structures';
|
|
3
3
|
import { type AllChannels } from '../../structures/channels';
|
|
4
4
|
import { PermissionsBitField } from '../../structures/extra/Permissions';
|
|
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.ChannelShorter = void 0;
|
|
7
|
-
const
|
|
7
|
+
const v10_1 = require("discord-api-types/v10");
|
|
8
8
|
const structures_1 = require("../../structures");
|
|
9
9
|
const channels_1 = __importDefault(require("../../structures/channels"));
|
|
10
10
|
const Permissions_1 = require("../../structures/extra/Permissions");
|
|
@@ -86,7 +86,7 @@ class ChannelShorter extends base_1.BaseShorter {
|
|
|
86
86
|
}
|
|
87
87
|
async memberPermissions(channelId, member, checkAdmin = true) {
|
|
88
88
|
const permissions = await member.fetchPermissions();
|
|
89
|
-
if (checkAdmin && permissions.has(
|
|
89
|
+
if (checkAdmin && permissions.has(v10_1.PermissionFlagsBits.Administrator)) {
|
|
90
90
|
return new Permissions_1.PermissionsBitField(Permissions_1.PermissionsBitField.All);
|
|
91
91
|
}
|
|
92
92
|
const overwrites = await this.overwritesFor(channelId, member);
|
|
@@ -107,7 +107,7 @@ class ChannelShorter extends base_1.BaseShorter {
|
|
|
107
107
|
if (overwrite.id === member.guildId) {
|
|
108
108
|
everyoneOverwrites = overwrite;
|
|
109
109
|
}
|
|
110
|
-
else if (member.roles.
|
|
110
|
+
else if (member.roles.keys.includes(overwrite.id)) {
|
|
111
111
|
roleOverwrites.push(overwrite);
|
|
112
112
|
}
|
|
113
113
|
else if (overwrite.id === member.id) {
|
|
@@ -121,7 +121,7 @@ class ChannelShorter extends base_1.BaseShorter {
|
|
|
121
121
|
};
|
|
122
122
|
}
|
|
123
123
|
async rolePermissions(channelId, role, checkAdmin = true) {
|
|
124
|
-
if (checkAdmin && role.permissions.has(
|
|
124
|
+
if (checkAdmin && role.permissions.has(v10_1.PermissionFlagsBits.Administrator)) {
|
|
125
125
|
return new Permissions_1.PermissionsBitField(Permissions_1.PermissionsBitField.All);
|
|
126
126
|
}
|
|
127
127
|
const channelOverwrites = (await this.client.cache.overwrites?.get(channelId)) ?? [];
|
|
@@ -24,7 +24,7 @@ export declare class GuildShorter extends BaseShorter {
|
|
|
24
24
|
*/
|
|
25
25
|
widgetURL(id: string, style?: GuildWidgetStyle): Promise<import("discord-api-types/v10").APIGuildWidgetSettings>;
|
|
26
26
|
list(query?: RESTGetAPICurrentUserGuildsQuery): Promise<AnonymousGuild[]>;
|
|
27
|
-
fetchSelf(id: string): Promise<GuildMember>;
|
|
27
|
+
fetchSelf(id: string, force?: boolean): Promise<GuildMember>;
|
|
28
28
|
leave(id: string): Promise<void | undefined>;
|
|
29
29
|
/**
|
|
30
30
|
* Provides access to channel-related functionality in a guild.
|
|
@@ -54,7 +54,12 @@ class GuildShorter extends base_1.BaseShorter {
|
|
|
54
54
|
.guilds.get({ query })
|
|
55
55
|
.then(guilds => guilds.map(guild => new structures_1.AnonymousGuild(this.client, { ...guild, splash: null })));
|
|
56
56
|
}
|
|
57
|
-
async fetchSelf(id) {
|
|
57
|
+
async fetchSelf(id, force = false) {
|
|
58
|
+
if (!force) {
|
|
59
|
+
const self = await this.client.cache.members?.get(this.client.botId, id);
|
|
60
|
+
if (self)
|
|
61
|
+
return self;
|
|
62
|
+
}
|
|
58
63
|
const self = await this.client.proxy.guilds(id).members(this.client.botId).get();
|
|
59
64
|
await this.client.cache.members?.patch(self.user.id, id, self);
|
|
60
65
|
return new structures_1.GuildMember(this.client, self, self.user, id);
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { RESTGetAPIGuildMembersQuery, RESTGetAPIGuildMembersSearchQuery, RESTPatchAPIGuildMemberJSONBody, RESTPutAPIGuildBanJSONBody, RESTPutAPIGuildMemberJSONBody } from 'discord-api-types/v10';
|
|
2
2
|
import { GuildMember } from '../../structures';
|
|
3
|
+
import { PermissionsBitField } from '../../structures/extra/Permissions';
|
|
4
|
+
import type { GuildMemberResolvable } from '../types/resolvables';
|
|
3
5
|
import { BaseShorter } from './base';
|
|
4
6
|
export declare class MemberShorter extends BaseShorter {
|
|
5
7
|
/**
|
|
@@ -86,4 +88,7 @@ export declare class MemberShorter extends BaseShorter {
|
|
|
86
88
|
* @param id The ID of the role to remove.
|
|
87
89
|
*/
|
|
88
90
|
removeRole(guildId: string, memberId: string, id: string): Promise<never>;
|
|
91
|
+
listRoles(guildId: string, memberId: string, force?: boolean): Promise<import("../../structures").GuildRole[]>;
|
|
92
|
+
sortRoles(guildId: string, memberId: string, force?: boolean): Promise<import("../../structures").GuildRole[]>;
|
|
93
|
+
permissions(guildId: string, memberId: string, force?: boolean): Promise<PermissionsBitField>;
|
|
89
94
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.MemberShorter = void 0;
|
|
4
|
-
const
|
|
4
|
+
const globals_1 = require("discord-api-types/globals");
|
|
5
5
|
const structures_1 = require("../../structures");
|
|
6
|
+
const Permissions_1 = require("../../structures/extra/Permissions");
|
|
6
7
|
const base_1 = require("./base");
|
|
7
8
|
class MemberShorter extends base_1.BaseShorter {
|
|
8
9
|
/**
|
|
@@ -13,7 +14,7 @@ class MemberShorter extends base_1.BaseShorter {
|
|
|
13
14
|
*/
|
|
14
15
|
async resolve(guildId, resolve) {
|
|
15
16
|
if (typeof resolve === 'string') {
|
|
16
|
-
const match = resolve.match(
|
|
17
|
+
const match = resolve.match(globals_1.FormattingPatterns.User)?.groups;
|
|
17
18
|
if (match?.id) {
|
|
18
19
|
return this.fetch(guildId, match.id);
|
|
19
20
|
}
|
|
@@ -160,5 +161,27 @@ class MemberShorter extends base_1.BaseShorter {
|
|
|
160
161
|
removeRole(guildId, memberId, id) {
|
|
161
162
|
return this.client.proxy.guilds(guildId).members(memberId).roles(id).delete();
|
|
162
163
|
}
|
|
164
|
+
async listRoles(guildId, memberId, force = false) {
|
|
165
|
+
if (!force) {
|
|
166
|
+
const member = await this.client.cache.members?.get(memberId, guildId);
|
|
167
|
+
if (member) {
|
|
168
|
+
const roles = (await this.client.cache.roles?.bulk(member.roles.keys)) ?? [];
|
|
169
|
+
if (roles.length)
|
|
170
|
+
return roles;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
const member = await this.client.members.fetch(guildId, memberId, force);
|
|
174
|
+
const allRoles = await this.client.roles.list(guildId, force);
|
|
175
|
+
const rolesId = member.roles.keys.concat(guildId);
|
|
176
|
+
return allRoles.filter(role => rolesId.includes(role.id));
|
|
177
|
+
}
|
|
178
|
+
async sortRoles(guildId, memberId, force = false) {
|
|
179
|
+
const roles = await this.listRoles(guildId, memberId, force);
|
|
180
|
+
return roles.sort((a, b) => b.position - a.position);
|
|
181
|
+
}
|
|
182
|
+
async permissions(guildId, memberId, force = false) {
|
|
183
|
+
const roles = await this.listRoles(guildId, memberId, force);
|
|
184
|
+
return new Permissions_1.PermissionsBitField(roles.map(x => BigInt(x.permissions.bits)));
|
|
185
|
+
}
|
|
163
186
|
}
|
|
164
187
|
exports.MemberShorter = MemberShorter;
|
|
@@ -6,7 +6,7 @@ export declare class MessageShorter extends BaseShorter {
|
|
|
6
6
|
write(channelId: string, { files, ...body }: MessageCreateBodyRequest): Promise<Message>;
|
|
7
7
|
edit(messageId: string, channelId: string, { files, ...body }: MessageUpdateBodyRequest): Promise<Message>;
|
|
8
8
|
crosspost(messageId: string, channelId: string, reason?: string): Promise<Message>;
|
|
9
|
-
delete(messageId: string, channelId: string, reason?: string): Promise<void>;
|
|
9
|
+
delete(messageId: string, channelId: string, reason?: string): Promise<void | undefined>;
|
|
10
10
|
fetch(messageId: string, channelId: string): Promise<Message>;
|
|
11
11
|
purge(messages: string[], channelId: string, reason?: string): Promise<never>;
|
|
12
12
|
thread(channelId: string, messageId: string, options: RESTPostAPIChannelMessagesThreadsJSONBody & {
|
|
@@ -44,7 +44,7 @@ class MessageShorter extends base_1.BaseShorter {
|
|
|
44
44
|
.messages(messageId)
|
|
45
45
|
.delete({ reason })
|
|
46
46
|
.then(() => {
|
|
47
|
-
return this.client.components
|
|
47
|
+
return this.client.components?.onMessageDelete(messageId);
|
|
48
48
|
});
|
|
49
49
|
}
|
|
50
50
|
fetch(messageId, channelId) {
|
|
@@ -6,10 +6,4 @@ export declare class UsersShorter extends BaseShorter {
|
|
|
6
6
|
deleteDM(userId: string, reason?: string): Promise<DMChannel>;
|
|
7
7
|
fetch(userId: string, force?: boolean): Promise<User>;
|
|
8
8
|
write(userId: string, body: MessageCreateBodyRequest): Promise<import("../../structures").Message>;
|
|
9
|
-
get users(): {
|
|
10
|
-
createDM: (userId: string, force?: boolean) => Promise<DMChannel>;
|
|
11
|
-
deleteDM: (userId: string, reason?: string) => Promise<DMChannel>;
|
|
12
|
-
fetch: (userId: string, force?: boolean) => Promise<User>;
|
|
13
|
-
write: (userId: string, body: MessageCreateBodyRequest) => Promise<import("../../structures").Message>;
|
|
14
|
-
};
|
|
15
9
|
}
|
|
@@ -34,39 +34,5 @@ class UsersShorter extends base_1.BaseShorter {
|
|
|
34
34
|
async write(userId, body) {
|
|
35
35
|
return (await this.client.users.createDM(userId)).messages.write(body);
|
|
36
36
|
}
|
|
37
|
-
get users() {
|
|
38
|
-
return {
|
|
39
|
-
createDM: async (userId, force = false) => {
|
|
40
|
-
if (!force) {
|
|
41
|
-
const dm = await this.client.cache.channels?.get(userId);
|
|
42
|
-
if (dm)
|
|
43
|
-
return dm;
|
|
44
|
-
}
|
|
45
|
-
const data = await this.client.proxy.users('@me').channels.post({
|
|
46
|
-
body: { recipient_id: userId },
|
|
47
|
-
});
|
|
48
|
-
await this.client.cache.channels?.set(userId, '@me', data);
|
|
49
|
-
return new structures_1.DMChannel(this.client, data);
|
|
50
|
-
},
|
|
51
|
-
deleteDM: async (userId, reason) => {
|
|
52
|
-
const res = await this.client.proxy.channels(userId).delete({ reason });
|
|
53
|
-
await this.client.cache.channels?.removeIfNI(structures_1.BaseChannel.__intent__('@me'), res.id, '@me');
|
|
54
|
-
return new structures_1.DMChannel(this.client, res);
|
|
55
|
-
},
|
|
56
|
-
fetch: async (userId, force = false) => {
|
|
57
|
-
if (!force) {
|
|
58
|
-
const user = await this.client.cache.users?.get(userId);
|
|
59
|
-
if (user)
|
|
60
|
-
return user;
|
|
61
|
-
}
|
|
62
|
-
const data = await this.client.proxy.users(userId).get();
|
|
63
|
-
await this.client.cache.users?.patch(userId, data);
|
|
64
|
-
return new structures_1.User(this.client, data);
|
|
65
|
-
},
|
|
66
|
-
write: async (userId, body) => {
|
|
67
|
-
return (await this.client.users.createDM(userId)).messages.write(body);
|
|
68
|
-
},
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
37
|
}
|
|
72
38
|
exports.UsersShorter = UsersShorter;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { RESTPatchAPIWebhookJSONBody, RESTPatchAPIWebhookWithTokenJSONBody, RESTPostAPIChannelWebhookJSONBody } from '
|
|
1
|
+
import type { RESTPatchAPIWebhookJSONBody, RESTPatchAPIWebhookWithTokenJSONBody, RESTPostAPIChannelWebhookJSONBody } from 'discord-api-types/v10';
|
|
2
2
|
import { Webhook, WebhookMessage, type MessageWebhookMethodEditParams, type MessageWebhookMethodWriteParams } from '../../structures';
|
|
3
3
|
import { BaseShorter } from './base';
|
|
4
4
|
export declare class WebhookShorter extends BaseShorter {
|
|
@@ -17,7 +17,7 @@ export declare class WebhookShorter extends BaseShorter {
|
|
|
17
17
|
* @param options The optional parameters including token and reason.
|
|
18
18
|
* @returns A Promise that resolves when the webhook is edited.
|
|
19
19
|
*/
|
|
20
|
-
edit(webhookId: string, body: RESTPatchAPIWebhookWithTokenJSONBody | RESTPatchAPIWebhookJSONBody, options: WebhookShorterOptionalParams): Promise<import("discord-api-types/
|
|
20
|
+
edit(webhookId: string, body: RESTPatchAPIWebhookWithTokenJSONBody | RESTPatchAPIWebhookJSONBody, options: WebhookShorterOptionalParams): Promise<import("discord-api-types/v10").RESTGetAPIWebhookWithTokenResult>;
|
|
21
21
|
/**
|
|
22
22
|
* Fetches a webhook.
|
|
23
23
|
* @param webhookId The ID of the webhook.
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { APIPartialEmoji
|
|
1
|
+
import type { APIPartialEmoji } from 'discord-api-types/v10';
|
|
2
|
+
import type { EmbedColors } from '..';
|
|
2
3
|
import type { Attachment, AttachmentDataType, AttachmentResolvable } from '../../builders';
|
|
3
4
|
import type { GuildMember } from '../../structures';
|
|
4
5
|
export type EmojiResolvable = string | Partial<APIPartialEmoji> | `<${string | undefined}:${string}:${string}>`;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { GatewayIntentBits, PermissionFlagsBits } from '
|
|
1
|
+
import type { GatewayIntentBits, PermissionFlagsBits } from 'discord-api-types/v10';
|
|
2
2
|
export type ToClass<T, This> = new (...args: any[]) => {
|
|
3
3
|
[K in keyof T]: T[K] extends (...args: any[]) => any ? ReturnType<T[K]> extends Promise<T> ? (...args: Parameters<T[K]>) => Promise<This> : ReturnType<T[K]> extends T ? (...args: Parameters<T[K]>) => This : T[K] : T[K];
|
|
4
4
|
};
|
|
@@ -34,6 +34,8 @@ export type Identify<T> = T extends infer U ? {
|
|
|
34
34
|
} : never;
|
|
35
35
|
export type TypeArray<T> = T | T[];
|
|
36
36
|
export type When<T extends boolean, A, B = never> = T extends true ? A : B;
|
|
37
|
+
export type AuxIsStrictlyUndefined<T> = T extends undefined | null | never | void ? true : false;
|
|
38
|
+
export type IsStrictlyUndefined<T> = AuxIsStrictlyUndefined<T> extends true ? true : AuxIsStrictlyUndefined<T> extends false ? false : false;
|
|
37
39
|
export type If<T extends boolean, A, B = null> = T extends true ? A : B extends null ? A | null : B;
|
|
38
40
|
export type PickPartial<T, K extends keyof T> = {
|
|
39
41
|
[P in keyof T]?: T[P] | undefined;
|
|
@@ -88,4 +90,5 @@ export type AtLeastOne<T, U = {
|
|
|
88
90
|
[K in keyof T]: Pick<T, K>;
|
|
89
91
|
}> = Partial<T> & U[keyof U];
|
|
90
92
|
export type FlatObjectKeys<T extends Record<string, any>, Key = keyof T> = Key extends string ? T[Key] extends Record<string, unknown> ? `${Key}.${FlatObjectKeys<T[Key]>}` : T[Key] extends string ? `${Key}` : never : never;
|
|
93
|
+
export type Awaitable<V> = Promise<V> | V;
|
|
91
94
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { APIActionRowComponent, APIEmbed, APIInteractionResponseCallbackData, APIInteractionResponseChannelMessageWithSource, APIMessageActionRowComponent, APIModalInteractionResponse, RESTPatchAPIChannelMessageJSONBody, RESTPatchAPIWebhookWithTokenMessageJSONBody, RESTPostAPIChannelMessageJSONBody, RESTPostAPIWebhookWithTokenJSONBody } from '
|
|
1
|
+
import type { APIActionRowComponent, APIEmbed, APIInteractionResponseCallbackData, APIInteractionResponseChannelMessageWithSource, APIMessageActionRowComponent, APIModalInteractionResponse, RESTPatchAPIChannelMessageJSONBody, RESTPatchAPIWebhookWithTokenMessageJSONBody, RESTPostAPIChannelMessageJSONBody, RESTPostAPIWebhookWithTokenJSONBody } from 'discord-api-types/v10';
|
|
2
2
|
import type { RawFile } from '../../api';
|
|
3
3
|
import type { ActionRow, Attachment, AttachmentBuilder, BuilderComponents, Embed, Modal } from '../../builders';
|
|
4
4
|
import type { OmitInsert } from './util';
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import type { APIMessageActionRowComponent, ComponentType } from '
|
|
2
|
-
import { BaseComponent } from '
|
|
1
|
+
import type { APIMessageActionRowComponent, ComponentType } from 'discord-api-types/v10';
|
|
2
|
+
import { BaseComponent } from './BaseComponent';
|
|
3
3
|
import type { ActionRowMessageComponents } from './index';
|
|
4
4
|
export declare class MessageActionRowComponent<T extends ActionRowMessageComponents> extends BaseComponent<ComponentType.ActionRow> {
|
|
5
|
+
private ComponentsFactory;
|
|
5
6
|
constructor(data: {
|
|
6
7
|
type: ComponentType.ActionRow;
|
|
7
8
|
components: APIMessageActionRowComponent[];
|
|
8
9
|
});
|
|
9
|
-
components: T[];
|
|
10
|
+
get components(): T[];
|
|
10
11
|
}
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.MessageActionRowComponent = void 0;
|
|
4
|
-
const BaseComponent_1 = require("
|
|
4
|
+
const BaseComponent_1 = require("./BaseComponent");
|
|
5
5
|
const index_1 = require("./index");
|
|
6
6
|
class MessageActionRowComponent extends BaseComponent_1.BaseComponent {
|
|
7
|
+
ComponentsFactory;
|
|
7
8
|
constructor(data) {
|
|
8
9
|
super(data);
|
|
9
|
-
this.
|
|
10
|
+
this.ComponentsFactory = data.components.map(index_1.componentFactory);
|
|
11
|
+
}
|
|
12
|
+
get components() {
|
|
13
|
+
return this.ComponentsFactory;
|
|
10
14
|
}
|
|
11
|
-
components;
|
|
12
15
|
}
|
|
13
16
|
exports.MessageActionRowComponent = MessageActionRowComponent;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type APIActionRowComponent, type APIActionRowComponentTypes, type APIButtonComponent, type APIChannelSelectComponent, type APIMentionableSelectComponent, type APIRoleSelectComponent, type APIStringSelectComponent, type APITextInputComponent, type APIUserSelectComponent, ComponentType } from 'discord-api-types/v10';
|
|
2
|
+
export declare class BaseComponent<T extends ComponentType> {
|
|
3
|
+
data: APIComponentsMap[T];
|
|
4
|
+
constructor(data: APIComponentsMap[T]);
|
|
5
|
+
get type(): ComponentType;
|
|
6
|
+
toJSON(): APIComponentsMap[T];
|
|
7
|
+
toBuilder(): import("../builders").BuilderComponents | import("../builders").ActionRow<import("../builders").BuilderComponents>;
|
|
8
|
+
}
|
|
9
|
+
export interface APIComponentsMap {
|
|
10
|
+
[ComponentType.ActionRow]: APIActionRowComponent<APIActionRowComponentTypes>;
|
|
11
|
+
[ComponentType.Button]: APIButtonComponent;
|
|
12
|
+
[ComponentType.ChannelSelect]: APIChannelSelectComponent;
|
|
13
|
+
[ComponentType.MentionableSelect]: APIMentionableSelectComponent;
|
|
14
|
+
[ComponentType.RoleSelect]: APIRoleSelectComponent;
|
|
15
|
+
[ComponentType.StringSelect]: APIStringSelectComponent;
|
|
16
|
+
[ComponentType.UserSelect]: APIUserSelectComponent;
|
|
17
|
+
[ComponentType.TextInput]: APITextInputComponent;
|
|
18
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BaseComponent = void 0;
|
|
4
|
+
const v10_1 = require("discord-api-types/v10");
|
|
5
|
+
const builders_1 = require("../builders");
|
|
6
|
+
class BaseComponent {
|
|
7
|
+
data;
|
|
8
|
+
constructor(data) {
|
|
9
|
+
this.data = data;
|
|
10
|
+
}
|
|
11
|
+
get type() {
|
|
12
|
+
return this.data.type;
|
|
13
|
+
}
|
|
14
|
+
toJSON() {
|
|
15
|
+
return this.data;
|
|
16
|
+
}
|
|
17
|
+
toBuilder() {
|
|
18
|
+
return (0, builders_1.fromComponent)(this.data);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
exports.BaseComponent = BaseComponent;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ComponentType } from 'discord-api-types/v10';
|
|
2
|
+
import { BaseComponent } from './BaseComponent';
|
|
3
|
+
export type APISelectMenuComponentTypes = ComponentType.ChannelSelect | ComponentType.MentionableSelect | ComponentType.RoleSelect | ComponentType.StringSelect | ComponentType.UserSelect;
|
|
4
|
+
export declare class BaseSelectMenuComponent<T extends APISelectMenuComponentTypes> extends BaseComponent<T> {
|
|
5
|
+
get customId(): string;
|
|
6
|
+
get disabed(): boolean | undefined;
|
|
7
|
+
get max(): number | undefined;
|
|
8
|
+
get min(): number | undefined;
|
|
9
|
+
get placeholder(): string | undefined;
|
|
10
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BaseSelectMenuComponent = void 0;
|
|
4
|
+
const BaseComponent_1 = require("./BaseComponent");
|
|
5
|
+
class BaseSelectMenuComponent extends BaseComponent_1.BaseComponent {
|
|
6
|
+
get customId() {
|
|
7
|
+
return this.data.custom_id;
|
|
8
|
+
}
|
|
9
|
+
get disabed() {
|
|
10
|
+
return this.data.disabled;
|
|
11
|
+
}
|
|
12
|
+
get max() {
|
|
13
|
+
return this.data.max_values;
|
|
14
|
+
}
|
|
15
|
+
get min() {
|
|
16
|
+
return this.data.min_values;
|
|
17
|
+
}
|
|
18
|
+
get placeholder() {
|
|
19
|
+
return this.data.placeholder;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.BaseSelectMenuComponent = BaseSelectMenuComponent;
|