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