@discordjs/builders 1.1.0-dev.1658102995-dda2895 → 1.1.0
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/CHANGELOG.md +16 -0
- package/README.md +5 -2
- package/dist/components/ActionRow.cjs +32 -0
- package/dist/components/ActionRow.cjs.map +1 -0
- package/dist/components/ActionRow.d.ts +35 -0
- package/dist/components/ActionRow.d.ts.map +1 -0
- package/dist/components/ActionRow.mjs +28 -0
- package/dist/components/ActionRow.mjs.map +1 -0
- package/dist/components/Assertions.cjs +77 -0
- package/dist/components/Assertions.cjs.map +1 -0
- package/dist/components/Assertions.d.ts +48 -0
- package/dist/components/Assertions.d.ts.map +1 -0
- package/dist/components/Assertions.mjs +57 -0
- package/dist/components/Assertions.mjs.map +1 -0
- package/dist/components/Component.cjs +12 -0
- package/dist/components/Component.cjs.map +1 -0
- package/dist/components/Component.d.ts +15 -0
- package/dist/components/Component.d.ts.map +1 -0
- package/dist/components/Component.mjs +8 -0
- package/dist/components/Component.mjs.map +1 -0
- package/dist/components/Components.cjs +31 -0
- package/dist/components/Components.cjs.map +1 -0
- package/dist/components/Components.d.ts +21 -0
- package/dist/components/Components.d.ts.map +1 -0
- package/dist/components/Components.mjs +27 -0
- package/dist/components/Components.mjs.map +1 -0
- package/dist/components/button/Button.cjs +46 -0
- package/dist/components/button/Button.cjs.map +1 -0
- package/dist/components/button/Button.d.ts +46 -0
- package/dist/components/button/Button.d.ts.map +1 -0
- package/dist/components/button/Button.mjs +42 -0
- package/dist/components/button/Button.mjs.map +1 -0
- package/dist/components/selectMenu/SelectMenu.cjs +59 -0
- package/dist/components/selectMenu/SelectMenu.cjs.map +1 -0
- package/dist/components/selectMenu/SelectMenu.d.ts +59 -0
- package/dist/components/selectMenu/SelectMenu.d.ts.map +1 -0
- package/dist/components/selectMenu/SelectMenu.mjs +55 -0
- package/dist/components/selectMenu/SelectMenu.mjs.map +1 -0
- package/dist/components/selectMenu/SelectMenuOption.cjs +40 -0
- package/dist/components/selectMenu/SelectMenuOption.cjs.map +1 -0
- package/dist/components/selectMenu/SelectMenuOption.d.ts +40 -0
- package/dist/components/selectMenu/SelectMenuOption.d.ts.map +1 -0
- package/dist/components/selectMenu/SelectMenuOption.mjs +36 -0
- package/dist/components/selectMenu/SelectMenuOption.mjs.map +1 -0
- package/dist/components/textInput/Assertions.cjs +31 -0
- package/dist/components/textInput/Assertions.cjs.map +1 -0
- package/dist/components/textInput/Assertions.d.ts +10 -0
- package/dist/components/textInput/Assertions.d.ts.map +1 -0
- package/dist/components/textInput/Assertions.mjs +20 -0
- package/dist/components/textInput/Assertions.mjs.map +1 -0
- package/dist/components/textInput/TextInput.cjs +67 -0
- package/dist/components/textInput/TextInput.cjs.map +1 -0
- package/dist/components/textInput/TextInput.d.ts +59 -0
- package/dist/components/textInput/TextInput.d.ts.map +1 -0
- package/dist/components/textInput/TextInput.mjs +59 -0
- package/dist/components/textInput/TextInput.mjs.map +1 -0
- package/dist/index.cjs +129 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +40 -1406
- package/dist/index.d.ts.map +1 -0
- package/dist/index.mjs +46 -1482
- package/dist/index.mjs.map +1 -1
- package/dist/interactions/contextMenuCommands/Assertions.cjs +40 -0
- package/dist/interactions/contextMenuCommands/Assertions.cjs.map +1 -0
- package/dist/interactions/contextMenuCommands/Assertions.d.ts +8 -0
- package/dist/interactions/contextMenuCommands/Assertions.d.ts.map +1 -0
- package/dist/interactions/contextMenuCommands/Assertions.mjs +31 -0
- package/dist/interactions/contextMenuCommands/Assertions.mjs.map +1 -0
- package/dist/interactions/contextMenuCommands/ContextMenuCommandBuilder.cjs +71 -0
- package/dist/interactions/contextMenuCommands/ContextMenuCommandBuilder.cjs.map +1 -0
- package/dist/interactions/contextMenuCommands/ContextMenuCommandBuilder.d.ts +94 -0
- package/dist/interactions/contextMenuCommands/ContextMenuCommandBuilder.d.ts.map +1 -0
- package/dist/interactions/contextMenuCommands/ContextMenuCommandBuilder.mjs +67 -0
- package/dist/interactions/contextMenuCommands/ContextMenuCommandBuilder.mjs.map +1 -0
- package/dist/interactions/modals/Assertions.cjs +21 -0
- package/dist/interactions/modals/Assertions.cjs.map +1 -0
- package/dist/interactions/modals/Assertions.d.ts +5 -0
- package/dist/interactions/modals/Assertions.d.ts.map +1 -0
- package/dist/interactions/modals/Assertions.mjs +15 -0
- package/dist/interactions/modals/Assertions.mjs.map +1 -0
- package/dist/interactions/modals/Modal.cjs +43 -0
- package/dist/interactions/modals/Modal.cjs.map +1 -0
- package/dist/interactions/modals/Modal.d.ts +35 -0
- package/dist/interactions/modals/Modal.d.ts.map +1 -0
- package/dist/interactions/modals/Modal.mjs +39 -0
- package/dist/interactions/modals/Modal.mjs.map +1 -0
- package/dist/interactions/slashCommands/Assertions.cjs +70 -0
- package/dist/interactions/slashCommands/Assertions.cjs.map +1 -0
- package/dist/interactions/slashCommands/Assertions.d.ts +18 -0
- package/dist/interactions/slashCommands/Assertions.d.ts.map +1 -0
- package/dist/interactions/slashCommands/Assertions.mjs +54 -0
- package/dist/interactions/slashCommands/Assertions.mjs.map +1 -0
- package/dist/interactions/slashCommands/SlashCommandBuilder.cjs +75 -0
- package/dist/interactions/slashCommands/SlashCommandBuilder.cjs.map +1 -0
- package/dist/interactions/slashCommands/SlashCommandBuilder.d.ts +100 -0
- package/dist/interactions/slashCommands/SlashCommandBuilder.d.ts.map +1 -0
- package/dist/interactions/slashCommands/SlashCommandBuilder.mjs +73 -0
- package/dist/interactions/slashCommands/SlashCommandBuilder.mjs.map +1 -0
- package/dist/interactions/slashCommands/SlashCommandSubcommands.cjs +72 -0
- package/dist/interactions/slashCommands/SlashCommandSubcommands.cjs.map +1 -0
- package/dist/interactions/slashCommands/SlashCommandSubcommands.d.ts +56 -0
- package/dist/interactions/slashCommands/SlashCommandSubcommands.d.ts.map +1 -0
- package/dist/interactions/slashCommands/SlashCommandSubcommands.mjs +70 -0
- package/dist/interactions/slashCommands/SlashCommandSubcommands.mjs.map +1 -0
- package/dist/interactions/slashCommands/mixins/ApplicationCommandNumericOptionMinMaxValueMixin.cjs +9 -0
- package/dist/interactions/slashCommands/mixins/ApplicationCommandNumericOptionMinMaxValueMixin.cjs.map +1 -0
- package/dist/interactions/slashCommands/mixins/ApplicationCommandNumericOptionMinMaxValueMixin.d.ts +17 -0
- package/dist/interactions/slashCommands/mixins/ApplicationCommandNumericOptionMinMaxValueMixin.d.ts.map +1 -0
- package/dist/interactions/slashCommands/mixins/ApplicationCommandNumericOptionMinMaxValueMixin.mjs +5 -0
- package/dist/interactions/slashCommands/mixins/ApplicationCommandNumericOptionMinMaxValueMixin.mjs.map +1 -0
- package/dist/interactions/slashCommands/mixins/ApplicationCommandOptionBase.cjs +27 -0
- package/dist/interactions/slashCommands/mixins/ApplicationCommandOptionBase.cjs.map +1 -0
- package/dist/interactions/slashCommands/mixins/ApplicationCommandOptionBase.d.ts +15 -0
- package/dist/interactions/slashCommands/mixins/ApplicationCommandOptionBase.d.ts.map +1 -0
- package/dist/interactions/slashCommands/mixins/ApplicationCommandOptionBase.mjs +23 -0
- package/dist/interactions/slashCommands/mixins/ApplicationCommandOptionBase.mjs.map +1 -0
- package/dist/interactions/slashCommands/mixins/ApplicationCommandOptionChannelTypesMixin.cjs +30 -0
- package/dist/interactions/slashCommands/mixins/ApplicationCommandOptionChannelTypesMixin.cjs.map +1 -0
- package/dist/interactions/slashCommands/mixins/ApplicationCommandOptionChannelTypesMixin.d.ts +14 -0
- package/dist/interactions/slashCommands/mixins/ApplicationCommandOptionChannelTypesMixin.d.ts.map +1 -0
- package/dist/interactions/slashCommands/mixins/ApplicationCommandOptionChannelTypesMixin.mjs +26 -0
- package/dist/interactions/slashCommands/mixins/ApplicationCommandOptionChannelTypesMixin.mjs.map +1 -0
- package/dist/interactions/slashCommands/mixins/ApplicationCommandOptionWithChoicesAndAutocompleteMixin.cjs +57 -0
- package/dist/interactions/slashCommands/mixins/ApplicationCommandOptionWithChoicesAndAutocompleteMixin.cjs.map +1 -0
- package/dist/interactions/slashCommands/mixins/ApplicationCommandOptionWithChoicesAndAutocompleteMixin.d.ts +19 -0
- package/dist/interactions/slashCommands/mixins/ApplicationCommandOptionWithChoicesAndAutocompleteMixin.d.ts.map +1 -0
- package/dist/interactions/slashCommands/mixins/ApplicationCommandOptionWithChoicesAndAutocompleteMixin.mjs +53 -0
- package/dist/interactions/slashCommands/mixins/ApplicationCommandOptionWithChoicesAndAutocompleteMixin.mjs.map +1 -0
- package/dist/interactions/slashCommands/mixins/NameAndDescription.cjs +65 -0
- package/dist/interactions/slashCommands/mixins/NameAndDescription.cjs.map +1 -0
- package/dist/interactions/slashCommands/mixins/NameAndDescription.d.ts +46 -0
- package/dist/interactions/slashCommands/mixins/NameAndDescription.d.ts.map +1 -0
- package/dist/interactions/slashCommands/mixins/NameAndDescription.mjs +61 -0
- package/dist/interactions/slashCommands/mixins/NameAndDescription.mjs.map +1 -0
- package/dist/interactions/slashCommands/mixins/SharedSlashCommandOptions.cjs +55 -0
- package/dist/interactions/slashCommands/mixins/SharedSlashCommandOptions.cjs.map +1 -0
- package/dist/interactions/slashCommands/mixins/SharedSlashCommandOptions.d.ts +69 -0
- package/dist/interactions/slashCommands/mixins/SharedSlashCommandOptions.d.ts.map +1 -0
- package/dist/interactions/slashCommands/mixins/SharedSlashCommandOptions.mjs +51 -0
- package/dist/interactions/slashCommands/mixins/SharedSlashCommandOptions.mjs.map +1 -0
- package/dist/interactions/slashCommands/options/attachment.cjs +20 -0
- package/dist/interactions/slashCommands/options/attachment.cjs.map +1 -0
- package/dist/interactions/slashCommands/options/attachment.d.ts +7 -0
- package/dist/interactions/slashCommands/options/attachment.d.ts.map +1 -0
- package/dist/interactions/slashCommands/options/attachment.mjs +16 -0
- package/dist/interactions/slashCommands/options/attachment.mjs.map +1 -0
- package/dist/interactions/slashCommands/options/boolean.cjs +20 -0
- package/dist/interactions/slashCommands/options/boolean.cjs.map +1 -0
- package/dist/interactions/slashCommands/options/boolean.d.ts +7 -0
- package/dist/interactions/slashCommands/options/boolean.d.ts.map +1 -0
- package/dist/interactions/slashCommands/options/boolean.mjs +16 -0
- package/dist/interactions/slashCommands/options/boolean.mjs.map +1 -0
- package/dist/interactions/slashCommands/options/channel.cjs +34 -0
- package/dist/interactions/slashCommands/options/channel.cjs.map +1 -0
- package/dist/interactions/slashCommands/options/channel.d.ts +10 -0
- package/dist/interactions/slashCommands/options/channel.d.ts.map +1 -0
- package/dist/interactions/slashCommands/options/channel.mjs +32 -0
- package/dist/interactions/slashCommands/options/channel.mjs.map +1 -0
- package/dist/interactions/slashCommands/options/integer.cjs +50 -0
- package/dist/interactions/slashCommands/options/integer.cjs.map +1 -0
- package/dist/interactions/slashCommands/options/integer.d.ts +13 -0
- package/dist/interactions/slashCommands/options/integer.d.ts.map +1 -0
- package/dist/interactions/slashCommands/options/integer.mjs +48 -0
- package/dist/interactions/slashCommands/options/integer.mjs.map +1 -0
- package/dist/interactions/slashCommands/options/mentionable.cjs +20 -0
- package/dist/interactions/slashCommands/options/mentionable.cjs.map +1 -0
- package/dist/interactions/slashCommands/options/mentionable.d.ts +7 -0
- package/dist/interactions/slashCommands/options/mentionable.d.ts.map +1 -0
- package/dist/interactions/slashCommands/options/mentionable.mjs +16 -0
- package/dist/interactions/slashCommands/options/mentionable.mjs.map +1 -0
- package/dist/interactions/slashCommands/options/number.cjs +50 -0
- package/dist/interactions/slashCommands/options/number.cjs.map +1 -0
- package/dist/interactions/slashCommands/options/number.d.ts +13 -0
- package/dist/interactions/slashCommands/options/number.d.ts.map +1 -0
- package/dist/interactions/slashCommands/options/number.mjs +48 -0
- package/dist/interactions/slashCommands/options/number.mjs.map +1 -0
- package/dist/interactions/slashCommands/options/role.cjs +20 -0
- package/dist/interactions/slashCommands/options/role.cjs.map +1 -0
- package/dist/interactions/slashCommands/options/role.d.ts +7 -0
- package/dist/interactions/slashCommands/options/role.d.ts.map +1 -0
- package/dist/interactions/slashCommands/options/role.mjs +16 -0
- package/dist/interactions/slashCommands/options/role.mjs.map +1 -0
- package/dist/interactions/slashCommands/options/string.cjs +50 -0
- package/dist/interactions/slashCommands/options/string.cjs.map +1 -0
- package/dist/interactions/slashCommands/options/string.d.ts +24 -0
- package/dist/interactions/slashCommands/options/string.d.ts.map +1 -0
- package/dist/interactions/slashCommands/options/string.mjs +48 -0
- package/dist/interactions/slashCommands/options/string.mjs.map +1 -0
- package/dist/interactions/slashCommands/options/user.cjs +20 -0
- package/dist/interactions/slashCommands/options/user.cjs.map +1 -0
- package/dist/interactions/slashCommands/options/user.d.ts +7 -0
- package/dist/interactions/slashCommands/options/user.d.ts.map +1 -0
- package/dist/interactions/slashCommands/options/user.mjs +16 -0
- package/dist/interactions/slashCommands/options/user.mjs.map +1 -0
- package/dist/messages/embed/Assertions.cjs +62 -0
- package/dist/messages/embed/Assertions.cjs.map +1 -0
- package/dist/messages/embed/Assertions.d.ts +50 -0
- package/dist/messages/embed/Assertions.d.ts.map +1 -0
- package/dist/messages/embed/Assertions.mjs +41 -0
- package/dist/messages/embed/Assertions.mjs.map +1 -0
- package/dist/messages/embed/Embed.cjs +101 -0
- package/dist/messages/embed/Embed.cjs.map +1 -0
- package/dist/messages/embed/Embed.d.ts +108 -0
- package/dist/messages/embed/Embed.d.ts.map +1 -0
- package/dist/messages/embed/Embed.mjs +97 -0
- package/dist/messages/embed/Embed.mjs.map +1 -0
- package/dist/messages/formatters.cjs +102 -0
- package/dist/messages/formatters.cjs.map +1 -0
- package/dist/messages/formatters.d.ts +246 -0
- package/dist/messages/formatters.d.ts.map +1 -0
- package/dist/messages/formatters.mjs +79 -0
- package/dist/messages/formatters.mjs.map +1 -0
- package/dist/util/componentUtil.cjs +10 -0
- package/dist/util/componentUtil.cjs.map +1 -0
- package/dist/util/componentUtil.d.ts +3 -0
- package/dist/util/componentUtil.d.ts.map +1 -0
- package/dist/util/componentUtil.mjs +6 -0
- package/dist/util/componentUtil.mjs.map +1 -0
- package/dist/util/equatable.cjs +10 -0
- package/dist/util/equatable.cjs.map +1 -0
- package/dist/util/equatable.d.ts +12 -0
- package/dist/util/equatable.d.ts.map +1 -0
- package/dist/util/equatable.mjs +6 -0
- package/dist/util/equatable.mjs.map +1 -0
- package/dist/util/jsonEncodable.cjs +10 -0
- package/dist/util/jsonEncodable.cjs.map +1 -0
- package/dist/util/jsonEncodable.d.ts +12 -0
- package/dist/util/jsonEncodable.d.ts.map +1 -0
- package/dist/util/jsonEncodable.mjs +6 -0
- package/dist/util/jsonEncodable.mjs.map +1 -0
- package/dist/util/normalizeArray.cjs +12 -0
- package/dist/util/normalizeArray.cjs.map +1 -0
- package/dist/util/normalizeArray.d.ts +3 -0
- package/dist/util/normalizeArray.d.ts.map +1 -0
- package/dist/util/normalizeArray.mjs +8 -0
- package/dist/util/normalizeArray.mjs.map +1 -0
- package/dist/util/validation.cjs +13 -0
- package/dist/util/validation.cjs.map +1 -0
- package/dist/util/validation.d.ts +4 -0
- package/dist/util/validation.d.ts.map +1 -0
- package/dist/util/validation.mjs +7 -0
- package/dist/util/validation.mjs.map +1 -0
- package/package.json +17 -16
- package/dist/index.js +0 -1557
- package/dist/index.js.map +0 -1
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { APIApplicationCommandRoleOption, ApplicationCommandOptionType } from 'discord-api-types/v10';
|
|
2
|
+
import { ApplicationCommandOptionBase } from '../mixins/ApplicationCommandOptionBase';
|
|
3
|
+
export declare class SlashCommandRoleOption extends ApplicationCommandOptionBase {
|
|
4
|
+
readonly type: ApplicationCommandOptionType.Role;
|
|
5
|
+
toJSON(): APIApplicationCommandRoleOption;
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=role.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"role.d.ts","sourceRoot":"","sources":["../../../../src/interactions/slashCommands/options/role.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,+BAA+B,EAAE,4BAA4B,EAAE,MAAM,uBAAuB,CAAC;AACtG,OAAO,EAAE,4BAA4B,EAAE,MAAM,wCAAwC,CAAC;AAEtF,qBAAa,sBAAuB,SAAQ,4BAA4B;IACvE,SAAyB,IAAI,oCAA8C;IAEpE,MAAM,IAAI,+BAA+B;CAKhD"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ApplicationCommandOptionType } from 'discord-api-types/v10';
|
|
2
|
+
import { ApplicationCommandOptionBase } from '../mixins/ApplicationCommandOptionBase.mjs';
|
|
3
|
+
|
|
4
|
+
class SlashCommandRoleOption extends ApplicationCommandOptionBase {
|
|
5
|
+
constructor() {
|
|
6
|
+
super(...arguments);
|
|
7
|
+
this.type = ApplicationCommandOptionType.Role;
|
|
8
|
+
}
|
|
9
|
+
toJSON() {
|
|
10
|
+
this.runRequiredValidations();
|
|
11
|
+
return { ...this };
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export { SlashCommandRoleOption };
|
|
16
|
+
//# sourceMappingURL=role.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"role.mjs","sources":["../../../../src/interactions/slashCommands/options/role.ts"],"sourcesContent":["import { APIApplicationCommandRoleOption, ApplicationCommandOptionType } from 'discord-api-types/v10';\nimport { ApplicationCommandOptionBase } from '../mixins/ApplicationCommandOptionBase';\n\nexport class SlashCommandRoleOption extends ApplicationCommandOptionBase {\n\tpublic override readonly type = ApplicationCommandOptionType.Role as const;\n\n\tpublic toJSON(): APIApplicationCommandRoleOption {\n\t\tthis.runRequiredValidations();\n\n\t\treturn { ...this };\n\t}\n}\n"],"names":[],"mappings":";;;AAEO,MAAM,sBAAsB,SAAS,4BAA4B,CAAC;AACzE,EAAE,WAAW,GAAG;AAChB,IAAI,KAAK,CAAC,GAAG,SAAS,CAAC,CAAC;AACxB,IAAI,IAAI,CAAC,IAAI,GAAG,4BAA4B,CAAC,IAAI,CAAC;AAClD,GAAG;AACH,EAAE,MAAM,GAAG;AACX,IAAI,IAAI,CAAC,sBAAsB,EAAE,CAAC;AAClC,IAAI,OAAO,EAAE,GAAG,IAAI,EAAE,CAAC;AACvB,GAAG;AACH;;;;"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const shapeshift = require('@sapphire/shapeshift');
|
|
6
|
+
const v10 = require('discord-api-types/v10');
|
|
7
|
+
const tsMixer = require('ts-mixer');
|
|
8
|
+
const ApplicationCommandOptionBase = require('../mixins/ApplicationCommandOptionBase.cjs');
|
|
9
|
+
const ApplicationCommandOptionWithChoicesAndAutocompleteMixin = require('../mixins/ApplicationCommandOptionWithChoicesAndAutocompleteMixin.cjs');
|
|
10
|
+
|
|
11
|
+
var __defProp = Object.defineProperty;
|
|
12
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
13
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
14
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
15
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
16
|
+
if (decorator = decorators[i])
|
|
17
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
18
|
+
if (kind && result)
|
|
19
|
+
__defProp(target, key, result);
|
|
20
|
+
return result;
|
|
21
|
+
};
|
|
22
|
+
const minLengthValidator = shapeshift.s.number.greaterThanOrEqual(0).lessThanOrEqual(6e3);
|
|
23
|
+
const maxLengthValidator = shapeshift.s.number.greaterThanOrEqual(1).lessThanOrEqual(6e3);
|
|
24
|
+
exports.SlashCommandStringOption = class extends ApplicationCommandOptionBase.ApplicationCommandOptionBase {
|
|
25
|
+
constructor() {
|
|
26
|
+
super(...arguments);
|
|
27
|
+
this.type = v10.ApplicationCommandOptionType.String;
|
|
28
|
+
}
|
|
29
|
+
setMaxLength(max) {
|
|
30
|
+
maxLengthValidator.parse(max);
|
|
31
|
+
Reflect.set(this, "max_length", max);
|
|
32
|
+
return this;
|
|
33
|
+
}
|
|
34
|
+
setMinLength(min) {
|
|
35
|
+
minLengthValidator.parse(min);
|
|
36
|
+
Reflect.set(this, "min_length", min);
|
|
37
|
+
return this;
|
|
38
|
+
}
|
|
39
|
+
toJSON() {
|
|
40
|
+
this.runRequiredValidations();
|
|
41
|
+
if (this.autocomplete && Array.isArray(this.choices) && this.choices.length > 0) {
|
|
42
|
+
throw new RangeError("Autocomplete and choices are mutually exclusive to each other.");
|
|
43
|
+
}
|
|
44
|
+
return { ...this };
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
exports.SlashCommandStringOption = __decorateClass([
|
|
48
|
+
tsMixer.mix(ApplicationCommandOptionWithChoicesAndAutocompleteMixin.ApplicationCommandOptionWithChoicesAndAutocompleteMixin)
|
|
49
|
+
], exports.SlashCommandStringOption);
|
|
50
|
+
//# sourceMappingURL=string.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"string.cjs","sources":["../../../../src/interactions/slashCommands/options/string.ts"],"sourcesContent":["import { s } from '@sapphire/shapeshift';\nimport { APIApplicationCommandStringOption, ApplicationCommandOptionType } from 'discord-api-types/v10';\nimport { mix } from 'ts-mixer';\nimport { ApplicationCommandOptionBase } from '../mixins/ApplicationCommandOptionBase';\nimport { ApplicationCommandOptionWithChoicesAndAutocompleteMixin } from '../mixins/ApplicationCommandOptionWithChoicesAndAutocompleteMixin';\n\nconst minLengthValidator = s.number.greaterThanOrEqual(0).lessThanOrEqual(6000);\nconst maxLengthValidator = s.number.greaterThanOrEqual(1).lessThanOrEqual(6000);\n\n@mix(ApplicationCommandOptionWithChoicesAndAutocompleteMixin)\nexport class SlashCommandStringOption extends ApplicationCommandOptionBase {\n\tpublic readonly type = ApplicationCommandOptionType.String as const;\n\tpublic readonly max_length?: number;\n\tpublic readonly min_length?: number;\n\n\t/**\n\t * Sets the maximum length of this string option.\n\t *\n\t * @param max - The maximum length this option can be\n\t */\n\tpublic setMaxLength(max: number): this {\n\t\tmaxLengthValidator.parse(max);\n\n\t\tReflect.set(this, 'max_length', max);\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the minimum length of this string option.\n\t *\n\t * @param min - The minimum length this option can be\n\t */\n\tpublic setMinLength(min: number): this {\n\t\tminLengthValidator.parse(min);\n\n\t\tReflect.set(this, 'min_length', min);\n\n\t\treturn this;\n\t}\n\n\tpublic toJSON(): APIApplicationCommandStringOption {\n\t\tthis.runRequiredValidations();\n\n\t\tif (this.autocomplete && Array.isArray(this.choices) && this.choices.length > 0) {\n\t\t\tthrow new RangeError('Autocomplete and choices are mutually exclusive to each other.');\n\t\t}\n\n\t\treturn { ...this };\n\t}\n}\n\nexport interface SlashCommandStringOption extends ApplicationCommandOptionWithChoicesAndAutocompleteMixin<string> {}\n"],"names":["s","SlashCommandStringOption","ApplicationCommandOptionBase","ApplicationCommandOptionType","mix","ApplicationCommandOptionWithChoicesAndAutocompleteMixin"],"mappings":";;;;;;;;;;AAAA,IAAI,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC;AACtC,IAAI,gBAAgB,GAAG,MAAM,CAAC,wBAAwB,CAAC;AACvD,IAAI,eAAe,GAAG,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,KAAK;AACzD,EAAE,IAAI,MAAM,GAAG,IAAI,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,IAAI,GAAG,gBAAgB,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC;AACjF,EAAE,KAAK,IAAI,CAAC,GAAG,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE,SAAS,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE;AAC5D,IAAI,IAAI,SAAS,GAAG,UAAU,CAAC,CAAC,CAAC;AACjC,MAAM,MAAM,GAAG,CAAC,IAAI,GAAG,SAAS,CAAC,MAAM,EAAE,GAAG,EAAE,MAAM,CAAC,GAAG,SAAS,CAAC,MAAM,CAAC,KAAK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AAM,IAAI,UAAU,CAAC,gEAAgE,CAAC,CAAC;AAC7F,KAAK;AACL,IAAI,OAAO,EAAE,GAAG,IAAI,EAAE,CAAC;AACvB,GAAG;AACH,EAAE;AACFF,gCAAwB,GAAG,eAAe,CAAC;AAC3C,EAAEG,WAAG,CAACC,+GAAuD,CAAC;AAC9D,CAAC,EAAEJ,gCAAwB,CAAC;;"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { APIApplicationCommandStringOption, ApplicationCommandOptionType } from 'discord-api-types/v10';
|
|
2
|
+
import { ApplicationCommandOptionBase } from '../mixins/ApplicationCommandOptionBase';
|
|
3
|
+
import { ApplicationCommandOptionWithChoicesAndAutocompleteMixin } from '../mixins/ApplicationCommandOptionWithChoicesAndAutocompleteMixin';
|
|
4
|
+
export declare class SlashCommandStringOption extends ApplicationCommandOptionBase {
|
|
5
|
+
readonly type: ApplicationCommandOptionType.String;
|
|
6
|
+
readonly max_length?: number;
|
|
7
|
+
readonly min_length?: number;
|
|
8
|
+
/**
|
|
9
|
+
* Sets the maximum length of this string option.
|
|
10
|
+
*
|
|
11
|
+
* @param max - The maximum length this option can be
|
|
12
|
+
*/
|
|
13
|
+
setMaxLength(max: number): this;
|
|
14
|
+
/**
|
|
15
|
+
* Sets the minimum length of this string option.
|
|
16
|
+
*
|
|
17
|
+
* @param min - The minimum length this option can be
|
|
18
|
+
*/
|
|
19
|
+
setMinLength(min: number): this;
|
|
20
|
+
toJSON(): APIApplicationCommandStringOption;
|
|
21
|
+
}
|
|
22
|
+
export interface SlashCommandStringOption extends ApplicationCommandOptionWithChoicesAndAutocompleteMixin<string> {
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=string.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"string.d.ts","sourceRoot":"","sources":["../../../../src/interactions/slashCommands/options/string.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iCAAiC,EAAE,4BAA4B,EAAE,MAAM,uBAAuB,CAAC;AAExG,OAAO,EAAE,4BAA4B,EAAE,MAAM,wCAAwC,CAAC;AACtF,OAAO,EAAE,uDAAuD,EAAE,MAAM,mEAAmE,CAAC;AAK5I,qBACa,wBAAyB,SAAQ,4BAA4B;IACzE,SAAgB,IAAI,sCAAgD;IACpE,SAAgB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpC,SAAgB,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpC;;;;OAIG;IACI,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAQtC;;;;OAIG;IACI,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAQ/B,MAAM,IAAI,iCAAiC;CASlD;AAED,MAAM,WAAW,wBAAyB,SAAQ,uDAAuD,CAAC,MAAM,CAAC;CAAG"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { s } from '@sapphire/shapeshift';
|
|
2
|
+
import { ApplicationCommandOptionType } from 'discord-api-types/v10';
|
|
3
|
+
import { mix } from 'ts-mixer';
|
|
4
|
+
import { ApplicationCommandOptionBase } from '../mixins/ApplicationCommandOptionBase.mjs';
|
|
5
|
+
import { ApplicationCommandOptionWithChoicesAndAutocompleteMixin } from '../mixins/ApplicationCommandOptionWithChoicesAndAutocompleteMixin.mjs';
|
|
6
|
+
|
|
7
|
+
var __defProp = Object.defineProperty;
|
|
8
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
9
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
10
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
11
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
12
|
+
if (decorator = decorators[i])
|
|
13
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
14
|
+
if (kind && result)
|
|
15
|
+
__defProp(target, key, result);
|
|
16
|
+
return result;
|
|
17
|
+
};
|
|
18
|
+
const minLengthValidator = s.number.greaterThanOrEqual(0).lessThanOrEqual(6e3);
|
|
19
|
+
const maxLengthValidator = s.number.greaterThanOrEqual(1).lessThanOrEqual(6e3);
|
|
20
|
+
let SlashCommandStringOption = class extends ApplicationCommandOptionBase {
|
|
21
|
+
constructor() {
|
|
22
|
+
super(...arguments);
|
|
23
|
+
this.type = ApplicationCommandOptionType.String;
|
|
24
|
+
}
|
|
25
|
+
setMaxLength(max) {
|
|
26
|
+
maxLengthValidator.parse(max);
|
|
27
|
+
Reflect.set(this, "max_length", max);
|
|
28
|
+
return this;
|
|
29
|
+
}
|
|
30
|
+
setMinLength(min) {
|
|
31
|
+
minLengthValidator.parse(min);
|
|
32
|
+
Reflect.set(this, "min_length", min);
|
|
33
|
+
return this;
|
|
34
|
+
}
|
|
35
|
+
toJSON() {
|
|
36
|
+
this.runRequiredValidations();
|
|
37
|
+
if (this.autocomplete && Array.isArray(this.choices) && this.choices.length > 0) {
|
|
38
|
+
throw new RangeError("Autocomplete and choices are mutually exclusive to each other.");
|
|
39
|
+
}
|
|
40
|
+
return { ...this };
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
SlashCommandStringOption = __decorateClass([
|
|
44
|
+
mix(ApplicationCommandOptionWithChoicesAndAutocompleteMixin)
|
|
45
|
+
], SlashCommandStringOption);
|
|
46
|
+
|
|
47
|
+
export { SlashCommandStringOption };
|
|
48
|
+
//# sourceMappingURL=string.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"string.mjs","sources":["../../../../src/interactions/slashCommands/options/string.ts"],"sourcesContent":["import { s } from '@sapphire/shapeshift';\nimport { APIApplicationCommandStringOption, ApplicationCommandOptionType } from 'discord-api-types/v10';\nimport { mix } from 'ts-mixer';\nimport { ApplicationCommandOptionBase } from '../mixins/ApplicationCommandOptionBase';\nimport { ApplicationCommandOptionWithChoicesAndAutocompleteMixin } from '../mixins/ApplicationCommandOptionWithChoicesAndAutocompleteMixin';\n\nconst minLengthValidator = s.number.greaterThanOrEqual(0).lessThanOrEqual(6000);\nconst maxLengthValidator = s.number.greaterThanOrEqual(1).lessThanOrEqual(6000);\n\n@mix(ApplicationCommandOptionWithChoicesAndAutocompleteMixin)\nexport class SlashCommandStringOption extends ApplicationCommandOptionBase {\n\tpublic readonly type = ApplicationCommandOptionType.String as const;\n\tpublic readonly max_length?: number;\n\tpublic readonly min_length?: number;\n\n\t/**\n\t * Sets the maximum length of this string option.\n\t *\n\t * @param max - The maximum length this option can be\n\t */\n\tpublic setMaxLength(max: number): this {\n\t\tmaxLengthValidator.parse(max);\n\n\t\tReflect.set(this, 'max_length', max);\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the minimum length of this string option.\n\t *\n\t * @param min - The minimum length this option can be\n\t */\n\tpublic setMinLength(min: number): this {\n\t\tminLengthValidator.parse(min);\n\n\t\tReflect.set(this, 'min_length', min);\n\n\t\treturn this;\n\t}\n\n\tpublic toJSON(): APIApplicationCommandStringOption {\n\t\tthis.runRequiredValidations();\n\n\t\tif (this.autocomplete && Array.isArray(this.choices) && this.choices.length > 0) {\n\t\t\tthrow new RangeError('Autocomplete and choices are mutually exclusive to each other.');\n\t\t}\n\n\t\treturn { ...this };\n\t}\n}\n\nexport interface SlashCommandStringOption extends ApplicationCommandOptionWithChoicesAndAutocompleteMixin<string> {}\n"],"names":[],"mappings":";;;;;;AAAA,IAAI,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC;AACtC,IAAI,gBAAgB,GAAG,MAAM,CAAC,wBAAwB,CAAC;AACvD,IAAI,eAAe,GAAG,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,KAAK;AACzD,EAAE,IAAI,MAAM,GAAG,IAAI,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,IAAI,GAAG,gBAAgB,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC;AACjF,EAAE,KAAK,IAAI,CAAC,GAAG,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE,SAAS,EAAE,CAAC,IA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,GAAG;AACX,IAAI,IAAI,CAAC,sBAAsB,EAAE,CAAC;AAClC,IAAI,IAAI,IAAI,CAAC,YAAY,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE;AACrF,MAAM,MAAM,IAAI,UAAU,CAAC,gEAAgE,CAAC,CAAC;AAC7F,KAAK;AACL,IAAI,OAAO,EAAE,GAAG,IAAI,EAAE,CAAC;AACvB,GAAG;AACH,EAAE;AACF,wBAAwB,GAAG,eAAe,CAAC;AAC3C,EAAE,GAAG,CAAC,uDAAuD,CAAC;AAC9D,CAAC,EAAE,wBAAwB,CAAC;;;;"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const v10 = require('discord-api-types/v10');
|
|
6
|
+
const ApplicationCommandOptionBase = require('../mixins/ApplicationCommandOptionBase.cjs');
|
|
7
|
+
|
|
8
|
+
class SlashCommandUserOption extends ApplicationCommandOptionBase.ApplicationCommandOptionBase {
|
|
9
|
+
constructor() {
|
|
10
|
+
super(...arguments);
|
|
11
|
+
this.type = v10.ApplicationCommandOptionType.User;
|
|
12
|
+
}
|
|
13
|
+
toJSON() {
|
|
14
|
+
this.runRequiredValidations();
|
|
15
|
+
return { ...this };
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
exports.SlashCommandUserOption = SlashCommandUserOption;
|
|
20
|
+
//# sourceMappingURL=user.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user.cjs","sources":["../../../../src/interactions/slashCommands/options/user.ts"],"sourcesContent":["import { APIApplicationCommandUserOption, ApplicationCommandOptionType } from 'discord-api-types/v10';\nimport { ApplicationCommandOptionBase } from '../mixins/ApplicationCommandOptionBase';\n\nexport class SlashCommandUserOption extends ApplicationCommandOptionBase {\n\tpublic readonly type = ApplicationCommandOptionType.User as const;\n\n\tpublic toJSON(): APIApplicationCommandUserOption {\n\t\tthis.runRequiredValidations();\n\n\t\treturn { ...this };\n\t}\n}\n"],"names":["ApplicationCommandOptionBase","ApplicationCommandOptionType"],"mappings":";;;;;;;AAEO,MAAM,sBAAsB,SAASA,yDAA4B,CAAC;AACzE,EAAE,WAAW,GAAG;AAChB,IAAI,KAAK,CAAC,GAAG,SAAS,CAAC,CAAC;AACxB,IAAI,IAAI,CAAC,IAAI,GAAGC,gCAA4B,CAAC,IAAI,CAAC;AAClD,GAAG;AACH,EAAE,MAAM,GAAG;AACX,IAAI,IAAI,CAAC,sBAAsB,EAAE,CAAC;AAClC,IAAI,OAAO,EAAE,GAAG,IAAI,EAAE,CAAC;AACvB,GAAG;AACH;;;;"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { APIApplicationCommandUserOption, ApplicationCommandOptionType } from 'discord-api-types/v10';
|
|
2
|
+
import { ApplicationCommandOptionBase } from '../mixins/ApplicationCommandOptionBase';
|
|
3
|
+
export declare class SlashCommandUserOption extends ApplicationCommandOptionBase {
|
|
4
|
+
readonly type: ApplicationCommandOptionType.User;
|
|
5
|
+
toJSON(): APIApplicationCommandUserOption;
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=user.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user.d.ts","sourceRoot":"","sources":["../../../../src/interactions/slashCommands/options/user.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,+BAA+B,EAAE,4BAA4B,EAAE,MAAM,uBAAuB,CAAC;AACtG,OAAO,EAAE,4BAA4B,EAAE,MAAM,wCAAwC,CAAC;AAEtF,qBAAa,sBAAuB,SAAQ,4BAA4B;IACvE,SAAgB,IAAI,oCAA8C;IAE3D,MAAM,IAAI,+BAA+B;CAKhD"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ApplicationCommandOptionType } from 'discord-api-types/v10';
|
|
2
|
+
import { ApplicationCommandOptionBase } from '../mixins/ApplicationCommandOptionBase.mjs';
|
|
3
|
+
|
|
4
|
+
class SlashCommandUserOption extends ApplicationCommandOptionBase {
|
|
5
|
+
constructor() {
|
|
6
|
+
super(...arguments);
|
|
7
|
+
this.type = ApplicationCommandOptionType.User;
|
|
8
|
+
}
|
|
9
|
+
toJSON() {
|
|
10
|
+
this.runRequiredValidations();
|
|
11
|
+
return { ...this };
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export { SlashCommandUserOption };
|
|
16
|
+
//# sourceMappingURL=user.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user.mjs","sources":["../../../../src/interactions/slashCommands/options/user.ts"],"sourcesContent":["import { APIApplicationCommandUserOption, ApplicationCommandOptionType } from 'discord-api-types/v10';\nimport { ApplicationCommandOptionBase } from '../mixins/ApplicationCommandOptionBase';\n\nexport class SlashCommandUserOption extends ApplicationCommandOptionBase {\n\tpublic readonly type = ApplicationCommandOptionType.User as const;\n\n\tpublic toJSON(): APIApplicationCommandUserOption {\n\t\tthis.runRequiredValidations();\n\n\t\treturn { ...this };\n\t}\n}\n"],"names":[],"mappings":";;;AAEO,MAAM,sBAAsB,SAAS,4BAA4B,CAAC;AACzE,EAAE,WAAW,GAAG;AAChB,IAAI,KAAK,CAAC,GAAG,SAAS,CAAC,CAAC;AACxB,IAAI,IAAI,CAAC,IAAI,GAAG,4BAA4B,CAAC,IAAI,CAAC;AAClD,GAAG;AACH,EAAE,MAAM,GAAG;AACX,IAAI,IAAI,CAAC,sBAAsB,EAAE,CAAC;AAClC,IAAI,OAAO,EAAE,GAAG,IAAI,EAAE,CAAC;AACvB,GAAG;AACH;;;;"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const shapeshift = require('@sapphire/shapeshift');
|
|
6
|
+
const validation = require('../../util/validation.cjs');
|
|
7
|
+
|
|
8
|
+
const fieldNamePredicate = shapeshift.s.string.lengthGreaterThanOrEqual(1).lengthLessThanOrEqual(256).setValidationEnabled(validation.isValidationEnabled);
|
|
9
|
+
const fieldValuePredicate = shapeshift.s.string.lengthGreaterThanOrEqual(1).lengthLessThanOrEqual(1024).setValidationEnabled(validation.isValidationEnabled);
|
|
10
|
+
const fieldInlinePredicate = shapeshift.s.boolean.optional;
|
|
11
|
+
const embedFieldPredicate = shapeshift.s.object({
|
|
12
|
+
name: fieldNamePredicate,
|
|
13
|
+
value: fieldValuePredicate,
|
|
14
|
+
inline: fieldInlinePredicate
|
|
15
|
+
}).setValidationEnabled(validation.isValidationEnabled);
|
|
16
|
+
const embedFieldsArrayPredicate = embedFieldPredicate.array.setValidationEnabled(validation.isValidationEnabled);
|
|
17
|
+
const fieldLengthPredicate = shapeshift.s.number.lessThanOrEqual(25).setValidationEnabled(validation.isValidationEnabled);
|
|
18
|
+
function validateFieldLength(amountAdding, fields) {
|
|
19
|
+
fieldLengthPredicate.parse((fields?.length ?? 0) + amountAdding);
|
|
20
|
+
}
|
|
21
|
+
const authorNamePredicate = fieldNamePredicate.nullable.setValidationEnabled(validation.isValidationEnabled);
|
|
22
|
+
const imageURLPredicate = shapeshift.s.string.url({
|
|
23
|
+
allowedProtocols: ["http:", "https:", "attachment:"]
|
|
24
|
+
}).nullish.setValidationEnabled(validation.isValidationEnabled);
|
|
25
|
+
const urlPredicate = shapeshift.s.string.url({
|
|
26
|
+
allowedProtocols: ["http:", "https:"]
|
|
27
|
+
}).nullish.setValidationEnabled(validation.isValidationEnabled);
|
|
28
|
+
const embedAuthorPredicate = shapeshift.s.object({
|
|
29
|
+
name: authorNamePredicate,
|
|
30
|
+
iconURL: imageURLPredicate,
|
|
31
|
+
url: urlPredicate
|
|
32
|
+
}).setValidationEnabled(validation.isValidationEnabled);
|
|
33
|
+
const RGBPredicate = shapeshift.s.number.int.greaterThanOrEqual(0).lessThanOrEqual(255).setValidationEnabled(validation.isValidationEnabled);
|
|
34
|
+
const colorPredicate = shapeshift.s.number.int.greaterThanOrEqual(0).lessThanOrEqual(16777215).or(shapeshift.s.tuple([RGBPredicate, RGBPredicate, RGBPredicate])).nullable.setValidationEnabled(validation.isValidationEnabled);
|
|
35
|
+
const descriptionPredicate = shapeshift.s.string.lengthGreaterThanOrEqual(1).lengthLessThanOrEqual(4096).nullable.setValidationEnabled(validation.isValidationEnabled);
|
|
36
|
+
const footerTextPredicate = shapeshift.s.string.lengthGreaterThanOrEqual(1).lengthLessThanOrEqual(2048).nullable.setValidationEnabled(validation.isValidationEnabled);
|
|
37
|
+
const embedFooterPredicate = shapeshift.s.object({
|
|
38
|
+
text: footerTextPredicate,
|
|
39
|
+
iconURL: imageURLPredicate
|
|
40
|
+
}).setValidationEnabled(validation.isValidationEnabled);
|
|
41
|
+
const timestampPredicate = shapeshift.s.union(shapeshift.s.number, shapeshift.s.date).nullable.setValidationEnabled(validation.isValidationEnabled);
|
|
42
|
+
const titlePredicate = fieldNamePredicate.nullable.setValidationEnabled(validation.isValidationEnabled);
|
|
43
|
+
|
|
44
|
+
exports.RGBPredicate = RGBPredicate;
|
|
45
|
+
exports.authorNamePredicate = authorNamePredicate;
|
|
46
|
+
exports.colorPredicate = colorPredicate;
|
|
47
|
+
exports.descriptionPredicate = descriptionPredicate;
|
|
48
|
+
exports.embedAuthorPredicate = embedAuthorPredicate;
|
|
49
|
+
exports.embedFieldPredicate = embedFieldPredicate;
|
|
50
|
+
exports.embedFieldsArrayPredicate = embedFieldsArrayPredicate;
|
|
51
|
+
exports.embedFooterPredicate = embedFooterPredicate;
|
|
52
|
+
exports.fieldInlinePredicate = fieldInlinePredicate;
|
|
53
|
+
exports.fieldLengthPredicate = fieldLengthPredicate;
|
|
54
|
+
exports.fieldNamePredicate = fieldNamePredicate;
|
|
55
|
+
exports.fieldValuePredicate = fieldValuePredicate;
|
|
56
|
+
exports.footerTextPredicate = footerTextPredicate;
|
|
57
|
+
exports.imageURLPredicate = imageURLPredicate;
|
|
58
|
+
exports.timestampPredicate = timestampPredicate;
|
|
59
|
+
exports.titlePredicate = titlePredicate;
|
|
60
|
+
exports.urlPredicate = urlPredicate;
|
|
61
|
+
exports.validateFieldLength = validateFieldLength;
|
|
62
|
+
//# sourceMappingURL=Assertions.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Assertions.cjs","sources":["../../../src/messages/embed/Assertions.ts"],"sourcesContent":["import { s } from '@sapphire/shapeshift';\nimport type { APIEmbedField } from 'discord-api-types/v10';\nimport { isValidationEnabled } from '../../util/validation';\n\nexport const fieldNamePredicate = s.string\n\t.lengthGreaterThanOrEqual(1)\n\t.lengthLessThanOrEqual(256)\n\t.setValidationEnabled(isValidationEnabled);\n\nexport const fieldValuePredicate = s.string\n\t.lengthGreaterThanOrEqual(1)\n\t.lengthLessThanOrEqual(1024)\n\t.setValidationEnabled(isValidationEnabled);\n\nexport const fieldInlinePredicate = s.boolean.optional;\n\nexport const embedFieldPredicate = s\n\t.object({\n\t\tname: fieldNamePredicate,\n\t\tvalue: fieldValuePredicate,\n\t\tinline: fieldInlinePredicate,\n\t})\n\t.setValidationEnabled(isValidationEnabled);\n\nexport const embedFieldsArrayPredicate = embedFieldPredicate.array.setValidationEnabled(isValidationEnabled);\n\nexport const fieldLengthPredicate = s.number.lessThanOrEqual(25).setValidationEnabled(isValidationEnabled);\n\nexport function validateFieldLength(amountAdding: number, fields?: APIEmbedField[]): void {\n\tfieldLengthPredicate.parse((fields?.length ?? 0) + amountAdding);\n}\n\nexport const authorNamePredicate = fieldNamePredicate.nullable.setValidationEnabled(isValidationEnabled);\n\nexport const imageURLPredicate = s.string\n\t.url({\n\t\tallowedProtocols: ['http:', 'https:', 'attachment:'],\n\t})\n\t.nullish.setValidationEnabled(isValidationEnabled);\n\nexport const urlPredicate = s.string\n\t.url({\n\t\tallowedProtocols: ['http:', 'https:'],\n\t})\n\t.nullish.setValidationEnabled(isValidationEnabled);\n\nexport const embedAuthorPredicate = s\n\t.object({\n\t\tname: authorNamePredicate,\n\t\ticonURL: imageURLPredicate,\n\t\turl: urlPredicate,\n\t})\n\t.setValidationEnabled(isValidationEnabled);\n\nexport const RGBPredicate = s.number.int\n\t.greaterThanOrEqual(0)\n\t.lessThanOrEqual(255)\n\t.setValidationEnabled(isValidationEnabled);\nexport const colorPredicate = s.number.int\n\t.greaterThanOrEqual(0)\n\t.lessThanOrEqual(0xffffff)\n\t.or(s.tuple([RGBPredicate, RGBPredicate, RGBPredicate]))\n\t.nullable.setValidationEnabled(isValidationEnabled);\n\nexport const descriptionPredicate = s.string\n\t.lengthGreaterThanOrEqual(1)\n\t.lengthLessThanOrEqual(4096)\n\t.nullable.setValidationEnabled(isValidationEnabled);\n\nexport const footerTextPredicate = s.string\n\t.lengthGreaterThanOrEqual(1)\n\t.lengthLessThanOrEqual(2048)\n\t.nullable.setValidationEnabled(isValidationEnabled);\n\nexport const embedFooterPredicate = s\n\t.object({\n\t\ttext: footerTextPredicate,\n\t\ticonURL: imageURLPredicate,\n\t})\n\t.setValidationEnabled(isValidationEnabled);\n\nexport const timestampPredicate = s.union(s.number, s.date).nullable.setValidationEnabled(isValidationEnabled);\n\nexport const titlePredicate = fieldNamePredicate.nullable.setValidationEnabled(isValidationEnabled);\n"],"names":["s","isValidationEnabled"],"mappings":";;;;;;;AAEY,MAAC,kBAAkB,GAAGA,YAAC,CAAC,MAAM,CAAC,wBAAwB,CAAC,CAAC,CAAC,CAAC,qBAAqB,CAAC,GAAG,CAAC,CAAC,oBAAoB,CAACC,8BAAmB,EAAE;AAChI,MAAC,mBAAmB,GAAGD,YAAC,CAAC,MAAM,CAAC,wBAAwB,CAAC,CAAC,CAAC,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAC,oBAAoB,CAACC,8BAAmB,EAAE;AAClI,MAAC,oBAAoB,GAAGD,YAAC,CAAC,OAAO,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ord-api-types/v10';
|
|
2
|
+
export declare const fieldNamePredicate: import("@sapphire/shapeshift").StringValidator<string>;
|
|
3
|
+
export declare const fieldValuePredicate: import("@sapphire/shapeshift").StringValidator<string>;
|
|
4
|
+
export declare const fieldInlinePredicate: import("@sapphire/shapeshift").UnionValidator<boolean | undefined>;
|
|
5
|
+
export declare const embedFieldPredicate: import("@sapphire/shapeshift").ObjectValidator<{
|
|
6
|
+
name: string;
|
|
7
|
+
value: string;
|
|
8
|
+
inline: boolean | undefined;
|
|
9
|
+
}, import("@sapphire/shapeshift").UndefinedToOptional<{
|
|
10
|
+
name: string;
|
|
11
|
+
value: string;
|
|
12
|
+
inline: boolean | undefined;
|
|
13
|
+
}>>;
|
|
14
|
+
export declare const embedFieldsArrayPredicate: import("@sapphire/shapeshift").ArrayValidator<import("@sapphire/shapeshift").UndefinedToOptional<{
|
|
15
|
+
name: string;
|
|
16
|
+
value: string;
|
|
17
|
+
inline: boolean | undefined;
|
|
18
|
+
}>[], import("@sapphire/shapeshift").UndefinedToOptional<{
|
|
19
|
+
name: string;
|
|
20
|
+
value: string;
|
|
21
|
+
inline: boolean | undefined;
|
|
22
|
+
}>>;
|
|
23
|
+
export declare const fieldLengthPredicate: import("@sapphire/shapeshift").NumberValidator<number>;
|
|
24
|
+
export declare function validateFieldLength(amountAdding: number, fields?: APIEmbedField[]): void;
|
|
25
|
+
export declare const authorNamePredicate: import("@sapphire/shapeshift").UnionValidator<string | null>;
|
|
26
|
+
export declare const imageURLPredicate: import("@sapphire/shapeshift").UnionValidator<string | null | undefined>;
|
|
27
|
+
export declare const urlPredicate: import("@sapphire/shapeshift").UnionValidator<string | null | undefined>;
|
|
28
|
+
export declare const embedAuthorPredicate: import("@sapphire/shapeshift").ObjectValidator<{
|
|
29
|
+
name: string | null;
|
|
30
|
+
iconURL: string | null | undefined;
|
|
31
|
+
url: string | null | undefined;
|
|
32
|
+
}, import("@sapphire/shapeshift").UndefinedToOptional<{
|
|
33
|
+
name: string | null;
|
|
34
|
+
iconURL: string | null | undefined;
|
|
35
|
+
url: string | null | undefined;
|
|
36
|
+
}>>;
|
|
37
|
+
export declare const RGBPredicate: import("@sapphire/shapeshift").NumberValidator<number>;
|
|
38
|
+
export declare const colorPredicate: import("@sapphire/shapeshift").UnionValidator<number | [number, number, number] | null>;
|
|
39
|
+
export declare const descriptionPredicate: import("@sapphire/shapeshift").UnionValidator<string | null>;
|
|
40
|
+
export declare const footerTextPredicate: import("@sapphire/shapeshift").UnionValidator<string | null>;
|
|
41
|
+
export declare const embedFooterPredicate: import("@sapphire/shapeshift").ObjectValidator<{
|
|
42
|
+
text: string | null;
|
|
43
|
+
iconURL: string | null | undefined;
|
|
44
|
+
}, import("@sapphire/shapeshift").UndefinedToOptional<{
|
|
45
|
+
text: string | null;
|
|
46
|
+
iconURL: string | null | undefined;
|
|
47
|
+
}>>;
|
|
48
|
+
export declare const timestampPredicate: import("@sapphire/shapeshift").UnionValidator<number | Date | null>;
|
|
49
|
+
export declare const titlePredicate: import("@sapphire/shapeshift").UnionValidator<string | null>;
|
|
50
|
+
//# sourceMappingURL=Assertions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Assertions.d.ts","sourceRoot":"","sources":["../../../src/messages/embed/Assertions.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAG3D,eAAO,MAAM,kBAAkB,wDAGY,CAAC;AAE5C,eAAO,MAAM,mBAAmB,wDAGW,CAAC;AAE5C,eAAO,MAAM,oBAAoB,oEAAqB,CAAC;AAEvD,eAAO,MAAM,mBAAmB;;;;;;;;GAMW,CAAC;AAE5C,eAAO,MAAM,yBAAyB;;;;;;;;GAAsE,CAAC;AAE7G,eAAO,MAAM,oBAAoB,wDAAyE,CAAC;AAE3G,wBAAgB,mBAAmB,CAAC,YAAY,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,aAAa,EAAE,GAAG,IAAI,CAExF;AAED,eAAO,MAAM,mBAAmB,8DAAwE,CAAC;AAEzG,eAAO,MAAM,iBAAiB,0EAIqB,CAAC;AAEpD,eAAO,MAAM,YAAY,0EAI0B,CAAC;AAEpD,eAAO,MAAM,oBAAoB;;;;;;;;GAMU,CAAC;AAE5C,eAAO,MAAM,YAAY,wDAGkB,CAAC;AAC5C,eAAO,MAAM,cAAc,yFAIyB,CAAC;AAErD,eAAO,MAAM,oBAAoB,8DAGmB,CAAC;AAErD,eAAO,MAAM,mBAAmB,8DAGoB,CAAC;AAErD,eAAO,MAAM,oBAAoB;;;;;;GAKU,CAAC;AAE5C,eAAO,MAAM,kBAAkB,qEAA+E,CAAC;AAE/G,eAAO,MAAM,cAAc,8DAAwE,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { s } from '@sapphire/shapeshift';
|
|
2
|
+
import { isValidationEnabled } from '../../util/validation.mjs';
|
|
3
|
+
|
|
4
|
+
const fieldNamePredicate = s.string.lengthGreaterThanOrEqual(1).lengthLessThanOrEqual(256).setValidationEnabled(isValidationEnabled);
|
|
5
|
+
const fieldValuePredicate = s.string.lengthGreaterThanOrEqual(1).lengthLessThanOrEqual(1024).setValidationEnabled(isValidationEnabled);
|
|
6
|
+
const fieldInlinePredicate = s.boolean.optional;
|
|
7
|
+
const embedFieldPredicate = s.object({
|
|
8
|
+
name: fieldNamePredicate,
|
|
9
|
+
value: fieldValuePredicate,
|
|
10
|
+
inline: fieldInlinePredicate
|
|
11
|
+
}).setValidationEnabled(isValidationEnabled);
|
|
12
|
+
const embedFieldsArrayPredicate = embedFieldPredicate.array.setValidationEnabled(isValidationEnabled);
|
|
13
|
+
const fieldLengthPredicate = s.number.lessThanOrEqual(25).setValidationEnabled(isValidationEnabled);
|
|
14
|
+
function validateFieldLength(amountAdding, fields) {
|
|
15
|
+
fieldLengthPredicate.parse((fields?.length ?? 0) + amountAdding);
|
|
16
|
+
}
|
|
17
|
+
const authorNamePredicate = fieldNamePredicate.nullable.setValidationEnabled(isValidationEnabled);
|
|
18
|
+
const imageURLPredicate = s.string.url({
|
|
19
|
+
allowedProtocols: ["http:", "https:", "attachment:"]
|
|
20
|
+
}).nullish.setValidationEnabled(isValidationEnabled);
|
|
21
|
+
const urlPredicate = s.string.url({
|
|
22
|
+
allowedProtocols: ["http:", "https:"]
|
|
23
|
+
}).nullish.setValidationEnabled(isValidationEnabled);
|
|
24
|
+
const embedAuthorPredicate = s.object({
|
|
25
|
+
name: authorNamePredicate,
|
|
26
|
+
iconURL: imageURLPredicate,
|
|
27
|
+
url: urlPredicate
|
|
28
|
+
}).setValidationEnabled(isValidationEnabled);
|
|
29
|
+
const RGBPredicate = s.number.int.greaterThanOrEqual(0).lessThanOrEqual(255).setValidationEnabled(isValidationEnabled);
|
|
30
|
+
const colorPredicate = s.number.int.greaterThanOrEqual(0).lessThanOrEqual(16777215).or(s.tuple([RGBPredicate, RGBPredicate, RGBPredicate])).nullable.setValidationEnabled(isValidationEnabled);
|
|
31
|
+
const descriptionPredicate = s.string.lengthGreaterThanOrEqual(1).lengthLessThanOrEqual(4096).nullable.setValidationEnabled(isValidationEnabled);
|
|
32
|
+
const footerTextPredicate = s.string.lengthGreaterThanOrEqual(1).lengthLessThanOrEqual(2048).nullable.setValidationEnabled(isValidationEnabled);
|
|
33
|
+
const embedFooterPredicate = s.object({
|
|
34
|
+
text: footerTextPredicate,
|
|
35
|
+
iconURL: imageURLPredicate
|
|
36
|
+
}).setValidationEnabled(isValidationEnabled);
|
|
37
|
+
const timestampPredicate = s.union(s.number, s.date).nullable.setValidationEnabled(isValidationEnabled);
|
|
38
|
+
const titlePredicate = fieldNamePredicate.nullable.setValidationEnabled(isValidationEnabled);
|
|
39
|
+
|
|
40
|
+
export { RGBPredicate, authorNamePredicate, colorPredicate, descriptionPredicate, embedAuthorPredicate, embedFieldPredicate, embedFieldsArrayPredicate, embedFooterPredicate, fieldInlinePredicate, fieldLengthPredicate, fieldNamePredicate, fieldValuePredicate, footerTextPredicate, imageURLPredicate, timestampPredicate, titlePredicate, urlPredicate, validateFieldLength };
|
|
41
|
+
//# sourceMappingURL=Assertions.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Assertions.mjs","sources":["../../../src/messages/embed/Assertions.ts"],"sourcesContent":["import { s } from '@sapphire/shapeshift';\nimport type { APIEmbedField } from 'discord-api-types/v10';\nimport { isValidationEnabled } from '../../util/validation';\n\nexport const fieldNamePredicate = s.string\n\t.lengthGreaterThanOrEqual(1)\n\t.lengthLessThanOrEqual(256)\n\t.setValidationEnabled(isValidationEnabled);\n\nexport const fieldValuePredicate = s.string\n\t.lengthGreaterThanOrEqual(1)\n\t.lengthLessThanOrEqual(1024)\n\t.setValidationEnabled(isValidationEnabled);\n\nexport const fieldInlinePredicate = s.boolean.optional;\n\nexport const embedFieldPredicate = s\n\t.object({\n\t\tname: fieldNamePredicate,\n\t\tvalue: fieldValuePredicate,\n\t\tinline: fieldInlinePredicate,\n\t})\n\t.setValidationEnabled(isValidationEnabled);\n\nexport const embedFieldsArrayPredicate = embedFieldPredicate.array.setValidationEnabled(isValidationEnabled);\n\nexport const fieldLengthPredicate = s.number.lessThanOrEqual(25).setValidationEnabled(isValidationEnabled);\n\nexport function validateFieldLength(amountAdding: number, fields?: APIEmbedField[]): void {\n\tfieldLengthPredicate.parse((fields?.length ?? 0) + amountAdding);\n}\n\nexport const authorNamePredicate = fieldNamePredicate.nullable.setValidationEnabled(isValidationEnabled);\n\nexport const imageURLPredicate = s.string\n\t.url({\n\t\tallowedProtocols: ['http:', 'https:', 'attachment:'],\n\t})\n\t.nullish.setValidationEnabled(isValidationEnabled);\n\nexport const urlPredicate = s.string\n\t.url({\n\t\tallowedProtocols: ['http:', 'https:'],\n\t})\n\t.nullish.setValidationEnabled(isValidationEnabled);\n\nexport const embedAuthorPredicate = s\n\t.object({\n\t\tname: authorNamePredicate,\n\t\ticonURL: imageURLPredicate,\n\t\turl: urlPredicate,\n\t})\n\t.setValidationEnabled(isValidationEnabled);\n\nexport const RGBPredicate = s.number.int\n\t.greaterThanOrEqual(0)\n\t.lessThanOrEqual(255)\n\t.setValidationEnabled(isValidationEnabled);\nexport const colorPredicate = s.number.int\n\t.greaterThanOrEqual(0)\n\t.lessThanOrEqual(0xffffff)\n\t.or(s.tuple([RGBPredicate, RGBPredicate, RGBPredicate]))\n\t.nullable.setValidationEnabled(isValidationEnabled);\n\nexport const descriptionPredicate = s.string\n\t.lengthGreaterThanOrEqual(1)\n\t.lengthLessThanOrEqual(4096)\n\t.nullable.setValidationEnabled(isValidationEnabled);\n\nexport const footerTextPredicate = s.string\n\t.lengthGreaterThanOrEqual(1)\n\t.lengthLessThanOrEqual(2048)\n\t.nullable.setValidationEnabled(isValidationEnabled);\n\nexport const embedFooterPredicate = s\n\t.object({\n\t\ttext: footerTextPredicate,\n\t\ticonURL: imageURLPredicate,\n\t})\n\t.setValidationEnabled(isValidationEnabled);\n\nexport const timestampPredicate = s.union(s.number, s.date).nullable.setValidationEnabled(isValidationEnabled);\n\nexport const titlePredicate = fieldNamePredicate.nullable.setValidationEnabled(isValidationEnabled);\n"],"names":[],"mappings":";;;AAEY,MAAC,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC,wBAAwB,CAAC,CAAC,CAAC,CAAC,qBAAqB,CAAC,GAAG,CAAC,CAAC,oBAAoB,CAAC,mBAAmB,EAAE;AAChI,MAAC,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC,wBAAwB,CAAC,CAAC,CAAC,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAC,oBAAoB,CAAC,mBAAmB,EAAE;AAClI,MAAC,oBAAoB,GAAG,CAAC,CAAC,OAAO,CAAC,SAAS;AAC3C,MAAC,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;AAC5C,EAAE,IAAI,EAAE,kBAAkB;AAC1B,EAAE,KAAK,EAAE,mBAAmB;AAC5B,EAAE,MAAM,EAAE,oBAAoB;AAC9B,CAAC,CAAC,CAAC,oB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C,MAAM,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,YAAY,EAAE,YAAY,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,oBAAoB,CAAC,mBAAmB,EAAE;AAC1L,MAAC,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC,wBAAwB,CAAC,CAAC,CAAC,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,oBAAoB,CAAC,mBAAmB,EAAE;AAC5I,MAAC,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC,wBAAwB,CAAC,CAAC,CAAC,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,oBAAoB,CAAC,mBAAmB,EAAE;AAC3I,MAAC,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;AAC7C,EAAE,IAAI,EAAE,mBAAmB;AAC3B,EAAE,OAAO,EAAE,iBAAiB;AAC5B,CAAC,CAAC,CAAC,oBAAoB,CAAC,mBAAmB,EAAE;AACjC,MAAC,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,oBAAoB,CAAC,mBAAmB,EAAE;AACnG,MAAC,cAAc,GAAG,kBAAkB,CAAC,QAAQ,CAAC,oBAAoB,CAAC,mBAAmB;;;;"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const Assertions = require('./Assertions.cjs');
|
|
6
|
+
const normalizeArray = require('../../util/normalizeArray.cjs');
|
|
7
|
+
|
|
8
|
+
class EmbedBuilder {
|
|
9
|
+
constructor(data = {}) {
|
|
10
|
+
this.data = { ...data };
|
|
11
|
+
if (data.timestamp)
|
|
12
|
+
this.data.timestamp = new Date(data.timestamp).toISOString();
|
|
13
|
+
}
|
|
14
|
+
addFields(...fields) {
|
|
15
|
+
fields = normalizeArray.normalizeArray(fields);
|
|
16
|
+
Assertions.validateFieldLength(fields.length, this.data.fields);
|
|
17
|
+
Assertions.embedFieldsArrayPredicate.parse(fields);
|
|
18
|
+
if (this.data.fields)
|
|
19
|
+
this.data.fields.push(...fields);
|
|
20
|
+
else
|
|
21
|
+
this.data.fields = fields;
|
|
22
|
+
return this;
|
|
23
|
+
}
|
|
24
|
+
spliceFields(index, deleteCount, ...fields) {
|
|
25
|
+
Assertions.validateFieldLength(fields.length - deleteCount, this.data.fields);
|
|
26
|
+
Assertions.embedFieldsArrayPredicate.parse(fields);
|
|
27
|
+
if (this.data.fields)
|
|
28
|
+
this.data.fields.splice(index, deleteCount, ...fields);
|
|
29
|
+
else
|
|
30
|
+
this.data.fields = fields;
|
|
31
|
+
return this;
|
|
32
|
+
}
|
|
33
|
+
setFields(...fields) {
|
|
34
|
+
this.spliceFields(0, this.data.fields?.length ?? 0, ...normalizeArray.normalizeArray(fields));
|
|
35
|
+
return this;
|
|
36
|
+
}
|
|
37
|
+
setAuthor(options) {
|
|
38
|
+
if (options === null) {
|
|
39
|
+
this.data.author = void 0;
|
|
40
|
+
return this;
|
|
41
|
+
}
|
|
42
|
+
Assertions.embedAuthorPredicate.parse(options);
|
|
43
|
+
this.data.author = { name: options.name, url: options.url, icon_url: options.iconURL };
|
|
44
|
+
return this;
|
|
45
|
+
}
|
|
46
|
+
setColor(color) {
|
|
47
|
+
Assertions.colorPredicate.parse(color);
|
|
48
|
+
if (Array.isArray(color)) {
|
|
49
|
+
const [red, green, blue] = color;
|
|
50
|
+
this.data.color = (red << 16) + (green << 8) + blue;
|
|
51
|
+
return this;
|
|
52
|
+
}
|
|
53
|
+
this.data.color = color ?? void 0;
|
|
54
|
+
return this;
|
|
55
|
+
}
|
|
56
|
+
setDescription(description) {
|
|
57
|
+
Assertions.descriptionPredicate.parse(description);
|
|
58
|
+
this.data.description = description ?? void 0;
|
|
59
|
+
return this;
|
|
60
|
+
}
|
|
61
|
+
setFooter(options) {
|
|
62
|
+
if (options === null) {
|
|
63
|
+
this.data.footer = void 0;
|
|
64
|
+
return this;
|
|
65
|
+
}
|
|
66
|
+
Assertions.embedFooterPredicate.parse(options);
|
|
67
|
+
this.data.footer = { text: options.text, icon_url: options.iconURL };
|
|
68
|
+
return this;
|
|
69
|
+
}
|
|
70
|
+
setImage(url) {
|
|
71
|
+
Assertions.imageURLPredicate.parse(url);
|
|
72
|
+
this.data.image = url ? { url } : void 0;
|
|
73
|
+
return this;
|
|
74
|
+
}
|
|
75
|
+
setThumbnail(url) {
|
|
76
|
+
Assertions.imageURLPredicate.parse(url);
|
|
77
|
+
this.data.thumbnail = url ? { url } : void 0;
|
|
78
|
+
return this;
|
|
79
|
+
}
|
|
80
|
+
setTimestamp(timestamp = Date.now()) {
|
|
81
|
+
Assertions.timestampPredicate.parse(timestamp);
|
|
82
|
+
this.data.timestamp = timestamp ? new Date(timestamp).toISOString() : void 0;
|
|
83
|
+
return this;
|
|
84
|
+
}
|
|
85
|
+
setTitle(title) {
|
|
86
|
+
Assertions.titlePredicate.parse(title);
|
|
87
|
+
this.data.title = title ?? void 0;
|
|
88
|
+
return this;
|
|
89
|
+
}
|
|
90
|
+
setURL(url) {
|
|
91
|
+
Assertions.urlPredicate.parse(url);
|
|
92
|
+
this.data.url = url ?? void 0;
|
|
93
|
+
return this;
|
|
94
|
+
}
|
|
95
|
+
toJSON() {
|
|
96
|
+
return { ...this.data };
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
exports.EmbedBuilder = EmbedBuilder;
|
|
101
|
+
//# sourceMappingURL=Embed.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Embed.cjs","sources":["../../../src/messages/embed/Embed.ts"],"sourcesContent":["import type { APIEmbed, APIEmbedAuthor, APIEmbedField, APIEmbedFooter, APIEmbedImage } from 'discord-api-types/v10';\nimport {\n\tcolorPredicate,\n\tdescriptionPredicate,\n\tembedAuthorPredicate,\n\tembedFieldsArrayPredicate,\n\tembedFooterPredicate,\n\timageURLPredicate,\n\ttimestampPredicate,\n\ttitlePredicate,\n\turlPredicate,\n\tvalidateFieldLength,\n} from './Assertions';\nimport { normalizeArray, type RestOrArray } from '../../util/normalizeArray';\n\nexport type RGBTuple = [red: number, green: number, blue: number];\n\nexport interface IconData {\n\t/**\n\t * The URL of the icon\n\t */\n\ticonURL?: string;\n\t/**\n\t * The proxy URL of the icon\n\t */\n\tproxyIconURL?: string;\n}\n\nexport type EmbedAuthorData = Omit<APIEmbedAuthor, 'icon_url' | 'proxy_icon_url'> & IconData;\n\nexport type EmbedAuthorOptions = Omit<EmbedAuthorData, 'proxyIconURL'>;\n\nexport type EmbedFooterData = Omit<APIEmbedFooter, 'icon_url' | 'proxy_icon_url'> & IconData;\n\nexport type EmbedFooterOptions = Omit<EmbedFooterData, 'proxyIconURL'>;\n\nexport interface EmbedImageData extends Omit<APIEmbedImage, 'proxy_url'> {\n\t/**\n\t * The proxy URL for the image\n\t */\n\tproxyURL?: string;\n}\n/**\n * Represents a embed in a message (image/video preview, rich embed, etc.)\n */\nexport class EmbedBuilder {\n\tpublic readonly data: APIEmbed;\n\n\tpublic constructor(data: APIEmbed = {}) {\n\t\tthis.data = { ...data };\n\t\tif (data.timestamp) this.data.timestamp = new Date(data.timestamp).toISOString();\n\t}\n\n\t/**\n\t * Adds fields to the embed (max 25)\n\t *\n\t * @param fields The fields to add\n\t */\n\tpublic addFields(...fields: RestOrArray<APIEmbedField>): this {\n\t\tfields = normalizeArray(fields);\n\t\t// Ensure adding these fields won't exceed the 25 field limit\n\t\tvalidateFieldLength(fields.length, this.data.fields);\n\n\t\t// Data assertions\n\t\tembedFieldsArrayPredicate.parse(fields);\n\n\t\tif (this.data.fields) this.data.fields.push(...fields);\n\t\telse this.data.fields = fields;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Removes, replaces, or inserts fields in the embed (max 25)\n\t *\n\t * @param index The index to start at\n\t * @param deleteCount The number of fields to remove\n\t * @param fields The replacing field objects\n\t */\n\tpublic spliceFields(index: number, deleteCount: number, ...fields: APIEmbedField[]): this {\n\t\t// Ensure adding these fields won't exceed the 25 field limit\n\t\tvalidateFieldLength(fields.length - deleteCount, this.data.fields);\n\n\t\t// Data assertions\n\t\tembedFieldsArrayPredicate.parse(fields);\n\t\tif (this.data.fields) this.data.fields.splice(index, deleteCount, ...fields);\n\t\telse this.data.fields = fields;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the embed's fields (max 25).\n\t * @param fields The fields to set\n\t */\n\tpublic setFields(...fields: RestOrArray<APIEmbedField>) {\n\t\tthis.spliceFields(0, this.data.fields?.length ?? 0, ...normalizeArray(fields));\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the author of this embed\n\t *\n\t * @param options The options for the author\n\t */\n\n\tpublic setAuthor(options: EmbedAuthorOptions | null): this {\n\t\tif (options === null) {\n\t\t\tthis.data.author = undefined;\n\t\t\treturn this;\n\t\t}\n\n\t\t// Data assertions\n\t\tembedAuthorPredicate.parse(options);\n\n\t\tthis.data.author = { name: options.name, url: options.url, icon_url: options.iconURL };\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the color of this embed\n\t *\n\t * @param color The color of the embed\n\t */\n\tpublic setColor(color: number | RGBTuple | null): this {\n\t\t// Data assertions\n\t\tcolorPredicate.parse(color);\n\n\t\tif (Array.isArray(color)) {\n\t\t\tconst [red, green, blue] = color;\n\t\t\tthis.data.color = (red << 16) + (green << 8) + blue;\n\t\t\treturn this;\n\t\t}\n\t\tthis.data.color = color ?? undefined;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the description of this embed\n\t *\n\t * @param description The description\n\t */\n\tpublic setDescription(description: string | null): this {\n\t\t// Data assertions\n\t\tdescriptionPredicate.parse(description);\n\n\t\tthis.data.description = description ?? undefined;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the footer of this embed\n\t *\n\t * @param options The options for the footer\n\t */\n\tpublic setFooter(options: EmbedFooterOptions | null): this {\n\t\tif (options === null) {\n\t\t\tthis.data.footer = undefined;\n\t\t\treturn this;\n\t\t}\n\n\t\t// Data assertions\n\t\tembedFooterPredicate.parse(options);\n\n\t\tthis.data.footer = { text: options.text, icon_url: options.iconURL };\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the image of this embed\n\t *\n\t * @param url The URL of the image\n\t */\n\tpublic setImage(url: string | null): this {\n\t\t// Data assertions\n\t\timageURLPredicate.parse(url);\n\n\t\tthis.data.image = url ? { url } : undefined;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the thumbnail of this embed\n\t *\n\t * @param url The URL of the thumbnail\n\t */\n\tpublic setThumbnail(url: string | null): this {\n\t\t// Data assertions\n\t\timageURLPredicate.parse(url);\n\n\t\tthis.data.thumbnail = url ? { url } : undefined;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the timestamp of this embed\n\t *\n\t * @param timestamp The timestamp or date\n\t */\n\tpublic setTimestamp(timestamp: number | Date | null = Date.now()): this {\n\t\t// Data assertions\n\t\ttimestampPredicate.parse(timestamp);\n\n\t\tthis.data.timestamp = timestamp ? new Date(timestamp).toISOString() : undefined;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the title of this embed\n\t *\n\t * @param title The title\n\t */\n\tpublic setTitle(title: string | null): this {\n\t\t// Data assertions\n\t\ttitlePredicate.parse(title);\n\n\t\tthis.data.title = title ?? undefined;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the URL of this embed\n\t *\n\t * @param url The URL\n\t */\n\tpublic setURL(url: string | null): this {\n\t\t// Data assertions\n\t\turlPredicate.parse(url);\n\n\t\tthis.data.url = url ?? undefined;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Transforms the embed to a plain object\n\t */\n\tpublic toJSON(): APIEmbed {\n\t\treturn { ...this.data };\n\t}\n}\n"],"names":["normalizeArray","validateFieldLength","embedFieldsArrayPredicate","embedAuthorPredicate","colorPredicate","descriptionPredicate","embedFooterPredicate","imageURLPredicate","timestampPredicate","titlePredicate","urlPredicate"],"mappings":";;;;;;;AAaO,MAAM,YAAY,CAAC;AAC1B,EAAE,WAAW,CAAC,IAAI,GAAG,EAAE,EAAE;AACzB,IAAI,IAAI,CAAC,IAAI,GAAG,EAAE,GAAG,IAAI,EAAE,CAAC;AAC5B,IAAI,IAAI,IAAI,CAAC,SAAS;AACtB,MAAM,IAAI,CAAC,IAAI,CAAC,SAAS,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,WAAW,EAAE,CAAC;AACnE,GAAG;AACH,EAAE,SAAS,CAAC,GAAG,MAAM,EAAE;AACvB,IAAI,MAAM,GAAGA,6BAAc,CAAC,MAAM,CAAC,CAAC;AACpC,IAAIC,8BAAmB,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AACzD,IAAIC,oCAAyB,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;AAC5C,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM;AACxB,MAAM,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,CAAC;AACvC;AACA,MAAM,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;AAChC,IAAI,OAAO,IAAI,CAAC;AAChB,GAAG;AACH,EAAE,YAAY,CAAC,KAAK,EAAE,WAAW,EAAE,GAAG,MAAM,EAAE;AAC9C,IAAID,8BAAmB,CAAC,MAAM,CAAC,MAAM,GAAG,WAAW,EAAE,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AACvE,IAAIC,oCAAyB,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;AAC5C,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM;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