@discordjs/builders 1.8.2 → 1.8.3-dev.1717589068-346d1be72
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.js +8 -15
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8 -15
- package/dist/index.mjs.map +1 -1
- package/package.json +8 -8
package/dist/index.mjs
CHANGED
|
@@ -10,8 +10,7 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
10
10
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
11
11
|
if (decorator = decorators[i])
|
|
12
12
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
13
|
-
if (kind && result)
|
|
14
|
-
__defProp(target, key, result);
|
|
13
|
+
if (kind && result) __defProp(target, key, result);
|
|
15
14
|
return result;
|
|
16
15
|
};
|
|
17
16
|
|
|
@@ -94,8 +93,7 @@ var titlePredicate = fieldNamePredicate.nullable.setValidationEnabled(isValidati
|
|
|
94
93
|
|
|
95
94
|
// src/util/normalizeArray.ts
|
|
96
95
|
function normalizeArray(arr) {
|
|
97
|
-
if (Array.isArray(arr[0]))
|
|
98
|
-
return [...arr[0]];
|
|
96
|
+
if (Array.isArray(arr[0])) return [...arr[0]];
|
|
99
97
|
return arr;
|
|
100
98
|
}
|
|
101
99
|
__name(normalizeArray, "normalizeArray");
|
|
@@ -116,8 +114,7 @@ var EmbedBuilder = class {
|
|
|
116
114
|
*/
|
|
117
115
|
constructor(data = {}) {
|
|
118
116
|
this.data = { ...data };
|
|
119
|
-
if (data.timestamp)
|
|
120
|
-
this.data.timestamp = new Date(data.timestamp).toISOString();
|
|
117
|
+
if (data.timestamp) this.data.timestamp = new Date(data.timestamp).toISOString();
|
|
121
118
|
}
|
|
122
119
|
/**
|
|
123
120
|
* Appends fields to the embed.
|
|
@@ -147,10 +144,8 @@ var EmbedBuilder = class {
|
|
|
147
144
|
const normalizedFields = normalizeArray(fields);
|
|
148
145
|
validateFieldLength(normalizedFields.length, this.data.fields);
|
|
149
146
|
embedFieldsArrayPredicate.parse(normalizedFields);
|
|
150
|
-
if (this.data.fields)
|
|
151
|
-
|
|
152
|
-
else
|
|
153
|
-
this.data.fields = normalizedFields;
|
|
147
|
+
if (this.data.fields) this.data.fields.push(...normalizedFields);
|
|
148
|
+
else this.data.fields = normalizedFields;
|
|
154
149
|
return this;
|
|
155
150
|
}
|
|
156
151
|
/**
|
|
@@ -185,10 +180,8 @@ var EmbedBuilder = class {
|
|
|
185
180
|
spliceFields(index, deleteCount, ...fields) {
|
|
186
181
|
validateFieldLength(fields.length - deleteCount, this.data.fields);
|
|
187
182
|
embedFieldsArrayPredicate.parse(fields);
|
|
188
|
-
if (this.data.fields)
|
|
189
|
-
|
|
190
|
-
else
|
|
191
|
-
this.data.fields = fields;
|
|
183
|
+
if (this.data.fields) this.data.fields.splice(index, deleteCount, ...fields);
|
|
184
|
+
else this.data.fields = fields;
|
|
192
185
|
return this;
|
|
193
186
|
}
|
|
194
187
|
/**
|
|
@@ -2699,7 +2692,7 @@ function embedLength(data) {
|
|
|
2699
2692
|
__name(embedLength, "embedLength");
|
|
2700
2693
|
|
|
2701
2694
|
// src/index.ts
|
|
2702
|
-
var version = "1.8.
|
|
2695
|
+
var version = "1.8.3-dev.1717589068-346d1be72";
|
|
2703
2696
|
export {
|
|
2704
2697
|
ActionRowBuilder,
|
|
2705
2698
|
ApplicationCommandNumericOptionMinMaxValueMixin,
|