@discordjs/builders 1.12.0 → 1.12.2
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 +12 -26
- package/dist/index.d.ts +12 -26
- package/dist/index.js +19 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +19 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1383,7 +1383,7 @@ var selectMenuMentionablePredicate = selectMenuBasePredicate.extend({
|
|
|
1383
1383
|
type: s4.literal(ComponentType9.MentionableSelect),
|
|
1384
1384
|
default_values: s4.object({
|
|
1385
1385
|
id: s4.string(),
|
|
1386
|
-
type: s4.literal(
|
|
1386
|
+
type: s4.union([s4.literal(SelectMenuDefaultValueType5.Role), s4.literal(SelectMenuDefaultValueType5.User)])
|
|
1387
1387
|
}).array().lengthLessThanOrEqual(25).optional()
|
|
1388
1388
|
}).setValidationEnabled(isValidationEnabled);
|
|
1389
1389
|
var selectMenuRolePredicate = selectMenuBasePredicate.extend({
|
|
@@ -2477,7 +2477,7 @@ __export(Assertions_exports6, {
|
|
|
2477
2477
|
});
|
|
2478
2478
|
import { s as s7 } from "@sapphire/shapeshift";
|
|
2479
2479
|
var titleValidator = s7.string().lengthGreaterThanOrEqual(1).lengthLessThanOrEqual(45).setValidationEnabled(isValidationEnabled);
|
|
2480
|
-
var componentsValidator = s7.union([s7.instance(ActionRowBuilder), s7.instance(LabelBuilder)]).array().lengthGreaterThanOrEqual(1).setValidationEnabled(isValidationEnabled);
|
|
2480
|
+
var componentsValidator = s7.union([s7.instance(ActionRowBuilder), s7.instance(LabelBuilder), s7.instance(TextDisplayBuilder)]).array().lengthGreaterThanOrEqual(1).setValidationEnabled(isValidationEnabled);
|
|
2481
2481
|
function validateRequiredParameters2(customId, title, components) {
|
|
2482
2482
|
customIdValidator.parse(customId);
|
|
2483
2483
|
titleValidator.parse(title);
|
|
@@ -2529,12 +2529,12 @@ var ModalBuilder = class {
|
|
|
2529
2529
|
* Adds components to this modal.
|
|
2530
2530
|
*
|
|
2531
2531
|
* @param components - The components to add
|
|
2532
|
-
* @deprecated Use {@link ModalBuilder.addLabelComponents} or {@link ModalBuilder.
|
|
2532
|
+
* @deprecated Use {@link ModalBuilder.addLabelComponents} or {@link ModalBuilder.addTextDisplayComponents} instead
|
|
2533
2533
|
*/
|
|
2534
2534
|
addComponents(...components) {
|
|
2535
2535
|
this.components.push(
|
|
2536
2536
|
...normalizeArray(components).map((component, idx) => {
|
|
2537
|
-
if (component instanceof ActionRowBuilder || component instanceof LabelBuilder) {
|
|
2537
|
+
if (component instanceof ActionRowBuilder || component instanceof LabelBuilder || component instanceof TextDisplayBuilder) {
|
|
2538
2538
|
return component;
|
|
2539
2539
|
}
|
|
2540
2540
|
if (component instanceof TextInputBuilder) {
|
|
@@ -2547,6 +2547,9 @@ var ModalBuilder = class {
|
|
|
2547
2547
|
if (component.type === ComponentType21.Label) {
|
|
2548
2548
|
return new LabelBuilder(component);
|
|
2549
2549
|
}
|
|
2550
|
+
if (component.type === ComponentType21.TextDisplay) {
|
|
2551
|
+
return new TextDisplayBuilder(component);
|
|
2552
|
+
}
|
|
2550
2553
|
if (component.type === ComponentType21.TextInput) {
|
|
2551
2554
|
return new ActionRowBuilder().addComponents(
|
|
2552
2555
|
new TextInputBuilder(component)
|
|
@@ -2569,6 +2572,17 @@ var ModalBuilder = class {
|
|
|
2569
2572
|
this.components.push(...resolved);
|
|
2570
2573
|
return this;
|
|
2571
2574
|
}
|
|
2575
|
+
/**
|
|
2576
|
+
* Adds text display components to this modal.
|
|
2577
|
+
*
|
|
2578
|
+
* @param components - The components to add
|
|
2579
|
+
*/
|
|
2580
|
+
addTextDisplayComponents(...components) {
|
|
2581
|
+
const normalized = normalizeArray(components);
|
|
2582
|
+
const resolved = normalized.map((row) => resolveBuilder(row, TextDisplayBuilder));
|
|
2583
|
+
this.components.push(...resolved);
|
|
2584
|
+
return this;
|
|
2585
|
+
}
|
|
2572
2586
|
/**
|
|
2573
2587
|
* Adds action rows to this modal.
|
|
2574
2588
|
*
|
|
@@ -3941,7 +3955,7 @@ function embedLength(data) {
|
|
|
3941
3955
|
__name(embedLength, "embedLength");
|
|
3942
3956
|
|
|
3943
3957
|
// src/index.ts
|
|
3944
|
-
var version = "1.12.
|
|
3958
|
+
var version = "1.12.2";
|
|
3945
3959
|
export {
|
|
3946
3960
|
ActionRowBuilder,
|
|
3947
3961
|
ApplicationCommandNumericOptionMinMaxValueMixin,
|