@discordjs/builders 2.0.0-dev.1751371559-02fbb706a → 2.0.0-dev.1751544354-e6d59eaf9
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 +357 -7583
- package/dist/index.d.ts +357 -7583
- package/dist/index.js +285 -272
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +284 -271
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -5
package/dist/index.mjs
CHANGED
|
@@ -40,8 +40,27 @@ var EmojiOrLabelButtonMixin = class {
|
|
|
40
40
|
}
|
|
41
41
|
};
|
|
42
42
|
|
|
43
|
+
// src/util/ValidationError.ts
|
|
44
|
+
import { z } from "zod/v4";
|
|
45
|
+
var ValidationError = class extends Error {
|
|
46
|
+
static {
|
|
47
|
+
__name(this, "ValidationError");
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* The underlying cause of the validation error.
|
|
51
|
+
*/
|
|
52
|
+
cause;
|
|
53
|
+
/**
|
|
54
|
+
* @internal
|
|
55
|
+
*/
|
|
56
|
+
constructor(error) {
|
|
57
|
+
super(z.prettifyError(error));
|
|
58
|
+
this.name = "ValidationError";
|
|
59
|
+
this.cause = error;
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
|
|
43
63
|
// src/util/validation.ts
|
|
44
|
-
import { fromZodError } from "zod-validation-error";
|
|
45
64
|
var validationEnabled = true;
|
|
46
65
|
function enableValidators() {
|
|
47
66
|
return validationEnabled = true;
|
|
@@ -56,12 +75,12 @@ function isValidationEnabled() {
|
|
|
56
75
|
}
|
|
57
76
|
__name(isValidationEnabled, "isValidationEnabled");
|
|
58
77
|
function validate(validator, value, validationOverride) {
|
|
59
|
-
if (validationOverride === false || !isValidationEnabled()) {
|
|
78
|
+
if (validationOverride === false || validationOverride === void 0 && !isValidationEnabled()) {
|
|
60
79
|
return value;
|
|
61
80
|
}
|
|
62
81
|
const result = validator.safeParse(value);
|
|
63
82
|
if (!result.success) {
|
|
64
|
-
throw
|
|
83
|
+
throw new ValidationError(result.error);
|
|
65
84
|
}
|
|
66
85
|
return result.data;
|
|
67
86
|
}
|
|
@@ -69,54 +88,50 @@ __name(validate, "validate");
|
|
|
69
88
|
|
|
70
89
|
// src/components/Assertions.ts
|
|
71
90
|
import { ButtonStyle, ChannelType, ComponentType, SelectMenuDefaultValueType } from "discord-api-types/v10";
|
|
72
|
-
import { z as
|
|
91
|
+
import { z as z3 } from "zod/v4";
|
|
73
92
|
|
|
74
93
|
// src/Assertions.ts
|
|
75
94
|
import { Locale } from "discord-api-types/v10";
|
|
76
|
-
import { z } from "zod";
|
|
77
|
-
var customIdPredicate =
|
|
78
|
-
var memberPermissionsPredicate =
|
|
79
|
-
var localeMapPredicate =
|
|
80
|
-
Object.fromEntries(Object.values(Locale).map((loc) => [loc,
|
|
81
|
-
)
|
|
82
|
-
var refineURLPredicate = /* @__PURE__ */ __name((allowedProtocols) => (value) => {
|
|
83
|
-
const url = new URL(value);
|
|
84
|
-
return allowedProtocols.includes(url.protocol);
|
|
85
|
-
}, "refineURLPredicate");
|
|
95
|
+
import { z as z2 } from "zod/v4";
|
|
96
|
+
var customIdPredicate = z2.string().min(1).max(100);
|
|
97
|
+
var memberPermissionsPredicate = z2.coerce.bigint();
|
|
98
|
+
var localeMapPredicate = z2.strictObject(
|
|
99
|
+
Object.fromEntries(Object.values(Locale).map((loc) => [loc, z2.string().optional()]))
|
|
100
|
+
);
|
|
86
101
|
|
|
87
102
|
// src/components/Assertions.ts
|
|
88
|
-
var labelPredicate =
|
|
89
|
-
var emojiPredicate =
|
|
90
|
-
id:
|
|
91
|
-
name:
|
|
92
|
-
animated:
|
|
93
|
-
}).
|
|
94
|
-
|
|
103
|
+
var labelPredicate = z3.string().min(1).max(80);
|
|
104
|
+
var emojiPredicate = z3.strictObject({
|
|
105
|
+
id: z3.string().optional(),
|
|
106
|
+
name: z3.string().min(2).max(32).optional(),
|
|
107
|
+
animated: z3.boolean().optional()
|
|
108
|
+
}).refine((data) => data.id !== void 0 || data.name !== void 0, {
|
|
109
|
+
error: "Either 'id' or 'name' must be provided"
|
|
95
110
|
});
|
|
96
|
-
var buttonPredicateBase =
|
|
97
|
-
type:
|
|
98
|
-
disabled:
|
|
111
|
+
var buttonPredicateBase = z3.strictObject({
|
|
112
|
+
type: z3.literal(ComponentType.Button),
|
|
113
|
+
disabled: z3.boolean().optional()
|
|
99
114
|
});
|
|
100
115
|
var buttonCustomIdPredicateBase = buttonPredicateBase.extend({
|
|
101
116
|
custom_id: customIdPredicate,
|
|
102
117
|
emoji: emojiPredicate.optional(),
|
|
103
118
|
label: labelPredicate
|
|
104
119
|
});
|
|
105
|
-
var buttonPrimaryPredicate = buttonCustomIdPredicateBase.extend({ style:
|
|
106
|
-
var buttonSecondaryPredicate = buttonCustomIdPredicateBase.extend({ style:
|
|
107
|
-
var buttonSuccessPredicate = buttonCustomIdPredicateBase.extend({ style:
|
|
108
|
-
var buttonDangerPredicate = buttonCustomIdPredicateBase.extend({ style:
|
|
120
|
+
var buttonPrimaryPredicate = buttonCustomIdPredicateBase.extend({ style: z3.literal(ButtonStyle.Primary) });
|
|
121
|
+
var buttonSecondaryPredicate = buttonCustomIdPredicateBase.extend({ style: z3.literal(ButtonStyle.Secondary) });
|
|
122
|
+
var buttonSuccessPredicate = buttonCustomIdPredicateBase.extend({ style: z3.literal(ButtonStyle.Success) });
|
|
123
|
+
var buttonDangerPredicate = buttonCustomIdPredicateBase.extend({ style: z3.literal(ButtonStyle.Danger) });
|
|
109
124
|
var buttonLinkPredicate = buttonPredicateBase.extend({
|
|
110
|
-
style:
|
|
111
|
-
url:
|
|
125
|
+
style: z3.literal(ButtonStyle.Link),
|
|
126
|
+
url: z3.url({ protocol: /^(?:https?|discord)$/ }),
|
|
112
127
|
emoji: emojiPredicate.optional(),
|
|
113
128
|
label: labelPredicate
|
|
114
|
-
})
|
|
129
|
+
});
|
|
115
130
|
var buttonPremiumPredicate = buttonPredicateBase.extend({
|
|
116
|
-
style:
|
|
117
|
-
sku_id:
|
|
118
|
-
})
|
|
119
|
-
var buttonPredicate =
|
|
131
|
+
style: z3.literal(ButtonStyle.Premium),
|
|
132
|
+
sku_id: z3.string()
|
|
133
|
+
});
|
|
134
|
+
var buttonPredicate = z3.discriminatedUnion("style", [
|
|
120
135
|
buttonLinkPredicate,
|
|
121
136
|
buttonPrimaryPredicate,
|
|
122
137
|
buttonSecondaryPredicate,
|
|
@@ -124,72 +139,73 @@ var buttonPredicate = z2.discriminatedUnion("style", [
|
|
|
124
139
|
buttonDangerPredicate,
|
|
125
140
|
buttonPremiumPredicate
|
|
126
141
|
]);
|
|
127
|
-
var selectMenuBasePredicate =
|
|
128
|
-
placeholder:
|
|
129
|
-
min_values:
|
|
130
|
-
max_values:
|
|
142
|
+
var selectMenuBasePredicate = z3.object({
|
|
143
|
+
placeholder: z3.string().max(150).optional(),
|
|
144
|
+
min_values: z3.number().min(0).max(25).optional(),
|
|
145
|
+
max_values: z3.number().min(0).max(25).optional(),
|
|
131
146
|
custom_id: customIdPredicate,
|
|
132
|
-
disabled:
|
|
147
|
+
disabled: z3.boolean().optional()
|
|
133
148
|
});
|
|
134
149
|
var selectMenuChannelPredicate = selectMenuBasePredicate.extend({
|
|
135
|
-
type:
|
|
136
|
-
channel_types:
|
|
137
|
-
default_values:
|
|
150
|
+
type: z3.literal(ComponentType.ChannelSelect),
|
|
151
|
+
channel_types: z3.enum(ChannelType).array().optional(),
|
|
152
|
+
default_values: z3.object({ id: z3.string(), type: z3.literal(SelectMenuDefaultValueType.Channel) }).array().max(25).optional()
|
|
138
153
|
});
|
|
139
154
|
var selectMenuMentionablePredicate = selectMenuBasePredicate.extend({
|
|
140
|
-
type:
|
|
141
|
-
default_values:
|
|
142
|
-
id:
|
|
143
|
-
type:
|
|
155
|
+
type: z3.literal(ComponentType.MentionableSelect),
|
|
156
|
+
default_values: z3.object({
|
|
157
|
+
id: z3.string(),
|
|
158
|
+
type: z3.literal([SelectMenuDefaultValueType.Role, SelectMenuDefaultValueType.User])
|
|
144
159
|
}).array().max(25).optional()
|
|
145
160
|
});
|
|
146
161
|
var selectMenuRolePredicate = selectMenuBasePredicate.extend({
|
|
147
|
-
type:
|
|
148
|
-
default_values:
|
|
162
|
+
type: z3.literal(ComponentType.RoleSelect),
|
|
163
|
+
default_values: z3.object({ id: z3.string(), type: z3.literal(SelectMenuDefaultValueType.Role) }).array().max(25).optional()
|
|
149
164
|
});
|
|
150
|
-
var selectMenuStringOptionPredicate =
|
|
165
|
+
var selectMenuStringOptionPredicate = z3.object({
|
|
151
166
|
label: labelPredicate,
|
|
152
|
-
value:
|
|
153
|
-
description:
|
|
167
|
+
value: z3.string().min(1).max(100),
|
|
168
|
+
description: z3.string().min(1).max(100).optional(),
|
|
154
169
|
emoji: emojiPredicate.optional(),
|
|
155
|
-
default:
|
|
170
|
+
default: z3.boolean().optional()
|
|
156
171
|
});
|
|
157
172
|
var selectMenuStringPredicate = selectMenuBasePredicate.extend({
|
|
158
|
-
type:
|
|
173
|
+
type: z3.literal(ComponentType.StringSelect),
|
|
159
174
|
options: selectMenuStringOptionPredicate.array().min(1).max(25)
|
|
160
|
-
}).
|
|
161
|
-
const addIssue = /* @__PURE__ */ __name((name, minimum) => ctx.
|
|
175
|
+
}).check((ctx) => {
|
|
176
|
+
const addIssue = /* @__PURE__ */ __name((name, minimum) => ctx.issues.push({
|
|
162
177
|
code: "too_small",
|
|
163
178
|
message: `The number of options must be greater than or equal to ${name}`,
|
|
164
179
|
inclusive: true,
|
|
165
180
|
minimum,
|
|
166
181
|
type: "number",
|
|
167
|
-
path: ["options"]
|
|
182
|
+
path: ["options"],
|
|
183
|
+
origin: "number",
|
|
184
|
+
input: minimum
|
|
168
185
|
}), "addIssue");
|
|
169
|
-
if (
|
|
170
|
-
addIssue("max_values",
|
|
186
|
+
if (ctx.value.max_values !== void 0 && ctx.value.options.length < ctx.value.max_values) {
|
|
187
|
+
addIssue("max_values", ctx.value.max_values);
|
|
171
188
|
}
|
|
172
|
-
if (
|
|
173
|
-
addIssue("min_values",
|
|
189
|
+
if (ctx.value.min_values !== void 0 && ctx.value.options.length < ctx.value.min_values) {
|
|
190
|
+
addIssue("min_values", ctx.value.min_values);
|
|
174
191
|
}
|
|
175
192
|
});
|
|
176
193
|
var selectMenuUserPredicate = selectMenuBasePredicate.extend({
|
|
177
|
-
type:
|
|
178
|
-
default_values:
|
|
194
|
+
type: z3.literal(ComponentType.UserSelect),
|
|
195
|
+
default_values: z3.object({ id: z3.string(), type: z3.literal(SelectMenuDefaultValueType.User) }).array().max(25).optional()
|
|
179
196
|
});
|
|
180
|
-
var actionRowPredicate =
|
|
181
|
-
type:
|
|
182
|
-
components:
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
type:
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
z2.literal(ComponentType.TextInput)
|
|
197
|
+
var actionRowPredicate = z3.object({
|
|
198
|
+
type: z3.literal(ComponentType.ActionRow),
|
|
199
|
+
components: z3.union([
|
|
200
|
+
z3.object({ type: z3.literal(ComponentType.Button) }).array().min(1).max(5),
|
|
201
|
+
z3.object({
|
|
202
|
+
type: z3.literal([
|
|
203
|
+
ComponentType.ChannelSelect,
|
|
204
|
+
ComponentType.MentionableSelect,
|
|
205
|
+
ComponentType.StringSelect,
|
|
206
|
+
ComponentType.RoleSelect,
|
|
207
|
+
ComponentType.TextInput,
|
|
208
|
+
ComponentType.UserSelect
|
|
193
209
|
])
|
|
194
210
|
}).array().length(1)
|
|
195
211
|
])
|
|
@@ -1012,17 +1028,17 @@ import { ComponentType as ComponentType11 } from "discord-api-types/v10";
|
|
|
1012
1028
|
|
|
1013
1029
|
// src/components/textInput/Assertions.ts
|
|
1014
1030
|
import { ComponentType as ComponentType10, TextInputStyle } from "discord-api-types/v10";
|
|
1015
|
-
import { z as
|
|
1016
|
-
var textInputPredicate =
|
|
1017
|
-
type:
|
|
1031
|
+
import { z as z4 } from "zod/v4";
|
|
1032
|
+
var textInputPredicate = z4.object({
|
|
1033
|
+
type: z4.literal(ComponentType10.TextInput),
|
|
1018
1034
|
custom_id: customIdPredicate,
|
|
1019
|
-
label:
|
|
1020
|
-
style:
|
|
1021
|
-
min_length:
|
|
1022
|
-
max_length:
|
|
1023
|
-
placeholder:
|
|
1024
|
-
value:
|
|
1025
|
-
required:
|
|
1035
|
+
label: z4.string().min(1).max(45),
|
|
1036
|
+
style: z4.enum(TextInputStyle),
|
|
1037
|
+
min_length: z4.number().min(0).max(4e3).optional(),
|
|
1038
|
+
max_length: z4.number().min(1).max(4e3).optional(),
|
|
1039
|
+
placeholder: z4.string().max(100).optional(),
|
|
1040
|
+
value: z4.string().min(1).max(4e3).optional(),
|
|
1041
|
+
required: z4.boolean().optional()
|
|
1026
1042
|
});
|
|
1027
1043
|
|
|
1028
1044
|
// src/components/textInput/TextInput.ts
|
|
@@ -1182,51 +1198,47 @@ import { ComponentType as ComponentType19 } from "discord-api-types/v10";
|
|
|
1182
1198
|
|
|
1183
1199
|
// src/components/v2/Assertions.ts
|
|
1184
1200
|
import { ComponentType as ComponentType12, SeparatorSpacingSize } from "discord-api-types/v10";
|
|
1185
|
-
import { z as
|
|
1186
|
-
var unfurledMediaItemPredicate =
|
|
1187
|
-
url:
|
|
1188
|
-
message: "Invalid protocol for media URL. Must be http:, https:, or attachment:"
|
|
1189
|
-
})
|
|
1201
|
+
import { z as z5 } from "zod/v4";
|
|
1202
|
+
var unfurledMediaItemPredicate = z5.object({
|
|
1203
|
+
url: z5.url({ protocol: /^(?:https?|attachment)$/ })
|
|
1190
1204
|
});
|
|
1191
|
-
var thumbnailPredicate =
|
|
1205
|
+
var thumbnailPredicate = z5.object({
|
|
1192
1206
|
media: unfurledMediaItemPredicate,
|
|
1193
|
-
description:
|
|
1194
|
-
spoiler:
|
|
1207
|
+
description: z5.string().min(1).max(1024).nullish(),
|
|
1208
|
+
spoiler: z5.boolean().optional()
|
|
1195
1209
|
});
|
|
1196
|
-
var unfurledMediaItemAttachmentOnlyPredicate =
|
|
1197
|
-
url:
|
|
1198
|
-
message: "Invalid protocol for file URL. Must be attachment:"
|
|
1199
|
-
})
|
|
1210
|
+
var unfurledMediaItemAttachmentOnlyPredicate = z5.object({
|
|
1211
|
+
url: z5.url({ protocol: /^attachment$/ })
|
|
1200
1212
|
});
|
|
1201
|
-
var filePredicate =
|
|
1213
|
+
var filePredicate = z5.object({
|
|
1202
1214
|
file: unfurledMediaItemAttachmentOnlyPredicate,
|
|
1203
|
-
spoiler:
|
|
1215
|
+
spoiler: z5.boolean().optional()
|
|
1204
1216
|
});
|
|
1205
|
-
var separatorPredicate =
|
|
1206
|
-
divider:
|
|
1207
|
-
spacing:
|
|
1217
|
+
var separatorPredicate = z5.object({
|
|
1218
|
+
divider: z5.boolean().optional(),
|
|
1219
|
+
spacing: z5.enum(SeparatorSpacingSize).optional()
|
|
1208
1220
|
});
|
|
1209
|
-
var textDisplayPredicate =
|
|
1210
|
-
content:
|
|
1221
|
+
var textDisplayPredicate = z5.object({
|
|
1222
|
+
content: z5.string().min(1).max(4e3)
|
|
1211
1223
|
});
|
|
1212
|
-
var mediaGalleryItemPredicate =
|
|
1224
|
+
var mediaGalleryItemPredicate = z5.object({
|
|
1213
1225
|
media: unfurledMediaItemPredicate,
|
|
1214
|
-
description:
|
|
1215
|
-
spoiler:
|
|
1226
|
+
description: z5.string().min(1).max(1024).nullish(),
|
|
1227
|
+
spoiler: z5.boolean().optional()
|
|
1216
1228
|
});
|
|
1217
|
-
var mediaGalleryPredicate =
|
|
1218
|
-
items:
|
|
1229
|
+
var mediaGalleryPredicate = z5.object({
|
|
1230
|
+
items: z5.array(mediaGalleryItemPredicate).min(1).max(10)
|
|
1219
1231
|
});
|
|
1220
|
-
var sectionPredicate =
|
|
1221
|
-
components:
|
|
1222
|
-
accessory:
|
|
1223
|
-
|
|
1224
|
-
|
|
1232
|
+
var sectionPredicate = z5.object({
|
|
1233
|
+
components: z5.array(textDisplayPredicate).min(1).max(3),
|
|
1234
|
+
accessory: z5.union([
|
|
1235
|
+
z5.object({ type: z5.literal(ComponentType12.Button) }),
|
|
1236
|
+
z5.object({ type: z5.literal(ComponentType12.Thumbnail) })
|
|
1225
1237
|
])
|
|
1226
1238
|
});
|
|
1227
|
-
var containerPredicate =
|
|
1228
|
-
components:
|
|
1229
|
-
|
|
1239
|
+
var containerPredicate = z5.object({
|
|
1240
|
+
components: z5.array(
|
|
1241
|
+
z5.union([
|
|
1230
1242
|
actionRowPredicate,
|
|
1231
1243
|
filePredicate,
|
|
1232
1244
|
mediaGalleryPredicate,
|
|
@@ -1235,8 +1247,8 @@ var containerPredicate = z4.object({
|
|
|
1235
1247
|
textDisplayPredicate
|
|
1236
1248
|
])
|
|
1237
1249
|
).min(1),
|
|
1238
|
-
spoiler:
|
|
1239
|
-
accent_color:
|
|
1250
|
+
spoiler: z5.boolean().optional(),
|
|
1251
|
+
accent_color: z5.int().min(0).max(16777215).nullish()
|
|
1240
1252
|
});
|
|
1241
1253
|
|
|
1242
1254
|
// src/components/v2/File.ts
|
|
@@ -2593,35 +2605,33 @@ import {
|
|
|
2593
2605
|
InteractionContextType,
|
|
2594
2606
|
ApplicationCommandOptionType
|
|
2595
2607
|
} from "discord-api-types/v10";
|
|
2596
|
-
import { z as
|
|
2597
|
-
var namePredicate =
|
|
2598
|
-
var descriptionPredicate =
|
|
2599
|
-
var sharedNameAndDescriptionPredicate =
|
|
2608
|
+
import { z as z6 } from "zod/v4";
|
|
2609
|
+
var namePredicate = z6.string().min(1).max(32).regex(/^[\p{Ll}\p{Lm}\p{Lo}\p{N}\p{sc=Devanagari}\p{sc=Thai}_-]+$/u);
|
|
2610
|
+
var descriptionPredicate = z6.string().min(1).max(100);
|
|
2611
|
+
var sharedNameAndDescriptionPredicate = z6.object({
|
|
2600
2612
|
name: namePredicate,
|
|
2601
2613
|
name_localizations: localeMapPredicate.optional(),
|
|
2602
2614
|
description: descriptionPredicate,
|
|
2603
2615
|
description_localizations: localeMapPredicate.optional()
|
|
2604
2616
|
});
|
|
2605
|
-
var numericMixinNumberOptionPredicate =
|
|
2606
|
-
max_value:
|
|
2607
|
-
min_value:
|
|
2617
|
+
var numericMixinNumberOptionPredicate = z6.object({
|
|
2618
|
+
max_value: z6.float32().optional(),
|
|
2619
|
+
min_value: z6.float32().optional()
|
|
2608
2620
|
});
|
|
2609
|
-
var numericMixinIntegerOptionPredicate =
|
|
2610
|
-
max_value:
|
|
2611
|
-
min_value:
|
|
2621
|
+
var numericMixinIntegerOptionPredicate = z6.object({
|
|
2622
|
+
max_value: z6.int().optional(),
|
|
2623
|
+
min_value: z6.int().optional()
|
|
2612
2624
|
});
|
|
2613
|
-
var channelMixinOptionPredicate =
|
|
2614
|
-
channel_types:
|
|
2615
|
-
ApplicationCommandOptionAllowedChannelTypes.map((type) => z5.literal(type))
|
|
2616
|
-
).array().optional()
|
|
2625
|
+
var channelMixinOptionPredicate = z6.object({
|
|
2626
|
+
channel_types: z6.literal(ApplicationCommandOptionAllowedChannelTypes).array().optional()
|
|
2617
2627
|
});
|
|
2618
|
-
var autocompleteMixinOptionPredicate =
|
|
2619
|
-
autocomplete:
|
|
2620
|
-
choices:
|
|
2628
|
+
var autocompleteMixinOptionPredicate = z6.object({
|
|
2629
|
+
autocomplete: z6.literal(true),
|
|
2630
|
+
choices: z6.union([z6.never(), z6.never().array(), z6.undefined()])
|
|
2621
2631
|
});
|
|
2622
|
-
var choiceValueStringPredicate =
|
|
2623
|
-
var choiceValueNumberPredicate =
|
|
2624
|
-
var choiceBasePredicate =
|
|
2632
|
+
var choiceValueStringPredicate = z6.string().min(1).max(100);
|
|
2633
|
+
var choiceValueNumberPredicate = z6.number();
|
|
2634
|
+
var choiceBasePredicate = z6.object({
|
|
2625
2635
|
name: choiceValueStringPredicate,
|
|
2626
2636
|
name_localizations: localeMapPredicate.optional()
|
|
2627
2637
|
});
|
|
@@ -2631,8 +2641,8 @@ var choiceStringPredicate = choiceBasePredicate.extend({
|
|
|
2631
2641
|
var choiceNumberPredicate = choiceBasePredicate.extend({
|
|
2632
2642
|
value: choiceValueNumberPredicate
|
|
2633
2643
|
});
|
|
2634
|
-
var choiceBaseMixinPredicate =
|
|
2635
|
-
autocomplete:
|
|
2644
|
+
var choiceBaseMixinPredicate = z6.object({
|
|
2645
|
+
autocomplete: z6.literal(false).optional()
|
|
2636
2646
|
});
|
|
2637
2647
|
var choiceStringMixinPredicate = choiceBaseMixinPredicate.extend({
|
|
2638
2648
|
choices: choiceStringPredicate.array().max(25).optional()
|
|
@@ -2640,7 +2650,7 @@ var choiceStringMixinPredicate = choiceBaseMixinPredicate.extend({
|
|
|
2640
2650
|
var choiceNumberMixinPredicate = choiceBaseMixinPredicate.extend({
|
|
2641
2651
|
choices: choiceNumberPredicate.array().max(25).optional()
|
|
2642
2652
|
});
|
|
2643
|
-
var
|
|
2653
|
+
var basicOptionTypesPredicate = z6.literal([
|
|
2644
2654
|
ApplicationCommandOptionType.Attachment,
|
|
2645
2655
|
ApplicationCommandOptionType.Boolean,
|
|
2646
2656
|
ApplicationCommandOptionType.Channel,
|
|
@@ -2650,50 +2660,56 @@ var basicOptionTypes = [
|
|
|
2650
2660
|
ApplicationCommandOptionType.Role,
|
|
2651
2661
|
ApplicationCommandOptionType.String,
|
|
2652
2662
|
ApplicationCommandOptionType.User
|
|
2653
|
-
];
|
|
2654
|
-
var basicOptionTypesPredicate = z5.union(
|
|
2655
|
-
basicOptionTypes.map((type) => z5.literal(type))
|
|
2656
|
-
);
|
|
2663
|
+
]);
|
|
2657
2664
|
var basicOptionPredicate = sharedNameAndDescriptionPredicate.extend({
|
|
2658
|
-
required:
|
|
2665
|
+
required: z6.boolean().optional(),
|
|
2659
2666
|
type: basicOptionTypesPredicate
|
|
2660
2667
|
});
|
|
2661
|
-
var autocompleteOrStringChoicesMixinOptionPredicate =
|
|
2668
|
+
var autocompleteOrStringChoicesMixinOptionPredicate = z6.discriminatedUnion("autocomplete", [
|
|
2662
2669
|
autocompleteMixinOptionPredicate,
|
|
2663
2670
|
choiceStringMixinPredicate
|
|
2664
2671
|
]);
|
|
2665
|
-
var autocompleteOrNumberChoicesMixinOptionPredicate =
|
|
2672
|
+
var autocompleteOrNumberChoicesMixinOptionPredicate = z6.discriminatedUnion("autocomplete", [
|
|
2666
2673
|
autocompleteMixinOptionPredicate,
|
|
2667
2674
|
choiceNumberMixinPredicate
|
|
2668
2675
|
]);
|
|
2669
|
-
var channelOptionPredicate =
|
|
2670
|
-
|
|
2671
|
-
|
|
2676
|
+
var channelOptionPredicate = z6.object({
|
|
2677
|
+
...basicOptionPredicate.shape,
|
|
2678
|
+
...channelMixinOptionPredicate.shape
|
|
2679
|
+
});
|
|
2680
|
+
var integerOptionPredicate = z6.object({
|
|
2681
|
+
...basicOptionPredicate.shape,
|
|
2682
|
+
...numericMixinIntegerOptionPredicate.shape
|
|
2683
|
+
}).and(autocompleteOrNumberChoicesMixinOptionPredicate);
|
|
2684
|
+
var numberOptionPredicate = z6.object({
|
|
2685
|
+
...basicOptionPredicate.shape,
|
|
2686
|
+
...numericMixinNumberOptionPredicate.shape
|
|
2687
|
+
}).and(autocompleteOrNumberChoicesMixinOptionPredicate);
|
|
2672
2688
|
var stringOptionPredicate = basicOptionPredicate.extend({
|
|
2673
|
-
max_length:
|
|
2674
|
-
min_length:
|
|
2689
|
+
max_length: z6.number().min(0).max(6e3).optional(),
|
|
2690
|
+
min_length: z6.number().min(1).max(6e3).optional()
|
|
2675
2691
|
}).and(autocompleteOrStringChoicesMixinOptionPredicate);
|
|
2676
2692
|
var baseChatInputCommandPredicate = sharedNameAndDescriptionPredicate.extend({
|
|
2677
|
-
contexts:
|
|
2693
|
+
contexts: z6.array(z6.enum(InteractionContextType)).optional(),
|
|
2678
2694
|
default_member_permissions: memberPermissionsPredicate.optional(),
|
|
2679
|
-
integration_types:
|
|
2680
|
-
nsfw:
|
|
2695
|
+
integration_types: z6.array(z6.enum(ApplicationIntegrationType)).optional(),
|
|
2696
|
+
nsfw: z6.boolean().optional()
|
|
2681
2697
|
});
|
|
2682
|
-
var chatInputCommandOptionsPredicate =
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
2698
|
+
var chatInputCommandOptionsPredicate = z6.union([
|
|
2699
|
+
z6.object({ type: basicOptionTypesPredicate }).array(),
|
|
2700
|
+
z6.object({ type: z6.literal(ApplicationCommandOptionType.Subcommand) }).array(),
|
|
2701
|
+
z6.object({ type: z6.literal(ApplicationCommandOptionType.SubcommandGroup) }).array()
|
|
2686
2702
|
]);
|
|
2687
2703
|
var chatInputCommandPredicate = baseChatInputCommandPredicate.extend({
|
|
2688
2704
|
options: chatInputCommandOptionsPredicate.optional()
|
|
2689
2705
|
});
|
|
2690
2706
|
var chatInputCommandSubcommandGroupPredicate = sharedNameAndDescriptionPredicate.extend({
|
|
2691
|
-
type:
|
|
2692
|
-
options:
|
|
2707
|
+
type: z6.literal(ApplicationCommandOptionType.SubcommandGroup),
|
|
2708
|
+
options: z6.array(z6.object({ type: z6.literal(ApplicationCommandOptionType.Subcommand) })).min(1).max(25)
|
|
2693
2709
|
});
|
|
2694
2710
|
var chatInputCommandSubcommandPredicate = sharedNameAndDescriptionPredicate.extend({
|
|
2695
|
-
type:
|
|
2696
|
-
options:
|
|
2711
|
+
type: z6.literal(ApplicationCommandOptionType.Subcommand),
|
|
2712
|
+
options: z6.array(z6.object({ type: basicOptionTypesPredicate })).max(25)
|
|
2697
2713
|
});
|
|
2698
2714
|
|
|
2699
2715
|
// src/interactions/commands/chatInput/options/ApplicationCommandOptionBase.ts
|
|
@@ -3242,23 +3258,23 @@ var ChatInputCommandBuilder = class extends Mixin8(
|
|
|
3242
3258
|
|
|
3243
3259
|
// src/interactions/commands/contextMenu/Assertions.ts
|
|
3244
3260
|
import { ApplicationCommandType as ApplicationCommandType2, ApplicationIntegrationType as ApplicationIntegrationType2, InteractionContextType as InteractionContextType2 } from "discord-api-types/v10";
|
|
3245
|
-
import { z as
|
|
3246
|
-
var namePredicate2 =
|
|
3247
|
-
var contextsPredicate =
|
|
3248
|
-
var integrationTypesPredicate =
|
|
3249
|
-
var baseContextMenuCommandPredicate =
|
|
3261
|
+
import { z as z7 } from "zod/v4";
|
|
3262
|
+
var namePredicate2 = z7.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);
|
|
3263
|
+
var contextsPredicate = z7.array(z7.enum(InteractionContextType2));
|
|
3264
|
+
var integrationTypesPredicate = z7.array(z7.enum(ApplicationIntegrationType2));
|
|
3265
|
+
var baseContextMenuCommandPredicate = z7.object({
|
|
3250
3266
|
contexts: contextsPredicate.optional(),
|
|
3251
3267
|
default_member_permissions: memberPermissionsPredicate.optional(),
|
|
3252
3268
|
name: namePredicate2,
|
|
3253
3269
|
name_localizations: localeMapPredicate.optional(),
|
|
3254
3270
|
integration_types: integrationTypesPredicate.optional(),
|
|
3255
|
-
nsfw:
|
|
3271
|
+
nsfw: z7.boolean().optional()
|
|
3256
3272
|
});
|
|
3257
3273
|
var userCommandPredicate = baseContextMenuCommandPredicate.extend({
|
|
3258
|
-
type:
|
|
3274
|
+
type: z7.literal(ApplicationCommandType2.User)
|
|
3259
3275
|
});
|
|
3260
3276
|
var messageCommandPredicate = baseContextMenuCommandPredicate.extend({
|
|
3261
|
-
type:
|
|
3277
|
+
type: z7.literal(ApplicationCommandType2.Message)
|
|
3262
3278
|
});
|
|
3263
3279
|
|
|
3264
3280
|
// src/interactions/commands/contextMenu/ContextMenuCommand.ts
|
|
@@ -3321,14 +3337,14 @@ var UserContextCommandBuilder = class extends ContextMenuCommandBuilder {
|
|
|
3321
3337
|
|
|
3322
3338
|
// src/interactions/modals/Assertions.ts
|
|
3323
3339
|
import { ComponentType as ComponentType22 } from "discord-api-types/v10";
|
|
3324
|
-
import { z as
|
|
3325
|
-
var titlePredicate =
|
|
3326
|
-
var modalPredicate =
|
|
3340
|
+
import { z as z8 } from "zod/v4";
|
|
3341
|
+
var titlePredicate = z8.string().min(1).max(45);
|
|
3342
|
+
var modalPredicate = z8.object({
|
|
3327
3343
|
title: titlePredicate,
|
|
3328
3344
|
custom_id: customIdPredicate,
|
|
3329
|
-
components:
|
|
3330
|
-
type:
|
|
3331
|
-
components:
|
|
3345
|
+
components: z8.object({
|
|
3346
|
+
type: z8.literal(ComponentType22.ActionRow),
|
|
3347
|
+
components: z8.object({ type: z8.literal(ComponentType22.TextInput) }).array().length(1)
|
|
3332
3348
|
}).array().min(1).max(5)
|
|
3333
3349
|
});
|
|
3334
3350
|
|
|
@@ -3451,7 +3467,7 @@ var ModalBuilder = class {
|
|
|
3451
3467
|
};
|
|
3452
3468
|
|
|
3453
3469
|
// src/messages/embed/Assertions.ts
|
|
3454
|
-
import { z as
|
|
3470
|
+
import { z as z9 } from "zod/v4";
|
|
3455
3471
|
|
|
3456
3472
|
// src/util/componentUtil.ts
|
|
3457
3473
|
function embedLength(data) {
|
|
@@ -3460,42 +3476,40 @@ function embedLength(data) {
|
|
|
3460
3476
|
__name(embedLength, "embedLength");
|
|
3461
3477
|
|
|
3462
3478
|
// src/messages/embed/Assertions.ts
|
|
3463
|
-
var namePredicate3 =
|
|
3464
|
-
var URLPredicate =
|
|
3465
|
-
var URLWithAttachmentProtocolPredicate =
|
|
3466
|
-
|
|
3467
|
-
});
|
|
3468
|
-
var embedFieldPredicate = z8.object({
|
|
3479
|
+
var namePredicate3 = z9.string().max(256);
|
|
3480
|
+
var URLPredicate = z9.url({ protocol: /^https?$/ });
|
|
3481
|
+
var URLWithAttachmentProtocolPredicate = z9.url({ protocol: /^(?:https?|attachment)$/ });
|
|
3482
|
+
var embedFieldPredicate = z9.object({
|
|
3469
3483
|
name: namePredicate3,
|
|
3470
|
-
value:
|
|
3471
|
-
inline:
|
|
3484
|
+
value: z9.string().max(1024),
|
|
3485
|
+
inline: z9.boolean().optional()
|
|
3472
3486
|
});
|
|
3473
|
-
var embedAuthorPredicate =
|
|
3487
|
+
var embedAuthorPredicate = z9.object({
|
|
3474
3488
|
name: namePredicate3.min(1),
|
|
3475
3489
|
icon_url: URLWithAttachmentProtocolPredicate.optional(),
|
|
3476
3490
|
url: URLPredicate.optional()
|
|
3477
3491
|
});
|
|
3478
|
-
var embedFooterPredicate =
|
|
3479
|
-
text:
|
|
3492
|
+
var embedFooterPredicate = z9.object({
|
|
3493
|
+
text: z9.string().min(1).max(2048),
|
|
3480
3494
|
icon_url: URLWithAttachmentProtocolPredicate.optional()
|
|
3481
3495
|
});
|
|
3482
|
-
var embedPredicate =
|
|
3496
|
+
var embedPredicate = z9.object({
|
|
3483
3497
|
title: namePredicate3.min(1).optional(),
|
|
3484
|
-
description:
|
|
3498
|
+
description: z9.string().min(1).max(4096).optional(),
|
|
3485
3499
|
url: URLPredicate.optional(),
|
|
3486
|
-
timestamp:
|
|
3487
|
-
color:
|
|
3500
|
+
timestamp: z9.string().optional(),
|
|
3501
|
+
color: z9.int().min(0).max(16777215).optional(),
|
|
3488
3502
|
footer: embedFooterPredicate.optional(),
|
|
3489
|
-
image:
|
|
3490
|
-
thumbnail:
|
|
3503
|
+
image: z9.object({ url: URLWithAttachmentProtocolPredicate }).optional(),
|
|
3504
|
+
thumbnail: z9.object({ url: URLWithAttachmentProtocolPredicate }).optional(),
|
|
3491
3505
|
author: embedAuthorPredicate.optional(),
|
|
3492
|
-
fields:
|
|
3506
|
+
fields: z9.array(embedFieldPredicate).max(25).optional()
|
|
3493
3507
|
}).refine(
|
|
3494
3508
|
(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,
|
|
3495
3509
|
{
|
|
3496
|
-
|
|
3510
|
+
error: "Embed must have at least a title, description, a field, a footer, an author, an image, OR a thumbnail."
|
|
3497
3511
|
}
|
|
3498
|
-
).refine((embed) => embedLength(embed) <= 6e3, {
|
|
3512
|
+
).refine((embed) => embedLength(embed) <= 6e3, { error: "Embeds must not exceed 6000 characters in total." });
|
|
3499
3513
|
|
|
3500
3514
|
// src/messages/embed/EmbedAuthor.ts
|
|
3501
3515
|
var EmbedAuthorBuilder = class {
|
|
@@ -3975,19 +3989,19 @@ var EmbedBuilder = class {
|
|
|
3975
3989
|
|
|
3976
3990
|
// src/messages/poll/Assertions.ts
|
|
3977
3991
|
import { PollLayoutType } from "discord-api-types/v10";
|
|
3978
|
-
import { z as
|
|
3979
|
-
var pollQuestionPredicate =
|
|
3980
|
-
var pollAnswerMediaPredicate =
|
|
3981
|
-
text:
|
|
3992
|
+
import { z as z10 } from "zod/v4";
|
|
3993
|
+
var pollQuestionPredicate = z10.object({ text: z10.string().min(1).max(300) });
|
|
3994
|
+
var pollAnswerMediaPredicate = z10.object({
|
|
3995
|
+
text: z10.string().min(1).max(55),
|
|
3982
3996
|
emoji: emojiPredicate.optional()
|
|
3983
3997
|
});
|
|
3984
|
-
var pollAnswerPredicate =
|
|
3985
|
-
var pollPredicate =
|
|
3998
|
+
var pollAnswerPredicate = z10.object({ poll_media: pollAnswerMediaPredicate });
|
|
3999
|
+
var pollPredicate = z10.object({
|
|
3986
4000
|
question: pollQuestionPredicate,
|
|
3987
|
-
answers:
|
|
3988
|
-
duration:
|
|
3989
|
-
allow_multiselect:
|
|
3990
|
-
layout_type:
|
|
4001
|
+
answers: z10.array(pollAnswerPredicate).min(1).max(10),
|
|
4002
|
+
duration: z10.number().min(1).max(768).optional(),
|
|
4003
|
+
allow_multiselect: z10.boolean().optional(),
|
|
4004
|
+
layout_type: z10.enum(PollLayoutType).optional()
|
|
3991
4005
|
});
|
|
3992
4006
|
|
|
3993
4007
|
// src/messages/poll/PollMedia.ts
|
|
@@ -4317,95 +4331,94 @@ var PollBuilder = class {
|
|
|
4317
4331
|
|
|
4318
4332
|
// src/messages/Assertions.ts
|
|
4319
4333
|
import { AllowedMentionsTypes, ComponentType as ComponentType23, MessageFlags, MessageReferenceType } from "discord-api-types/v10";
|
|
4320
|
-
import { z as
|
|
4321
|
-
var attachmentPredicate =
|
|
4322
|
-
id:
|
|
4323
|
-
description:
|
|
4324
|
-
duration_secs:
|
|
4325
|
-
filename:
|
|
4326
|
-
title:
|
|
4327
|
-
waveform:
|
|
4334
|
+
import { z as z11 } from "zod/v4";
|
|
4335
|
+
var attachmentPredicate = z11.object({
|
|
4336
|
+
id: z11.union([z11.string(), z11.number()]),
|
|
4337
|
+
description: z11.string().max(1024).optional(),
|
|
4338
|
+
duration_secs: z11.number().max(2 ** 31 - 1).optional(),
|
|
4339
|
+
filename: z11.string().max(1024).optional(),
|
|
4340
|
+
title: z11.string().max(1024).optional(),
|
|
4341
|
+
waveform: z11.string().max(400).optional()
|
|
4328
4342
|
});
|
|
4329
|
-
var allowedMentionPredicate =
|
|
4330
|
-
parse:
|
|
4331
|
-
roles:
|
|
4332
|
-
users:
|
|
4333
|
-
replied_user:
|
|
4343
|
+
var allowedMentionPredicate = z11.object({
|
|
4344
|
+
parse: z11.enum(AllowedMentionsTypes).array().optional(),
|
|
4345
|
+
roles: z11.string().array().max(100).optional(),
|
|
4346
|
+
users: z11.string().array().max(100).optional(),
|
|
4347
|
+
replied_user: z11.boolean().optional()
|
|
4334
4348
|
}).refine(
|
|
4335
4349
|
(data) => !(data.parse?.includes(AllowedMentionsTypes.User) && data.users?.length || data.parse?.includes(AllowedMentionsTypes.Role) && data.roles?.length),
|
|
4336
4350
|
{
|
|
4337
|
-
|
|
4351
|
+
error: 'Cannot specify both parse: ["users"] and non-empty users array, or parse: ["roles"] and non-empty roles array. These are mutually exclusive'
|
|
4338
4352
|
}
|
|
4339
4353
|
);
|
|
4340
|
-
var messageReferencePredicate =
|
|
4341
|
-
channel_id:
|
|
4342
|
-
fail_if_not_exists:
|
|
4343
|
-
guild_id:
|
|
4344
|
-
message_id:
|
|
4345
|
-
type:
|
|
4354
|
+
var messageReferencePredicate = z11.object({
|
|
4355
|
+
channel_id: z11.string().optional(),
|
|
4356
|
+
fail_if_not_exists: z11.boolean().optional(),
|
|
4357
|
+
guild_id: z11.string().optional(),
|
|
4358
|
+
message_id: z11.string(),
|
|
4359
|
+
type: z11.enum(MessageReferenceType).optional()
|
|
4346
4360
|
});
|
|
4347
|
-
var baseMessagePredicate =
|
|
4348
|
-
nonce:
|
|
4349
|
-
tts:
|
|
4361
|
+
var baseMessagePredicate = z11.object({
|
|
4362
|
+
nonce: z11.union([z11.string().max(25), z11.number()]).optional(),
|
|
4363
|
+
tts: z11.boolean().optional(),
|
|
4350
4364
|
allowed_mentions: allowedMentionPredicate.optional(),
|
|
4351
4365
|
message_reference: messageReferencePredicate.optional(),
|
|
4352
4366
|
attachments: attachmentPredicate.array().max(10).optional(),
|
|
4353
|
-
enforce_nonce:
|
|
4367
|
+
enforce_nonce: z11.boolean().optional()
|
|
4354
4368
|
});
|
|
4355
|
-
var basicActionRowPredicate =
|
|
4356
|
-
type:
|
|
4357
|
-
components:
|
|
4358
|
-
type:
|
|
4359
|
-
|
|
4360
|
-
|
|
4361
|
-
|
|
4362
|
-
|
|
4363
|
-
|
|
4364
|
-
|
|
4369
|
+
var basicActionRowPredicate = z11.object({
|
|
4370
|
+
type: z11.literal(ComponentType23.ActionRow),
|
|
4371
|
+
components: z11.object({
|
|
4372
|
+
type: z11.literal([
|
|
4373
|
+
ComponentType23.Button,
|
|
4374
|
+
ComponentType23.ChannelSelect,
|
|
4375
|
+
ComponentType23.MentionableSelect,
|
|
4376
|
+
ComponentType23.RoleSelect,
|
|
4377
|
+
ComponentType23.StringSelect,
|
|
4378
|
+
ComponentType23.UserSelect
|
|
4365
4379
|
])
|
|
4366
4380
|
}).array()
|
|
4367
4381
|
});
|
|
4368
4382
|
var messageNoComponentsV2Predicate = baseMessagePredicate.extend({
|
|
4369
|
-
content:
|
|
4383
|
+
content: z11.string().max(2e3).optional(),
|
|
4370
4384
|
embeds: embedPredicate.array().max(10).optional(),
|
|
4371
|
-
sticker_ids:
|
|
4385
|
+
sticker_ids: z11.array(z11.string()).max(3).optional(),
|
|
4372
4386
|
poll: pollPredicate.optional(),
|
|
4373
4387
|
components: basicActionRowPredicate.array().max(5).optional(),
|
|
4374
|
-
flags:
|
|
4375
|
-
|
|
4376
|
-
return (flags & MessageFlags.IsComponentsV2) === 0;
|
|
4377
|
-
}
|
|
4378
|
-
return true;
|
|
4388
|
+
flags: z11.int().optional().refine((flags) => !flags || (flags & MessageFlags.IsComponentsV2) === 0, {
|
|
4389
|
+
error: "Cannot set content, embeds, stickers, or poll with IsComponentsV2 flag set"
|
|
4379
4390
|
})
|
|
4380
4391
|
}).refine(
|
|
4381
4392
|
(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,
|
|
4382
|
-
{
|
|
4393
|
+
{ error: "Messages must have content, embeds, a poll, attachments, components or stickers" }
|
|
4383
4394
|
);
|
|
4384
|
-
var allTopLevelComponentsPredicate =
|
|
4395
|
+
var allTopLevelComponentsPredicate = z11.union([
|
|
4385
4396
|
basicActionRowPredicate,
|
|
4386
|
-
|
|
4387
|
-
type:
|
|
4397
|
+
z11.object({
|
|
4398
|
+
type: z11.literal([
|
|
4388
4399
|
// Components v2
|
|
4389
|
-
|
|
4390
|
-
|
|
4391
|
-
|
|
4392
|
-
|
|
4393
|
-
|
|
4394
|
-
|
|
4395
|
-
|
|
4400
|
+
ComponentType23.Container,
|
|
4401
|
+
ComponentType23.File,
|
|
4402
|
+
ComponentType23.MediaGallery,
|
|
4403
|
+
ComponentType23.Section,
|
|
4404
|
+
ComponentType23.Separator,
|
|
4405
|
+
ComponentType23.TextDisplay,
|
|
4406
|
+
ComponentType23.Thumbnail
|
|
4396
4407
|
])
|
|
4397
4408
|
})
|
|
4398
4409
|
]).array().min(1).max(10);
|
|
4399
4410
|
var messageComponentsV2Predicate = baseMessagePredicate.extend({
|
|
4400
4411
|
components: allTopLevelComponentsPredicate,
|
|
4401
|
-
flags:
|
|
4412
|
+
flags: z11.int().refine((flags) => (flags & MessageFlags.IsComponentsV2) === MessageFlags.IsComponentsV2, {
|
|
4413
|
+
error: "Must set IsComponentsV2 flag to use Components V2"
|
|
4414
|
+
}),
|
|
4402
4415
|
// These fields cannot be set
|
|
4403
|
-
content:
|
|
4404
|
-
embeds:
|
|
4405
|
-
sticker_ids:
|
|
4406
|
-
poll:
|
|
4416
|
+
content: z11.string().length(0).nullish(),
|
|
4417
|
+
embeds: z11.array(z11.never()).nullish(),
|
|
4418
|
+
sticker_ids: z11.array(z11.never()).nullish(),
|
|
4419
|
+
poll: z11.null().optional()
|
|
4407
4420
|
});
|
|
4408
|
-
var messagePredicate =
|
|
4421
|
+
var messagePredicate = z11.union([messageNoComponentsV2Predicate, messageComponentsV2Predicate]);
|
|
4409
4422
|
|
|
4410
4423
|
// src/messages/AllowedMentions.ts
|
|
4411
4424
|
var AllowedMentionsBuilder = class {
|
|
@@ -5295,7 +5308,7 @@ var MessageBuilder = class {
|
|
|
5295
5308
|
};
|
|
5296
5309
|
|
|
5297
5310
|
// src/index.ts
|
|
5298
|
-
var version = "2.0.0-dev.
|
|
5311
|
+
var version = "2.0.0-dev.1751544354-e6d59eaf9";
|
|
5299
5312
|
export {
|
|
5300
5313
|
ActionRowBuilder,
|
|
5301
5314
|
AllowedMentionsBuilder,
|
|
@@ -5364,6 +5377,7 @@ export {
|
|
|
5364
5377
|
ThumbnailBuilder,
|
|
5365
5378
|
UserContextCommandBuilder,
|
|
5366
5379
|
UserSelectMenuBuilder,
|
|
5380
|
+
ValidationError,
|
|
5367
5381
|
actionRowPredicate,
|
|
5368
5382
|
allowedMentionPredicate,
|
|
5369
5383
|
attachmentPredicate,
|
|
@@ -5401,7 +5415,6 @@ export {
|
|
|
5401
5415
|
pollAnswerPredicate,
|
|
5402
5416
|
pollPredicate,
|
|
5403
5417
|
pollQuestionPredicate,
|
|
5404
|
-
refineURLPredicate,
|
|
5405
5418
|
resolveAccessoryComponent,
|
|
5406
5419
|
resolveBuilder,
|
|
5407
5420
|
sectionPredicate,
|