@discordjs/builders 0.16.0-dev.1657152714-10ba008 → 0.16.0-dev.1657239113-e78c9c9
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.ts +14 -0
- package/dist/index.js +21 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +21 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -998,6 +998,20 @@ declare class SlashCommandRoleOption extends ApplicationCommandOptionBase {
|
|
|
998
998
|
|
|
999
999
|
declare class SlashCommandStringOption extends ApplicationCommandOptionBase {
|
|
1000
1000
|
readonly type: ApplicationCommandOptionType.String;
|
|
1001
|
+
readonly max_length?: number;
|
|
1002
|
+
readonly min_length?: number;
|
|
1003
|
+
/**
|
|
1004
|
+
* Sets the maximum length of this string option.
|
|
1005
|
+
*
|
|
1006
|
+
* @param max - The maximum length this option can be
|
|
1007
|
+
*/
|
|
1008
|
+
setMaxLength(max: number): this;
|
|
1009
|
+
/**
|
|
1010
|
+
* Sets the minimum length of this string option.
|
|
1011
|
+
*
|
|
1012
|
+
* @param min - The minimum length this option can be
|
|
1013
|
+
*/
|
|
1014
|
+
setMinLength(min: number): this;
|
|
1001
1015
|
toJSON(): APIApplicationCommandStringOption;
|
|
1002
1016
|
}
|
|
1003
1017
|
interface SlashCommandStringOption extends ApplicationCommandOptionWithChoicesAndAutocompleteMixin<string> {
|
package/dist/index.js
CHANGED
|
@@ -1169,12 +1169,27 @@ var SlashCommandRoleOption = class extends ApplicationCommandOptionBase {
|
|
|
1169
1169
|
__name(SlashCommandRoleOption, "SlashCommandRoleOption");
|
|
1170
1170
|
|
|
1171
1171
|
// src/interactions/slashCommands/options/string.ts
|
|
1172
|
+
var import_shapeshift10 = require("@sapphire/shapeshift");
|
|
1172
1173
|
var import_v1018 = require("discord-api-types/v10");
|
|
1173
1174
|
var import_ts_mixer4 = require("ts-mixer");
|
|
1175
|
+
var minLengthValidator2 = import_shapeshift10.s.number.greaterThanOrEqual(0).lessThanOrEqual(6e3);
|
|
1176
|
+
var maxLengthValidator2 = import_shapeshift10.s.number.greaterThanOrEqual(1).lessThanOrEqual(6e3);
|
|
1174
1177
|
var SlashCommandStringOption = class extends ApplicationCommandOptionBase {
|
|
1175
1178
|
constructor() {
|
|
1176
1179
|
super(...arguments);
|
|
1177
1180
|
__publicField(this, "type", import_v1018.ApplicationCommandOptionType.String);
|
|
1181
|
+
__publicField(this, "max_length");
|
|
1182
|
+
__publicField(this, "min_length");
|
|
1183
|
+
}
|
|
1184
|
+
setMaxLength(max) {
|
|
1185
|
+
maxLengthValidator2.parse(max);
|
|
1186
|
+
Reflect.set(this, "max_length", max);
|
|
1187
|
+
return this;
|
|
1188
|
+
}
|
|
1189
|
+
setMinLength(min) {
|
|
1190
|
+
minLengthValidator2.parse(min);
|
|
1191
|
+
Reflect.set(this, "min_length", min);
|
|
1192
|
+
return this;
|
|
1178
1193
|
}
|
|
1179
1194
|
toJSON() {
|
|
1180
1195
|
this.runRequiredValidations();
|
|
@@ -1368,11 +1383,11 @@ __export(Assertions_exports6, {
|
|
|
1368
1383
|
validateRequiredParameters: () => validateRequiredParameters4,
|
|
1369
1384
|
validateType: () => validateType
|
|
1370
1385
|
});
|
|
1371
|
-
var
|
|
1386
|
+
var import_shapeshift11 = require("@sapphire/shapeshift");
|
|
1372
1387
|
var import_v1021 = require("discord-api-types/v10");
|
|
1373
|
-
var namePredicate2 =
|
|
1374
|
-
var typePredicate =
|
|
1375
|
-
var booleanPredicate3 =
|
|
1388
|
+
var namePredicate2 = import_shapeshift11.s.string.lengthGreaterThanOrEqual(1).lengthLessThanOrEqual(32).regex(/^( *[\p{L}\p{N}\p{sc=Devanagari}\p{sc=Thai}_-]+ *)+$/u).setValidationEnabled(isValidationEnabled);
|
|
1389
|
+
var typePredicate = import_shapeshift11.s.union(import_shapeshift11.s.literal(import_v1021.ApplicationCommandType.User), import_shapeshift11.s.literal(import_v1021.ApplicationCommandType.Message)).setValidationEnabled(isValidationEnabled);
|
|
1390
|
+
var booleanPredicate3 = import_shapeshift11.s.boolean;
|
|
1376
1391
|
function validateDefaultPermission2(value) {
|
|
1377
1392
|
booleanPredicate3.parse(value);
|
|
1378
1393
|
}
|
|
@@ -1390,12 +1405,12 @@ function validateRequiredParameters4(name, type) {
|
|
|
1390
1405
|
validateType(type);
|
|
1391
1406
|
}
|
|
1392
1407
|
__name(validateRequiredParameters4, "validateRequiredParameters");
|
|
1393
|
-
var dmPermissionPredicate2 =
|
|
1408
|
+
var dmPermissionPredicate2 = import_shapeshift11.s.boolean.nullish;
|
|
1394
1409
|
function validateDMPermission2(value) {
|
|
1395
1410
|
dmPermissionPredicate2.parse(value);
|
|
1396
1411
|
}
|
|
1397
1412
|
__name(validateDMPermission2, "validateDMPermission");
|
|
1398
|
-
var memberPermissionPredicate2 =
|
|
1413
|
+
var memberPermissionPredicate2 = import_shapeshift11.s.union(import_shapeshift11.s.bigint.transform((value) => value.toString()), import_shapeshift11.s.number.safeInt.transform((value) => value.toString()), import_shapeshift11.s.string.regex(/^\d+$/)).nullish;
|
|
1399
1414
|
function validateDefaultMemberPermissions2(permissions) {
|
|
1400
1415
|
return memberPermissionPredicate2.parse(permissions);
|
|
1401
1416
|
}
|