lunibee 0.3.3 → 0.4.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/README.md +1 -1
- package/dist/builders/commands.d.ts +1 -1
- package/dist/builders/components.d.ts +9 -11
- package/dist/builders/embed.d.ts +1 -1
- package/dist/builders/index.d.ts +1 -1
- package/dist/builders/index.js +87 -1298
- package/dist/builders/index.js.map +3 -11
- package/dist/chunks/index-0wn81eng.js +2492 -0
- package/dist/chunks/index-0wn81eng.js.map +17 -0
- package/dist/chunks/index-2en489j6.js +40 -0
- package/dist/chunks/index-2en489j6.js.map +10 -0
- package/dist/chunks/index-3hyps48a.js +203 -0
- package/dist/chunks/index-3hyps48a.js.map +11 -0
- package/dist/chunks/index-57c5n3ms.js +2274 -0
- package/dist/chunks/index-57c5n3ms.js.map +19 -0
- package/dist/chunks/index-5yx92e36.js +1170 -0
- package/dist/chunks/index-5yx92e36.js.map +14 -0
- package/dist/chunks/index-690bp093.js +95 -0
- package/dist/chunks/index-690bp093.js.map +10 -0
- package/dist/chunks/index-7fp2hvmg.js +2155 -0
- package/dist/chunks/index-7fp2hvmg.js.map +24 -0
- package/dist/chunks/index-cnmsajvk.js +1119 -0
- package/dist/chunks/index-cnmsajvk.js.map +12 -0
- package/dist/chunks/index-fdvgk2sw.js +1310 -0
- package/dist/chunks/index-fdvgk2sw.js.map +21 -0
- package/dist/chunks/index-gyvps8b9.js +214 -0
- package/dist/chunks/index-gyvps8b9.js.map +12 -0
- package/dist/chunks/index-jzg4bh99.js +1533 -0
- package/dist/chunks/index-jzg4bh99.js.map +21 -0
- package/dist/chunks/index-mgw2yvrm.js +3547 -0
- package/dist/chunks/index-mgw2yvrm.js.map +25 -0
- package/dist/chunks/index-yh76b55h.js +3449 -0
- package/dist/chunks/index-yh76b55h.js.map +29 -0
- package/dist/collection/index.js +9 -1118
- package/dist/collection/index.js.map +3 -6
- package/dist/core/api.d.ts +3 -3
- package/dist/core/channel-create.d.ts +2 -2
- package/dist/core/commands.d.ts +3 -3
- package/dist/core/events.d.ts +4 -4
- package/dist/core/handles.d.ts +4 -4
- package/dist/core/index.d.ts +25 -20
- package/dist/core/index.js +68 -10130
- package/dist/core/index.js.map +3 -65
- package/dist/core/permissions.d.ts +1 -1
- package/dist/core/redis-cache.d.ts +1 -1
- package/dist/formatters/index.js +41 -110
- package/dist/formatters/index.js.map +3 -4
- package/dist/handlers/index.js +5 -37
- package/dist/handlers/index.js.map +3 -4
- package/dist/index.d.ts +21 -21
- package/dist/index.js +641 -16325
- package/dist/index.js.map +3 -92
- package/dist/managers/advanced.d.ts +3 -3
- package/dist/managers/application.d.ts +2 -2
- package/dist/managers/base.d.ts +1 -1
- package/dist/managers/emoji.d.ts +2 -2
- package/dist/managers/guild-resources.d.ts +6 -6
- package/dist/managers/guild.d.ts +3 -3
- package/dist/managers/index.d.ts +4 -8
- package/dist/managers/index.js +51 -4060
- package/dist/managers/index.js.map +3 -29
- package/dist/managers/member.d.ts +2 -2
- package/dist/managers/message.d.ts +14 -6
- package/dist/managers/role.d.ts +2 -2
- package/dist/managers/thread.d.ts +3 -3
- package/dist/managers/user.d.ts +7 -4
- package/dist/rest/index.d.ts +10 -35
- package/dist/rest/index.js +57 -2184
- package/dist/rest/index.js.map +3 -18
- package/dist/rest/limiter.d.ts +9 -1
- package/dist/rest/webhook.d.ts +2 -8
- package/dist/sharding/bus.d.ts +2 -2
- package/dist/sharding/cluster.d.ts +45 -5
- package/dist/sharding/context.d.ts +45 -3
- package/dist/sharding/gateway-bot.d.ts +2 -1
- package/dist/sharding/health.d.ts +1 -1
- package/dist/sharding/identify.d.ts +12 -0
- package/dist/sharding/index.d.ts +44 -11
- package/dist/sharding/index.js +60 -4620
- package/dist/sharding/index.js.map +3 -33
- package/dist/sharding/supervisor.d.ts +4 -2
- package/dist/structures/audit-log.d.ts +1 -1
- package/dist/structures/base.d.ts +6 -6
- package/dist/structures/channels.d.ts +1 -1
- package/dist/structures/embed.d.ts +1 -1
- package/dist/structures/index.d.ts +14 -14
- package/dist/structures/index.js +109 -2382
- package/dist/structures/index.js.map +3 -16
- package/dist/structures/interactions.d.ts +13 -9
- package/dist/structures/options.d.ts +1 -1
- package/dist/structures/permissions.d.ts +2 -2
- package/dist/structures/resources.d.ts +10 -10
- package/dist/structures/sticker.d.ts +1 -1
- package/dist/types/gateway.d.ts +2 -79
- package/dist/types/index.d.ts +0 -6
- package/dist/types/index.js +41 -272
- package/dist/types/index.js.map +3 -6
- package/dist/utils/index.js +23 -209
- package/dist/utils/index.js.map +3 -5
- package/dist/voice/connection.d.ts +200 -0
- package/dist/voice/crypto.d.ts +50 -0
- package/dist/voice/dave.d.ts +85 -0
- package/dist/voice/effects.d.ts +31 -0
- package/dist/voice/emitter.d.ts +14 -0
- package/dist/voice/gateway.d.ts +59 -0
- package/dist/voice/index.d.ts +25 -228
- package/dist/voice/index.js +111 -442
- package/dist/voice/index.js.map +3 -4
- package/dist/voice/libopus.d.ts +88 -0
- package/dist/voice/networking.d.ts +80 -0
- package/dist/voice/ogg.d.ts +24 -0
- package/dist/voice/opus.d.ts +18 -0
- package/dist/voice/player.d.ts +79 -0
- package/dist/voice/protocol.d.ts +76 -0
- package/dist/voice/receiver.d.ts +59 -0
- package/dist/voice/resource.d.ts +102 -0
- package/dist/voice/udp.d.ts +40 -0
- package/dist/ws/close-codes.d.ts +1 -1
- package/dist/ws/index.d.ts +25 -4
- package/dist/ws/index.js +47 -1336
- package/dist/ws/index.js.map +3 -17
- package/dist/ws/protocol.d.ts +1 -1
- package/dist/ws/send-budget.d.ts +0 -2
- package/dist/ws/state.d.ts +0 -10
- package/package.json +19 -16
package/dist/builders/index.js
CHANGED
|
@@ -1,1302 +1,91 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}
|
|
48
|
-
setColor(value) {
|
|
49
|
-
if (!Number.isInteger(value) || value < 0 || value > 16777215)
|
|
50
|
-
throw new RangeError("Embed color must be an integer between 0 and 16777215.");
|
|
51
|
-
this.#data.color = value;
|
|
52
|
-
return this;
|
|
53
|
-
}
|
|
54
|
-
setTimestamp(value = new Date) {
|
|
55
|
-
const date = value instanceof Date ? value : new Date(value);
|
|
56
|
-
if (Number.isNaN(date.getTime()))
|
|
57
|
-
throw new RangeError("Embed timestamp must be a valid date.");
|
|
58
|
-
this.#data.timestamp = date.toISOString();
|
|
59
|
-
return this;
|
|
60
|
-
}
|
|
61
|
-
setFooter(value) {
|
|
62
|
-
this.#data.footer = {
|
|
63
|
-
text: validate(value.text, 2048, "Footer text"),
|
|
64
|
-
...value.icon_url ? { icon_url: url(value.icon_url, "Footer icon URL") } : {}
|
|
65
|
-
};
|
|
66
|
-
return this;
|
|
67
|
-
}
|
|
68
|
-
setAuthor(value) {
|
|
69
|
-
this.#data.author = {
|
|
70
|
-
name: validate(value.name, 256, "Author name"),
|
|
71
|
-
...value.url ? { url: url(value.url, "Author URL") } : {},
|
|
72
|
-
...value.icon_url ? { icon_url: url(value.icon_url, "Author icon URL") } : {}
|
|
73
|
-
};
|
|
74
|
-
return this;
|
|
75
|
-
}
|
|
76
|
-
setThumbnail(value) {
|
|
77
|
-
if (value === null) {
|
|
78
|
-
delete this.#data.thumbnail;
|
|
79
|
-
return this;
|
|
80
|
-
}
|
|
81
|
-
const valueURL = typeof value === "string" ? value : value.url;
|
|
82
|
-
this.#data.thumbnail = { url: url(valueURL, "Thumbnail URL") };
|
|
83
|
-
return this;
|
|
84
|
-
}
|
|
85
|
-
setImage(value) {
|
|
86
|
-
if (value === null) {
|
|
87
|
-
delete this.#data.image;
|
|
88
|
-
return this;
|
|
89
|
-
}
|
|
90
|
-
const valueURL = typeof value === "string" ? value : value.url;
|
|
91
|
-
this.#data.image = { url: url(valueURL, "Image URL") };
|
|
92
|
-
return this;
|
|
93
|
-
}
|
|
94
|
-
addFields(...fields) {
|
|
95
|
-
const resolved = fields.length === 1 && Array.isArray(fields[0]) ? fields[0] : fields;
|
|
96
|
-
if (!resolved.length)
|
|
97
|
-
throw new TypeError("At least one embed field is required.");
|
|
98
|
-
const current = this.#data.fields ?? [];
|
|
99
|
-
if (current.length + resolved.length > 25)
|
|
100
|
-
throw new RangeError("An embed cannot contain more than 25 fields.");
|
|
101
|
-
for (const field of resolved) {
|
|
102
|
-
validate(field.name, 256, "Embed field name");
|
|
103
|
-
validate(field.value, 1024, "Embed field value");
|
|
104
|
-
}
|
|
105
|
-
this.#data.fields = [
|
|
106
|
-
...current,
|
|
107
|
-
...resolved.map((field) => ({ ...field }))
|
|
108
|
-
];
|
|
109
|
-
return this;
|
|
110
|
-
}
|
|
111
|
-
setFields(fields) {
|
|
112
|
-
this.#data.fields = [];
|
|
113
|
-
return this.addFields(...fields);
|
|
114
|
-
}
|
|
115
|
-
spliceFields(index, deleteCount, ...fields) {
|
|
116
|
-
const current = [...this.#data.fields ?? []];
|
|
117
|
-
if (!Number.isInteger(index) || !Number.isInteger(deleteCount) || index < 0 || deleteCount < 0)
|
|
118
|
-
throw new RangeError("Field index and delete count must be non-negative integers.");
|
|
119
|
-
for (const field of fields) {
|
|
120
|
-
validate(field.name, 256, "Embed field name");
|
|
121
|
-
validate(field.value, 1024, "Embed field value");
|
|
122
|
-
}
|
|
123
|
-
current.splice(index, deleteCount, ...fields.map((f) => ({ ...f })));
|
|
124
|
-
if (current.length > 25)
|
|
125
|
-
throw new RangeError("An embed cannot contain more than 25 fields.");
|
|
126
|
-
this.#data.fields = current;
|
|
127
|
-
return this;
|
|
128
|
-
}
|
|
129
|
-
clearFields() {
|
|
130
|
-
delete this.#data.fields;
|
|
131
|
-
return this;
|
|
132
|
-
}
|
|
133
|
-
clearTitle() {
|
|
134
|
-
delete this.#data.title;
|
|
135
|
-
return this;
|
|
136
|
-
}
|
|
137
|
-
clearDescription() {
|
|
138
|
-
delete this.#data.description;
|
|
139
|
-
return this;
|
|
140
|
-
}
|
|
141
|
-
get data() {
|
|
142
|
-
return this.toJSON();
|
|
143
|
-
}
|
|
144
|
-
toJSON() {
|
|
145
|
-
const data = this.#data;
|
|
146
|
-
const total = (data.title?.length ?? 0) + (data.description?.length ?? 0) + (data.footer?.text.length ?? 0) + (data.author?.name.length ?? 0) + (data.fields ?? []).reduce((sum, field) => sum + field.name.length + field.value.length, 0);
|
|
147
|
-
if (total > 6000)
|
|
148
|
-
throw new RangeError(`An embed cannot contain more than 6000 characters in total (this one has ${total}).`);
|
|
149
|
-
return cloneData(data);
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
function validate(value, max, field) {
|
|
153
|
-
if (typeof value !== "string" || value.length === 0 || value.length > max)
|
|
154
|
-
throw new RangeError(`${field} must contain 1-${max} characters.`);
|
|
155
|
-
return value;
|
|
156
|
-
}
|
|
157
|
-
function url(value, field) {
|
|
158
|
-
let parsed;
|
|
159
|
-
try {
|
|
160
|
-
parsed = new URL(value);
|
|
161
|
-
} catch (error) {
|
|
162
|
-
throw new TypeError(`${field} must be a valid URL.`, { cause: error });
|
|
163
|
-
}
|
|
164
|
-
if (!["http:", "https:", "attachment:"].includes(parsed.protocol))
|
|
165
|
-
throw new TypeError(`${field} must use http, https or attachment.`);
|
|
166
|
-
return parsed.toString();
|
|
167
|
-
}
|
|
168
|
-
// packages/types/src/channel-kind.ts
|
|
169
|
-
var ChannelKinds = {
|
|
170
|
-
text: [0],
|
|
171
|
-
dm: [1],
|
|
172
|
-
voice: [2],
|
|
173
|
-
"group-dm": [3],
|
|
174
|
-
category: [4],
|
|
175
|
-
announcement: [5],
|
|
176
|
-
thread: [10, 11, 12],
|
|
177
|
-
stage: [13],
|
|
178
|
-
directory: [14],
|
|
179
|
-
forum: [15],
|
|
180
|
-
media: [16]
|
|
181
|
-
};
|
|
182
|
-
var KIND_OF_TYPE = new Map(Object.keys(ChannelKinds).flatMap((kind) => ChannelKinds[kind].map((type) => [type, kind])));
|
|
183
|
-
// packages/types/src/gateway.ts
|
|
184
|
-
var GatewayIntentBits = {
|
|
185
|
-
Guilds: 1 << 0,
|
|
186
|
-
GuildMembers: 1 << 1,
|
|
187
|
-
GuildModeration: 1 << 2,
|
|
188
|
-
GuildExpressions: 1 << 3,
|
|
189
|
-
GuildIntegrations: 1 << 4,
|
|
190
|
-
GuildWebhooks: 1 << 5,
|
|
191
|
-
GuildInvites: 1 << 6,
|
|
192
|
-
GuildVoiceStates: 1 << 7,
|
|
193
|
-
GuildPresences: 1 << 8,
|
|
194
|
-
GuildMessages: 1 << 9,
|
|
195
|
-
GuildMessageReactions: 1 << 10,
|
|
196
|
-
GuildMessageTyping: 1 << 11,
|
|
197
|
-
DirectMessages: 1 << 12,
|
|
198
|
-
DirectMessageReactions: 1 << 13,
|
|
199
|
-
DirectMessageTyping: 1 << 14,
|
|
200
|
-
MessageContent: 1 << 15,
|
|
201
|
-
GuildScheduledEvents: 1 << 16,
|
|
202
|
-
AutoModerationConfiguration: 1 << 20,
|
|
203
|
-
AutoModerationExecution: 1 << 21,
|
|
204
|
-
GuildMessagePolls: 1 << 24,
|
|
205
|
-
DirectMessagePolls: 1 << 25
|
|
206
|
-
};
|
|
207
|
-
var IntentBits = {
|
|
208
|
-
guild: 1 << 0,
|
|
209
|
-
guilds: 1 << 0,
|
|
210
|
-
guildMembers: 1 << 1,
|
|
211
|
-
guildModeration: 1 << 2,
|
|
212
|
-
guildBans: 1 << 2,
|
|
213
|
-
guildExpressions: 1 << 3,
|
|
214
|
-
guildEmojis: 1 << 3,
|
|
215
|
-
guildEmojisAndStickers: 1 << 3,
|
|
216
|
-
guildIntegrations: 1 << 4,
|
|
217
|
-
guildWebhooks: 1 << 5,
|
|
218
|
-
guildInvites: 1 << 6,
|
|
219
|
-
guildVoiceStates: 1 << 7,
|
|
220
|
-
guildPresences: 1 << 8,
|
|
221
|
-
guildMessages: 1 << 9,
|
|
222
|
-
guildMessage: 1 << 9,
|
|
223
|
-
guildMessageReactions: 1 << 10,
|
|
224
|
-
guildMessageTyping: 1 << 11,
|
|
225
|
-
directMessages: 1 << 12,
|
|
226
|
-
directMessageReactions: 1 << 13,
|
|
227
|
-
directMessageTyping: 1 << 14,
|
|
228
|
-
messageContent: 1 << 15,
|
|
229
|
-
guildScheduledEvents: 1 << 16,
|
|
230
|
-
autoModerationConfiguration: 1 << 20,
|
|
231
|
-
autoModerationExecution: 1 << 21,
|
|
232
|
-
guildMessagePolls: 1 << 24,
|
|
233
|
-
directMessagePolls: 1 << 25
|
|
234
|
-
};
|
|
235
|
-
// packages/types/src/index.ts
|
|
236
|
-
var ComponentEnum = {
|
|
237
|
-
ActionRow: 1,
|
|
238
|
-
Button: 2,
|
|
239
|
-
StringSelect: 3,
|
|
240
|
-
TextInput: 4,
|
|
241
|
-
UserSelect: 5,
|
|
242
|
-
RoleSelect: 6,
|
|
243
|
-
MentionableSelect: 7,
|
|
244
|
-
ChannelSelect: 8,
|
|
245
|
-
Section: 9,
|
|
246
|
-
TextDisplay: 10,
|
|
247
|
-
Thumbnail: 11,
|
|
248
|
-
MediaGallery: 12,
|
|
249
|
-
File: 13,
|
|
250
|
-
Separator: 14,
|
|
251
|
-
ContentInventoryEntry: 16,
|
|
252
|
-
Container: 17
|
|
253
|
-
};
|
|
254
|
-
var ButtonType = {
|
|
255
|
-
Primary: 1,
|
|
256
|
-
Secondary: 2,
|
|
257
|
-
Success: 3,
|
|
258
|
-
Danger: 4,
|
|
259
|
-
Link: 5,
|
|
260
|
-
Premium: 6
|
|
261
|
-
};
|
|
262
|
-
|
|
263
|
-
// packages/builders/src/components.ts
|
|
264
|
-
var TextInputType = { Short: 1, Paragraph: 2 };
|
|
265
|
-
|
|
266
|
-
class CreateActionRow {
|
|
267
|
-
#components = [];
|
|
268
|
-
addComponents(...components) {
|
|
269
|
-
if (!components.length)
|
|
270
|
-
throw new TypeError("At least one component is required.");
|
|
271
|
-
if (this.#components.length + components.length > 5)
|
|
272
|
-
throw new RangeError("An action row cannot contain more than 5 components.");
|
|
273
|
-
this.#components.push(...components);
|
|
274
|
-
return this;
|
|
275
|
-
}
|
|
276
|
-
clearComponents() {
|
|
277
|
-
this.#components.length = 0;
|
|
278
|
-
return this;
|
|
279
|
-
}
|
|
280
|
-
toJSON() {
|
|
281
|
-
const components = this.#components.map((component) => component.toJSON());
|
|
282
|
-
if (components.length === 0)
|
|
283
|
-
throw new RangeError("An action row needs at least one component.");
|
|
284
|
-
const types = components.map((component) => component.type);
|
|
285
|
-
if (types.some((type) => type !== ComponentEnum.Button) && components.length > 1)
|
|
286
|
-
throw new RangeError("A select menu or text input must be alone in its action row.");
|
|
287
|
-
return { type: ComponentEnum.ActionRow, components };
|
|
288
|
-
}
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
class CreateSelectMenu {
|
|
292
|
-
#select;
|
|
293
|
-
constructor(data) {
|
|
294
|
-
this.#select = data;
|
|
295
|
-
}
|
|
296
|
-
setCustomId(value) {
|
|
297
|
-
validateText(value, 100, "Component custom ID");
|
|
298
|
-
this.#select.custom_id = value;
|
|
299
|
-
return this;
|
|
300
|
-
}
|
|
301
|
-
setPlaceholder(value) {
|
|
302
|
-
validateText(value, 150, "Component placeholder");
|
|
303
|
-
this.#select.placeholder = value;
|
|
304
|
-
return this;
|
|
305
|
-
}
|
|
306
|
-
setMinValues(value) {
|
|
307
|
-
validateCount(value, "min_values", 0);
|
|
308
|
-
this.#select.min_values = value;
|
|
309
|
-
return this;
|
|
310
|
-
}
|
|
311
|
-
setMaxValues(value) {
|
|
312
|
-
validateCount(value, "max_values", 1);
|
|
313
|
-
this.#select.max_values = value;
|
|
314
|
-
return this;
|
|
315
|
-
}
|
|
316
|
-
setRequired(value = true) {
|
|
317
|
-
this.#select.required = value;
|
|
318
|
-
return this;
|
|
319
|
-
}
|
|
320
|
-
setDisabled(value = true) {
|
|
321
|
-
this.#select.disabled = value;
|
|
322
|
-
return this;
|
|
323
|
-
}
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
class CreateStringSelect extends CreateSelectMenu {
|
|
327
|
-
#data;
|
|
328
|
-
constructor() {
|
|
329
|
-
const data = {
|
|
330
|
-
type: ComponentEnum.StringSelect
|
|
331
|
-
};
|
|
332
|
-
super(data);
|
|
333
|
-
this.#data = data;
|
|
334
|
-
}
|
|
335
|
-
addOptions(...options) {
|
|
336
|
-
if (!options.length)
|
|
337
|
-
throw new TypeError("At least one select option is required.");
|
|
338
|
-
const current = this.#data.options ?? [];
|
|
339
|
-
if (current.length + options.length > 25)
|
|
340
|
-
throw new RangeError("A string select cannot contain more than 25 options.");
|
|
341
|
-
for (const option of options) {
|
|
342
|
-
validateText(option.label, 100, "Select option label");
|
|
343
|
-
validateText(option.value, 100, "Select option value");
|
|
344
|
-
if (option.description)
|
|
345
|
-
validateText(option.description, 100, "Select option description");
|
|
346
|
-
}
|
|
347
|
-
this.#data.options = [
|
|
348
|
-
...current,
|
|
349
|
-
...options.map((option) => ({ ...option }))
|
|
350
|
-
];
|
|
351
|
-
return this;
|
|
352
|
-
}
|
|
353
|
-
toJSON() {
|
|
354
|
-
assertSelect(this.#data);
|
|
355
|
-
const count = this.#data.options?.length ?? 0;
|
|
356
|
-
if (count === 0)
|
|
357
|
-
throw new RangeError("A string select needs at least one option.");
|
|
358
|
-
if ((this.#data.max_values ?? 1) > count)
|
|
359
|
-
throw new RangeError("max_values cannot exceed the number of options.");
|
|
360
|
-
return cloneData(this.#data);
|
|
361
|
-
}
|
|
362
|
-
}
|
|
363
|
-
|
|
364
|
-
class CreateButton {
|
|
365
|
-
#data = {
|
|
366
|
-
type: ComponentEnum.Button,
|
|
367
|
-
style: ButtonType.Secondary
|
|
368
|
-
};
|
|
369
|
-
setStyle(style) {
|
|
370
|
-
const data = this.#data;
|
|
371
|
-
data.style = style;
|
|
372
|
-
if (style === ButtonType.Link) {
|
|
373
|
-
delete data.custom_id;
|
|
374
|
-
delete data.sku_id;
|
|
375
|
-
} else if (style === ButtonType.Premium) {
|
|
376
|
-
delete data.custom_id;
|
|
377
|
-
delete data.url;
|
|
378
|
-
delete data.label;
|
|
379
|
-
delete data.emoji;
|
|
380
|
-
} else {
|
|
381
|
-
delete data.url;
|
|
382
|
-
delete data.sku_id;
|
|
383
|
-
}
|
|
384
|
-
return this;
|
|
385
|
-
}
|
|
386
|
-
setCustomId(value) {
|
|
387
|
-
validateText(value, 100, "Button custom ID");
|
|
388
|
-
if (this.#data.style === ButtonType.Link)
|
|
389
|
-
throw new TypeError("Link buttons cannot use custom IDs.");
|
|
390
|
-
this.#data.custom_id = value;
|
|
391
|
-
return this;
|
|
392
|
-
}
|
|
393
|
-
setLabel(value) {
|
|
394
|
-
validateText(value, 80, "Button label");
|
|
395
|
-
this.#data.label = value;
|
|
396
|
-
return this;
|
|
397
|
-
}
|
|
398
|
-
setURL(value) {
|
|
399
|
-
validateText(value, 512, "Button URL");
|
|
400
|
-
let url;
|
|
401
|
-
try {
|
|
402
|
-
url = new URL(value);
|
|
403
|
-
} catch (error) {
|
|
404
|
-
throw new TypeError("Button URL must be a valid URL.", {
|
|
405
|
-
cause: error
|
|
406
|
-
});
|
|
407
|
-
}
|
|
408
|
-
if (!["http:", "https:", "discord:"].includes(url.protocol))
|
|
409
|
-
throw new TypeError("Button URL must use http, https or discord.");
|
|
410
|
-
this.setStyle(ButtonType.Link);
|
|
411
|
-
this.#data.url = url.toString();
|
|
412
|
-
return this;
|
|
413
|
-
}
|
|
414
|
-
setSKUId(skuId) {
|
|
415
|
-
validateText(skuId, 20, "Button SKU ID");
|
|
416
|
-
this.setStyle(ButtonType.Premium);
|
|
417
|
-
this.#data.sku_id = skuId;
|
|
418
|
-
return this;
|
|
419
|
-
}
|
|
420
|
-
setEmoji(emoji) {
|
|
421
|
-
this.#data.emoji = typeof emoji === "string" ? { name: emoji } : { ...emoji };
|
|
422
|
-
return this;
|
|
423
|
-
}
|
|
424
|
-
setDisabled(value = true) {
|
|
425
|
-
this.#data.disabled = value;
|
|
426
|
-
return this;
|
|
427
|
-
}
|
|
428
|
-
toJSON() {
|
|
429
|
-
const data = this.#data;
|
|
430
|
-
if (data.style === ButtonType.Link) {
|
|
431
|
-
if (!data.url)
|
|
432
|
-
throw new TypeError("Link buttons require a URL.");
|
|
433
|
-
if (data.custom_id || data.sku_id)
|
|
434
|
-
throw new TypeError("Link buttons cannot have a custom ID or SKU ID.");
|
|
435
|
-
} else if (data.style === ButtonType.Premium) {
|
|
436
|
-
if (!data.sku_id)
|
|
437
|
-
throw new TypeError("Premium buttons require a SKU ID.");
|
|
438
|
-
if (data.custom_id || data.url || data.label || data.emoji)
|
|
439
|
-
throw new TypeError("Premium buttons cannot have a custom ID, URL, label or emoji.");
|
|
440
|
-
} else {
|
|
441
|
-
if (!data.custom_id)
|
|
442
|
-
throw new TypeError("Non-link buttons require a custom ID.");
|
|
443
|
-
if (data.url || data.sku_id)
|
|
444
|
-
throw new TypeError("Only link buttons have a URL and only premium buttons have a SKU ID.");
|
|
445
|
-
}
|
|
446
|
-
if (data.style !== ButtonType.Premium && !data.label && !data.emoji)
|
|
447
|
-
throw new TypeError("Buttons require a label or an emoji.");
|
|
448
|
-
return cloneData(data);
|
|
449
|
-
}
|
|
450
|
-
}
|
|
451
|
-
|
|
452
|
-
class CreateEntitySelect extends CreateSelectMenu {
|
|
453
|
-
#data;
|
|
454
|
-
constructor(type) {
|
|
455
|
-
if (type !== ComponentEnum.UserSelect && type !== ComponentEnum.RoleSelect && type !== ComponentEnum.MentionableSelect && type !== ComponentEnum.ChannelSelect)
|
|
456
|
-
throw new TypeError("Invalid select component type.");
|
|
457
|
-
const data = { type };
|
|
458
|
-
super(data);
|
|
459
|
-
this.#data = data;
|
|
460
|
-
}
|
|
461
|
-
setDefaultValues(...values) {
|
|
462
|
-
this.#data.default_values = values.map((value) => ({ ...value }));
|
|
463
|
-
return this;
|
|
464
|
-
}
|
|
465
|
-
toJSON() {
|
|
466
|
-
assertSelect(this.#data);
|
|
467
|
-
return cloneData(this.#data);
|
|
468
|
-
}
|
|
469
|
-
}
|
|
470
|
-
|
|
471
|
-
class CreateModal {
|
|
472
|
-
#components = [];
|
|
473
|
-
#custom_id;
|
|
474
|
-
#title;
|
|
475
|
-
setCustomId(value) {
|
|
476
|
-
validateText(value, 100, "Modal custom ID");
|
|
477
|
-
this.#custom_id = value;
|
|
478
|
-
return this;
|
|
479
|
-
}
|
|
480
|
-
setTitle(value) {
|
|
481
|
-
validateText(value, 45, "Modal title");
|
|
482
|
-
this.#title = value;
|
|
483
|
-
return this;
|
|
484
|
-
}
|
|
485
|
-
addComponents(...components) {
|
|
486
|
-
if (!components.length)
|
|
487
|
-
throw new TypeError("At least one modal component is required.");
|
|
488
|
-
if (this.#components.length + components.length > 5)
|
|
489
|
-
throw new RangeError("A modal cannot contain more than 5 action rows.");
|
|
490
|
-
this.#components.push(...components);
|
|
491
|
-
return this;
|
|
492
|
-
}
|
|
493
|
-
addTextInputs(...inputs) {
|
|
494
|
-
return this.addComponents(...inputs.map((input) => new CreateActionRow().addComponents(input)));
|
|
495
|
-
}
|
|
496
|
-
toJSON() {
|
|
497
|
-
if (!this.#custom_id || !this.#title)
|
|
498
|
-
throw new TypeError("Modals require a custom ID and a title.");
|
|
499
|
-
if (this.#components.length === 0)
|
|
500
|
-
throw new RangeError("Modals require at least one component.");
|
|
501
|
-
return {
|
|
502
|
-
type: 9,
|
|
503
|
-
custom_id: this.#custom_id,
|
|
504
|
-
title: this.#title,
|
|
505
|
-
components: this.#components.map((component) => component.toJSON())
|
|
506
|
-
};
|
|
507
|
-
}
|
|
508
|
-
}
|
|
509
|
-
|
|
510
|
-
class CreateTextInput {
|
|
511
|
-
#data = {
|
|
512
|
-
type: ComponentEnum.TextInput,
|
|
513
|
-
style: TextInputType.Short
|
|
514
|
-
};
|
|
515
|
-
setStyle(style) {
|
|
516
|
-
this.#data.style = style;
|
|
517
|
-
return this;
|
|
518
|
-
}
|
|
519
|
-
setCustomId(value) {
|
|
520
|
-
validateText(value, 100, "Text input custom ID");
|
|
521
|
-
this.#data.custom_id = value;
|
|
522
|
-
return this;
|
|
523
|
-
}
|
|
524
|
-
setLabel(value) {
|
|
525
|
-
validateText(value, 45, "Text input label");
|
|
526
|
-
this.#data.label = value;
|
|
527
|
-
return this;
|
|
528
|
-
}
|
|
529
|
-
setPlaceholder(value) {
|
|
530
|
-
validateText(value, 100, "Text input placeholder");
|
|
531
|
-
this.#data.placeholder = value;
|
|
532
|
-
return this;
|
|
533
|
-
}
|
|
534
|
-
setMinLength(value) {
|
|
535
|
-
validateLength(value, "min_length", 4000);
|
|
536
|
-
this.#data.min_length = value;
|
|
537
|
-
return this;
|
|
538
|
-
}
|
|
539
|
-
setMaxLength(value) {
|
|
540
|
-
validateLength(value, "max_length", 4000);
|
|
541
|
-
this.#data.max_length = value;
|
|
542
|
-
return this;
|
|
543
|
-
}
|
|
544
|
-
setRequired(value = true) {
|
|
545
|
-
this.#data.required = value;
|
|
546
|
-
return this;
|
|
547
|
-
}
|
|
548
|
-
setValue(value) {
|
|
549
|
-
validateText(value, 4000, "Text input value");
|
|
550
|
-
this.#data.value = value;
|
|
551
|
-
return this;
|
|
552
|
-
}
|
|
553
|
-
toJSON() {
|
|
554
|
-
const data = this.#data;
|
|
555
|
-
if (!data.custom_id)
|
|
556
|
-
throw new TypeError("Text inputs require a custom ID.");
|
|
557
|
-
if (data.min_length !== undefined && data.max_length !== undefined && data.min_length > data.max_length)
|
|
558
|
-
throw new RangeError("min_length cannot exceed max_length.");
|
|
559
|
-
return cloneData(data);
|
|
560
|
-
}
|
|
561
|
-
}
|
|
562
|
-
|
|
563
|
-
class CreateContainer {
|
|
564
|
-
#components = [];
|
|
565
|
-
#accentColor;
|
|
566
|
-
#spoiler;
|
|
567
|
-
addComponents(...components) {
|
|
568
|
-
if (!components.length)
|
|
569
|
-
throw new TypeError("At least one component is required.");
|
|
570
|
-
this.#components.push(...components);
|
|
571
|
-
return this;
|
|
572
|
-
}
|
|
573
|
-
setAccentColor(color) {
|
|
574
|
-
if (!Number.isInteger(color) || color < 0 || color > 16777215) {
|
|
575
|
-
throw new RangeError("Accent color must be an integer between 0 and 16777215 (0xFFFFFF).");
|
|
576
|
-
}
|
|
577
|
-
this.#accentColor = color;
|
|
578
|
-
return this;
|
|
579
|
-
}
|
|
580
|
-
setSpoiler(spoiler = true) {
|
|
581
|
-
this.#spoiler = spoiler;
|
|
582
|
-
return this;
|
|
583
|
-
}
|
|
584
|
-
toJSON() {
|
|
585
|
-
const data = {
|
|
586
|
-
type: ComponentEnum.Container,
|
|
587
|
-
components: this.#components.map((c) => c.toJSON())
|
|
588
|
-
};
|
|
589
|
-
if (this.#accentColor !== undefined)
|
|
590
|
-
data.accent_color = this.#accentColor;
|
|
591
|
-
if (this.#spoiler !== undefined)
|
|
592
|
-
data.spoiler = this.#spoiler;
|
|
593
|
-
return data;
|
|
594
|
-
}
|
|
595
|
-
}
|
|
596
|
-
|
|
597
|
-
class CreateSection {
|
|
598
|
-
#components = [];
|
|
599
|
-
#accessory;
|
|
600
|
-
addComponents(...components) {
|
|
601
|
-
if (!components.length)
|
|
602
|
-
throw new TypeError("At least one component is required.");
|
|
603
|
-
this.#components.push(...components);
|
|
604
|
-
return this;
|
|
605
|
-
}
|
|
606
|
-
setAccessory(accessory) {
|
|
607
|
-
this.#accessory = accessory;
|
|
608
|
-
return this;
|
|
609
|
-
}
|
|
610
|
-
toJSON() {
|
|
611
|
-
return {
|
|
612
|
-
type: ComponentEnum.Section,
|
|
613
|
-
components: this.#components.length ? this.#components.map((c) => c.toJSON()) : undefined,
|
|
614
|
-
accessory: this.#accessory?.toJSON()
|
|
615
|
-
};
|
|
616
|
-
}
|
|
617
|
-
}
|
|
618
|
-
|
|
619
|
-
class CreateTextDisplay {
|
|
620
|
-
#content = "";
|
|
621
|
-
setContent(content) {
|
|
622
|
-
validateText(content, 4000, "Text display content");
|
|
623
|
-
this.#content = content;
|
|
624
|
-
return this;
|
|
625
|
-
}
|
|
626
|
-
toJSON() {
|
|
627
|
-
return {
|
|
628
|
-
type: ComponentEnum.TextDisplay,
|
|
629
|
-
content: this.#content
|
|
630
|
-
};
|
|
631
|
-
}
|
|
632
|
-
}
|
|
633
|
-
|
|
634
|
-
class CreateMediaGallery {
|
|
635
|
-
#items = [];
|
|
636
|
-
addItems(...items) {
|
|
637
|
-
if (!items.length) {
|
|
638
|
-
throw new TypeError("At least one media gallery item is required.");
|
|
639
|
-
}
|
|
640
|
-
if (this.#items.length + items.length > 10) {
|
|
641
|
-
throw new RangeError("MediaGallery can only contain up to 10 items.");
|
|
642
|
-
}
|
|
643
|
-
this.#items.push(...items.map(({ url, description, spoiler }) => ({
|
|
644
|
-
media: { url },
|
|
645
|
-
...description !== undefined ? { description } : {},
|
|
646
|
-
...spoiler !== undefined ? { spoiler } : {}
|
|
647
|
-
})));
|
|
648
|
-
return this;
|
|
649
|
-
}
|
|
650
|
-
toJSON() {
|
|
651
|
-
return {
|
|
652
|
-
type: ComponentEnum.MediaGallery,
|
|
653
|
-
items: cloneData(this.#items)
|
|
654
|
-
};
|
|
655
|
-
}
|
|
656
|
-
}
|
|
657
|
-
|
|
658
|
-
class CreateFileComponent {
|
|
659
|
-
#url = "";
|
|
660
|
-
#spoiler;
|
|
661
|
-
setUrl(url) {
|
|
662
|
-
validateText(url, 2048, "File component URL");
|
|
663
|
-
this.#url = url;
|
|
664
|
-
return this;
|
|
665
|
-
}
|
|
666
|
-
setSpoiler(spoiler = true) {
|
|
667
|
-
this.#spoiler = spoiler;
|
|
668
|
-
return this;
|
|
669
|
-
}
|
|
670
|
-
toJSON() {
|
|
671
|
-
if (!this.#url)
|
|
672
|
-
throw new Error("File component must have a URL.");
|
|
673
|
-
const data = {
|
|
674
|
-
type: ComponentEnum.File,
|
|
675
|
-
file: { url: this.#url }
|
|
676
|
-
};
|
|
677
|
-
if (this.#spoiler !== undefined)
|
|
678
|
-
data.spoiler = this.#spoiler;
|
|
679
|
-
return data;
|
|
680
|
-
}
|
|
681
|
-
}
|
|
682
|
-
|
|
683
|
-
class CreateSeparator {
|
|
684
|
-
#spacing;
|
|
685
|
-
#divider;
|
|
686
|
-
setSpacing(spacing) {
|
|
687
|
-
this.#spacing = spacing;
|
|
688
|
-
return this;
|
|
689
|
-
}
|
|
690
|
-
setDivider(divider = true) {
|
|
691
|
-
this.#divider = divider;
|
|
692
|
-
return this;
|
|
693
|
-
}
|
|
694
|
-
toJSON() {
|
|
695
|
-
const data = {
|
|
696
|
-
type: ComponentEnum.Separator
|
|
697
|
-
};
|
|
698
|
-
if (this.#spacing !== undefined)
|
|
699
|
-
data.spacing = this.#spacing;
|
|
700
|
-
if (this.#divider !== undefined)
|
|
701
|
-
data.divider = this.#divider;
|
|
702
|
-
return data;
|
|
703
|
-
}
|
|
704
|
-
}
|
|
705
|
-
|
|
706
|
-
class CreateThumbnail {
|
|
707
|
-
#url = "";
|
|
708
|
-
#description;
|
|
709
|
-
#spoiler;
|
|
710
|
-
setUrl(url) {
|
|
711
|
-
validateText(url, 2048, "Thumbnail URL");
|
|
712
|
-
this.#url = url;
|
|
713
|
-
return this;
|
|
714
|
-
}
|
|
715
|
-
setDescription(description) {
|
|
716
|
-
validateText(description, 1024, "Thumbnail description");
|
|
717
|
-
this.#description = description;
|
|
718
|
-
return this;
|
|
719
|
-
}
|
|
720
|
-
setSpoiler(spoiler = true) {
|
|
721
|
-
this.#spoiler = spoiler;
|
|
722
|
-
return this;
|
|
723
|
-
}
|
|
724
|
-
toJSON() {
|
|
725
|
-
const data = {
|
|
726
|
-
type: ComponentEnum.Thumbnail,
|
|
727
|
-
media: { url: this.#url }
|
|
728
|
-
};
|
|
729
|
-
if (this.#description !== undefined)
|
|
730
|
-
data.description = this.#description;
|
|
731
|
-
if (this.#spoiler !== undefined)
|
|
732
|
-
data.spoiler = this.#spoiler;
|
|
733
|
-
return data;
|
|
734
|
-
}
|
|
735
|
-
}
|
|
736
|
-
|
|
737
|
-
class CreateContentInventoryEntry {
|
|
738
|
-
#id = "";
|
|
739
|
-
setId(id) {
|
|
740
|
-
validateText(id, 100, "Content inventory entry ID");
|
|
741
|
-
this.#id = id;
|
|
742
|
-
return this;
|
|
743
|
-
}
|
|
744
|
-
toJSON() {
|
|
745
|
-
return {
|
|
746
|
-
type: ComponentEnum.ContentInventoryEntry,
|
|
747
|
-
id: this.#id
|
|
748
|
-
};
|
|
749
|
-
}
|
|
750
|
-
}
|
|
751
|
-
function validateText(value, max, field) {
|
|
752
|
-
if (typeof value !== "string")
|
|
753
|
-
throw new TypeError(`${field} must be a string.`);
|
|
754
|
-
if (!value.trim())
|
|
755
|
-
throw new RangeError(`${field} must be a non-empty string.`);
|
|
756
|
-
if (value.length > max)
|
|
757
|
-
throw new RangeError(`${field} cannot exceed ${max} characters.`);
|
|
758
|
-
}
|
|
759
|
-
function validateCount(value, field, min, max = 25) {
|
|
760
|
-
if (!Number.isInteger(value) || value < min || value > max)
|
|
761
|
-
throw new RangeError(`${field} must be an integer between ${min} and ${max}.`);
|
|
762
|
-
}
|
|
763
|
-
function validateLength(value, field, max = 4000) {
|
|
764
|
-
if (!Number.isInteger(value) || value < 0 || value > max)
|
|
765
|
-
throw new RangeError(`${field} must be an integer between 0 and ${max}.`);
|
|
766
|
-
}
|
|
767
|
-
class CreateUserSelectMenu extends CreateEntitySelect {
|
|
768
|
-
constructor() {
|
|
769
|
-
super(ComponentEnum.UserSelect);
|
|
770
|
-
}
|
|
771
|
-
}
|
|
772
|
-
|
|
773
|
-
class CreateRoleSelectMenu extends CreateEntitySelect {
|
|
774
|
-
constructor() {
|
|
775
|
-
super(ComponentEnum.RoleSelect);
|
|
776
|
-
}
|
|
777
|
-
}
|
|
778
|
-
|
|
779
|
-
class CreateMentionableSelectMenu extends CreateEntitySelect {
|
|
780
|
-
constructor() {
|
|
781
|
-
super(ComponentEnum.MentionableSelect);
|
|
782
|
-
}
|
|
783
|
-
}
|
|
784
|
-
|
|
785
|
-
class CreateChannelSelectMenu extends CreateEntitySelect {
|
|
786
|
-
constructor() {
|
|
787
|
-
super(ComponentEnum.ChannelSelect);
|
|
788
|
-
}
|
|
789
|
-
}
|
|
790
|
-
function assertSelect(data) {
|
|
791
|
-
if (!data.custom_id)
|
|
792
|
-
throw new TypeError("Select menus require a custom ID.");
|
|
793
|
-
if ((data.min_values ?? 1) > (data.max_values ?? 1))
|
|
794
|
-
throw new RangeError("min_values cannot exceed max_values.");
|
|
795
|
-
}
|
|
796
|
-
var IS_COMPONENTS_V2 = 1 << 15;
|
|
797
|
-
function componentsV2Message(components, options) {
|
|
798
|
-
const list = Array.isArray(components) ? components : [components];
|
|
799
|
-
if (!list.length)
|
|
800
|
-
throw new TypeError("A Components V2 message needs at least one component.");
|
|
801
|
-
return {
|
|
802
|
-
...options ?? {},
|
|
803
|
-
components: list.map((component) => component.toJSON()),
|
|
804
|
-
flags: (options?.flags ?? 0) | IS_COMPONENTS_V2
|
|
805
|
-
};
|
|
806
|
-
}
|
|
807
|
-
// packages/builders/src/commands.ts
|
|
808
|
-
var ApplicationCommandOptionEnum = {
|
|
809
|
-
Subcommand: 1,
|
|
810
|
-
SubcommandGroup: 2,
|
|
811
|
-
String: 3,
|
|
812
|
-
Integer: 4,
|
|
813
|
-
Boolean: 5,
|
|
814
|
-
User: 6,
|
|
815
|
-
Channel: 7,
|
|
816
|
-
Role: 8,
|
|
817
|
-
Mentionable: 9,
|
|
818
|
-
Number: 10,
|
|
819
|
-
Attachment: 11
|
|
820
|
-
};
|
|
821
|
-
function validateContexts(contexts) {
|
|
822
|
-
if (contexts.some((context) => context !== 0 && context !== 1 && context !== 2))
|
|
823
|
-
throw new RangeError("Command contexts must be 0, 1 or 2.");
|
|
824
|
-
}
|
|
825
|
-
|
|
826
|
-
class CreateSlashCommand {
|
|
827
|
-
#data = { type: 1 };
|
|
828
|
-
setName(name) {
|
|
829
|
-
validateName(name, "Command name");
|
|
830
|
-
this.#data.name = name;
|
|
831
|
-
return this;
|
|
832
|
-
}
|
|
833
|
-
setDescription(description) {
|
|
834
|
-
validateText2(description, "Command description", 100);
|
|
835
|
-
this.#data.description = description;
|
|
836
|
-
return this;
|
|
837
|
-
}
|
|
838
|
-
setContexts(...contexts) {
|
|
839
|
-
validateContexts(contexts);
|
|
840
|
-
this.#data.contexts = [...contexts];
|
|
841
|
-
return this;
|
|
842
|
-
}
|
|
843
|
-
setNSFW(nsfw = true) {
|
|
844
|
-
this.#data.nsfw = nsfw;
|
|
845
|
-
return this;
|
|
846
|
-
}
|
|
847
|
-
setNsfw(nsfw = true) {
|
|
848
|
-
return this.setNSFW(nsfw);
|
|
849
|
-
}
|
|
850
|
-
setDefaultMemberPermissions(permissions) {
|
|
851
|
-
this.#data.default_member_permissions = permissions === null ? null : BigInt(permissions).toString();
|
|
852
|
-
return this;
|
|
853
|
-
}
|
|
854
|
-
setIntegrationTypes(...types) {
|
|
855
|
-
this.#data.integration_types = [...types];
|
|
856
|
-
return this;
|
|
857
|
-
}
|
|
858
|
-
addStringOption(configure) {
|
|
859
|
-
return this.addOption(configure(new CreateStringOption));
|
|
860
|
-
}
|
|
861
|
-
addIntegerOption(configure) {
|
|
862
|
-
return this.addOption(configure(new CreateIntegerOption));
|
|
863
|
-
}
|
|
864
|
-
addNumberOption(configure) {
|
|
865
|
-
return this.addOption(configure(new CreateNumberOption));
|
|
866
|
-
}
|
|
867
|
-
addBooleanOption(configure) {
|
|
868
|
-
return this.addOption(configure(new CreateBooleanOption));
|
|
869
|
-
}
|
|
870
|
-
addUserOption(configure) {
|
|
871
|
-
return this.addOption(configure(new CreateUserOption));
|
|
872
|
-
}
|
|
873
|
-
addChannelOption(configure) {
|
|
874
|
-
return this.addOption(configure(new CreateChannelOption));
|
|
875
|
-
}
|
|
876
|
-
addRoleOption(configure) {
|
|
877
|
-
return this.addOption(configure(new CreateRoleOption));
|
|
878
|
-
}
|
|
879
|
-
addMentionableOption(configure) {
|
|
880
|
-
return this.addOption(configure(new CreateMentionableOption));
|
|
881
|
-
}
|
|
882
|
-
addAttachmentOption(configure) {
|
|
883
|
-
return this.addOption(configure(new CreateAttachmentOption));
|
|
884
|
-
}
|
|
885
|
-
addSubcommand(configure) {
|
|
886
|
-
return this.addOption(configure(new CreateSubcommand));
|
|
887
|
-
}
|
|
888
|
-
addSubcommandGroup(configure) {
|
|
889
|
-
return this.addOption(configure(new CreateSubcommandGroup));
|
|
890
|
-
}
|
|
891
|
-
toJSON() {
|
|
892
|
-
return cloneData(this.#data);
|
|
893
|
-
}
|
|
894
|
-
addOption(option) {
|
|
895
|
-
this.#data.options = appendOption(this.#data.options, option.toJSON(), "application command");
|
|
896
|
-
return this;
|
|
897
|
-
}
|
|
898
|
-
}
|
|
899
|
-
|
|
900
|
-
class CreateCommandOption {
|
|
901
|
-
data;
|
|
902
|
-
constructor(type) {
|
|
903
|
-
this.data = { type };
|
|
904
|
-
}
|
|
905
|
-
setName(name) {
|
|
906
|
-
validateName(name, "Option name");
|
|
907
|
-
this.data.name = name;
|
|
908
|
-
return this;
|
|
909
|
-
}
|
|
910
|
-
setDescription(description) {
|
|
911
|
-
validateText2(description, "Option description", 100);
|
|
912
|
-
this.data.description = description;
|
|
913
|
-
return this;
|
|
914
|
-
}
|
|
915
|
-
setRequired(required = true) {
|
|
916
|
-
this.data.required = required;
|
|
917
|
-
return this;
|
|
918
|
-
}
|
|
919
|
-
setAutocomplete(enabled = true) {
|
|
920
|
-
if (enabled && Array.isArray(this.data.choices) && this.data.choices.length)
|
|
921
|
-
throw new RangeError("Autocomplete options cannot define choices.");
|
|
922
|
-
this.data.autocomplete = enabled;
|
|
923
|
-
return this;
|
|
924
|
-
}
|
|
925
|
-
toJSON() {
|
|
926
|
-
return cloneData(this.data);
|
|
927
|
-
}
|
|
928
|
-
}
|
|
929
|
-
|
|
930
|
-
class CreateStringOption extends CreateCommandOption {
|
|
931
|
-
constructor() {
|
|
932
|
-
super(ApplicationCommandOptionEnum.String);
|
|
933
|
-
}
|
|
934
|
-
addChoices(...choices) {
|
|
935
|
-
for (const choice of choices)
|
|
936
|
-
validateText2(choice.value, "Choice value", 100);
|
|
937
|
-
appendChoices(this.data, choices);
|
|
938
|
-
return this;
|
|
939
|
-
}
|
|
940
|
-
setMinLength(value) {
|
|
941
|
-
validateIntegerRange(value, 0, 6000, "min_length");
|
|
942
|
-
this.data.min_length = value;
|
|
943
|
-
return this;
|
|
944
|
-
}
|
|
945
|
-
setMaxLength(value) {
|
|
946
|
-
validateIntegerRange(value, 1, 6000, "max_length");
|
|
947
|
-
if (this.data.min_length !== undefined && this.data.min_length > value)
|
|
948
|
-
throw new RangeError("min_length cannot exceed max_length.");
|
|
949
|
-
this.data.max_length = value;
|
|
950
|
-
return this;
|
|
951
|
-
}
|
|
952
|
-
}
|
|
953
|
-
|
|
954
|
-
class CreateNumericOption extends CreateCommandOption {
|
|
955
|
-
#integer;
|
|
956
|
-
constructor(type, integer) {
|
|
957
|
-
super(type);
|
|
958
|
-
this.#integer = integer;
|
|
959
|
-
}
|
|
960
|
-
setMinValue(value) {
|
|
961
|
-
validateNumberRange(value, -MAX_SAFE, MAX_SAFE, "min_value", this.#integer);
|
|
962
|
-
const max = this.data.max_value;
|
|
963
|
-
if (max !== undefined && value > max)
|
|
964
|
-
throw new RangeError("min_value cannot exceed max_value.");
|
|
965
|
-
this.data.min_value = value;
|
|
966
|
-
return this;
|
|
967
|
-
}
|
|
968
|
-
setMaxValue(value) {
|
|
969
|
-
validateNumberRange(value, -MAX_SAFE, MAX_SAFE, "max_value", this.#integer);
|
|
970
|
-
const min = this.data.min_value;
|
|
971
|
-
if (min !== undefined && min > value)
|
|
972
|
-
throw new RangeError("min_value cannot exceed max_value.");
|
|
973
|
-
this.data.max_value = value;
|
|
974
|
-
return this;
|
|
975
|
-
}
|
|
976
|
-
setAutocomplete(enabled = true) {
|
|
977
|
-
if (enabled && Array.isArray(this.data.choices) && this.data.choices.length)
|
|
978
|
-
throw new RangeError("Autocomplete options cannot define choices.");
|
|
979
|
-
this.data.autocomplete = enabled;
|
|
980
|
-
return this;
|
|
981
|
-
}
|
|
982
|
-
addChoices(...choices) {
|
|
983
|
-
appendChoices(this.data, choices);
|
|
984
|
-
return this;
|
|
985
|
-
}
|
|
986
|
-
}
|
|
987
|
-
|
|
988
|
-
class CreateIntegerOption extends CreateNumericOption {
|
|
989
|
-
constructor() {
|
|
990
|
-
super(ApplicationCommandOptionEnum.Integer, true);
|
|
991
|
-
}
|
|
992
|
-
}
|
|
993
|
-
|
|
994
|
-
class CreateNumberOption extends CreateNumericOption {
|
|
995
|
-
constructor() {
|
|
996
|
-
super(ApplicationCommandOptionEnum.Number, false);
|
|
997
|
-
}
|
|
998
|
-
}
|
|
999
|
-
|
|
1000
|
-
class CreateBooleanOption extends CreateCommandOption {
|
|
1001
|
-
constructor() {
|
|
1002
|
-
super(ApplicationCommandOptionEnum.Boolean);
|
|
1003
|
-
}
|
|
1004
|
-
}
|
|
1005
|
-
|
|
1006
|
-
class CreateUserOption extends CreateCommandOption {
|
|
1007
|
-
constructor() {
|
|
1008
|
-
super(ApplicationCommandOptionEnum.User);
|
|
1009
|
-
}
|
|
1010
|
-
}
|
|
1011
|
-
|
|
1012
|
-
class CreateRoleOption extends CreateCommandOption {
|
|
1013
|
-
constructor() {
|
|
1014
|
-
super(ApplicationCommandOptionEnum.Role);
|
|
1015
|
-
}
|
|
1016
|
-
}
|
|
1017
|
-
|
|
1018
|
-
class CreateMentionableOption extends CreateCommandOption {
|
|
1019
|
-
constructor() {
|
|
1020
|
-
super(ApplicationCommandOptionEnum.Mentionable);
|
|
1021
|
-
}
|
|
1022
|
-
}
|
|
1023
|
-
|
|
1024
|
-
class CreateAttachmentOption extends CreateCommandOption {
|
|
1025
|
-
constructor() {
|
|
1026
|
-
super(ApplicationCommandOptionEnum.Attachment);
|
|
1027
|
-
}
|
|
1028
|
-
}
|
|
1029
|
-
|
|
1030
|
-
class CreateChannelOption extends CreateCommandOption {
|
|
1031
|
-
constructor() {
|
|
1032
|
-
super(ApplicationCommandOptionEnum.Channel);
|
|
1033
|
-
}
|
|
1034
|
-
addChannelTypes(...types) {
|
|
1035
|
-
if (types.some((type) => !Number.isInteger(type) || type < 0))
|
|
1036
|
-
throw new RangeError("Channel types must be non-negative integers.");
|
|
1037
|
-
this.data.channel_types = [...new Set(types)];
|
|
1038
|
-
return this;
|
|
1039
|
-
}
|
|
1040
|
-
}
|
|
1041
|
-
|
|
1042
|
-
class CreateSubcommand extends CreateCommandOption {
|
|
1043
|
-
constructor() {
|
|
1044
|
-
super(ApplicationCommandOptionEnum.Subcommand);
|
|
1045
|
-
}
|
|
1046
|
-
addStringOption(configure) {
|
|
1047
|
-
return this.addChildOption(configure(new CreateStringOption));
|
|
1048
|
-
}
|
|
1049
|
-
addIntegerOption(configure) {
|
|
1050
|
-
return this.addChildOption(configure(new CreateIntegerOption));
|
|
1051
|
-
}
|
|
1052
|
-
addNumberOption(configure) {
|
|
1053
|
-
return this.addChildOption(configure(new CreateNumberOption));
|
|
1054
|
-
}
|
|
1055
|
-
addBooleanOption(configure) {
|
|
1056
|
-
return this.addChildOption(configure(new CreateBooleanOption));
|
|
1057
|
-
}
|
|
1058
|
-
addUserOption(configure) {
|
|
1059
|
-
return this.addChildOption(configure(new CreateUserOption));
|
|
1060
|
-
}
|
|
1061
|
-
addChannelOption(configure) {
|
|
1062
|
-
return this.addChildOption(configure(new CreateChannelOption));
|
|
1063
|
-
}
|
|
1064
|
-
addRoleOption(configure) {
|
|
1065
|
-
return this.addChildOption(configure(new CreateRoleOption));
|
|
1066
|
-
}
|
|
1067
|
-
addMentionableOption(configure) {
|
|
1068
|
-
return this.addChildOption(configure(new CreateMentionableOption));
|
|
1069
|
-
}
|
|
1070
|
-
addAttachmentOption(configure) {
|
|
1071
|
-
return this.addChildOption(configure(new CreateAttachmentOption));
|
|
1072
|
-
}
|
|
1073
|
-
addChildOption(option) {
|
|
1074
|
-
const options = this.data.options ?? [];
|
|
1075
|
-
if (options.some((existing) => existing.type === ApplicationCommandOptionEnum.Subcommand))
|
|
1076
|
-
throw new RangeError("Subcommands cannot contain nested subcommands.");
|
|
1077
|
-
this.data.options = appendOption(options, option.toJSON(), "subcommand");
|
|
1078
|
-
return this;
|
|
1079
|
-
}
|
|
1080
|
-
}
|
|
1081
|
-
|
|
1082
|
-
class CreateSubcommandGroup extends CreateCommandOption {
|
|
1083
|
-
constructor() {
|
|
1084
|
-
super(ApplicationCommandOptionEnum.SubcommandGroup);
|
|
1085
|
-
}
|
|
1086
|
-
addSubcommand(configure) {
|
|
1087
|
-
const options = this.data.options ?? [];
|
|
1088
|
-
if (options.length >= 25)
|
|
1089
|
-
throw new RangeError("A subcommand group cannot contain more than 25 subcommands.");
|
|
1090
|
-
const payload = configure(new CreateSubcommand).toJSON();
|
|
1091
|
-
if (options.some((existing) => existing.name === payload.name))
|
|
1092
|
-
throw new RangeError(`Duplicate subcommand name: ${String(payload.name)}.`);
|
|
1093
|
-
if (payload.type !== ApplicationCommandOptionEnum.Subcommand)
|
|
1094
|
-
throw new TypeError("Subcommand group children must be subcommands.");
|
|
1095
|
-
options.push(payload);
|
|
1096
|
-
this.data.options = options;
|
|
1097
|
-
return this;
|
|
1098
|
-
}
|
|
1099
|
-
}
|
|
1100
|
-
var MAX_SAFE = Number.MAX_SAFE_INTEGER;
|
|
1101
|
-
function appendOption(options, payload, parent) {
|
|
1102
|
-
const list = options ?? [];
|
|
1103
|
-
if (list.length >= 25)
|
|
1104
|
-
throw new RangeError(`${parent === "subcommand" ? "A subcommand" : "An application command"} cannot contain more than 25 options.`);
|
|
1105
|
-
if (list.some((existing) => existing.name === payload.name))
|
|
1106
|
-
throw new RangeError(`Duplicate option name: ${String(payload.name)}.`);
|
|
1107
|
-
if (payload.required === true && list.some((existing) => existing.required !== true))
|
|
1108
|
-
throw new RangeError(`Required ${parent} options must be placed before optional options.`);
|
|
1109
|
-
return [...list, payload];
|
|
1110
|
-
}
|
|
1111
|
-
function appendChoices(data, choices) {
|
|
1112
|
-
const current = data.choices ?? [];
|
|
1113
|
-
if (!choices.length)
|
|
1114
|
-
throw new TypeError("At least one choice is required.");
|
|
1115
|
-
if (data.autocomplete === true)
|
|
1116
|
-
throw new RangeError("Autocomplete options cannot define choices.");
|
|
1117
|
-
if (current.length + choices.length > 25)
|
|
1118
|
-
throw new RangeError("An option cannot contain more than 25 choices.");
|
|
1119
|
-
for (const choice of choices) {
|
|
1120
|
-
validateText2(choice.name, "Choice name", 100);
|
|
1121
|
-
const value = choice.value;
|
|
1122
|
-
if (typeof value === "string" ? value.length === 0 || value.length > 100 : typeof value !== "number" || !Number.isFinite(value))
|
|
1123
|
-
throw new TypeError("Choice value must be a string of 1-100 characters or a finite number.");
|
|
1124
|
-
}
|
|
1125
|
-
data.choices = [...current, ...choices.map((choice) => ({ ...choice }))];
|
|
1126
|
-
}
|
|
1127
|
-
function validateName(value, field) {
|
|
1128
|
-
if (!/^[\p{L}\p{N}_-]{1,32}$/u.test(value) || value !== value.toLowerCase())
|
|
1129
|
-
throw new RangeError(`${field} must contain 1-32 lowercase letters, numbers, underscores, or hyphens.`);
|
|
1130
|
-
}
|
|
1131
|
-
function validateText2(value, field, max) {
|
|
1132
|
-
if (typeof value !== "string" || !value.trim() || value.length > max)
|
|
1133
|
-
throw new RangeError(`${field} must contain 1-${max} characters.`);
|
|
1134
|
-
}
|
|
1135
|
-
function validateIntegerRange(value, minimum, maximum, field) {
|
|
1136
|
-
if (!Number.isInteger(value) || value < minimum || value > maximum)
|
|
1137
|
-
throw new RangeError(`${field} must be an integer between ${minimum} and ${maximum}.`);
|
|
1138
|
-
}
|
|
1139
|
-
function validateNumberRange(value, minimum, maximum, field, integerOnly = true) {
|
|
1140
|
-
if (!Number.isFinite(value) || integerOnly && !Number.isInteger(value) || value < minimum || value > maximum)
|
|
1141
|
-
throw new RangeError(`${field} must be ${integerOnly ? "an integer" : "a number"} between ${minimum} and ${maximum}.`);
|
|
1142
|
-
}
|
|
1143
|
-
|
|
1144
|
-
class CreateContextMenuCommand {
|
|
1145
|
-
data;
|
|
1146
|
-
constructor(type = 2) {
|
|
1147
|
-
this.data = { type };
|
|
1148
|
-
}
|
|
1149
|
-
setType(type) {
|
|
1150
|
-
if (type !== 2 && type !== 3)
|
|
1151
|
-
throw new RangeError("Context menu command type must be 2 or 3.");
|
|
1152
|
-
this.data.type = type;
|
|
1153
|
-
return this;
|
|
1154
|
-
}
|
|
1155
|
-
setName(name) {
|
|
1156
|
-
if (typeof name !== "string" || name.trim().length < 1 || name.length > 32)
|
|
1157
|
-
throw new RangeError("Command name must contain 1-32 characters.");
|
|
1158
|
-
this.data.name = name;
|
|
1159
|
-
return this;
|
|
1160
|
-
}
|
|
1161
|
-
setDefaultMemberPermissions(permissions) {
|
|
1162
|
-
this.data.default_member_permissions = permissions === null ? null : BigInt(permissions).toString();
|
|
1163
|
-
return this;
|
|
1164
|
-
}
|
|
1165
|
-
setIntegrationTypes(...types) {
|
|
1166
|
-
this.data.integration_types = [...types];
|
|
1167
|
-
return this;
|
|
1168
|
-
}
|
|
1169
|
-
setContexts(...contexts) {
|
|
1170
|
-
validateContexts(contexts);
|
|
1171
|
-
this.data.contexts = [...contexts];
|
|
1172
|
-
return this;
|
|
1173
|
-
}
|
|
1174
|
-
setNameLocalizations(localizations) {
|
|
1175
|
-
this.data.name_localizations = localizations === null ? null : { ...localizations };
|
|
1176
|
-
return this;
|
|
1177
|
-
}
|
|
1178
|
-
toJSON() {
|
|
1179
|
-
return cloneData(this.data);
|
|
1180
|
-
}
|
|
1181
|
-
}
|
|
1182
|
-
|
|
1183
|
-
class CreateUserCommand extends CreateContextMenuCommand {
|
|
1184
|
-
constructor() {
|
|
1185
|
-
super(2);
|
|
1186
|
-
}
|
|
1187
|
-
}
|
|
1188
|
-
|
|
1189
|
-
class CreateMessageCommand extends CreateContextMenuCommand {
|
|
1190
|
-
constructor() {
|
|
1191
|
-
super(3);
|
|
1192
|
-
}
|
|
1193
|
-
}
|
|
1194
|
-
// packages/builders/src/attachment.ts
|
|
1195
|
-
import { readFile, realpath } from "fs/promises";
|
|
1196
|
-
import { basename, isAbsolute, relative, resolve } from "path";
|
|
1197
|
-
|
|
1198
|
-
class CreateAttachment {
|
|
1199
|
-
name;
|
|
1200
|
-
description;
|
|
1201
|
-
file;
|
|
1202
|
-
root;
|
|
1203
|
-
constructor(file, data) {
|
|
1204
|
-
this.file = file;
|
|
1205
|
-
if (typeof data === "string") {
|
|
1206
|
-
this.name = data;
|
|
1207
|
-
} else {
|
|
1208
|
-
this.name = data?.name ?? (typeof file === "string" ? basename(file) : "file.bin");
|
|
1209
|
-
this.description = data?.description;
|
|
1210
|
-
this.root = data?.root;
|
|
1211
|
-
}
|
|
1212
|
-
}
|
|
1213
|
-
setName(name) {
|
|
1214
|
-
this.name = name;
|
|
1215
|
-
return this;
|
|
1216
|
-
}
|
|
1217
|
-
setDescription(description) {
|
|
1218
|
-
this.description = description;
|
|
1219
|
-
return this;
|
|
1220
|
-
}
|
|
1221
|
-
setFile(file) {
|
|
1222
|
-
this.file = file;
|
|
1223
|
-
return this;
|
|
1224
|
-
}
|
|
1225
|
-
async toBuffer() {
|
|
1226
|
-
if (typeof this.file === "string") {
|
|
1227
|
-
const path = this.root === undefined ? this.file : await insideRoot(this.root, this.file);
|
|
1228
|
-
const buffer = await readFile(path);
|
|
1229
|
-
return new Uint8Array(buffer);
|
|
1230
|
-
}
|
|
1231
|
-
if (this.file instanceof Uint8Array)
|
|
1232
|
-
return this.file;
|
|
1233
|
-
if (this.file instanceof ArrayBuffer)
|
|
1234
|
-
return new Uint8Array(this.file);
|
|
1235
|
-
if (this.file instanceof Blob) {
|
|
1236
|
-
const buf = await this.file.arrayBuffer();
|
|
1237
|
-
return new Uint8Array(buf);
|
|
1238
|
-
}
|
|
1239
|
-
if (typeof Buffer !== "undefined" && Buffer.isBuffer(this.file)) {
|
|
1240
|
-
return new Uint8Array(this.file);
|
|
1241
|
-
}
|
|
1242
|
-
throw new TypeError("Attachment file must be a supported binary value or file path.");
|
|
1243
|
-
}
|
|
1244
|
-
}
|
|
1245
|
-
async function insideRoot(root, file) {
|
|
1246
|
-
const base = await realpath(root).catch(() => {
|
|
1247
|
-
throw new Error("Attachment root folder was not found.");
|
|
1248
|
-
});
|
|
1249
|
-
const target = await realpath(resolve(base, file)).catch(() => {
|
|
1250
|
-
throw new Error("Attachment file was not found inside its root.");
|
|
1251
|
-
});
|
|
1252
|
-
const rel = relative(base, target);
|
|
1253
|
-
if (rel === "" || rel === ".." || rel.startsWith("../") || rel.startsWith("..\\") || isAbsolute(rel))
|
|
1254
|
-
throw new Error("Attachment file is outside its root folder.");
|
|
1255
|
-
return target;
|
|
1256
|
-
}
|
|
2
|
+
import {
|
|
3
|
+
ComponentEnum2,
|
|
4
|
+
ButtonType2
|
|
5
|
+
} from "../chunks/index-gyvps8b9.js";
|
|
6
|
+
import {
|
|
7
|
+
CreateEmbed2,
|
|
8
|
+
TextInputType2,
|
|
9
|
+
CreateActionRow2,
|
|
10
|
+
CreateStringSelect2,
|
|
11
|
+
CreateButton2,
|
|
12
|
+
CreateEntitySelect2,
|
|
13
|
+
CreateModal2,
|
|
14
|
+
CreateTextInput2,
|
|
15
|
+
CreateContainer2,
|
|
16
|
+
CreateSection2,
|
|
17
|
+
CreateTextDisplay2,
|
|
18
|
+
CreateMediaGallery2,
|
|
19
|
+
CreateFileComponent2,
|
|
20
|
+
CreateSeparator2,
|
|
21
|
+
CreateThumbnail2,
|
|
22
|
+
CreateContentInventoryEntry2,
|
|
23
|
+
CreateUserSelect2,
|
|
24
|
+
CreateRoleSelect2,
|
|
25
|
+
CreateMentionableSelect2,
|
|
26
|
+
CreateChannelSelect2,
|
|
27
|
+
componentsV2Message2,
|
|
28
|
+
ApplicationCommandOptionEnum2,
|
|
29
|
+
CreateSlashCommand2,
|
|
30
|
+
CreateCommandOption2,
|
|
31
|
+
CreateStringOption2,
|
|
32
|
+
CreateIntegerOption2,
|
|
33
|
+
CreateNumberOption2,
|
|
34
|
+
CreateBooleanOption2,
|
|
35
|
+
CreateUserOption2,
|
|
36
|
+
CreateRoleOption2,
|
|
37
|
+
CreateMentionableOption2,
|
|
38
|
+
CreateAttachmentOption2,
|
|
39
|
+
CreateChannelOption2,
|
|
40
|
+
CreateSubcommand2,
|
|
41
|
+
CreateSubcommandGroup2,
|
|
42
|
+
CreateContextMenuCommand2,
|
|
43
|
+
CreateUserCommand2,
|
|
44
|
+
CreateMessageCommand2,
|
|
45
|
+
CreateAttachment2
|
|
46
|
+
} from "../chunks/index-5yx92e36.js";
|
|
1257
47
|
export {
|
|
1258
|
-
ApplicationCommandOptionEnum,
|
|
1259
|
-
ButtonType,
|
|
1260
|
-
ComponentEnum,
|
|
1261
|
-
CreateActionRow,
|
|
1262
|
-
CreateAttachment,
|
|
1263
|
-
CreateAttachmentOption,
|
|
1264
|
-
CreateBooleanOption,
|
|
1265
|
-
CreateButton,
|
|
1266
|
-
CreateChannelOption,
|
|
1267
|
-
|
|
1268
|
-
CreateCommandOption,
|
|
1269
|
-
CreateContainer,
|
|
1270
|
-
CreateContentInventoryEntry,
|
|
1271
|
-
CreateContextMenuCommand,
|
|
1272
|
-
CreateEmbed,
|
|
1273
|
-
CreateEntitySelect,
|
|
1274
|
-
CreateFileComponent,
|
|
1275
|
-
CreateIntegerOption,
|
|
1276
|
-
CreateMediaGallery,
|
|
1277
|
-
CreateMentionableOption,
|
|
1278
|
-
|
|
1279
|
-
CreateMessageCommand,
|
|
1280
|
-
CreateModal,
|
|
1281
|
-
CreateNumberOption,
|
|
1282
|
-
CreateRoleOption,
|
|
1283
|
-
|
|
1284
|
-
CreateSection,
|
|
1285
|
-
CreateSeparator,
|
|
1286
|
-
CreateSlashCommand,
|
|
1287
|
-
CreateStringOption,
|
|
1288
|
-
CreateStringSelect,
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
componentsV2Message
|
|
48
|
+
ApplicationCommandOptionEnum2 as ApplicationCommandOptionEnum,
|
|
49
|
+
ButtonType2 as ButtonType,
|
|
50
|
+
ComponentEnum2 as ComponentEnum,
|
|
51
|
+
CreateActionRow2 as CreateActionRow,
|
|
52
|
+
CreateAttachment2 as CreateAttachment,
|
|
53
|
+
CreateAttachmentOption2 as CreateAttachmentOption,
|
|
54
|
+
CreateBooleanOption2 as CreateBooleanOption,
|
|
55
|
+
CreateButton2 as CreateButton,
|
|
56
|
+
CreateChannelOption2 as CreateChannelOption,
|
|
57
|
+
CreateChannelSelect2 as CreateChannelSelect,
|
|
58
|
+
CreateCommandOption2 as CreateCommandOption,
|
|
59
|
+
CreateContainer2 as CreateContainer,
|
|
60
|
+
CreateContentInventoryEntry2 as CreateContentInventoryEntry,
|
|
61
|
+
CreateContextMenuCommand2 as CreateContextMenuCommand,
|
|
62
|
+
CreateEmbed2 as CreateEmbed,
|
|
63
|
+
CreateEntitySelect2 as CreateEntitySelect,
|
|
64
|
+
CreateFileComponent2 as CreateFileComponent,
|
|
65
|
+
CreateIntegerOption2 as CreateIntegerOption,
|
|
66
|
+
CreateMediaGallery2 as CreateMediaGallery,
|
|
67
|
+
CreateMentionableOption2 as CreateMentionableOption,
|
|
68
|
+
CreateMentionableSelect2 as CreateMentionableSelect,
|
|
69
|
+
CreateMessageCommand2 as CreateMessageCommand,
|
|
70
|
+
CreateModal2 as CreateModal,
|
|
71
|
+
CreateNumberOption2 as CreateNumberOption,
|
|
72
|
+
CreateRoleOption2 as CreateRoleOption,
|
|
73
|
+
CreateRoleSelect2 as CreateRoleSelect,
|
|
74
|
+
CreateSection2 as CreateSection,
|
|
75
|
+
CreateSeparator2 as CreateSeparator,
|
|
76
|
+
CreateSlashCommand2 as CreateSlashCommand,
|
|
77
|
+
CreateStringOption2 as CreateStringOption,
|
|
78
|
+
CreateStringSelect2 as CreateStringSelect,
|
|
79
|
+
CreateSubcommand2 as CreateSubcommand,
|
|
80
|
+
CreateSubcommandGroup2 as CreateSubcommandGroup,
|
|
81
|
+
CreateTextDisplay2 as CreateTextDisplay,
|
|
82
|
+
CreateTextInput2 as CreateTextInput,
|
|
83
|
+
CreateThumbnail2 as CreateThumbnail,
|
|
84
|
+
CreateUserCommand2 as CreateUserCommand,
|
|
85
|
+
CreateUserOption2 as CreateUserOption,
|
|
86
|
+
CreateUserSelect2 as CreateUserSelect,
|
|
87
|
+
TextInputType2 as TextInputType,
|
|
88
|
+
componentsV2Message2 as componentsV2Message
|
|
1300
89
|
};
|
|
1301
90
|
|
|
1302
|
-
//# debugId=
|
|
91
|
+
//# debugId=C2A147CDC234617F64756E2164756E21
|