@discordjs/builders 2.0.0-dev.1745367189-42ce11622 → 2.0.0-dev.1745540007-8e4e319c2
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/dist/index.d.mts +1513 -370
- package/dist/index.d.ts +1513 -370
- package/dist/index.js +1273 -298
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1229 -271
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -47,6 +47,7 @@ __export(index_exports, {
|
|
|
47
47
|
ChatInputCommandUserOption: () => ChatInputCommandUserOption,
|
|
48
48
|
CommandBuilder: () => CommandBuilder,
|
|
49
49
|
ComponentBuilder: () => ComponentBuilder,
|
|
50
|
+
ContainerBuilder: () => ContainerBuilder,
|
|
50
51
|
ContextMenuCommandBuilder: () => ContextMenuCommandBuilder,
|
|
51
52
|
CustomIdButtonBuilder: () => CustomIdButtonBuilder,
|
|
52
53
|
DangerButtonBuilder: () => DangerButtonBuilder,
|
|
@@ -55,7 +56,10 @@ __export(index_exports, {
|
|
|
55
56
|
EmbedFieldBuilder: () => EmbedFieldBuilder,
|
|
56
57
|
EmbedFooterBuilder: () => EmbedFooterBuilder,
|
|
57
58
|
EmojiOrLabelButtonMixin: () => EmojiOrLabelButtonMixin,
|
|
59
|
+
FileBuilder: () => FileBuilder,
|
|
58
60
|
LinkButtonBuilder: () => LinkButtonBuilder,
|
|
61
|
+
MediaGalleryBuilder: () => MediaGalleryBuilder,
|
|
62
|
+
MediaGalleryItemBuilder: () => MediaGalleryItemBuilder,
|
|
59
63
|
MentionableSelectMenuBuilder: () => MentionableSelectMenuBuilder,
|
|
60
64
|
MessageBuilder: () => MessageBuilder,
|
|
61
65
|
MessageContextCommandBuilder: () => MessageContextCommandBuilder,
|
|
@@ -70,6 +74,8 @@ __export(index_exports, {
|
|
|
70
74
|
PrimaryButtonBuilder: () => PrimaryButtonBuilder,
|
|
71
75
|
RoleSelectMenuBuilder: () => RoleSelectMenuBuilder,
|
|
72
76
|
SecondaryButtonBuilder: () => SecondaryButtonBuilder,
|
|
77
|
+
SectionBuilder: () => SectionBuilder,
|
|
78
|
+
SeparatorBuilder: () => SeparatorBuilder,
|
|
73
79
|
SharedChatInputCommandOptions: () => SharedChatInputCommandOptions,
|
|
74
80
|
SharedChatInputCommandSubcommands: () => SharedChatInputCommandSubcommands,
|
|
75
81
|
SharedName: () => SharedName,
|
|
@@ -77,7 +83,9 @@ __export(index_exports, {
|
|
|
77
83
|
StringSelectMenuBuilder: () => StringSelectMenuBuilder,
|
|
78
84
|
StringSelectMenuOptionBuilder: () => StringSelectMenuOptionBuilder,
|
|
79
85
|
SuccessButtonBuilder: () => SuccessButtonBuilder,
|
|
86
|
+
TextDisplayBuilder: () => TextDisplayBuilder,
|
|
80
87
|
TextInputBuilder: () => TextInputBuilder,
|
|
88
|
+
ThumbnailBuilder: () => ThumbnailBuilder,
|
|
81
89
|
UserContextCommandBuilder: () => UserContextCommandBuilder,
|
|
82
90
|
UserSelectMenuBuilder: () => UserSelectMenuBuilder,
|
|
83
91
|
actionRowPredicate: () => actionRowPredicate,
|
|
@@ -89,6 +97,7 @@ __export(index_exports, {
|
|
|
89
97
|
chatInputCommandPredicate: () => chatInputCommandPredicate,
|
|
90
98
|
chatInputCommandSubcommandGroupPredicate: () => chatInputCommandSubcommandGroupPredicate,
|
|
91
99
|
chatInputCommandSubcommandPredicate: () => chatInputCommandSubcommandPredicate,
|
|
100
|
+
containerPredicate: () => containerPredicate,
|
|
92
101
|
createComponentBuilder: () => createComponentBuilder,
|
|
93
102
|
customIdPredicate: () => customIdPredicate,
|
|
94
103
|
disableValidators: () => disableValidators,
|
|
@@ -99,9 +108,12 @@ __export(index_exports, {
|
|
|
99
108
|
embedPredicate: () => embedPredicate,
|
|
100
109
|
emojiPredicate: () => emojiPredicate,
|
|
101
110
|
enableValidators: () => enableValidators,
|
|
111
|
+
filePredicate: () => filePredicate,
|
|
102
112
|
integerOptionPredicate: () => integerOptionPredicate,
|
|
103
113
|
isValidationEnabled: () => isValidationEnabled,
|
|
104
114
|
localeMapPredicate: () => localeMapPredicate,
|
|
115
|
+
mediaGalleryItemPredicate: () => mediaGalleryItemPredicate,
|
|
116
|
+
mediaGalleryPredicate: () => mediaGalleryPredicate,
|
|
105
117
|
memberPermissionsPredicate: () => memberPermissionsPredicate,
|
|
106
118
|
messageCommandPredicate: () => messageCommandPredicate,
|
|
107
119
|
messagePredicate: () => messagePredicate,
|
|
@@ -114,15 +126,20 @@ __export(index_exports, {
|
|
|
114
126
|
pollPredicate: () => pollPredicate,
|
|
115
127
|
pollQuestionPredicate: () => pollQuestionPredicate,
|
|
116
128
|
refineURLPredicate: () => refineURLPredicate,
|
|
129
|
+
resolveAccessoryComponent: () => resolveAccessoryComponent,
|
|
117
130
|
resolveBuilder: () => resolveBuilder,
|
|
131
|
+
sectionPredicate: () => sectionPredicate,
|
|
118
132
|
selectMenuChannelPredicate: () => selectMenuChannelPredicate,
|
|
119
133
|
selectMenuMentionablePredicate: () => selectMenuMentionablePredicate,
|
|
120
134
|
selectMenuRolePredicate: () => selectMenuRolePredicate,
|
|
121
135
|
selectMenuStringOptionPredicate: () => selectMenuStringOptionPredicate,
|
|
122
136
|
selectMenuStringPredicate: () => selectMenuStringPredicate,
|
|
123
137
|
selectMenuUserPredicate: () => selectMenuUserPredicate,
|
|
138
|
+
separatorPredicate: () => separatorPredicate,
|
|
124
139
|
stringOptionPredicate: () => stringOptionPredicate,
|
|
140
|
+
textDisplayPredicate: () => textDisplayPredicate,
|
|
125
141
|
textInputPredicate: () => textInputPredicate,
|
|
142
|
+
thumbnailPredicate: () => thumbnailPredicate,
|
|
126
143
|
userCommandPredicate: () => userCommandPredicate,
|
|
127
144
|
validate: () => validate,
|
|
128
145
|
version: () => version
|
|
@@ -328,6 +345,22 @@ var ComponentBuilder = class {
|
|
|
328
345
|
static {
|
|
329
346
|
__name(this, "ComponentBuilder");
|
|
330
347
|
}
|
|
348
|
+
/**
|
|
349
|
+
* Sets the id of this component.
|
|
350
|
+
*
|
|
351
|
+
* @param id - The id to use
|
|
352
|
+
*/
|
|
353
|
+
setId(id) {
|
|
354
|
+
this.data.id = id;
|
|
355
|
+
return this;
|
|
356
|
+
}
|
|
357
|
+
/**
|
|
358
|
+
* Clears the id of this component, defaulting to a default incremented id.
|
|
359
|
+
*/
|
|
360
|
+
clearId() {
|
|
361
|
+
this.data.id = void 0;
|
|
362
|
+
return this;
|
|
363
|
+
}
|
|
331
364
|
};
|
|
332
365
|
|
|
333
366
|
// src/components/button/Button.ts
|
|
@@ -1121,197 +1154,1023 @@ var textInputPredicate = import_zod3.z.object({
|
|
|
1121
1154
|
required: import_zod3.z.boolean().optional()
|
|
1122
1155
|
});
|
|
1123
1156
|
|
|
1124
|
-
// src/components/textInput/TextInput.ts
|
|
1125
|
-
var TextInputBuilder = class extends ComponentBuilder {
|
|
1157
|
+
// src/components/textInput/TextInput.ts
|
|
1158
|
+
var TextInputBuilder = class extends ComponentBuilder {
|
|
1159
|
+
static {
|
|
1160
|
+
__name(this, "TextInputBuilder");
|
|
1161
|
+
}
|
|
1162
|
+
data;
|
|
1163
|
+
/**
|
|
1164
|
+
* Creates a new text input from API data.
|
|
1165
|
+
*
|
|
1166
|
+
* @param data - The API data to create this text input with
|
|
1167
|
+
* @example
|
|
1168
|
+
* Creating a text input from an API data object:
|
|
1169
|
+
* ```ts
|
|
1170
|
+
* const textInput = new TextInputBuilder({
|
|
1171
|
+
* custom_id: 'a cool text input',
|
|
1172
|
+
* label: 'Type something',
|
|
1173
|
+
* style: TextInputStyle.Short,
|
|
1174
|
+
* });
|
|
1175
|
+
* ```
|
|
1176
|
+
* @example
|
|
1177
|
+
* Creating a text input using setters and API data:
|
|
1178
|
+
* ```ts
|
|
1179
|
+
* const textInput = new TextInputBuilder({
|
|
1180
|
+
* label: 'Type something else',
|
|
1181
|
+
* })
|
|
1182
|
+
* .setCustomId('woah')
|
|
1183
|
+
* .setStyle(TextInputStyle.Paragraph);
|
|
1184
|
+
* ```
|
|
1185
|
+
*/
|
|
1186
|
+
constructor(data = {}) {
|
|
1187
|
+
super();
|
|
1188
|
+
this.data = { ...structuredClone(data), type: import_v1012.ComponentType.TextInput };
|
|
1189
|
+
}
|
|
1190
|
+
/**
|
|
1191
|
+
* Sets the custom id for this text input.
|
|
1192
|
+
*
|
|
1193
|
+
* @param customId - The custom id to use
|
|
1194
|
+
*/
|
|
1195
|
+
setCustomId(customId) {
|
|
1196
|
+
this.data.custom_id = customId;
|
|
1197
|
+
return this;
|
|
1198
|
+
}
|
|
1199
|
+
/**
|
|
1200
|
+
* Sets the label for this text input.
|
|
1201
|
+
*
|
|
1202
|
+
* @param label - The label to use
|
|
1203
|
+
*/
|
|
1204
|
+
setLabel(label) {
|
|
1205
|
+
this.data.label = label;
|
|
1206
|
+
return this;
|
|
1207
|
+
}
|
|
1208
|
+
/**
|
|
1209
|
+
* Sets the style for this text input.
|
|
1210
|
+
*
|
|
1211
|
+
* @param style - The style to use
|
|
1212
|
+
*/
|
|
1213
|
+
setStyle(style) {
|
|
1214
|
+
this.data.style = style;
|
|
1215
|
+
return this;
|
|
1216
|
+
}
|
|
1217
|
+
/**
|
|
1218
|
+
* Sets the minimum length of text for this text input.
|
|
1219
|
+
*
|
|
1220
|
+
* @param minLength - The minimum length of text for this text input
|
|
1221
|
+
*/
|
|
1222
|
+
setMinLength(minLength) {
|
|
1223
|
+
this.data.min_length = minLength;
|
|
1224
|
+
return this;
|
|
1225
|
+
}
|
|
1226
|
+
/**
|
|
1227
|
+
* Clears the minimum length of text for this text input.
|
|
1228
|
+
*/
|
|
1229
|
+
clearMinLength() {
|
|
1230
|
+
this.data.min_length = void 0;
|
|
1231
|
+
return this;
|
|
1232
|
+
}
|
|
1233
|
+
/**
|
|
1234
|
+
* Sets the maximum length of text for this text input.
|
|
1235
|
+
*
|
|
1236
|
+
* @param maxLength - The maximum length of text for this text input
|
|
1237
|
+
*/
|
|
1238
|
+
setMaxLength(maxLength) {
|
|
1239
|
+
this.data.max_length = maxLength;
|
|
1240
|
+
return this;
|
|
1241
|
+
}
|
|
1242
|
+
/**
|
|
1243
|
+
* Clears the maximum length of text for this text input.
|
|
1244
|
+
*/
|
|
1245
|
+
clearMaxLength() {
|
|
1246
|
+
this.data.max_length = void 0;
|
|
1247
|
+
return this;
|
|
1248
|
+
}
|
|
1249
|
+
/**
|
|
1250
|
+
* Sets the placeholder for this text input.
|
|
1251
|
+
*
|
|
1252
|
+
* @param placeholder - The placeholder to use
|
|
1253
|
+
*/
|
|
1254
|
+
setPlaceholder(placeholder) {
|
|
1255
|
+
this.data.placeholder = placeholder;
|
|
1256
|
+
return this;
|
|
1257
|
+
}
|
|
1258
|
+
/**
|
|
1259
|
+
* Clears the placeholder for this text input.
|
|
1260
|
+
*/
|
|
1261
|
+
clearPlaceholder() {
|
|
1262
|
+
this.data.placeholder = void 0;
|
|
1263
|
+
return this;
|
|
1264
|
+
}
|
|
1265
|
+
/**
|
|
1266
|
+
* Sets the value for this text input.
|
|
1267
|
+
*
|
|
1268
|
+
* @param value - The value to use
|
|
1269
|
+
*/
|
|
1270
|
+
setValue(value) {
|
|
1271
|
+
this.data.value = value;
|
|
1272
|
+
return this;
|
|
1273
|
+
}
|
|
1274
|
+
/**
|
|
1275
|
+
* Clears the value for this text input.
|
|
1276
|
+
*/
|
|
1277
|
+
clearValue() {
|
|
1278
|
+
this.data.value = void 0;
|
|
1279
|
+
return this;
|
|
1280
|
+
}
|
|
1281
|
+
/**
|
|
1282
|
+
* Sets whether this text input is required.
|
|
1283
|
+
*
|
|
1284
|
+
* @param required - Whether this text input is required
|
|
1285
|
+
*/
|
|
1286
|
+
setRequired(required = true) {
|
|
1287
|
+
this.data.required = required;
|
|
1288
|
+
return this;
|
|
1289
|
+
}
|
|
1290
|
+
/**
|
|
1291
|
+
* {@inheritDoc ComponentBuilder.toJSON}
|
|
1292
|
+
*/
|
|
1293
|
+
toJSON(validationOverride) {
|
|
1294
|
+
const clone = structuredClone(this.data);
|
|
1295
|
+
validate(textInputPredicate, clone, validationOverride);
|
|
1296
|
+
return clone;
|
|
1297
|
+
}
|
|
1298
|
+
};
|
|
1299
|
+
|
|
1300
|
+
// src/components/ActionRow.ts
|
|
1301
|
+
var import_v1022 = require("discord-api-types/v10");
|
|
1302
|
+
|
|
1303
|
+
// src/components/Components.ts
|
|
1304
|
+
var import_v1021 = require("discord-api-types/v10");
|
|
1305
|
+
|
|
1306
|
+
// src/components/v2/Container.ts
|
|
1307
|
+
var import_v1020 = require("discord-api-types/v10");
|
|
1308
|
+
|
|
1309
|
+
// src/components/v2/Assertions.ts
|
|
1310
|
+
var import_v1013 = require("discord-api-types/v10");
|
|
1311
|
+
var import_zod4 = require("zod");
|
|
1312
|
+
var unfurledMediaItemPredicate = import_zod4.z.object({
|
|
1313
|
+
url: import_zod4.z.string().url().refine(refineURLPredicate(["http:", "https:", "attachment:"]), {
|
|
1314
|
+
message: "Invalid protocol for media URL. Must be http:, https:, or attachment:"
|
|
1315
|
+
})
|
|
1316
|
+
});
|
|
1317
|
+
var thumbnailPredicate = import_zod4.z.object({
|
|
1318
|
+
media: unfurledMediaItemPredicate,
|
|
1319
|
+
description: import_zod4.z.string().min(1).max(1024).nullish(),
|
|
1320
|
+
spoiler: import_zod4.z.boolean().optional()
|
|
1321
|
+
});
|
|
1322
|
+
var unfurledMediaItemAttachmentOnlyPredicate = import_zod4.z.object({
|
|
1323
|
+
url: import_zod4.z.string().url().refine(refineURLPredicate(["attachment:"]), {
|
|
1324
|
+
message: "Invalid protocol for file URL. Must be attachment:"
|
|
1325
|
+
})
|
|
1326
|
+
});
|
|
1327
|
+
var filePredicate = import_zod4.z.object({
|
|
1328
|
+
file: unfurledMediaItemAttachmentOnlyPredicate,
|
|
1329
|
+
spoiler: import_zod4.z.boolean().optional()
|
|
1330
|
+
});
|
|
1331
|
+
var separatorPredicate = import_zod4.z.object({
|
|
1332
|
+
divider: import_zod4.z.boolean().optional(),
|
|
1333
|
+
spacing: import_zod4.z.nativeEnum(import_v1013.SeparatorSpacingSize).optional()
|
|
1334
|
+
});
|
|
1335
|
+
var textDisplayPredicate = import_zod4.z.object({
|
|
1336
|
+
content: import_zod4.z.string().min(1).max(4e3)
|
|
1337
|
+
});
|
|
1338
|
+
var mediaGalleryItemPredicate = import_zod4.z.object({
|
|
1339
|
+
media: unfurledMediaItemPredicate,
|
|
1340
|
+
description: import_zod4.z.string().min(1).max(1024).nullish(),
|
|
1341
|
+
spoiler: import_zod4.z.boolean().optional()
|
|
1342
|
+
});
|
|
1343
|
+
var mediaGalleryPredicate = import_zod4.z.object({
|
|
1344
|
+
items: import_zod4.z.array(mediaGalleryItemPredicate).min(1).max(10)
|
|
1345
|
+
});
|
|
1346
|
+
var sectionPredicate = import_zod4.z.object({
|
|
1347
|
+
components: import_zod4.z.array(textDisplayPredicate).min(1).max(3),
|
|
1348
|
+
accessory: import_zod4.z.union([
|
|
1349
|
+
import_zod4.z.object({ type: import_zod4.z.literal(import_v1013.ComponentType.Button) }),
|
|
1350
|
+
import_zod4.z.object({ type: import_zod4.z.literal(import_v1013.ComponentType.Thumbnail) })
|
|
1351
|
+
])
|
|
1352
|
+
});
|
|
1353
|
+
var containerPredicate = import_zod4.z.object({
|
|
1354
|
+
components: import_zod4.z.array(
|
|
1355
|
+
import_zod4.z.union([
|
|
1356
|
+
actionRowPredicate,
|
|
1357
|
+
filePredicate,
|
|
1358
|
+
mediaGalleryPredicate,
|
|
1359
|
+
sectionPredicate,
|
|
1360
|
+
separatorPredicate,
|
|
1361
|
+
textDisplayPredicate
|
|
1362
|
+
])
|
|
1363
|
+
).min(1).max(10),
|
|
1364
|
+
spoiler: import_zod4.z.boolean().optional(),
|
|
1365
|
+
accent_color: import_zod4.z.number().int().min(0).max(16777215).nullish()
|
|
1366
|
+
});
|
|
1367
|
+
|
|
1368
|
+
// src/components/v2/File.ts
|
|
1369
|
+
var import_v1014 = require("discord-api-types/v10");
|
|
1370
|
+
var FileBuilder = class extends ComponentBuilder {
|
|
1371
|
+
static {
|
|
1372
|
+
__name(this, "FileBuilder");
|
|
1373
|
+
}
|
|
1374
|
+
data;
|
|
1375
|
+
/**
|
|
1376
|
+
* Creates a new file from API data.
|
|
1377
|
+
*
|
|
1378
|
+
* @param data - The API data to create this file with
|
|
1379
|
+
* @example
|
|
1380
|
+
* Creating a file from an API data object:
|
|
1381
|
+
* ```ts
|
|
1382
|
+
* const file = new FileBuilder({
|
|
1383
|
+
* spoiler: true,
|
|
1384
|
+
* file: {
|
|
1385
|
+
* url: 'attachment://file.png',
|
|
1386
|
+
* },
|
|
1387
|
+
* });
|
|
1388
|
+
* ```
|
|
1389
|
+
* @example
|
|
1390
|
+
* Creating a file using setters and API data:
|
|
1391
|
+
* ```ts
|
|
1392
|
+
* const file = new FileBuilder({
|
|
1393
|
+
* file: {
|
|
1394
|
+
* url: 'attachment://image.jpg',
|
|
1395
|
+
* },
|
|
1396
|
+
* })
|
|
1397
|
+
* .setSpoiler(false);
|
|
1398
|
+
* ```
|
|
1399
|
+
*/
|
|
1400
|
+
constructor(data = {}) {
|
|
1401
|
+
super();
|
|
1402
|
+
this.data = {
|
|
1403
|
+
...structuredClone(data),
|
|
1404
|
+
file: data.file ? { url: data.file.url } : void 0,
|
|
1405
|
+
type: import_v1014.ComponentType.File
|
|
1406
|
+
};
|
|
1407
|
+
}
|
|
1408
|
+
/**
|
|
1409
|
+
* Sets the spoiler status of this file.
|
|
1410
|
+
*
|
|
1411
|
+
* @param spoiler - The spoiler status to use
|
|
1412
|
+
*/
|
|
1413
|
+
setSpoiler(spoiler = true) {
|
|
1414
|
+
this.data.spoiler = spoiler;
|
|
1415
|
+
return this;
|
|
1416
|
+
}
|
|
1417
|
+
/**
|
|
1418
|
+
* Sets the media URL of this file.
|
|
1419
|
+
*
|
|
1420
|
+
* @param url - The URL to use
|
|
1421
|
+
*/
|
|
1422
|
+
setURL(url) {
|
|
1423
|
+
this.data.file = { url };
|
|
1424
|
+
return this;
|
|
1425
|
+
}
|
|
1426
|
+
/**
|
|
1427
|
+
* {@inheritDoc ComponentBuilder.toJSON}
|
|
1428
|
+
*/
|
|
1429
|
+
toJSON(validationOverride) {
|
|
1430
|
+
const clone = structuredClone(this.data);
|
|
1431
|
+
validate(filePredicate, clone, validationOverride);
|
|
1432
|
+
return clone;
|
|
1433
|
+
}
|
|
1434
|
+
};
|
|
1435
|
+
|
|
1436
|
+
// src/components/v2/MediaGallery.ts
|
|
1437
|
+
var import_v1015 = require("discord-api-types/v10");
|
|
1438
|
+
|
|
1439
|
+
// src/components/v2/MediaGalleryItem.ts
|
|
1440
|
+
var MediaGalleryItemBuilder = class {
|
|
1441
|
+
static {
|
|
1442
|
+
__name(this, "MediaGalleryItemBuilder");
|
|
1443
|
+
}
|
|
1444
|
+
data;
|
|
1445
|
+
/**
|
|
1446
|
+
* Creates a new media gallery item from API data.
|
|
1447
|
+
*
|
|
1448
|
+
* @param data - The API data to create this media gallery item with
|
|
1449
|
+
* @example
|
|
1450
|
+
* Creating a media gallery item from an API data object:
|
|
1451
|
+
* ```ts
|
|
1452
|
+
* const item = new MediaGalleryItemBuilder({
|
|
1453
|
+
* description: "Some text here",
|
|
1454
|
+
* media: {
|
|
1455
|
+
* url: 'https://cdn.discordapp.com/embed/avatars/2.png',
|
|
1456
|
+
* },
|
|
1457
|
+
* });
|
|
1458
|
+
* ```
|
|
1459
|
+
* @example
|
|
1460
|
+
* Creating a media gallery item using setters and API data:
|
|
1461
|
+
* ```ts
|
|
1462
|
+
* const item = new MediaGalleryItemBuilder({
|
|
1463
|
+
* media: {
|
|
1464
|
+
* url: 'https://cdn.discordapp.com/embed/avatars/5.png',
|
|
1465
|
+
* },
|
|
1466
|
+
* })
|
|
1467
|
+
* .setDescription("alt text");
|
|
1468
|
+
* ```
|
|
1469
|
+
*/
|
|
1470
|
+
constructor(data = {}) {
|
|
1471
|
+
this.data = {
|
|
1472
|
+
...structuredClone(data)
|
|
1473
|
+
};
|
|
1474
|
+
}
|
|
1475
|
+
/**
|
|
1476
|
+
* Sets the source URL of this media gallery item.
|
|
1477
|
+
*
|
|
1478
|
+
* @param url - The URL to use
|
|
1479
|
+
*/
|
|
1480
|
+
setURL(url) {
|
|
1481
|
+
this.data.media = { url };
|
|
1482
|
+
return this;
|
|
1483
|
+
}
|
|
1484
|
+
/**
|
|
1485
|
+
* Sets the description of this thumbnail.
|
|
1486
|
+
*
|
|
1487
|
+
* @param description - The description to use
|
|
1488
|
+
*/
|
|
1489
|
+
setDescription(description) {
|
|
1490
|
+
this.data.description = description;
|
|
1491
|
+
return this;
|
|
1492
|
+
}
|
|
1493
|
+
/**
|
|
1494
|
+
* Clears the description of this thumbnail.
|
|
1495
|
+
*/
|
|
1496
|
+
clearDescription() {
|
|
1497
|
+
this.data.description = void 0;
|
|
1498
|
+
return this;
|
|
1499
|
+
}
|
|
1500
|
+
/**
|
|
1501
|
+
* Sets the spoiler status of this thumbnail.
|
|
1502
|
+
*
|
|
1503
|
+
* @param spoiler - The spoiler status to use
|
|
1504
|
+
*/
|
|
1505
|
+
setSpoiler(spoiler = true) {
|
|
1506
|
+
this.data.spoiler = spoiler;
|
|
1507
|
+
return this;
|
|
1508
|
+
}
|
|
1509
|
+
/**
|
|
1510
|
+
* Transforms this object to its JSON format
|
|
1511
|
+
*/
|
|
1512
|
+
toJSON(validationOverride) {
|
|
1513
|
+
const clone = structuredClone(this.data);
|
|
1514
|
+
validate(mediaGalleryItemPredicate, clone, validationOverride);
|
|
1515
|
+
return clone;
|
|
1516
|
+
}
|
|
1517
|
+
};
|
|
1518
|
+
|
|
1519
|
+
// src/components/v2/MediaGallery.ts
|
|
1520
|
+
var MediaGalleryBuilder = class extends ComponentBuilder {
|
|
1521
|
+
static {
|
|
1522
|
+
__name(this, "MediaGalleryBuilder");
|
|
1523
|
+
}
|
|
1524
|
+
data;
|
|
1525
|
+
/**
|
|
1526
|
+
* Creates a new media gallery from API data.
|
|
1527
|
+
*
|
|
1528
|
+
* @param data - The API data to create this container with
|
|
1529
|
+
* @example
|
|
1530
|
+
* Creating a media gallery from an API data object:
|
|
1531
|
+
* ```ts
|
|
1532
|
+
* const mediaGallery = new MediaGalleryBuilder({
|
|
1533
|
+
* items: [
|
|
1534
|
+
* {
|
|
1535
|
+
* description: "Some text here",
|
|
1536
|
+
* media: {
|
|
1537
|
+
* url: 'https://cdn.discordapp.com/embed/avatars/2.png',
|
|
1538
|
+
* },
|
|
1539
|
+
* },
|
|
1540
|
+
* ],
|
|
1541
|
+
* });
|
|
1542
|
+
* ```
|
|
1543
|
+
* @example
|
|
1544
|
+
* Creating a media gallery using setters and API data:
|
|
1545
|
+
* ```ts
|
|
1546
|
+
* const mediaGallery = new MediaGalleryBuilder({
|
|
1547
|
+
* items: [
|
|
1548
|
+
* {
|
|
1549
|
+
* description: "alt text",
|
|
1550
|
+
* media: {
|
|
1551
|
+
* url: 'https://cdn.discordapp.com/embed/avatars/5.png',
|
|
1552
|
+
* },
|
|
1553
|
+
* },
|
|
1554
|
+
* ],
|
|
1555
|
+
* })
|
|
1556
|
+
* .addItems(item2, item3);
|
|
1557
|
+
* ```
|
|
1558
|
+
*/
|
|
1559
|
+
constructor(data = {}) {
|
|
1560
|
+
super();
|
|
1561
|
+
this.data = {
|
|
1562
|
+
items: data?.items?.map((item) => new MediaGalleryItemBuilder(item)) ?? [],
|
|
1563
|
+
type: import_v1015.ComponentType.MediaGallery
|
|
1564
|
+
};
|
|
1565
|
+
}
|
|
1566
|
+
/**
|
|
1567
|
+
* The items in this media gallery.
|
|
1568
|
+
*/
|
|
1569
|
+
get items() {
|
|
1570
|
+
return this.data.items;
|
|
1571
|
+
}
|
|
1572
|
+
/**
|
|
1573
|
+
* Adds a media gallery item to this media gallery.
|
|
1574
|
+
*
|
|
1575
|
+
* @param input - The items to add
|
|
1576
|
+
*/
|
|
1577
|
+
addItems(...input) {
|
|
1578
|
+
const normalized = normalizeArray(input);
|
|
1579
|
+
const resolved = normalized.map((item) => resolveBuilder(item, MediaGalleryItemBuilder));
|
|
1580
|
+
this.data.items.push(...resolved);
|
|
1581
|
+
return this;
|
|
1582
|
+
}
|
|
1583
|
+
/**
|
|
1584
|
+
* Removes, replaces, or inserts media gallery items for this media gallery.
|
|
1585
|
+
*
|
|
1586
|
+
* @param index - The index to start removing, replacing or inserting items
|
|
1587
|
+
* @param deleteCount - The amount of items to remove
|
|
1588
|
+
* @param items - The items to insert
|
|
1589
|
+
*/
|
|
1590
|
+
spliceItems(index, deleteCount, ...items) {
|
|
1591
|
+
const normalized = normalizeArray(items);
|
|
1592
|
+
const resolved = normalized.map((item) => resolveBuilder(item, MediaGalleryItemBuilder));
|
|
1593
|
+
this.data.items.splice(index, deleteCount, ...resolved);
|
|
1594
|
+
return this;
|
|
1595
|
+
}
|
|
1596
|
+
/**
|
|
1597
|
+
* {@inheritDoc ComponentBuilder.toJSON}
|
|
1598
|
+
*/
|
|
1599
|
+
toJSON(validationOverride) {
|
|
1600
|
+
const { items, ...rest } = this.data;
|
|
1601
|
+
const data = {
|
|
1602
|
+
...structuredClone(rest),
|
|
1603
|
+
items: items.map((item) => item.toJSON(false))
|
|
1604
|
+
};
|
|
1605
|
+
validate(mediaGalleryPredicate, data, validationOverride);
|
|
1606
|
+
return data;
|
|
1607
|
+
}
|
|
1608
|
+
};
|
|
1609
|
+
|
|
1610
|
+
// src/components/v2/Section.ts
|
|
1611
|
+
var import_v1018 = require("discord-api-types/v10");
|
|
1612
|
+
|
|
1613
|
+
// src/components/v2/TextDisplay.ts
|
|
1614
|
+
var import_v1016 = require("discord-api-types/v10");
|
|
1615
|
+
var TextDisplayBuilder = class extends ComponentBuilder {
|
|
1616
|
+
static {
|
|
1617
|
+
__name(this, "TextDisplayBuilder");
|
|
1618
|
+
}
|
|
1619
|
+
data;
|
|
1620
|
+
/**
|
|
1621
|
+
* Creates a new text display from API data.
|
|
1622
|
+
*
|
|
1623
|
+
* @param data - The API data to create this text display with
|
|
1624
|
+
* @example
|
|
1625
|
+
* Creating a text display from an API data object:
|
|
1626
|
+
* ```ts
|
|
1627
|
+
* const textDisplay = new TextDisplayBuilder({
|
|
1628
|
+
* content: 'some text',
|
|
1629
|
+
* });
|
|
1630
|
+
* ```
|
|
1631
|
+
* @example
|
|
1632
|
+
* Creating a text display using setters and API data:
|
|
1633
|
+
* ```ts
|
|
1634
|
+
* const textDisplay = new TextDisplayBuilder({
|
|
1635
|
+
* content: 'old text',
|
|
1636
|
+
* })
|
|
1637
|
+
* .setContent('new text');
|
|
1638
|
+
* ```
|
|
1639
|
+
*/
|
|
1640
|
+
constructor(data = {}) {
|
|
1641
|
+
super();
|
|
1642
|
+
this.data = {
|
|
1643
|
+
...structuredClone(data),
|
|
1644
|
+
type: import_v1016.ComponentType.TextDisplay
|
|
1645
|
+
};
|
|
1646
|
+
}
|
|
1647
|
+
/**
|
|
1648
|
+
* Sets the text of this text display.
|
|
1649
|
+
*
|
|
1650
|
+
* @param content - The text to use
|
|
1651
|
+
*/
|
|
1652
|
+
setContent(content) {
|
|
1653
|
+
this.data.content = content;
|
|
1654
|
+
return this;
|
|
1655
|
+
}
|
|
1656
|
+
/**
|
|
1657
|
+
* {@inheritDoc ComponentBuilder.toJSON}
|
|
1658
|
+
*/
|
|
1659
|
+
toJSON(validationOverride) {
|
|
1660
|
+
const clone = structuredClone(this.data);
|
|
1661
|
+
validate(textDisplayPredicate, clone, validationOverride);
|
|
1662
|
+
return clone;
|
|
1663
|
+
}
|
|
1664
|
+
};
|
|
1665
|
+
|
|
1666
|
+
// src/components/v2/Thumbnail.ts
|
|
1667
|
+
var import_v1017 = require("discord-api-types/v10");
|
|
1668
|
+
var ThumbnailBuilder = class extends ComponentBuilder {
|
|
1669
|
+
static {
|
|
1670
|
+
__name(this, "ThumbnailBuilder");
|
|
1671
|
+
}
|
|
1672
|
+
data;
|
|
1673
|
+
/**
|
|
1674
|
+
* Creates a new thumbnail from API data.
|
|
1675
|
+
*
|
|
1676
|
+
* @param data - The API data to create this thumbnail with
|
|
1677
|
+
* @example
|
|
1678
|
+
* Creating a thumbnail from an API data object:
|
|
1679
|
+
* ```ts
|
|
1680
|
+
* const thumbnail = new ThumbnailBuilder({
|
|
1681
|
+
* description: 'some text',
|
|
1682
|
+
* media: {
|
|
1683
|
+
* url: 'https://cdn.discordapp.com/embed/avatars/4.png',
|
|
1684
|
+
* },
|
|
1685
|
+
* });
|
|
1686
|
+
* ```
|
|
1687
|
+
* @example
|
|
1688
|
+
* Creating a thumbnail using setters and API data:
|
|
1689
|
+
* ```ts
|
|
1690
|
+
* const thumbnail = new ThumbnailBuilder({
|
|
1691
|
+
* media: {
|
|
1692
|
+
* url: 'attachment://image.png',
|
|
1693
|
+
* },
|
|
1694
|
+
* })
|
|
1695
|
+
* .setDescription('alt text');
|
|
1696
|
+
* ```
|
|
1697
|
+
*/
|
|
1698
|
+
constructor(data = {}) {
|
|
1699
|
+
super();
|
|
1700
|
+
this.data = {
|
|
1701
|
+
...structuredClone(data),
|
|
1702
|
+
media: data.media ? { url: data.media.url } : void 0,
|
|
1703
|
+
type: import_v1017.ComponentType.Thumbnail
|
|
1704
|
+
};
|
|
1705
|
+
}
|
|
1706
|
+
/**
|
|
1707
|
+
* Sets the description of this thumbnail.
|
|
1708
|
+
*
|
|
1709
|
+
* @param description - The description to use
|
|
1710
|
+
*/
|
|
1711
|
+
setDescription(description) {
|
|
1712
|
+
this.data.description = description;
|
|
1713
|
+
return this;
|
|
1714
|
+
}
|
|
1715
|
+
/**
|
|
1716
|
+
* Clears the description of this thumbnail.
|
|
1717
|
+
*/
|
|
1718
|
+
clearDescription() {
|
|
1719
|
+
this.data.description = void 0;
|
|
1720
|
+
return this;
|
|
1721
|
+
}
|
|
1722
|
+
/**
|
|
1723
|
+
* Sets the spoiler status of this thumbnail.
|
|
1724
|
+
*
|
|
1725
|
+
* @param spoiler - The spoiler status to use
|
|
1726
|
+
*/
|
|
1727
|
+
setSpoiler(spoiler = true) {
|
|
1728
|
+
this.data.spoiler = spoiler;
|
|
1729
|
+
return this;
|
|
1730
|
+
}
|
|
1731
|
+
/**
|
|
1732
|
+
* Sets the media URL of this thumbnail.
|
|
1733
|
+
*
|
|
1734
|
+
* @param url - The URL to use
|
|
1735
|
+
*/
|
|
1736
|
+
setURL(url) {
|
|
1737
|
+
this.data.media = { url };
|
|
1738
|
+
return this;
|
|
1739
|
+
}
|
|
1740
|
+
/**
|
|
1741
|
+
* {@inheritdoc ComponentBuilder.toJSON}
|
|
1742
|
+
*/
|
|
1743
|
+
toJSON(validationOverride) {
|
|
1744
|
+
const clone = structuredClone(this.data);
|
|
1745
|
+
validate(thumbnailPredicate, clone, validationOverride);
|
|
1746
|
+
return clone;
|
|
1747
|
+
}
|
|
1748
|
+
};
|
|
1749
|
+
|
|
1750
|
+
// src/components/v2/Section.ts
|
|
1751
|
+
var SectionBuilder = class extends ComponentBuilder {
|
|
1752
|
+
static {
|
|
1753
|
+
__name(this, "SectionBuilder");
|
|
1754
|
+
}
|
|
1755
|
+
data;
|
|
1756
|
+
get components() {
|
|
1757
|
+
return this.data.components;
|
|
1758
|
+
}
|
|
1759
|
+
/**
|
|
1760
|
+
* Creates a new section from API data.
|
|
1761
|
+
*
|
|
1762
|
+
* @param data - The API data to create this section with
|
|
1763
|
+
* @example
|
|
1764
|
+
* Creating a section from an API data object:
|
|
1765
|
+
* ```ts
|
|
1766
|
+
* const section = new SectionBuilder({
|
|
1767
|
+
* components: [
|
|
1768
|
+
* {
|
|
1769
|
+
* content: "Some text here",
|
|
1770
|
+
* type: ComponentType.TextDisplay,
|
|
1771
|
+
* },
|
|
1772
|
+
* ],
|
|
1773
|
+
* accessory: {
|
|
1774
|
+
* media: {
|
|
1775
|
+
* url: 'https://cdn.discordapp.com/embed/avatars/3.png',
|
|
1776
|
+
* },
|
|
1777
|
+
* }
|
|
1778
|
+
* });
|
|
1779
|
+
* ```
|
|
1780
|
+
* @example
|
|
1781
|
+
* Creating a section using setters and API data:
|
|
1782
|
+
* ```ts
|
|
1783
|
+
* const section = new SectionBuilder({
|
|
1784
|
+
* components: [
|
|
1785
|
+
* {
|
|
1786
|
+
* content: "# Heading",
|
|
1787
|
+
* type: ComponentType.TextDisplay,
|
|
1788
|
+
* },
|
|
1789
|
+
* ],
|
|
1790
|
+
* })
|
|
1791
|
+
* .setPrimaryButtonAccessory(button);
|
|
1792
|
+
* ```
|
|
1793
|
+
*/
|
|
1794
|
+
constructor(data = {}) {
|
|
1795
|
+
super();
|
|
1796
|
+
const { components = [], accessory, ...rest } = data;
|
|
1797
|
+
this.data = {
|
|
1798
|
+
...structuredClone(rest),
|
|
1799
|
+
accessory: accessory ? resolveAccessoryComponent(accessory) : void 0,
|
|
1800
|
+
components: components.map((component) => new TextDisplayBuilder(component)),
|
|
1801
|
+
type: import_v1018.ComponentType.Section
|
|
1802
|
+
};
|
|
1803
|
+
}
|
|
1804
|
+
/**
|
|
1805
|
+
* Adds text display components to this section.
|
|
1806
|
+
*
|
|
1807
|
+
* @param input - The text display components to add
|
|
1808
|
+
*/
|
|
1809
|
+
addTextDisplayComponents(...input) {
|
|
1810
|
+
const normalized = normalizeArray(input);
|
|
1811
|
+
const resolved = normalized.map((component) => resolveBuilder(component, TextDisplayBuilder));
|
|
1812
|
+
this.data.components.push(...resolved);
|
|
1813
|
+
return this;
|
|
1814
|
+
}
|
|
1815
|
+
/**
|
|
1816
|
+
* Sets a primary button component to be the accessory of this section.
|
|
1817
|
+
*
|
|
1818
|
+
* @param input - The button to set as the accessory
|
|
1819
|
+
*/
|
|
1820
|
+
setPrimaryButtonAccessory(input) {
|
|
1821
|
+
const builder = resolveBuilder(input, PrimaryButtonBuilder);
|
|
1822
|
+
this.data.accessory = builder;
|
|
1823
|
+
return this;
|
|
1824
|
+
}
|
|
1825
|
+
/**
|
|
1826
|
+
* Sets a secondary button component to be the accessory of this section.
|
|
1827
|
+
*
|
|
1828
|
+
* @param input - The button to set as the accessory
|
|
1829
|
+
*/
|
|
1830
|
+
setSecondaryButtonAccessory(input) {
|
|
1831
|
+
const builder = resolveBuilder(input, SecondaryButtonBuilder);
|
|
1832
|
+
this.data.accessory = builder;
|
|
1833
|
+
return this;
|
|
1834
|
+
}
|
|
1835
|
+
/**
|
|
1836
|
+
* Sets a success button component to be the accessory of this section.
|
|
1837
|
+
*
|
|
1838
|
+
* @param input - The button to set as the accessory
|
|
1839
|
+
*/
|
|
1840
|
+
setSuccessButtonAccessory(input) {
|
|
1841
|
+
const builder = resolveBuilder(input, SuccessButtonBuilder);
|
|
1842
|
+
this.data.accessory = builder;
|
|
1843
|
+
return this;
|
|
1844
|
+
}
|
|
1845
|
+
/**
|
|
1846
|
+
* Sets a danger button component to be the accessory of this section.
|
|
1847
|
+
*
|
|
1848
|
+
* @param input - The button to set as the accessory
|
|
1849
|
+
*/
|
|
1850
|
+
setDangerButtonAccessory(input) {
|
|
1851
|
+
const builder = resolveBuilder(input, DangerButtonBuilder);
|
|
1852
|
+
this.data.accessory = builder;
|
|
1853
|
+
return this;
|
|
1854
|
+
}
|
|
1855
|
+
/**
|
|
1856
|
+
* Sets a SKU id button component to be the accessory of this section.
|
|
1857
|
+
*
|
|
1858
|
+
* @param input - The button to set as the accessory
|
|
1859
|
+
*/
|
|
1860
|
+
setPremiumButtonAccessory(input) {
|
|
1861
|
+
const builder = resolveBuilder(input, PremiumButtonBuilder);
|
|
1862
|
+
this.data.accessory = builder;
|
|
1863
|
+
return this;
|
|
1864
|
+
}
|
|
1865
|
+
/**
|
|
1866
|
+
* Sets a URL button component to be the accessory of this section.
|
|
1867
|
+
*
|
|
1868
|
+
* @param input - The button to set as the accessory
|
|
1869
|
+
*/
|
|
1870
|
+
setLinkButtonAccessory(input) {
|
|
1871
|
+
const builder = resolveBuilder(input, LinkButtonBuilder);
|
|
1872
|
+
this.data.accessory = builder;
|
|
1873
|
+
return this;
|
|
1874
|
+
}
|
|
1875
|
+
/**
|
|
1876
|
+
* Sets a thumbnail component to be the accessory of this section.
|
|
1877
|
+
*
|
|
1878
|
+
* @param input - The thumbnail to set as the accessory
|
|
1879
|
+
*/
|
|
1880
|
+
setThumbnailAccessory(input) {
|
|
1881
|
+
const builder = resolveBuilder(input, ThumbnailBuilder);
|
|
1882
|
+
this.data.accessory = builder;
|
|
1883
|
+
return this;
|
|
1884
|
+
}
|
|
1885
|
+
/**
|
|
1886
|
+
* Removes, replaces, or inserts text display components for this section.
|
|
1887
|
+
*
|
|
1888
|
+
* @param index - The index to start removing, replacing or inserting text display components
|
|
1889
|
+
* @param deleteCount - The amount of text display components to remove
|
|
1890
|
+
* @param components - The text display components to insert
|
|
1891
|
+
*/
|
|
1892
|
+
spliceTextDisplayComponents(index, deleteCount, ...components) {
|
|
1893
|
+
const normalized = normalizeArray(components);
|
|
1894
|
+
const resolved = normalized.map((component) => resolveBuilder(component, TextDisplayBuilder));
|
|
1895
|
+
this.data.components.splice(index, deleteCount, ...resolved);
|
|
1896
|
+
return this;
|
|
1897
|
+
}
|
|
1898
|
+
/**
|
|
1899
|
+
* {@inheritDoc ComponentBuilder.toJSON}
|
|
1900
|
+
*/
|
|
1901
|
+
toJSON(validationOverride) {
|
|
1902
|
+
const { components, accessory, ...rest } = this.data;
|
|
1903
|
+
const data = {
|
|
1904
|
+
...structuredClone(rest),
|
|
1905
|
+
components: components.map((component) => component.toJSON(false)),
|
|
1906
|
+
accessory: accessory?.toJSON(validationOverride)
|
|
1907
|
+
};
|
|
1908
|
+
validate(sectionPredicate, data, validationOverride);
|
|
1909
|
+
return data;
|
|
1910
|
+
}
|
|
1911
|
+
};
|
|
1912
|
+
|
|
1913
|
+
// src/components/v2/Separator.ts
|
|
1914
|
+
var import_v1019 = require("discord-api-types/v10");
|
|
1915
|
+
var SeparatorBuilder = class extends ComponentBuilder {
|
|
1126
1916
|
static {
|
|
1127
|
-
__name(this, "
|
|
1917
|
+
__name(this, "SeparatorBuilder");
|
|
1128
1918
|
}
|
|
1129
1919
|
data;
|
|
1130
1920
|
/**
|
|
1131
|
-
* Creates a new
|
|
1921
|
+
* Creates a new separator from API data.
|
|
1132
1922
|
*
|
|
1133
|
-
* @param data - The API data to create this
|
|
1923
|
+
* @param data - The API data to create this separator with
|
|
1134
1924
|
* @example
|
|
1135
|
-
* Creating a
|
|
1925
|
+
* Creating a separator from an API data object:
|
|
1136
1926
|
* ```ts
|
|
1137
|
-
* const
|
|
1138
|
-
*
|
|
1139
|
-
*
|
|
1140
|
-
* style: TextInputStyle.Short,
|
|
1927
|
+
* const separator = new SeparatorBuilder({
|
|
1928
|
+
* spacing: SeparatorSpacingSize.Small,
|
|
1929
|
+
* divider: true,
|
|
1141
1930
|
* });
|
|
1142
1931
|
* ```
|
|
1143
1932
|
* @example
|
|
1144
|
-
* Creating a
|
|
1933
|
+
* Creating a separator using setters and API data:
|
|
1145
1934
|
* ```ts
|
|
1146
|
-
* const
|
|
1147
|
-
*
|
|
1935
|
+
* const separator = new SeparatorBuilder({
|
|
1936
|
+
* spacing: SeparatorSpacingSize.Large,
|
|
1148
1937
|
* })
|
|
1149
|
-
* .
|
|
1150
|
-
* .setStyle(TextInputStyle.Paragraph);
|
|
1938
|
+
* .setDivider(false);
|
|
1151
1939
|
* ```
|
|
1152
1940
|
*/
|
|
1153
1941
|
constructor(data = {}) {
|
|
1154
1942
|
super();
|
|
1155
|
-
this.data = {
|
|
1943
|
+
this.data = {
|
|
1944
|
+
...structuredClone(data),
|
|
1945
|
+
type: import_v1019.ComponentType.Separator
|
|
1946
|
+
};
|
|
1156
1947
|
}
|
|
1157
1948
|
/**
|
|
1158
|
-
* Sets
|
|
1949
|
+
* Sets whether this separator should show a divider line.
|
|
1159
1950
|
*
|
|
1160
|
-
* @param
|
|
1951
|
+
* @param divider - Whether to show a divider line
|
|
1161
1952
|
*/
|
|
1162
|
-
|
|
1163
|
-
this.data.
|
|
1953
|
+
setDivider(divider = true) {
|
|
1954
|
+
this.data.divider = divider;
|
|
1164
1955
|
return this;
|
|
1165
1956
|
}
|
|
1166
1957
|
/**
|
|
1167
|
-
* Sets the
|
|
1958
|
+
* Sets the spacing of this separator.
|
|
1168
1959
|
*
|
|
1169
|
-
* @param
|
|
1960
|
+
* @param spacing - The spacing to use
|
|
1170
1961
|
*/
|
|
1171
|
-
|
|
1172
|
-
this.data.
|
|
1962
|
+
setSpacing(spacing) {
|
|
1963
|
+
this.data.spacing = spacing;
|
|
1173
1964
|
return this;
|
|
1174
1965
|
}
|
|
1175
1966
|
/**
|
|
1176
|
-
*
|
|
1177
|
-
*
|
|
1178
|
-
* @param style - The style to use
|
|
1967
|
+
* Clears the spacing of this separator.
|
|
1179
1968
|
*/
|
|
1180
|
-
|
|
1181
|
-
this.data.
|
|
1969
|
+
clearSpacing() {
|
|
1970
|
+
this.data.spacing = void 0;
|
|
1182
1971
|
return this;
|
|
1183
1972
|
}
|
|
1184
1973
|
/**
|
|
1185
|
-
*
|
|
1974
|
+
* {@inheritDoc ComponentBuilder.toJSON}
|
|
1975
|
+
*/
|
|
1976
|
+
toJSON(validationOverride) {
|
|
1977
|
+
const clone = structuredClone(this.data);
|
|
1978
|
+
validate(separatorPredicate, clone, validationOverride);
|
|
1979
|
+
return clone;
|
|
1980
|
+
}
|
|
1981
|
+
};
|
|
1982
|
+
|
|
1983
|
+
// src/components/v2/Container.ts
|
|
1984
|
+
var ContainerBuilder = class extends ComponentBuilder {
|
|
1985
|
+
static {
|
|
1986
|
+
__name(this, "ContainerBuilder");
|
|
1987
|
+
}
|
|
1988
|
+
data;
|
|
1989
|
+
constructor({ components = [], ...rest } = {}) {
|
|
1990
|
+
super();
|
|
1991
|
+
this.data = {
|
|
1992
|
+
...structuredClone(rest),
|
|
1993
|
+
components: components.map((component) => createComponentBuilder(component)),
|
|
1994
|
+
type: import_v1020.ComponentType.Container
|
|
1995
|
+
};
|
|
1996
|
+
}
|
|
1997
|
+
/**
|
|
1998
|
+
* Sets the accent color of this container.
|
|
1186
1999
|
*
|
|
1187
|
-
* @param
|
|
2000
|
+
* @param color - The color to use
|
|
1188
2001
|
*/
|
|
1189
|
-
|
|
1190
|
-
this.data.
|
|
2002
|
+
setAccentColor(color) {
|
|
2003
|
+
this.data.accent_color = color;
|
|
1191
2004
|
return this;
|
|
1192
2005
|
}
|
|
1193
2006
|
/**
|
|
1194
|
-
* Clears the
|
|
2007
|
+
* Clears the accent color of this container.
|
|
1195
2008
|
*/
|
|
1196
|
-
|
|
1197
|
-
this.data.
|
|
2009
|
+
clearAccentColor() {
|
|
2010
|
+
this.data.accent_color = void 0;
|
|
1198
2011
|
return this;
|
|
1199
2012
|
}
|
|
1200
2013
|
/**
|
|
1201
|
-
* Sets the
|
|
2014
|
+
* Sets the spoiler status of this container.
|
|
1202
2015
|
*
|
|
1203
|
-
* @param
|
|
2016
|
+
* @param spoiler - The spoiler status to use
|
|
1204
2017
|
*/
|
|
1205
|
-
|
|
1206
|
-
this.data.
|
|
2018
|
+
setSpoiler(spoiler = true) {
|
|
2019
|
+
this.data.spoiler = spoiler;
|
|
1207
2020
|
return this;
|
|
1208
2021
|
}
|
|
1209
2022
|
/**
|
|
1210
|
-
*
|
|
2023
|
+
* Adds action row components to this container.
|
|
2024
|
+
*
|
|
2025
|
+
* @param input - The action row to add
|
|
1211
2026
|
*/
|
|
1212
|
-
|
|
1213
|
-
|
|
2027
|
+
addActionRowComponents(...input) {
|
|
2028
|
+
const normalized = normalizeArray(input);
|
|
2029
|
+
const resolved = normalized.map((component) => resolveBuilder(component, ActionRowBuilder));
|
|
2030
|
+
this.data.components.push(...resolved);
|
|
1214
2031
|
return this;
|
|
1215
2032
|
}
|
|
1216
2033
|
/**
|
|
1217
|
-
*
|
|
2034
|
+
* Adds file components to this container.
|
|
1218
2035
|
*
|
|
1219
|
-
* @param
|
|
2036
|
+
* @param input - The file components to add
|
|
1220
2037
|
*/
|
|
1221
|
-
|
|
1222
|
-
|
|
2038
|
+
addFileComponents(...input) {
|
|
2039
|
+
const normalized = normalizeArray(input);
|
|
2040
|
+
const resolved = normalized.map((component) => resolveBuilder(component, FileBuilder));
|
|
2041
|
+
this.data.components.push(...resolved);
|
|
1223
2042
|
return this;
|
|
1224
2043
|
}
|
|
1225
2044
|
/**
|
|
1226
|
-
*
|
|
2045
|
+
* Adds media gallery components to this container.
|
|
2046
|
+
*
|
|
2047
|
+
* @param input - The media gallery components to add
|
|
1227
2048
|
*/
|
|
1228
|
-
|
|
1229
|
-
|
|
2049
|
+
addMediaGalleryComponents(...input) {
|
|
2050
|
+
const normalized = normalizeArray(input);
|
|
2051
|
+
const resolved = normalized.map((component) => resolveBuilder(component, MediaGalleryBuilder));
|
|
2052
|
+
this.data.components.push(...resolved);
|
|
1230
2053
|
return this;
|
|
1231
2054
|
}
|
|
1232
2055
|
/**
|
|
1233
|
-
*
|
|
2056
|
+
* Adds section components to this container.
|
|
1234
2057
|
*
|
|
1235
|
-
* @param
|
|
2058
|
+
* @param input - The section components to add
|
|
1236
2059
|
*/
|
|
1237
|
-
|
|
1238
|
-
|
|
2060
|
+
addSectionComponents(...input) {
|
|
2061
|
+
const normalized = normalizeArray(input);
|
|
2062
|
+
const resolved = normalized.map((component) => resolveBuilder(component, SectionBuilder));
|
|
2063
|
+
this.data.components.push(...resolved);
|
|
1239
2064
|
return this;
|
|
1240
2065
|
}
|
|
1241
2066
|
/**
|
|
1242
|
-
*
|
|
2067
|
+
* Adds separator components to this container.
|
|
2068
|
+
*
|
|
2069
|
+
* @param input - The separator components to add
|
|
1243
2070
|
*/
|
|
1244
|
-
|
|
1245
|
-
|
|
2071
|
+
addSeparatorComponents(...input) {
|
|
2072
|
+
const normalized = normalizeArray(input);
|
|
2073
|
+
const resolved = normalized.map((component) => resolveBuilder(component, SeparatorBuilder));
|
|
2074
|
+
this.data.components.push(...resolved);
|
|
1246
2075
|
return this;
|
|
1247
2076
|
}
|
|
1248
2077
|
/**
|
|
1249
|
-
*
|
|
2078
|
+
* Adds text display components to this container.
|
|
1250
2079
|
*
|
|
1251
|
-
* @param
|
|
2080
|
+
* @param input - The text display components to add
|
|
1252
2081
|
*/
|
|
1253
|
-
|
|
1254
|
-
|
|
2082
|
+
addTextDisplayComponents(...input) {
|
|
2083
|
+
const normalized = normalizeArray(input);
|
|
2084
|
+
const resolved = normalized.map((component) => resolveBuilder(component, TextDisplayBuilder));
|
|
2085
|
+
this.data.components.push(...resolved);
|
|
2086
|
+
return this;
|
|
2087
|
+
}
|
|
2088
|
+
/**
|
|
2089
|
+
* Removes, replaces, or inserts components for this container
|
|
2090
|
+
*
|
|
2091
|
+
* @remarks
|
|
2092
|
+
* This method behaves similarly
|
|
2093
|
+
* to {@link https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/splice | Array.prototype.splice()}.
|
|
2094
|
+
*
|
|
2095
|
+
* It's useful for modifying and adjusting order of the already-existing components of a container.
|
|
2096
|
+
* @example
|
|
2097
|
+
* Remove the first component:
|
|
2098
|
+
* ```ts
|
|
2099
|
+
* container.spliceComponents(0, 1);
|
|
2100
|
+
* ```
|
|
2101
|
+
* @example
|
|
2102
|
+
* Remove the first n components:
|
|
2103
|
+
* ```ts
|
|
2104
|
+
* const n = 4;
|
|
2105
|
+
* container.spliceComponents(0, n);
|
|
2106
|
+
* ```
|
|
2107
|
+
* @example
|
|
2108
|
+
* Remove the last component:
|
|
2109
|
+
* ```ts
|
|
2110
|
+
* container.spliceComponents(-1, 1);
|
|
2111
|
+
* ```
|
|
2112
|
+
* @param index - The index to start at
|
|
2113
|
+
* @param deleteCount - The number of components to remove
|
|
2114
|
+
* @param components - The replacing component objects
|
|
2115
|
+
*/
|
|
2116
|
+
spliceComponents(index, deleteCount, ...components) {
|
|
2117
|
+
const normalized = normalizeArray(components);
|
|
2118
|
+
const resolved = normalized.map(
|
|
2119
|
+
(component) => component instanceof ComponentBuilder ? component : createComponentBuilder(component)
|
|
2120
|
+
);
|
|
2121
|
+
this.data.components.splice(index, deleteCount, ...resolved);
|
|
1255
2122
|
return this;
|
|
1256
2123
|
}
|
|
1257
2124
|
/**
|
|
1258
2125
|
* {@inheritDoc ComponentBuilder.toJSON}
|
|
1259
2126
|
*/
|
|
1260
2127
|
toJSON(validationOverride) {
|
|
1261
|
-
const
|
|
1262
|
-
|
|
1263
|
-
|
|
2128
|
+
const { components, ...rest } = this.data;
|
|
2129
|
+
const data = {
|
|
2130
|
+
...structuredClone(rest),
|
|
2131
|
+
components: components.map((component) => component.toJSON(false))
|
|
2132
|
+
};
|
|
2133
|
+
validate(containerPredicate, data, validationOverride);
|
|
2134
|
+
return data;
|
|
1264
2135
|
}
|
|
1265
2136
|
};
|
|
1266
2137
|
|
|
1267
|
-
// src/components/ActionRow.ts
|
|
1268
|
-
var import_v1014 = require("discord-api-types/v10");
|
|
1269
|
-
|
|
1270
2138
|
// src/components/Components.ts
|
|
1271
|
-
var import_v1013 = require("discord-api-types/v10");
|
|
1272
2139
|
function createComponentBuilder(data) {
|
|
1273
2140
|
if (data instanceof ComponentBuilder) {
|
|
1274
2141
|
return data;
|
|
1275
2142
|
}
|
|
1276
2143
|
switch (data.type) {
|
|
1277
|
-
case
|
|
2144
|
+
case import_v1021.ComponentType.ActionRow:
|
|
1278
2145
|
return new ActionRowBuilder(data);
|
|
1279
|
-
case
|
|
2146
|
+
case import_v1021.ComponentType.Button:
|
|
1280
2147
|
return createButtonBuilder(data);
|
|
1281
|
-
case
|
|
2148
|
+
case import_v1021.ComponentType.StringSelect:
|
|
1282
2149
|
return new StringSelectMenuBuilder(data);
|
|
1283
|
-
case
|
|
2150
|
+
case import_v1021.ComponentType.TextInput:
|
|
1284
2151
|
return new TextInputBuilder(data);
|
|
1285
|
-
case
|
|
2152
|
+
case import_v1021.ComponentType.UserSelect:
|
|
1286
2153
|
return new UserSelectMenuBuilder(data);
|
|
1287
|
-
case
|
|
2154
|
+
case import_v1021.ComponentType.RoleSelect:
|
|
1288
2155
|
return new RoleSelectMenuBuilder(data);
|
|
1289
|
-
case
|
|
2156
|
+
case import_v1021.ComponentType.MentionableSelect:
|
|
1290
2157
|
return new MentionableSelectMenuBuilder(data);
|
|
1291
|
-
case
|
|
2158
|
+
case import_v1021.ComponentType.ChannelSelect:
|
|
1292
2159
|
return new ChannelSelectMenuBuilder(data);
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
case
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
case
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
throw new Error("Not implemented yet: ComponentType.File case");
|
|
1308
|
-
}
|
|
1309
|
-
case import_v1013.ComponentType.Separator: {
|
|
1310
|
-
throw new Error("Not implemented yet: ComponentType.Separator case");
|
|
1311
|
-
}
|
|
1312
|
-
case import_v1013.ComponentType.Container: {
|
|
1313
|
-
throw new Error("Not implemented yet: ComponentType.Container case");
|
|
1314
|
-
}
|
|
2160
|
+
case import_v1021.ComponentType.Thumbnail:
|
|
2161
|
+
return new ThumbnailBuilder(data);
|
|
2162
|
+
case import_v1021.ComponentType.File:
|
|
2163
|
+
return new FileBuilder(data);
|
|
2164
|
+
case import_v1021.ComponentType.Separator:
|
|
2165
|
+
return new SeparatorBuilder(data);
|
|
2166
|
+
case import_v1021.ComponentType.TextDisplay:
|
|
2167
|
+
return new TextDisplayBuilder(data);
|
|
2168
|
+
case import_v1021.ComponentType.MediaGallery:
|
|
2169
|
+
return new MediaGalleryBuilder(data);
|
|
2170
|
+
case import_v1021.ComponentType.Section:
|
|
2171
|
+
return new SectionBuilder(data);
|
|
2172
|
+
case import_v1021.ComponentType.Container:
|
|
2173
|
+
return new ContainerBuilder(data);
|
|
1315
2174
|
default:
|
|
1316
2175
|
throw new Error(`Cannot properly serialize component type: ${data.type}`);
|
|
1317
2176
|
}
|
|
@@ -1319,23 +2178,34 @@ function createComponentBuilder(data) {
|
|
|
1319
2178
|
__name(createComponentBuilder, "createComponentBuilder");
|
|
1320
2179
|
function createButtonBuilder(data) {
|
|
1321
2180
|
switch (data.style) {
|
|
1322
|
-
case
|
|
2181
|
+
case import_v1021.ButtonStyle.Primary:
|
|
1323
2182
|
return new PrimaryButtonBuilder(data);
|
|
1324
|
-
case
|
|
2183
|
+
case import_v1021.ButtonStyle.Secondary:
|
|
1325
2184
|
return new SecondaryButtonBuilder(data);
|
|
1326
|
-
case
|
|
2185
|
+
case import_v1021.ButtonStyle.Success:
|
|
1327
2186
|
return new SuccessButtonBuilder(data);
|
|
1328
|
-
case
|
|
2187
|
+
case import_v1021.ButtonStyle.Danger:
|
|
1329
2188
|
return new DangerButtonBuilder(data);
|
|
1330
|
-
case
|
|
2189
|
+
case import_v1021.ButtonStyle.Link:
|
|
1331
2190
|
return new LinkButtonBuilder(data);
|
|
1332
|
-
case
|
|
2191
|
+
case import_v1021.ButtonStyle.Premium:
|
|
1333
2192
|
return new PremiumButtonBuilder(data);
|
|
1334
2193
|
default:
|
|
1335
2194
|
throw new Error(`Cannot properly serialize button with style: ${data.style}`);
|
|
1336
2195
|
}
|
|
1337
2196
|
}
|
|
1338
2197
|
__name(createButtonBuilder, "createButtonBuilder");
|
|
2198
|
+
function resolveAccessoryComponent(component) {
|
|
2199
|
+
switch (component.type) {
|
|
2200
|
+
case import_v1021.ComponentType.Button:
|
|
2201
|
+
return createButtonBuilder(component);
|
|
2202
|
+
case import_v1021.ComponentType.Thumbnail:
|
|
2203
|
+
return new ThumbnailBuilder(component);
|
|
2204
|
+
default:
|
|
2205
|
+
throw new Error(`Cannot properly serialize section accessory component: ${component.type}`);
|
|
2206
|
+
}
|
|
2207
|
+
}
|
|
2208
|
+
__name(resolveAccessoryComponent, "resolveAccessoryComponent");
|
|
1339
2209
|
|
|
1340
2210
|
// src/components/ActionRow.ts
|
|
1341
2211
|
var ActionRowBuilder = class extends ComponentBuilder {
|
|
@@ -1387,7 +2257,7 @@ var ActionRowBuilder = class extends ComponentBuilder {
|
|
|
1387
2257
|
super();
|
|
1388
2258
|
this.data = {
|
|
1389
2259
|
...structuredClone(data),
|
|
1390
|
-
type:
|
|
2260
|
+
type: import_v1022.ComponentType.ActionRow,
|
|
1391
2261
|
components: components.map((component) => createComponentBuilder(component))
|
|
1392
2262
|
};
|
|
1393
2263
|
}
|
|
@@ -1603,18 +2473,18 @@ var ApplicationCommandNumericOptionMinMaxValueMixin = class {
|
|
|
1603
2473
|
};
|
|
1604
2474
|
|
|
1605
2475
|
// src/interactions/commands/chatInput/mixins/ApplicationCommandOptionChannelTypesMixin.ts
|
|
1606
|
-
var
|
|
2476
|
+
var import_v1023 = require("discord-api-types/v10");
|
|
1607
2477
|
var ApplicationCommandOptionAllowedChannelTypes = [
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
2478
|
+
import_v1023.ChannelType.GuildText,
|
|
2479
|
+
import_v1023.ChannelType.GuildVoice,
|
|
2480
|
+
import_v1023.ChannelType.GuildCategory,
|
|
2481
|
+
import_v1023.ChannelType.GuildAnnouncement,
|
|
2482
|
+
import_v1023.ChannelType.AnnouncementThread,
|
|
2483
|
+
import_v1023.ChannelType.PublicThread,
|
|
2484
|
+
import_v1023.ChannelType.PrivateThread,
|
|
2485
|
+
import_v1023.ChannelType.GuildStageVoice,
|
|
2486
|
+
import_v1023.ChannelType.GuildForum,
|
|
2487
|
+
import_v1023.ChannelType.GuildMedia
|
|
1618
2488
|
];
|
|
1619
2489
|
var ApplicationCommandOptionChannelTypesMixin = class {
|
|
1620
2490
|
static {
|
|
@@ -1685,7 +2555,7 @@ var ApplicationCommandOptionWithChoicesMixin = class {
|
|
|
1685
2555
|
};
|
|
1686
2556
|
|
|
1687
2557
|
// src/interactions/commands/chatInput/options/attachment.ts
|
|
1688
|
-
var
|
|
2558
|
+
var import_v1025 = require("discord-api-types/v10");
|
|
1689
2559
|
|
|
1690
2560
|
// src/interactions/commands/SharedName.ts
|
|
1691
2561
|
var SharedName = class {
|
|
@@ -1796,36 +2666,36 @@ var SharedNameAndDescription = class extends SharedName {
|
|
|
1796
2666
|
};
|
|
1797
2667
|
|
|
1798
2668
|
// src/interactions/commands/chatInput/Assertions.ts
|
|
1799
|
-
var
|
|
1800
|
-
var
|
|
1801
|
-
var namePredicate =
|
|
1802
|
-
var descriptionPredicate =
|
|
1803
|
-
var sharedNameAndDescriptionPredicate =
|
|
2669
|
+
var import_v1024 = require("discord-api-types/v10");
|
|
2670
|
+
var import_zod5 = require("zod");
|
|
2671
|
+
var namePredicate = import_zod5.z.string().min(1).max(32).regex(/^[\p{Ll}\p{Lm}\p{Lo}\p{N}\p{sc=Devanagari}\p{sc=Thai}_-]+$/u);
|
|
2672
|
+
var descriptionPredicate = import_zod5.z.string().min(1).max(100);
|
|
2673
|
+
var sharedNameAndDescriptionPredicate = import_zod5.z.object({
|
|
1804
2674
|
name: namePredicate,
|
|
1805
2675
|
name_localizations: localeMapPredicate.optional(),
|
|
1806
2676
|
description: descriptionPredicate,
|
|
1807
2677
|
description_localizations: localeMapPredicate.optional()
|
|
1808
2678
|
});
|
|
1809
|
-
var numericMixinNumberOptionPredicate =
|
|
1810
|
-
max_value:
|
|
1811
|
-
min_value:
|
|
2679
|
+
var numericMixinNumberOptionPredicate = import_zod5.z.object({
|
|
2680
|
+
max_value: import_zod5.z.number().safe().optional(),
|
|
2681
|
+
min_value: import_zod5.z.number().safe().optional()
|
|
1812
2682
|
});
|
|
1813
|
-
var numericMixinIntegerOptionPredicate =
|
|
1814
|
-
max_value:
|
|
1815
|
-
min_value:
|
|
2683
|
+
var numericMixinIntegerOptionPredicate = import_zod5.z.object({
|
|
2684
|
+
max_value: import_zod5.z.number().safe().int().optional(),
|
|
2685
|
+
min_value: import_zod5.z.number().safe().int().optional()
|
|
1816
2686
|
});
|
|
1817
|
-
var channelMixinOptionPredicate =
|
|
1818
|
-
channel_types:
|
|
1819
|
-
ApplicationCommandOptionAllowedChannelTypes.map((type) =>
|
|
2687
|
+
var channelMixinOptionPredicate = import_zod5.z.object({
|
|
2688
|
+
channel_types: import_zod5.z.union(
|
|
2689
|
+
ApplicationCommandOptionAllowedChannelTypes.map((type) => import_zod5.z.literal(type))
|
|
1820
2690
|
).array().optional()
|
|
1821
2691
|
});
|
|
1822
|
-
var autocompleteMixinOptionPredicate =
|
|
1823
|
-
autocomplete:
|
|
1824
|
-
choices:
|
|
2692
|
+
var autocompleteMixinOptionPredicate = import_zod5.z.object({
|
|
2693
|
+
autocomplete: import_zod5.z.literal(true),
|
|
2694
|
+
choices: import_zod5.z.union([import_zod5.z.never(), import_zod5.z.never().array(), import_zod5.z.undefined()])
|
|
1825
2695
|
});
|
|
1826
|
-
var choiceValueStringPredicate =
|
|
1827
|
-
var choiceValueNumberPredicate =
|
|
1828
|
-
var choiceBasePredicate =
|
|
2696
|
+
var choiceValueStringPredicate = import_zod5.z.string().min(1).max(100);
|
|
2697
|
+
var choiceValueNumberPredicate = import_zod5.z.number().safe();
|
|
2698
|
+
var choiceBasePredicate = import_zod5.z.object({
|
|
1829
2699
|
name: choiceValueStringPredicate,
|
|
1830
2700
|
name_localizations: localeMapPredicate.optional()
|
|
1831
2701
|
});
|
|
@@ -1835,8 +2705,8 @@ var choiceStringPredicate = choiceBasePredicate.extend({
|
|
|
1835
2705
|
var choiceNumberPredicate = choiceBasePredicate.extend({
|
|
1836
2706
|
value: choiceValueNumberPredicate
|
|
1837
2707
|
});
|
|
1838
|
-
var choiceBaseMixinPredicate =
|
|
1839
|
-
autocomplete:
|
|
2708
|
+
var choiceBaseMixinPredicate = import_zod5.z.object({
|
|
2709
|
+
autocomplete: import_zod5.z.literal(false).optional()
|
|
1840
2710
|
});
|
|
1841
2711
|
var choiceStringMixinPredicate = choiceBaseMixinPredicate.extend({
|
|
1842
2712
|
choices: choiceStringPredicate.array().max(25).optional()
|
|
@@ -1845,28 +2715,28 @@ var choiceNumberMixinPredicate = choiceBaseMixinPredicate.extend({
|
|
|
1845
2715
|
choices: choiceNumberPredicate.array().max(25).optional()
|
|
1846
2716
|
});
|
|
1847
2717
|
var basicOptionTypes = [
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
2718
|
+
import_v1024.ApplicationCommandOptionType.Attachment,
|
|
2719
|
+
import_v1024.ApplicationCommandOptionType.Boolean,
|
|
2720
|
+
import_v1024.ApplicationCommandOptionType.Channel,
|
|
2721
|
+
import_v1024.ApplicationCommandOptionType.Integer,
|
|
2722
|
+
import_v1024.ApplicationCommandOptionType.Mentionable,
|
|
2723
|
+
import_v1024.ApplicationCommandOptionType.Number,
|
|
2724
|
+
import_v1024.ApplicationCommandOptionType.Role,
|
|
2725
|
+
import_v1024.ApplicationCommandOptionType.String,
|
|
2726
|
+
import_v1024.ApplicationCommandOptionType.User
|
|
1857
2727
|
];
|
|
1858
|
-
var basicOptionTypesPredicate =
|
|
1859
|
-
basicOptionTypes.map((type) =>
|
|
2728
|
+
var basicOptionTypesPredicate = import_zod5.z.union(
|
|
2729
|
+
basicOptionTypes.map((type) => import_zod5.z.literal(type))
|
|
1860
2730
|
);
|
|
1861
2731
|
var basicOptionPredicate = sharedNameAndDescriptionPredicate.extend({
|
|
1862
|
-
required:
|
|
2732
|
+
required: import_zod5.z.boolean().optional(),
|
|
1863
2733
|
type: basicOptionTypesPredicate
|
|
1864
2734
|
});
|
|
1865
|
-
var autocompleteOrStringChoicesMixinOptionPredicate =
|
|
2735
|
+
var autocompleteOrStringChoicesMixinOptionPredicate = import_zod5.z.discriminatedUnion("autocomplete", [
|
|
1866
2736
|
autocompleteMixinOptionPredicate,
|
|
1867
2737
|
choiceStringMixinPredicate
|
|
1868
2738
|
]);
|
|
1869
|
-
var autocompleteOrNumberChoicesMixinOptionPredicate =
|
|
2739
|
+
var autocompleteOrNumberChoicesMixinOptionPredicate = import_zod5.z.discriminatedUnion("autocomplete", [
|
|
1870
2740
|
autocompleteMixinOptionPredicate,
|
|
1871
2741
|
choiceNumberMixinPredicate
|
|
1872
2742
|
]);
|
|
@@ -1874,30 +2744,30 @@ var channelOptionPredicate = basicOptionPredicate.merge(channelMixinOptionPredic
|
|
|
1874
2744
|
var integerOptionPredicate = basicOptionPredicate.merge(numericMixinIntegerOptionPredicate).and(autocompleteOrNumberChoicesMixinOptionPredicate);
|
|
1875
2745
|
var numberOptionPredicate = basicOptionPredicate.merge(numericMixinNumberOptionPredicate).and(autocompleteOrNumberChoicesMixinOptionPredicate);
|
|
1876
2746
|
var stringOptionPredicate = basicOptionPredicate.extend({
|
|
1877
|
-
max_length:
|
|
1878
|
-
min_length:
|
|
2747
|
+
max_length: import_zod5.z.number().min(0).max(6e3).optional(),
|
|
2748
|
+
min_length: import_zod5.z.number().min(1).max(6e3).optional()
|
|
1879
2749
|
}).and(autocompleteOrStringChoicesMixinOptionPredicate);
|
|
1880
2750
|
var baseChatInputCommandPredicate = sharedNameAndDescriptionPredicate.extend({
|
|
1881
|
-
contexts:
|
|
2751
|
+
contexts: import_zod5.z.array(import_zod5.z.nativeEnum(import_v1024.InteractionContextType)).optional(),
|
|
1882
2752
|
default_member_permissions: memberPermissionsPredicate.optional(),
|
|
1883
|
-
integration_types:
|
|
1884
|
-
nsfw:
|
|
2753
|
+
integration_types: import_zod5.z.array(import_zod5.z.nativeEnum(import_v1024.ApplicationIntegrationType)).optional(),
|
|
2754
|
+
nsfw: import_zod5.z.boolean().optional()
|
|
1885
2755
|
});
|
|
1886
|
-
var chatInputCommandOptionsPredicate =
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
2756
|
+
var chatInputCommandOptionsPredicate = import_zod5.z.union([
|
|
2757
|
+
import_zod5.z.object({ type: basicOptionTypesPredicate }).array(),
|
|
2758
|
+
import_zod5.z.object({ type: import_zod5.z.literal(import_v1024.ApplicationCommandOptionType.Subcommand) }).array(),
|
|
2759
|
+
import_zod5.z.object({ type: import_zod5.z.literal(import_v1024.ApplicationCommandOptionType.SubcommandGroup) }).array()
|
|
1890
2760
|
]);
|
|
1891
2761
|
var chatInputCommandPredicate = baseChatInputCommandPredicate.extend({
|
|
1892
2762
|
options: chatInputCommandOptionsPredicate.optional()
|
|
1893
2763
|
});
|
|
1894
2764
|
var chatInputCommandSubcommandGroupPredicate = sharedNameAndDescriptionPredicate.extend({
|
|
1895
|
-
type:
|
|
1896
|
-
options:
|
|
2765
|
+
type: import_zod5.z.literal(import_v1024.ApplicationCommandOptionType.SubcommandGroup),
|
|
2766
|
+
options: import_zod5.z.array(import_zod5.z.object({ type: import_zod5.z.literal(import_v1024.ApplicationCommandOptionType.Subcommand) })).min(1).max(25)
|
|
1897
2767
|
});
|
|
1898
2768
|
var chatInputCommandSubcommandPredicate = sharedNameAndDescriptionPredicate.extend({
|
|
1899
|
-
type:
|
|
1900
|
-
options:
|
|
2769
|
+
type: import_zod5.z.literal(import_v1024.ApplicationCommandOptionType.Subcommand),
|
|
2770
|
+
options: import_zod5.z.array(import_zod5.z.object({ type: basicOptionTypesPredicate })).max(25)
|
|
1901
2771
|
});
|
|
1902
2772
|
|
|
1903
2773
|
// src/interactions/commands/chatInput/options/ApplicationCommandOptionBase.ts
|
|
@@ -1939,23 +2809,23 @@ var ChatInputCommandAttachmentOption = class extends ApplicationCommandOptionBas
|
|
|
1939
2809
|
__name(this, "ChatInputCommandAttachmentOption");
|
|
1940
2810
|
}
|
|
1941
2811
|
constructor() {
|
|
1942
|
-
super(
|
|
2812
|
+
super(import_v1025.ApplicationCommandOptionType.Attachment);
|
|
1943
2813
|
}
|
|
1944
2814
|
};
|
|
1945
2815
|
|
|
1946
2816
|
// src/interactions/commands/chatInput/options/boolean.ts
|
|
1947
|
-
var
|
|
2817
|
+
var import_v1026 = require("discord-api-types/v10");
|
|
1948
2818
|
var ChatInputCommandBooleanOption = class extends ApplicationCommandOptionBase {
|
|
1949
2819
|
static {
|
|
1950
2820
|
__name(this, "ChatInputCommandBooleanOption");
|
|
1951
2821
|
}
|
|
1952
2822
|
constructor() {
|
|
1953
|
-
super(
|
|
2823
|
+
super(import_v1026.ApplicationCommandOptionType.Boolean);
|
|
1954
2824
|
}
|
|
1955
2825
|
};
|
|
1956
2826
|
|
|
1957
2827
|
// src/interactions/commands/chatInput/options/channel.ts
|
|
1958
|
-
var
|
|
2828
|
+
var import_v1027 = require("discord-api-types/v10");
|
|
1959
2829
|
var import_ts_mixer3 = require("ts-mixer");
|
|
1960
2830
|
var ChatInputCommandChannelOption = class extends (0, import_ts_mixer3.Mixin)(
|
|
1961
2831
|
ApplicationCommandOptionBase,
|
|
@@ -1966,12 +2836,12 @@ var ChatInputCommandChannelOption = class extends (0, import_ts_mixer3.Mixin)(
|
|
|
1966
2836
|
}
|
|
1967
2837
|
static predicate = channelOptionPredicate;
|
|
1968
2838
|
constructor() {
|
|
1969
|
-
super(
|
|
2839
|
+
super(import_v1027.ApplicationCommandOptionType.Channel);
|
|
1970
2840
|
}
|
|
1971
2841
|
};
|
|
1972
2842
|
|
|
1973
2843
|
// src/interactions/commands/chatInput/options/integer.ts
|
|
1974
|
-
var
|
|
2844
|
+
var import_v1028 = require("discord-api-types/v10");
|
|
1975
2845
|
var import_ts_mixer4 = require("ts-mixer");
|
|
1976
2846
|
var ChatInputCommandIntegerOption = class extends (0, import_ts_mixer4.Mixin)(
|
|
1977
2847
|
ApplicationCommandOptionBase,
|
|
@@ -1984,23 +2854,23 @@ var ChatInputCommandIntegerOption = class extends (0, import_ts_mixer4.Mixin)(
|
|
|
1984
2854
|
}
|
|
1985
2855
|
static predicate = integerOptionPredicate;
|
|
1986
2856
|
constructor() {
|
|
1987
|
-
super(
|
|
2857
|
+
super(import_v1028.ApplicationCommandOptionType.Integer);
|
|
1988
2858
|
}
|
|
1989
2859
|
};
|
|
1990
2860
|
|
|
1991
2861
|
// src/interactions/commands/chatInput/options/mentionable.ts
|
|
1992
|
-
var
|
|
2862
|
+
var import_v1029 = require("discord-api-types/v10");
|
|
1993
2863
|
var ChatInputCommandMentionableOption = class extends ApplicationCommandOptionBase {
|
|
1994
2864
|
static {
|
|
1995
2865
|
__name(this, "ChatInputCommandMentionableOption");
|
|
1996
2866
|
}
|
|
1997
2867
|
constructor() {
|
|
1998
|
-
super(
|
|
2868
|
+
super(import_v1029.ApplicationCommandOptionType.Mentionable);
|
|
1999
2869
|
}
|
|
2000
2870
|
};
|
|
2001
2871
|
|
|
2002
2872
|
// src/interactions/commands/chatInput/options/number.ts
|
|
2003
|
-
var
|
|
2873
|
+
var import_v1030 = require("discord-api-types/v10");
|
|
2004
2874
|
var import_ts_mixer5 = require("ts-mixer");
|
|
2005
2875
|
var ChatInputCommandNumberOption = class extends (0, import_ts_mixer5.Mixin)(
|
|
2006
2876
|
ApplicationCommandOptionBase,
|
|
@@ -2013,23 +2883,23 @@ var ChatInputCommandNumberOption = class extends (0, import_ts_mixer5.Mixin)(
|
|
|
2013
2883
|
}
|
|
2014
2884
|
static predicate = numberOptionPredicate;
|
|
2015
2885
|
constructor() {
|
|
2016
|
-
super(
|
|
2886
|
+
super(import_v1030.ApplicationCommandOptionType.Number);
|
|
2017
2887
|
}
|
|
2018
2888
|
};
|
|
2019
2889
|
|
|
2020
2890
|
// src/interactions/commands/chatInput/options/role.ts
|
|
2021
|
-
var
|
|
2891
|
+
var import_v1031 = require("discord-api-types/v10");
|
|
2022
2892
|
var ChatInputCommandRoleOption = class extends ApplicationCommandOptionBase {
|
|
2023
2893
|
static {
|
|
2024
2894
|
__name(this, "ChatInputCommandRoleOption");
|
|
2025
2895
|
}
|
|
2026
2896
|
constructor() {
|
|
2027
|
-
super(
|
|
2897
|
+
super(import_v1031.ApplicationCommandOptionType.Role);
|
|
2028
2898
|
}
|
|
2029
2899
|
};
|
|
2030
2900
|
|
|
2031
2901
|
// src/interactions/commands/chatInput/options/string.ts
|
|
2032
|
-
var
|
|
2902
|
+
var import_v1032 = require("discord-api-types/v10");
|
|
2033
2903
|
var import_ts_mixer6 = require("ts-mixer");
|
|
2034
2904
|
var ChatInputCommandStringOption = class extends (0, import_ts_mixer6.Mixin)(
|
|
2035
2905
|
ApplicationCommandOptionBase,
|
|
@@ -2041,7 +2911,7 @@ var ChatInputCommandStringOption = class extends (0, import_ts_mixer6.Mixin)(
|
|
|
2041
2911
|
}
|
|
2042
2912
|
static predicate = stringOptionPredicate;
|
|
2043
2913
|
constructor() {
|
|
2044
|
-
super(
|
|
2914
|
+
super(import_v1032.ApplicationCommandOptionType.String);
|
|
2045
2915
|
}
|
|
2046
2916
|
/**
|
|
2047
2917
|
* Sets the maximum length of this string option.
|
|
@@ -2078,13 +2948,13 @@ var ChatInputCommandStringOption = class extends (0, import_ts_mixer6.Mixin)(
|
|
|
2078
2948
|
};
|
|
2079
2949
|
|
|
2080
2950
|
// src/interactions/commands/chatInput/options/user.ts
|
|
2081
|
-
var
|
|
2951
|
+
var import_v1033 = require("discord-api-types/v10");
|
|
2082
2952
|
var ChatInputCommandUserOption = class extends ApplicationCommandOptionBase {
|
|
2083
2953
|
static {
|
|
2084
2954
|
__name(this, "ChatInputCommandUserOption");
|
|
2085
2955
|
}
|
|
2086
2956
|
constructor() {
|
|
2087
|
-
super(
|
|
2957
|
+
super(import_v1033.ApplicationCommandOptionType.User);
|
|
2088
2958
|
}
|
|
2089
2959
|
};
|
|
2090
2960
|
|
|
@@ -2216,7 +3086,7 @@ var SharedChatInputCommandOptions = class {
|
|
|
2216
3086
|
};
|
|
2217
3087
|
|
|
2218
3088
|
// src/interactions/commands/chatInput/ChatInputCommandSubcommands.ts
|
|
2219
|
-
var
|
|
3089
|
+
var import_v1034 = require("discord-api-types/v10");
|
|
2220
3090
|
var import_ts_mixer7 = require("ts-mixer");
|
|
2221
3091
|
var ChatInputCommandSubcommandGroupBuilder = class extends SharedNameAndDescription {
|
|
2222
3092
|
static {
|
|
@@ -2248,7 +3118,7 @@ var ChatInputCommandSubcommandGroupBuilder = class extends SharedNameAndDescript
|
|
|
2248
3118
|
const { options, ...rest } = this.data;
|
|
2249
3119
|
const data = {
|
|
2250
3120
|
...structuredClone(rest),
|
|
2251
|
-
type:
|
|
3121
|
+
type: import_v1034.ApplicationCommandOptionType.SubcommandGroup,
|
|
2252
3122
|
options: options?.map((option) => option.toJSON(validationOverride)) ?? []
|
|
2253
3123
|
};
|
|
2254
3124
|
validate(chatInputCommandSubcommandGroupPredicate, data, validationOverride);
|
|
@@ -2270,7 +3140,7 @@ var ChatInputCommandSubcommandBuilder = class extends (0, import_ts_mixer7.Mixin
|
|
|
2270
3140
|
const { options, ...rest } = this.data;
|
|
2271
3141
|
const data = {
|
|
2272
3142
|
...structuredClone(rest),
|
|
2273
|
-
type:
|
|
3143
|
+
type: import_v1034.ApplicationCommandOptionType.Subcommand,
|
|
2274
3144
|
options: options?.map((option) => option.toJSON(validationOverride)) ?? []
|
|
2275
3145
|
};
|
|
2276
3146
|
validate(chatInputCommandSubcommandPredicate, data, validationOverride);
|
|
@@ -2310,7 +3180,7 @@ var SharedChatInputCommandSubcommands = class {
|
|
|
2310
3180
|
};
|
|
2311
3181
|
|
|
2312
3182
|
// src/interactions/commands/chatInput/ChatInputCommand.ts
|
|
2313
|
-
var
|
|
3183
|
+
var import_v1035 = require("discord-api-types/v10");
|
|
2314
3184
|
var import_ts_mixer8 = require("ts-mixer");
|
|
2315
3185
|
|
|
2316
3186
|
// src/interactions/commands/Command.ts
|
|
@@ -2383,7 +3253,7 @@ var ChatInputCommandBuilder = class extends (0, import_ts_mixer8.Mixin)(
|
|
|
2383
3253
|
const { options, ...rest } = this.data;
|
|
2384
3254
|
const data = {
|
|
2385
3255
|
...structuredClone(rest),
|
|
2386
|
-
type:
|
|
3256
|
+
type: import_v1035.ApplicationCommandType.ChatInput,
|
|
2387
3257
|
options: options?.map((option) => option.toJSON(validationOverride))
|
|
2388
3258
|
};
|
|
2389
3259
|
validate(chatInputCommandPredicate, data, validationOverride);
|
|
@@ -2392,24 +3262,24 @@ var ChatInputCommandBuilder = class extends (0, import_ts_mixer8.Mixin)(
|
|
|
2392
3262
|
};
|
|
2393
3263
|
|
|
2394
3264
|
// src/interactions/commands/contextMenu/Assertions.ts
|
|
2395
|
-
var
|
|
2396
|
-
var
|
|
2397
|
-
var namePredicate2 =
|
|
2398
|
-
var contextsPredicate =
|
|
2399
|
-
var integrationTypesPredicate =
|
|
2400
|
-
var baseContextMenuCommandPredicate =
|
|
3265
|
+
var import_v1036 = require("discord-api-types/v10");
|
|
3266
|
+
var import_zod6 = require("zod");
|
|
3267
|
+
var namePredicate2 = import_zod6.z.string().min(1).max(32).regex(/^(?:(?: *[\p{P}\p{L}\p{N}\p{sc=Devanagari}\p{sc=Thai}\p{Extended_Pictographic}\p{Emoji_Component}]) *)+$/u);
|
|
3268
|
+
var contextsPredicate = import_zod6.z.array(import_zod6.z.nativeEnum(import_v1036.InteractionContextType));
|
|
3269
|
+
var integrationTypesPredicate = import_zod6.z.array(import_zod6.z.nativeEnum(import_v1036.ApplicationIntegrationType));
|
|
3270
|
+
var baseContextMenuCommandPredicate = import_zod6.z.object({
|
|
2401
3271
|
contexts: contextsPredicate.optional(),
|
|
2402
3272
|
default_member_permissions: memberPermissionsPredicate.optional(),
|
|
2403
3273
|
name: namePredicate2,
|
|
2404
3274
|
name_localizations: localeMapPredicate.optional(),
|
|
2405
3275
|
integration_types: integrationTypesPredicate.optional(),
|
|
2406
|
-
nsfw:
|
|
3276
|
+
nsfw: import_zod6.z.boolean().optional()
|
|
2407
3277
|
});
|
|
2408
3278
|
var userCommandPredicate = baseContextMenuCommandPredicate.extend({
|
|
2409
|
-
type:
|
|
3279
|
+
type: import_zod6.z.literal(import_v1036.ApplicationCommandType.User)
|
|
2410
3280
|
});
|
|
2411
3281
|
var messageCommandPredicate = baseContextMenuCommandPredicate.extend({
|
|
2412
|
-
type:
|
|
3282
|
+
type: import_zod6.z.literal(import_v1036.ApplicationCommandType.Message)
|
|
2413
3283
|
});
|
|
2414
3284
|
|
|
2415
3285
|
// src/interactions/commands/contextMenu/ContextMenuCommand.ts
|
|
@@ -2429,7 +3299,7 @@ var ContextMenuCommandBuilder = class extends (0, import_ts_mixer9.Mixin)(
|
|
|
2429
3299
|
};
|
|
2430
3300
|
|
|
2431
3301
|
// src/interactions/commands/contextMenu/MessageCommand.ts
|
|
2432
|
-
var
|
|
3302
|
+
var import_v1037 = require("discord-api-types/v10");
|
|
2433
3303
|
var MessageContextCommandBuilder = class extends ContextMenuCommandBuilder {
|
|
2434
3304
|
static {
|
|
2435
3305
|
__name(this, "MessageContextCommandBuilder");
|
|
@@ -2438,14 +3308,14 @@ var MessageContextCommandBuilder = class extends ContextMenuCommandBuilder {
|
|
|
2438
3308
|
* {@inheritDoc CommandBuilder.toJSON}
|
|
2439
3309
|
*/
|
|
2440
3310
|
toJSON(validationOverride) {
|
|
2441
|
-
const data = { ...structuredClone(this.data), type:
|
|
3311
|
+
const data = { ...structuredClone(this.data), type: import_v1037.ApplicationCommandType.Message };
|
|
2442
3312
|
validate(messageCommandPredicate, data, validationOverride);
|
|
2443
3313
|
return data;
|
|
2444
3314
|
}
|
|
2445
3315
|
};
|
|
2446
3316
|
|
|
2447
3317
|
// src/interactions/commands/contextMenu/UserCommand.ts
|
|
2448
|
-
var
|
|
3318
|
+
var import_v1038 = require("discord-api-types/v10");
|
|
2449
3319
|
var UserContextCommandBuilder = class extends ContextMenuCommandBuilder {
|
|
2450
3320
|
static {
|
|
2451
3321
|
__name(this, "UserContextCommandBuilder");
|
|
@@ -2454,22 +3324,22 @@ var UserContextCommandBuilder = class extends ContextMenuCommandBuilder {
|
|
|
2454
3324
|
* {@inheritDoc CommandBuilder.toJSON}
|
|
2455
3325
|
*/
|
|
2456
3326
|
toJSON(validationOverride) {
|
|
2457
|
-
const data = { ...structuredClone(this.data), type:
|
|
3327
|
+
const data = { ...structuredClone(this.data), type: import_v1038.ApplicationCommandType.User };
|
|
2458
3328
|
validate(userCommandPredicate, data, validationOverride);
|
|
2459
3329
|
return data;
|
|
2460
3330
|
}
|
|
2461
3331
|
};
|
|
2462
3332
|
|
|
2463
3333
|
// src/interactions/modals/Assertions.ts
|
|
2464
|
-
var
|
|
2465
|
-
var
|
|
2466
|
-
var titlePredicate =
|
|
2467
|
-
var modalPredicate =
|
|
3334
|
+
var import_v1039 = require("discord-api-types/v10");
|
|
3335
|
+
var import_zod7 = require("zod");
|
|
3336
|
+
var titlePredicate = import_zod7.z.string().min(1).max(45);
|
|
3337
|
+
var modalPredicate = import_zod7.z.object({
|
|
2468
3338
|
title: titlePredicate,
|
|
2469
3339
|
custom_id: customIdPredicate,
|
|
2470
|
-
components:
|
|
2471
|
-
type:
|
|
2472
|
-
components:
|
|
3340
|
+
components: import_zod7.z.object({
|
|
3341
|
+
type: import_zod7.z.literal(import_v1039.ComponentType.ActionRow),
|
|
3342
|
+
components: import_zod7.z.object({ type: import_zod7.z.literal(import_v1039.ComponentType.TextInput) }).array().length(1)
|
|
2473
3343
|
}).array().min(1).max(5)
|
|
2474
3344
|
});
|
|
2475
3345
|
|
|
@@ -2591,7 +3461,7 @@ var ModalBuilder = class {
|
|
|
2591
3461
|
};
|
|
2592
3462
|
|
|
2593
3463
|
// src/messages/embed/Assertions.ts
|
|
2594
|
-
var
|
|
3464
|
+
var import_zod8 = require("zod");
|
|
2595
3465
|
|
|
2596
3466
|
// src/util/componentUtil.ts
|
|
2597
3467
|
function embedLength(data) {
|
|
@@ -2600,36 +3470,36 @@ function embedLength(data) {
|
|
|
2600
3470
|
__name(embedLength, "embedLength");
|
|
2601
3471
|
|
|
2602
3472
|
// src/messages/embed/Assertions.ts
|
|
2603
|
-
var namePredicate3 =
|
|
2604
|
-
var URLPredicate =
|
|
2605
|
-
var URLWithAttachmentProtocolPredicate =
|
|
3473
|
+
var namePredicate3 = import_zod8.z.string().max(256);
|
|
3474
|
+
var URLPredicate = import_zod8.z.string().url().refine(refineURLPredicate(["http:", "https:"]), { message: "Invalid protocol for URL. Must be http: or https:" });
|
|
3475
|
+
var URLWithAttachmentProtocolPredicate = import_zod8.z.string().url().refine(refineURLPredicate(["http:", "https:", "attachment:"]), {
|
|
2606
3476
|
message: "Invalid protocol for URL. Must be http:, https:, or attachment:"
|
|
2607
3477
|
});
|
|
2608
|
-
var embedFieldPredicate =
|
|
3478
|
+
var embedFieldPredicate = import_zod8.z.object({
|
|
2609
3479
|
name: namePredicate3,
|
|
2610
|
-
value:
|
|
2611
|
-
inline:
|
|
3480
|
+
value: import_zod8.z.string().max(1024),
|
|
3481
|
+
inline: import_zod8.z.boolean().optional()
|
|
2612
3482
|
});
|
|
2613
|
-
var embedAuthorPredicate =
|
|
3483
|
+
var embedAuthorPredicate = import_zod8.z.object({
|
|
2614
3484
|
name: namePredicate3.min(1),
|
|
2615
3485
|
icon_url: URLWithAttachmentProtocolPredicate.optional(),
|
|
2616
3486
|
url: URLPredicate.optional()
|
|
2617
3487
|
});
|
|
2618
|
-
var embedFooterPredicate =
|
|
2619
|
-
text:
|
|
3488
|
+
var embedFooterPredicate = import_zod8.z.object({
|
|
3489
|
+
text: import_zod8.z.string().min(1).max(2048),
|
|
2620
3490
|
icon_url: URLWithAttachmentProtocolPredicate.optional()
|
|
2621
3491
|
});
|
|
2622
|
-
var embedPredicate =
|
|
3492
|
+
var embedPredicate = import_zod8.z.object({
|
|
2623
3493
|
title: namePredicate3.min(1).optional(),
|
|
2624
|
-
description:
|
|
3494
|
+
description: import_zod8.z.string().min(1).max(4096).optional(),
|
|
2625
3495
|
url: URLPredicate.optional(),
|
|
2626
|
-
timestamp:
|
|
2627
|
-
color:
|
|
3496
|
+
timestamp: import_zod8.z.string().optional(),
|
|
3497
|
+
color: import_zod8.z.number().int().min(0).max(16777215).optional(),
|
|
2628
3498
|
footer: embedFooterPredicate.optional(),
|
|
2629
|
-
image:
|
|
2630
|
-
thumbnail:
|
|
3499
|
+
image: import_zod8.z.object({ url: URLWithAttachmentProtocolPredicate }).optional(),
|
|
3500
|
+
thumbnail: import_zod8.z.object({ url: URLWithAttachmentProtocolPredicate }).optional(),
|
|
2631
3501
|
author: embedAuthorPredicate.optional(),
|
|
2632
|
-
fields:
|
|
3502
|
+
fields: import_zod8.z.array(embedFieldPredicate).max(25).optional()
|
|
2633
3503
|
}).refine(
|
|
2634
3504
|
(embed) => embed.title !== void 0 || embed.description !== void 0 || embed.fields !== void 0 && embed.fields.length > 0 || embed.footer !== void 0 || embed.author !== void 0 || embed.image !== void 0 || embed.thumbnail !== void 0,
|
|
2635
3505
|
{
|
|
@@ -3104,20 +3974,20 @@ var EmbedBuilder = class {
|
|
|
3104
3974
|
};
|
|
3105
3975
|
|
|
3106
3976
|
// src/messages/poll/Assertions.ts
|
|
3107
|
-
var
|
|
3108
|
-
var
|
|
3109
|
-
var pollQuestionPredicate =
|
|
3110
|
-
var pollAnswerMediaPredicate =
|
|
3111
|
-
text:
|
|
3977
|
+
var import_v1040 = require("discord-api-types/v10");
|
|
3978
|
+
var import_zod9 = require("zod");
|
|
3979
|
+
var pollQuestionPredicate = import_zod9.z.object({ text: import_zod9.z.string().min(1).max(300) });
|
|
3980
|
+
var pollAnswerMediaPredicate = import_zod9.z.object({
|
|
3981
|
+
text: import_zod9.z.string().min(1).max(55),
|
|
3112
3982
|
emoji: emojiPredicate.optional()
|
|
3113
3983
|
});
|
|
3114
|
-
var pollAnswerPredicate =
|
|
3115
|
-
var pollPredicate =
|
|
3984
|
+
var pollAnswerPredicate = import_zod9.z.object({ poll_media: pollAnswerMediaPredicate });
|
|
3985
|
+
var pollPredicate = import_zod9.z.object({
|
|
3116
3986
|
question: pollQuestionPredicate,
|
|
3117
|
-
answers:
|
|
3118
|
-
duration:
|
|
3119
|
-
allow_multiselect:
|
|
3120
|
-
layout_type:
|
|
3987
|
+
answers: import_zod9.z.array(pollAnswerPredicate).min(1).max(10),
|
|
3988
|
+
duration: import_zod9.z.number().min(1).max(768).optional(),
|
|
3989
|
+
allow_multiselect: import_zod9.z.boolean().optional(),
|
|
3990
|
+
layout_type: import_zod9.z.nativeEnum(import_v1040.PollLayoutType).optional()
|
|
3121
3991
|
});
|
|
3122
3992
|
|
|
3123
3993
|
// src/messages/poll/PollMedia.ts
|
|
@@ -3442,60 +4312,91 @@ var PollBuilder = class {
|
|
|
3442
4312
|
};
|
|
3443
4313
|
|
|
3444
4314
|
// src/messages/Assertions.ts
|
|
3445
|
-
var
|
|
3446
|
-
var
|
|
3447
|
-
var attachmentPredicate =
|
|
3448
|
-
id:
|
|
3449
|
-
description:
|
|
3450
|
-
duration_secs:
|
|
3451
|
-
filename:
|
|
3452
|
-
title:
|
|
3453
|
-
waveform:
|
|
4315
|
+
var import_v1041 = require("discord-api-types/v10");
|
|
4316
|
+
var import_zod10 = require("zod");
|
|
4317
|
+
var attachmentPredicate = import_zod10.z.object({
|
|
4318
|
+
id: import_zod10.z.union([import_zod10.z.string(), import_zod10.z.number()]),
|
|
4319
|
+
description: import_zod10.z.string().optional(),
|
|
4320
|
+
duration_secs: import_zod10.z.number().optional(),
|
|
4321
|
+
filename: import_zod10.z.string().optional(),
|
|
4322
|
+
title: import_zod10.z.string().optional(),
|
|
4323
|
+
waveform: import_zod10.z.string().optional()
|
|
3454
4324
|
});
|
|
3455
|
-
var allowedMentionPredicate =
|
|
3456
|
-
parse:
|
|
3457
|
-
roles:
|
|
3458
|
-
users:
|
|
3459
|
-
replied_user:
|
|
4325
|
+
var allowedMentionPredicate = import_zod10.z.object({
|
|
4326
|
+
parse: import_zod10.z.nativeEnum(import_v1041.AllowedMentionsTypes).array().optional(),
|
|
4327
|
+
roles: import_zod10.z.string().array().optional(),
|
|
4328
|
+
users: import_zod10.z.string().array().optional(),
|
|
4329
|
+
replied_user: import_zod10.z.boolean().optional()
|
|
3460
4330
|
});
|
|
3461
|
-
var messageReferencePredicate =
|
|
3462
|
-
channel_id:
|
|
3463
|
-
fail_if_not_exists:
|
|
3464
|
-
guild_id:
|
|
3465
|
-
message_id:
|
|
3466
|
-
type:
|
|
4331
|
+
var messageReferencePredicate = import_zod10.z.object({
|
|
4332
|
+
channel_id: import_zod10.z.string().optional(),
|
|
4333
|
+
fail_if_not_exists: import_zod10.z.boolean().optional(),
|
|
4334
|
+
guild_id: import_zod10.z.string().optional(),
|
|
4335
|
+
message_id: import_zod10.z.string(),
|
|
4336
|
+
type: import_zod10.z.nativeEnum(import_v1041.MessageReferenceType).optional()
|
|
3467
4337
|
});
|
|
3468
|
-
var
|
|
3469
|
-
|
|
3470
|
-
|
|
3471
|
-
tts: import_zod9.z.boolean().optional(),
|
|
3472
|
-
embeds: embedPredicate.array().max(10).optional(),
|
|
4338
|
+
var baseMessagePredicate = import_zod10.z.object({
|
|
4339
|
+
nonce: import_zod10.z.union([import_zod10.z.string().max(25), import_zod10.z.number()]).optional(),
|
|
4340
|
+
tts: import_zod10.z.boolean().optional(),
|
|
3473
4341
|
allowed_mentions: allowedMentionPredicate.optional(),
|
|
3474
4342
|
message_reference: messageReferencePredicate.optional(),
|
|
3475
|
-
// Partial validation here to ensure the components are valid,
|
|
3476
|
-
// rest of the validation is done in the action row predicate
|
|
3477
|
-
components: import_zod9.z.object({
|
|
3478
|
-
type: import_zod9.z.literal(import_v1033.ComponentType.ActionRow),
|
|
3479
|
-
components: import_zod9.z.object({
|
|
3480
|
-
type: import_zod9.z.union([
|
|
3481
|
-
import_zod9.z.literal(import_v1033.ComponentType.Button),
|
|
3482
|
-
import_zod9.z.literal(import_v1033.ComponentType.ChannelSelect),
|
|
3483
|
-
import_zod9.z.literal(import_v1033.ComponentType.MentionableSelect),
|
|
3484
|
-
import_zod9.z.literal(import_v1033.ComponentType.RoleSelect),
|
|
3485
|
-
import_zod9.z.literal(import_v1033.ComponentType.StringSelect),
|
|
3486
|
-
import_zod9.z.literal(import_v1033.ComponentType.UserSelect)
|
|
3487
|
-
])
|
|
3488
|
-
}).array()
|
|
3489
|
-
}).array().max(5).optional(),
|
|
3490
|
-
sticker_ids: import_zod9.z.array(import_zod9.z.string()).min(0).max(3).optional(),
|
|
3491
4343
|
attachments: attachmentPredicate.array().max(10).optional(),
|
|
3492
|
-
|
|
3493
|
-
|
|
3494
|
-
|
|
4344
|
+
enforce_nonce: import_zod10.z.boolean().optional()
|
|
4345
|
+
});
|
|
4346
|
+
var basicActionRowPredicate = import_zod10.z.object({
|
|
4347
|
+
type: import_zod10.z.literal(import_v1041.ComponentType.ActionRow),
|
|
4348
|
+
components: import_zod10.z.object({
|
|
4349
|
+
type: import_zod10.z.union([
|
|
4350
|
+
import_zod10.z.literal(import_v1041.ComponentType.Button),
|
|
4351
|
+
import_zod10.z.literal(import_v1041.ComponentType.ChannelSelect),
|
|
4352
|
+
import_zod10.z.literal(import_v1041.ComponentType.MentionableSelect),
|
|
4353
|
+
import_zod10.z.literal(import_v1041.ComponentType.RoleSelect),
|
|
4354
|
+
import_zod10.z.literal(import_v1041.ComponentType.StringSelect),
|
|
4355
|
+
import_zod10.z.literal(import_v1041.ComponentType.UserSelect)
|
|
4356
|
+
])
|
|
4357
|
+
}).array()
|
|
4358
|
+
});
|
|
4359
|
+
var messageNoComponentsV2Predicate = baseMessagePredicate.extend({
|
|
4360
|
+
content: import_zod10.z.string().optional(),
|
|
4361
|
+
embeds: embedPredicate.array().max(10).optional(),
|
|
4362
|
+
sticker_ids: import_zod10.z.array(import_zod10.z.string()).min(0).max(3).optional(),
|
|
4363
|
+
poll: pollPredicate.optional(),
|
|
4364
|
+
components: basicActionRowPredicate.array().max(5).optional(),
|
|
4365
|
+
flags: import_zod10.z.number().optional().refine((flags) => {
|
|
4366
|
+
if (flags) {
|
|
4367
|
+
return (flags & import_v1041.MessageFlags.IsComponentsV2) === 0;
|
|
4368
|
+
}
|
|
4369
|
+
return true;
|
|
4370
|
+
})
|
|
3495
4371
|
}).refine(
|
|
3496
4372
|
(data) => data.content !== void 0 || data.embeds !== void 0 && data.embeds.length > 0 || data.poll !== void 0 || data.attachments !== void 0 && data.attachments.length > 0 || data.components !== void 0 && data.components.length > 0 || data.sticker_ids !== void 0 && data.sticker_ids.length > 0,
|
|
3497
|
-
{ message: "Messages must have content, embeds, a poll, attachments, components
|
|
4373
|
+
{ message: "Messages must have content, embeds, a poll, attachments, components or stickers" }
|
|
3498
4374
|
);
|
|
4375
|
+
var allTopLevelComponentsPredicate = import_zod10.z.union([
|
|
4376
|
+
basicActionRowPredicate,
|
|
4377
|
+
import_zod10.z.object({
|
|
4378
|
+
type: import_zod10.z.union([
|
|
4379
|
+
// Components v2
|
|
4380
|
+
import_zod10.z.literal(import_v1041.ComponentType.Container),
|
|
4381
|
+
import_zod10.z.literal(import_v1041.ComponentType.File),
|
|
4382
|
+
import_zod10.z.literal(import_v1041.ComponentType.MediaGallery),
|
|
4383
|
+
import_zod10.z.literal(import_v1041.ComponentType.Section),
|
|
4384
|
+
import_zod10.z.literal(import_v1041.ComponentType.Separator),
|
|
4385
|
+
import_zod10.z.literal(import_v1041.ComponentType.TextDisplay),
|
|
4386
|
+
import_zod10.z.literal(import_v1041.ComponentType.Thumbnail)
|
|
4387
|
+
])
|
|
4388
|
+
})
|
|
4389
|
+
]).array().min(1).max(10);
|
|
4390
|
+
var messageComponentsV2Predicate = baseMessagePredicate.extend({
|
|
4391
|
+
components: allTopLevelComponentsPredicate,
|
|
4392
|
+
flags: import_zod10.z.number().refine((flags) => (flags & import_v1041.MessageFlags.IsComponentsV2) === import_v1041.MessageFlags.IsComponentsV2),
|
|
4393
|
+
// These fields cannot be set
|
|
4394
|
+
content: import_zod10.z.string().length(0).nullish(),
|
|
4395
|
+
embeds: import_zod10.z.array(import_zod10.z.never()).nullish(),
|
|
4396
|
+
sticker_ids: import_zod10.z.array(import_zod10.z.never()).nullish(),
|
|
4397
|
+
poll: import_zod10.z.null().optional()
|
|
4398
|
+
});
|
|
4399
|
+
var messagePredicate = import_zod10.z.union([messageNoComponentsV2Predicate, messageComponentsV2Predicate]);
|
|
3499
4400
|
|
|
3500
4401
|
// src/messages/AllowedMentions.ts
|
|
3501
4402
|
var AllowedMentionsBuilder = class {
|
|
@@ -3889,9 +4790,7 @@ var MessageBuilder = class {
|
|
|
3889
4790
|
attachments: data.attachments?.map((attachment) => new AttachmentBuilder(attachment)) ?? [],
|
|
3890
4791
|
embeds: data.embeds?.map((embed) => new EmbedBuilder(embed)) ?? [],
|
|
3891
4792
|
poll: data.poll ? new PollBuilder(data.poll) : void 0,
|
|
3892
|
-
components: data.components?.map(
|
|
3893
|
-
(component) => new ActionRowBuilder(component)
|
|
3894
|
-
) ?? [],
|
|
4793
|
+
components: data.components?.map((component) => createComponentBuilder(component)) ?? [],
|
|
3895
4794
|
message_reference: data.message_reference ? new MessageReferenceBuilder(data.message_reference) : void 0
|
|
3896
4795
|
};
|
|
3897
4796
|
}
|
|
@@ -4048,16 +4947,82 @@ var MessageBuilder = class {
|
|
|
4048
4947
|
return this;
|
|
4049
4948
|
}
|
|
4050
4949
|
/**
|
|
4051
|
-
* Adds components to this message.
|
|
4950
|
+
* Adds action row components to this message.
|
|
4052
4951
|
*
|
|
4053
|
-
* @param components - The components to add
|
|
4952
|
+
* @param components - The action row components to add
|
|
4054
4953
|
*/
|
|
4055
|
-
|
|
4954
|
+
addActionRowComponents(...components) {
|
|
4056
4955
|
this.data.components ??= [];
|
|
4057
4956
|
const resolved = normalizeArray(components).map((component) => resolveBuilder(component, ActionRowBuilder));
|
|
4058
4957
|
this.data.components.push(...resolved);
|
|
4059
4958
|
return this;
|
|
4060
4959
|
}
|
|
4960
|
+
/**
|
|
4961
|
+
* Adds container components to this message.
|
|
4962
|
+
*
|
|
4963
|
+
* @param components - The container components to add
|
|
4964
|
+
*/
|
|
4965
|
+
addContainerComponents(...components) {
|
|
4966
|
+
this.data.components ??= [];
|
|
4967
|
+
const resolved = normalizeArray(components).map((component) => resolveBuilder(component, ContainerBuilder));
|
|
4968
|
+
this.data.components.push(...resolved);
|
|
4969
|
+
return this;
|
|
4970
|
+
}
|
|
4971
|
+
/**
|
|
4972
|
+
* Adds file components to this message.
|
|
4973
|
+
*
|
|
4974
|
+
* @param components - The file components to add
|
|
4975
|
+
*/
|
|
4976
|
+
addFileComponents(...components) {
|
|
4977
|
+
this.data.components ??= [];
|
|
4978
|
+
const resolved = normalizeArray(components).map((component) => resolveBuilder(component, FileBuilder));
|
|
4979
|
+
this.data.components.push(...resolved);
|
|
4980
|
+
return this;
|
|
4981
|
+
}
|
|
4982
|
+
/**
|
|
4983
|
+
* Adds media gallery components to this message.
|
|
4984
|
+
*
|
|
4985
|
+
* @param components - The media gallery components to add
|
|
4986
|
+
*/
|
|
4987
|
+
addMediaGalleryComponents(...components) {
|
|
4988
|
+
this.data.components ??= [];
|
|
4989
|
+
const resolved = normalizeArray(components).map((component) => resolveBuilder(component, MediaGalleryBuilder));
|
|
4990
|
+
this.data.components.push(...resolved);
|
|
4991
|
+
return this;
|
|
4992
|
+
}
|
|
4993
|
+
/**
|
|
4994
|
+
* Adds section components to this message.
|
|
4995
|
+
*
|
|
4996
|
+
* @param components - The section components to add
|
|
4997
|
+
*/
|
|
4998
|
+
addSectionComponents(...components) {
|
|
4999
|
+
this.data.components ??= [];
|
|
5000
|
+
const resolved = normalizeArray(components).map((component) => resolveBuilder(component, SectionBuilder));
|
|
5001
|
+
this.data.components.push(...resolved);
|
|
5002
|
+
return this;
|
|
5003
|
+
}
|
|
5004
|
+
/**
|
|
5005
|
+
* Adds separator components to this message.
|
|
5006
|
+
*
|
|
5007
|
+
* @param components - The separator components to add
|
|
5008
|
+
*/
|
|
5009
|
+
addSeparatorComponents(...components) {
|
|
5010
|
+
this.data.components ??= [];
|
|
5011
|
+
const resolved = normalizeArray(components).map((component) => resolveBuilder(component, SeparatorBuilder));
|
|
5012
|
+
this.data.components.push(...resolved);
|
|
5013
|
+
return this;
|
|
5014
|
+
}
|
|
5015
|
+
/**
|
|
5016
|
+
* Adds text display components to this message.
|
|
5017
|
+
*
|
|
5018
|
+
* @param components - The text display components to add
|
|
5019
|
+
*/
|
|
5020
|
+
addTextDisplayComponents(...components) {
|
|
5021
|
+
this.data.components ??= [];
|
|
5022
|
+
const resolved = normalizeArray(components).map((component) => resolveBuilder(component, TextDisplayBuilder));
|
|
5023
|
+
this.data.components.push(...resolved);
|
|
5024
|
+
return this;
|
|
5025
|
+
}
|
|
4061
5026
|
/**
|
|
4062
5027
|
* Removes, replaces, or inserts components for this message.
|
|
4063
5028
|
*
|
|
@@ -4088,19 +5053,12 @@ var MessageBuilder = class {
|
|
|
4088
5053
|
*/
|
|
4089
5054
|
spliceComponents(start, deleteCount, ...components) {
|
|
4090
5055
|
this.data.components ??= [];
|
|
4091
|
-
const resolved = normalizeArray(components).map(
|
|
5056
|
+
const resolved = normalizeArray(components).map(
|
|
5057
|
+
(component) => component instanceof ComponentBuilder ? component : createComponentBuilder(component)
|
|
5058
|
+
);
|
|
4092
5059
|
this.data.components.splice(start, deleteCount, ...resolved);
|
|
4093
5060
|
return this;
|
|
4094
5061
|
}
|
|
4095
|
-
/**
|
|
4096
|
-
* Sets the components of this message.
|
|
4097
|
-
*
|
|
4098
|
-
* @param components - The components to set
|
|
4099
|
-
*/
|
|
4100
|
-
setComponents(...components) {
|
|
4101
|
-
this.data.components = normalizeArray(components).map((component) => resolveBuilder(component, ActionRowBuilder));
|
|
4102
|
-
return this;
|
|
4103
|
-
}
|
|
4104
5062
|
/**
|
|
4105
5063
|
* Sets the sticker ids of this message.
|
|
4106
5064
|
*
|
|
@@ -4278,7 +5236,7 @@ var MessageBuilder = class {
|
|
|
4278
5236
|
};
|
|
4279
5237
|
|
|
4280
5238
|
// src/index.ts
|
|
4281
|
-
var version = "2.0.0-dev.
|
|
5239
|
+
var version = "2.0.0-dev.1745540007-8e4e319c2";
|
|
4282
5240
|
// Annotate the CommonJS export names for ESM import in node:
|
|
4283
5241
|
0 && (module.exports = {
|
|
4284
5242
|
ActionRowBuilder,
|
|
@@ -4307,6 +5265,7 @@ var version = "2.0.0-dev.1745367189-42ce11622";
|
|
|
4307
5265
|
ChatInputCommandUserOption,
|
|
4308
5266
|
CommandBuilder,
|
|
4309
5267
|
ComponentBuilder,
|
|
5268
|
+
ContainerBuilder,
|
|
4310
5269
|
ContextMenuCommandBuilder,
|
|
4311
5270
|
CustomIdButtonBuilder,
|
|
4312
5271
|
DangerButtonBuilder,
|
|
@@ -4315,7 +5274,10 @@ var version = "2.0.0-dev.1745367189-42ce11622";
|
|
|
4315
5274
|
EmbedFieldBuilder,
|
|
4316
5275
|
EmbedFooterBuilder,
|
|
4317
5276
|
EmojiOrLabelButtonMixin,
|
|
5277
|
+
FileBuilder,
|
|
4318
5278
|
LinkButtonBuilder,
|
|
5279
|
+
MediaGalleryBuilder,
|
|
5280
|
+
MediaGalleryItemBuilder,
|
|
4319
5281
|
MentionableSelectMenuBuilder,
|
|
4320
5282
|
MessageBuilder,
|
|
4321
5283
|
MessageContextCommandBuilder,
|
|
@@ -4330,6 +5292,8 @@ var version = "2.0.0-dev.1745367189-42ce11622";
|
|
|
4330
5292
|
PrimaryButtonBuilder,
|
|
4331
5293
|
RoleSelectMenuBuilder,
|
|
4332
5294
|
SecondaryButtonBuilder,
|
|
5295
|
+
SectionBuilder,
|
|
5296
|
+
SeparatorBuilder,
|
|
4333
5297
|
SharedChatInputCommandOptions,
|
|
4334
5298
|
SharedChatInputCommandSubcommands,
|
|
4335
5299
|
SharedName,
|
|
@@ -4337,7 +5301,9 @@ var version = "2.0.0-dev.1745367189-42ce11622";
|
|
|
4337
5301
|
StringSelectMenuBuilder,
|
|
4338
5302
|
StringSelectMenuOptionBuilder,
|
|
4339
5303
|
SuccessButtonBuilder,
|
|
5304
|
+
TextDisplayBuilder,
|
|
4340
5305
|
TextInputBuilder,
|
|
5306
|
+
ThumbnailBuilder,
|
|
4341
5307
|
UserContextCommandBuilder,
|
|
4342
5308
|
UserSelectMenuBuilder,
|
|
4343
5309
|
actionRowPredicate,
|
|
@@ -4349,6 +5315,7 @@ var version = "2.0.0-dev.1745367189-42ce11622";
|
|
|
4349
5315
|
chatInputCommandPredicate,
|
|
4350
5316
|
chatInputCommandSubcommandGroupPredicate,
|
|
4351
5317
|
chatInputCommandSubcommandPredicate,
|
|
5318
|
+
containerPredicate,
|
|
4352
5319
|
createComponentBuilder,
|
|
4353
5320
|
customIdPredicate,
|
|
4354
5321
|
disableValidators,
|
|
@@ -4359,9 +5326,12 @@ var version = "2.0.0-dev.1745367189-42ce11622";
|
|
|
4359
5326
|
embedPredicate,
|
|
4360
5327
|
emojiPredicate,
|
|
4361
5328
|
enableValidators,
|
|
5329
|
+
filePredicate,
|
|
4362
5330
|
integerOptionPredicate,
|
|
4363
5331
|
isValidationEnabled,
|
|
4364
5332
|
localeMapPredicate,
|
|
5333
|
+
mediaGalleryItemPredicate,
|
|
5334
|
+
mediaGalleryPredicate,
|
|
4365
5335
|
memberPermissionsPredicate,
|
|
4366
5336
|
messageCommandPredicate,
|
|
4367
5337
|
messagePredicate,
|
|
@@ -4374,15 +5344,20 @@ var version = "2.0.0-dev.1745367189-42ce11622";
|
|
|
4374
5344
|
pollPredicate,
|
|
4375
5345
|
pollQuestionPredicate,
|
|
4376
5346
|
refineURLPredicate,
|
|
5347
|
+
resolveAccessoryComponent,
|
|
4377
5348
|
resolveBuilder,
|
|
5349
|
+
sectionPredicate,
|
|
4378
5350
|
selectMenuChannelPredicate,
|
|
4379
5351
|
selectMenuMentionablePredicate,
|
|
4380
5352
|
selectMenuRolePredicate,
|
|
4381
5353
|
selectMenuStringOptionPredicate,
|
|
4382
5354
|
selectMenuStringPredicate,
|
|
4383
5355
|
selectMenuUserPredicate,
|
|
5356
|
+
separatorPredicate,
|
|
4384
5357
|
stringOptionPredicate,
|
|
5358
|
+
textDisplayPredicate,
|
|
4385
5359
|
textInputPredicate,
|
|
5360
|
+
thumbnailPredicate,
|
|
4386
5361
|
userCommandPredicate,
|
|
4387
5362
|
validate,
|
|
4388
5363
|
version
|