@discordjs/builders 0.4.0 → 0.8.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.
Files changed (69) hide show
  1. package/LICENSE +1 -0
  2. package/README.md +28 -8
  3. package/dist/index.d.ts +818 -12
  4. package/dist/index.js +4 -16
  5. package/dist/index.js.map +7 -1
  6. package/dist/index.mjs +4 -32
  7. package/dist/index.mjs.map +7 -0
  8. package/package.json +65 -53
  9. package/dist/index.d.ts.map +0 -1
  10. package/dist/interactions/slashCommands/Assertions.d.ts +0 -11
  11. package/dist/interactions/slashCommands/Assertions.d.ts.map +0 -1
  12. package/dist/interactions/slashCommands/Assertions.js +0 -58
  13. package/dist/interactions/slashCommands/Assertions.js.map +0 -1
  14. package/dist/interactions/slashCommands/SlashCommandBuilder.d.ts +0 -50
  15. package/dist/interactions/slashCommands/SlashCommandBuilder.d.ts.map +0 -1
  16. package/dist/interactions/slashCommands/SlashCommandBuilder.js +0 -96
  17. package/dist/interactions/slashCommands/SlashCommandBuilder.js.map +0 -1
  18. package/dist/interactions/slashCommands/SlashCommandSubcommands.d.ts +0 -64
  19. package/dist/interactions/slashCommands/SlashCommandSubcommands.d.ts.map +0 -1
  20. package/dist/interactions/slashCommands/SlashCommandSubcommands.js +0 -123
  21. package/dist/interactions/slashCommands/SlashCommandSubcommands.js.map +0 -1
  22. package/dist/interactions/slashCommands/mixins/CommandOptionBase.d.ts +0 -20
  23. package/dist/interactions/slashCommands/mixins/CommandOptionBase.d.ts.map +0 -1
  24. package/dist/interactions/slashCommands/mixins/CommandOptionBase.js +0 -48
  25. package/dist/interactions/slashCommands/mixins/CommandOptionBase.js.map +0 -1
  26. package/dist/interactions/slashCommands/mixins/CommandOptionWithChoices.d.ts +0 -25
  27. package/dist/interactions/slashCommands/mixins/CommandOptionWithChoices.d.ts.map +0 -1
  28. package/dist/interactions/slashCommands/mixins/CommandOptionWithChoices.js +0 -59
  29. package/dist/interactions/slashCommands/mixins/CommandOptionWithChoices.js.map +0 -1
  30. package/dist/interactions/slashCommands/mixins/CommandOptions.d.ts +0 -48
  31. package/dist/interactions/slashCommands/mixins/CommandOptions.d.ts.map +0 -1
  32. package/dist/interactions/slashCommands/mixins/CommandOptions.js +0 -83
  33. package/dist/interactions/slashCommands/mixins/CommandOptions.js.map +0 -1
  34. package/dist/interactions/slashCommands/mixins/NameAndDescription.d.ts +0 -15
  35. package/dist/interactions/slashCommands/mixins/NameAndDescription.d.ts.map +0 -1
  36. package/dist/interactions/slashCommands/mixins/NameAndDescription.js +0 -42
  37. package/dist/interactions/slashCommands/mixins/NameAndDescription.js.map +0 -1
  38. package/dist/interactions/slashCommands/options/boolean.d.ts +0 -7
  39. package/dist/interactions/slashCommands/options/boolean.d.ts.map +0 -1
  40. package/dist/interactions/slashCommands/options/boolean.js +0 -18
  41. package/dist/interactions/slashCommands/options/boolean.js.map +0 -1
  42. package/dist/interactions/slashCommands/options/channel.d.ts +0 -7
  43. package/dist/interactions/slashCommands/options/channel.d.ts.map +0 -1
  44. package/dist/interactions/slashCommands/options/channel.js +0 -18
  45. package/dist/interactions/slashCommands/options/channel.js.map +0 -1
  46. package/dist/interactions/slashCommands/options/integer.d.ts +0 -7
  47. package/dist/interactions/slashCommands/options/integer.d.ts.map +0 -1
  48. package/dist/interactions/slashCommands/options/integer.js +0 -18
  49. package/dist/interactions/slashCommands/options/integer.js.map +0 -1
  50. package/dist/interactions/slashCommands/options/mentionable.d.ts +0 -7
  51. package/dist/interactions/slashCommands/options/mentionable.d.ts.map +0 -1
  52. package/dist/interactions/slashCommands/options/mentionable.js +0 -18
  53. package/dist/interactions/slashCommands/options/mentionable.js.map +0 -1
  54. package/dist/interactions/slashCommands/options/role.d.ts +0 -7
  55. package/dist/interactions/slashCommands/options/role.d.ts.map +0 -1
  56. package/dist/interactions/slashCommands/options/role.js +0 -18
  57. package/dist/interactions/slashCommands/options/role.js.map +0 -1
  58. package/dist/interactions/slashCommands/options/string.d.ts +0 -7
  59. package/dist/interactions/slashCommands/options/string.d.ts.map +0 -1
  60. package/dist/interactions/slashCommands/options/string.js +0 -18
  61. package/dist/interactions/slashCommands/options/string.js.map +0 -1
  62. package/dist/interactions/slashCommands/options/user.d.ts +0 -7
  63. package/dist/interactions/slashCommands/options/user.d.ts.map +0 -1
  64. package/dist/interactions/slashCommands/options/user.js +0 -18
  65. package/dist/interactions/slashCommands/options/user.js.map +0 -1
  66. package/dist/messages/formatters.d.ts +0 -207
  67. package/dist/messages/formatters.d.ts.map +0 -1
  68. package/dist/messages/formatters.js +0 -184
  69. package/dist/messages/formatters.js.map +0 -1
@@ -1,48 +0,0 @@
1
- import { SlashCommandBooleanOption } from '../options/boolean';
2
- import { SlashCommandChannelOption } from '../options/channel';
3
- import { SlashCommandIntegerOption } from '../options/integer';
4
- import { SlashCommandMentionableOption } from '../options/mentionable';
5
- import { SlashCommandRoleOption } from '../options/role';
6
- import { SlashCommandStringOption } from '../options/string';
7
- import { SlashCommandUserOption } from '../options/user';
8
- import type { ToAPIApplicationCommandOptions } from '../SlashCommandBuilder';
9
- export declare class SharedSlashCommandOptions<ShouldOmitSubcommandFunctions = true> {
10
- readonly options: ToAPIApplicationCommandOptions[];
11
- /**
12
- * Adds a boolean option
13
- * @param input A function that returns an option builder, or an already built builder
14
- */
15
- addBooleanOption(input: SlashCommandBooleanOption | ((builder: SlashCommandBooleanOption) => SlashCommandBooleanOption)): ShouldOmitSubcommandFunctions extends true ? Omit<this, "addSubcommand" | "addSubcommandGroup"> : this;
16
- /**
17
- * Adds a user option
18
- * @param input A function that returns an option builder, or an already built builder
19
- */
20
- addUserOption(input: SlashCommandUserOption | ((builder: SlashCommandUserOption) => SlashCommandUserOption)): ShouldOmitSubcommandFunctions extends true ? Omit<this, "addSubcommand" | "addSubcommandGroup"> : this;
21
- /**
22
- * Adds a channel option
23
- * @param input A function that returns an option builder, or an already built builder
24
- */
25
- addChannelOption(input: SlashCommandChannelOption | ((builder: SlashCommandChannelOption) => SlashCommandChannelOption)): ShouldOmitSubcommandFunctions extends true ? Omit<this, "addSubcommand" | "addSubcommandGroup"> : this;
26
- /**
27
- * Adds a role option
28
- * @param input A function that returns an option builder, or an already built builder
29
- */
30
- addRoleOption(input: SlashCommandRoleOption | ((builder: SlashCommandRoleOption) => SlashCommandRoleOption)): ShouldOmitSubcommandFunctions extends true ? Omit<this, "addSubcommand" | "addSubcommandGroup"> : this;
31
- /**
32
- * Adds a mentionable option
33
- * @param input A function that returns an option builder, or an already built builder
34
- */
35
- addMentionableOption(input: SlashCommandMentionableOption | ((builder: SlashCommandMentionableOption) => SlashCommandMentionableOption)): ShouldOmitSubcommandFunctions extends true ? Omit<this, "addSubcommand" | "addSubcommandGroup"> : this;
36
- /**
37
- * Adds a string option
38
- * @param input A function that returns an option builder, or an already built builder
39
- */
40
- addStringOption(input: SlashCommandStringOption | ((builder: SlashCommandStringOption) => SlashCommandStringOption)): ShouldOmitSubcommandFunctions extends true ? Omit<this, "addSubcommand" | "addSubcommandGroup"> : this;
41
- /**
42
- * Adds an integer option
43
- * @param input A function that returns an option builder, or an already built builder
44
- */
45
- addIntegerOption(input: SlashCommandIntegerOption | ((builder: SlashCommandIntegerOption) => SlashCommandIntegerOption)): ShouldOmitSubcommandFunctions extends true ? Omit<this, "addSubcommand" | "addSubcommandGroup"> : this;
46
- private _sharedAddOptionMethod;
47
- }
48
- //# sourceMappingURL=CommandOptions.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CommandOptions.d.ts","sourceRoot":"/","sources":["interactions/slashCommands/mixins/CommandOptions.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EAAE,6BAA6B,EAAE,MAAM,wBAAwB,CAAC;AACvE,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,wBAAwB,CAAC;AAE7E,qBAAa,yBAAyB,CAAC,6BAA6B,GAAG,IAAI;IAC1E,SAAgB,OAAO,EAAG,8BAA8B,EAAE,CAAC;IAE3D;;;OAGG;IACI,gBAAgB,CACtB,KAAK,EAAE,yBAAyB,GAAG,CAAC,CAAC,OAAO,EAAE,yBAAyB,KAAK,yBAAyB,CAAC;IAKvG;;;OAGG;IACI,aAAa,CAAC,KAAK,EAAE,sBAAsB,GAAG,CAAC,CAAC,OAAO,EAAE,sBAAsB,KAAK,sBAAsB,CAAC;IAIlH;;;OAGG;IACI,gBAAgB,CACtB,KAAK,EAAE,yBAAyB,GAAG,CAAC,CAAC,OAAO,EAAE,yBAAyB,KAAK,yBAAyB,CAAC;IAKvG;;;OAGG;IACI,aAAa,CAAC,KAAK,EAAE,sBAAsB,GAAG,CAAC,CAAC,OAAO,EAAE,sBAAsB,KAAK,sBAAsB,CAAC;IAIlH;;;OAGG;IACI,oBAAoB,CAC1B,KAAK,EAAE,6BAA6B,GAAG,CAAC,CAAC,OAAO,EAAE,6BAA6B,KAAK,6BAA6B,CAAC;IAKnH;;;OAGG;IACI,eAAe,CACrB,KAAK,EAAE,wBAAwB,GAAG,CAAC,CAAC,OAAO,EAAE,wBAAwB,KAAK,wBAAwB,CAAC;IAKpG;;;OAGG;IACI,gBAAgB,CACtB,KAAK,EAAE,yBAAyB,GAAG,CAAC,CAAC,OAAO,EAAE,yBAAyB,KAAK,yBAAyB,CAAC;IAKvG,OAAO,CAAC,sBAAsB;CAmB9B"}
@@ -1,83 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SharedSlashCommandOptions = void 0;
4
- const Assertions_1 = require("../Assertions");
5
- const boolean_1 = require("../options/boolean");
6
- const channel_1 = require("../options/channel");
7
- const integer_1 = require("../options/integer");
8
- const mentionable_1 = require("../options/mentionable");
9
- const role_1 = require("../options/role");
10
- const string_1 = require("../options/string");
11
- const user_1 = require("../options/user");
12
- class SharedSlashCommandOptions {
13
- constructor() {
14
- Object.defineProperty(this, "options", {
15
- enumerable: true,
16
- configurable: true,
17
- writable: true,
18
- value: void 0
19
- });
20
- }
21
- /**
22
- * Adds a boolean option
23
- * @param input A function that returns an option builder, or an already built builder
24
- */
25
- addBooleanOption(input) {
26
- return this._sharedAddOptionMethod(input, boolean_1.SlashCommandBooleanOption);
27
- }
28
- /**
29
- * Adds a user option
30
- * @param input A function that returns an option builder, or an already built builder
31
- */
32
- addUserOption(input) {
33
- return this._sharedAddOptionMethod(input, user_1.SlashCommandUserOption);
34
- }
35
- /**
36
- * Adds a channel option
37
- * @param input A function that returns an option builder, or an already built builder
38
- */
39
- addChannelOption(input) {
40
- return this._sharedAddOptionMethod(input, channel_1.SlashCommandChannelOption);
41
- }
42
- /**
43
- * Adds a role option
44
- * @param input A function that returns an option builder, or an already built builder
45
- */
46
- addRoleOption(input) {
47
- return this._sharedAddOptionMethod(input, role_1.SlashCommandRoleOption);
48
- }
49
- /**
50
- * Adds a mentionable option
51
- * @param input A function that returns an option builder, or an already built builder
52
- */
53
- addMentionableOption(input) {
54
- return this._sharedAddOptionMethod(input, mentionable_1.SlashCommandMentionableOption);
55
- }
56
- /**
57
- * Adds a string option
58
- * @param input A function that returns an option builder, or an already built builder
59
- */
60
- addStringOption(input) {
61
- return this._sharedAddOptionMethod(input, string_1.SlashCommandStringOption);
62
- }
63
- /**
64
- * Adds an integer option
65
- * @param input A function that returns an option builder, or an already built builder
66
- */
67
- addIntegerOption(input) {
68
- return this._sharedAddOptionMethod(input, integer_1.SlashCommandIntegerOption);
69
- }
70
- _sharedAddOptionMethod(input, Instance) {
71
- const { options } = this;
72
- // First, assert options conditions - we cannot have more than 25 options
73
- Assertions_1.validateMaxOptionsLength(options);
74
- // Get the final result
75
- const result = typeof input === 'function' ? input(new Instance()) : input;
76
- Assertions_1.assertReturnOfBuilder(result, Instance);
77
- // Push it
78
- options.push(result);
79
- return this;
80
- }
81
- }
82
- exports.SharedSlashCommandOptions = SharedSlashCommandOptions;
83
- //# sourceMappingURL=CommandOptions.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CommandOptions.js","sourceRoot":"/","sources":["interactions/slashCommands/mixins/CommandOptions.ts"],"names":[],"mappings":";;;AAAA,8CAAgF;AAEhF,gDAA+D;AAC/D,gDAA+D;AAC/D,gDAA+D;AAC/D,wDAAuE;AACvE,0CAAyD;AACzD,8CAA6D;AAC7D,0CAAyD;AAGzD,MAAa,yBAAyB;IAAtC;QACC;;;;;WAA2D;IAuF5D,CAAC;IArFA;;;OAGG;IACI,gBAAgB,CACtB,KAAsG;QAEtG,OAAO,IAAI,CAAC,sBAAsB,CAAC,KAAK,EAAE,mCAAyB,CAAC,CAAC;IACtE,CAAC;IAED;;;OAGG;IACI,aAAa,CAAC,KAA6F;QACjH,OAAO,IAAI,CAAC,sBAAsB,CAAC,KAAK,EAAE,6BAAsB,CAAC,CAAC;IACnE,CAAC;IAED;;;OAGG;IACI,gBAAgB,CACtB,KAAsG;QAEtG,OAAO,IAAI,CAAC,sBAAsB,CAAC,KAAK,EAAE,mCAAyB,CAAC,CAAC;IACtE,CAAC;IAED;;;OAGG;IACI,aAAa,CAAC,KAA6F;QACjH,OAAO,IAAI,CAAC,sBAAsB,CAAC,KAAK,EAAE,6BAAsB,CAAC,CAAC;IACnE,CAAC;IAED;;;OAGG;IACI,oBAAoB,CAC1B,KAAkH;QAElH,OAAO,IAAI,CAAC,sBAAsB,CAAC,KAAK,EAAE,2CAA6B,CAAC,CAAC;IAC1E,CAAC;IAED;;;OAGG;IACI,eAAe,CACrB,KAAmG;QAEnG,OAAO,IAAI,CAAC,sBAAsB,CAAC,KAAK,EAAE,iCAAwB,CAAC,CAAC;IACrE,CAAC;IAED;;;OAGG;IACI,gBAAgB,CACtB,KAAsG;QAEtG,OAAO,IAAI,CAAC,sBAAsB,CAAC,KAAK,EAAE,mCAAyB,CAAC,CAAC;IACtE,CAAC;IAEO,sBAAsB,CAC7B,KAA8B,EAC9B,QAAqB;QAErB,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;QAEzB,yEAAyE;QACzE,qCAAwB,CAAC,OAAO,CAAC,CAAC;QAElC,uBAAuB;QACvB,MAAM,MAAM,GAAG,OAAO,KAAK,KAAK,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;QAE3E,kCAAqB,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;QAExC,UAAU;QACV,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAErB,OAAO,IAAI,CAAC;IACb,CAAC;CACD;AAxFD,8DAwFC","sourcesContent":["import { assertReturnOfBuilder, validateMaxOptionsLength } from '../Assertions';\nimport type { SlashCommandOptionBase } from './CommandOptionBase';\nimport { SlashCommandBooleanOption } from '../options/boolean';\nimport { SlashCommandChannelOption } from '../options/channel';\nimport { SlashCommandIntegerOption } from '../options/integer';\nimport { SlashCommandMentionableOption } from '../options/mentionable';\nimport { SlashCommandRoleOption } from '../options/role';\nimport { SlashCommandStringOption } from '../options/string';\nimport { SlashCommandUserOption } from '../options/user';\nimport type { ToAPIApplicationCommandOptions } from '../SlashCommandBuilder';\n\nexport class SharedSlashCommandOptions<ShouldOmitSubcommandFunctions = true> {\n\tpublic readonly options!: ToAPIApplicationCommandOptions[];\n\n\t/**\n\t * Adds a boolean option\n\t * @param input A function that returns an option builder, or an already built builder\n\t */\n\tpublic addBooleanOption(\n\t\tinput: SlashCommandBooleanOption | ((builder: SlashCommandBooleanOption) => SlashCommandBooleanOption),\n\t) {\n\t\treturn this._sharedAddOptionMethod(input, SlashCommandBooleanOption);\n\t}\n\n\t/**\n\t * Adds a user option\n\t * @param input A function that returns an option builder, or an already built builder\n\t */\n\tpublic addUserOption(input: SlashCommandUserOption | ((builder: SlashCommandUserOption) => SlashCommandUserOption)) {\n\t\treturn this._sharedAddOptionMethod(input, SlashCommandUserOption);\n\t}\n\n\t/**\n\t * Adds a channel option\n\t * @param input A function that returns an option builder, or an already built builder\n\t */\n\tpublic addChannelOption(\n\t\tinput: SlashCommandChannelOption | ((builder: SlashCommandChannelOption) => SlashCommandChannelOption),\n\t) {\n\t\treturn this._sharedAddOptionMethod(input, SlashCommandChannelOption);\n\t}\n\n\t/**\n\t * Adds a role option\n\t * @param input A function that returns an option builder, or an already built builder\n\t */\n\tpublic addRoleOption(input: SlashCommandRoleOption | ((builder: SlashCommandRoleOption) => SlashCommandRoleOption)) {\n\t\treturn this._sharedAddOptionMethod(input, SlashCommandRoleOption);\n\t}\n\n\t/**\n\t * Adds a mentionable option\n\t * @param input A function that returns an option builder, or an already built builder\n\t */\n\tpublic addMentionableOption(\n\t\tinput: SlashCommandMentionableOption | ((builder: SlashCommandMentionableOption) => SlashCommandMentionableOption),\n\t) {\n\t\treturn this._sharedAddOptionMethod(input, SlashCommandMentionableOption);\n\t}\n\n\t/**\n\t * Adds a string option\n\t * @param input A function that returns an option builder, or an already built builder\n\t */\n\tpublic addStringOption(\n\t\tinput: SlashCommandStringOption | ((builder: SlashCommandStringOption) => SlashCommandStringOption),\n\t) {\n\t\treturn this._sharedAddOptionMethod(input, SlashCommandStringOption);\n\t}\n\n\t/**\n\t * Adds an integer option\n\t * @param input A function that returns an option builder, or an already built builder\n\t */\n\tpublic addIntegerOption(\n\t\tinput: SlashCommandIntegerOption | ((builder: SlashCommandIntegerOption) => SlashCommandIntegerOption),\n\t) {\n\t\treturn this._sharedAddOptionMethod(input, SlashCommandIntegerOption);\n\t}\n\n\tprivate _sharedAddOptionMethod<T extends SlashCommandOptionBase>(\n\t\tinput: T | ((builder: T) => T),\n\t\tInstance: new () => T,\n\t): ShouldOmitSubcommandFunctions extends true ? Omit<this, 'addSubcommand' | 'addSubcommandGroup'> : this {\n\t\tconst { options } = this;\n\n\t\t// First, assert options conditions - we cannot have more than 25 options\n\t\tvalidateMaxOptionsLength(options);\n\n\t\t// Get the final result\n\t\tconst result = typeof input === 'function' ? input(new Instance()) : input;\n\n\t\tassertReturnOfBuilder(result, Instance);\n\n\t\t// Push it\n\t\toptions.push(result);\n\n\t\treturn this;\n\t}\n}\n"]}
@@ -1,15 +0,0 @@
1
- export declare class SharedNameAndDescription {
2
- readonly name: string;
3
- readonly description: string;
4
- /**
5
- * Sets the name
6
- * @param name The name
7
- */
8
- setName(name: string): this;
9
- /**
10
- * Sets the description
11
- * @param description The description
12
- */
13
- setDescription(description: string): this;
14
- }
15
- //# sourceMappingURL=NameAndDescription.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"NameAndDescription.d.ts","sourceRoot":"/","sources":["interactions/slashCommands/mixins/NameAndDescription.ts"],"names":[],"mappings":"AAEA,qBAAa,wBAAwB;IACpC,SAAgB,IAAI,EAAG,MAAM,CAAC;IAC9B,SAAgB,WAAW,EAAG,MAAM,CAAC;IAErC;;;OAGG;IACI,OAAO,CAAC,IAAI,EAAE,MAAM;IAS3B;;;OAGG;IACI,cAAc,CAAC,WAAW,EAAE,MAAM;CAQzC"}
@@ -1,42 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SharedNameAndDescription = void 0;
4
- const Assertions_1 = require("../Assertions");
5
- class SharedNameAndDescription {
6
- constructor() {
7
- Object.defineProperty(this, "name", {
8
- enumerable: true,
9
- configurable: true,
10
- writable: true,
11
- value: void 0
12
- });
13
- Object.defineProperty(this, "description", {
14
- enumerable: true,
15
- configurable: true,
16
- writable: true,
17
- value: void 0
18
- });
19
- }
20
- /**
21
- * Sets the name
22
- * @param name The name
23
- */
24
- setName(name) {
25
- // Assert the name matches the conditions
26
- Assertions_1.validateName(name);
27
- Reflect.set(this, 'name', name);
28
- return this;
29
- }
30
- /**
31
- * Sets the description
32
- * @param description The description
33
- */
34
- setDescription(description) {
35
- // Assert the description matches the conditions
36
- Assertions_1.validateDescription(description);
37
- Reflect.set(this, 'description', description);
38
- return this;
39
- }
40
- }
41
- exports.SharedNameAndDescription = SharedNameAndDescription;
42
- //# sourceMappingURL=NameAndDescription.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"NameAndDescription.js","sourceRoot":"/","sources":["interactions/slashCommands/mixins/NameAndDescription.ts"],"names":[],"mappings":";;;AAAA,8CAAkE;AAElE,MAAa,wBAAwB;IAArC;QACC;;;;;WAA8B;QAC9B;;;;;WAAqC;IA2BtC,CAAC;IAzBA;;;OAGG;IACI,OAAO,CAAC,IAAY;QAC1B,yCAAyC;QACzC,yBAAY,CAAC,IAAI,CAAC,CAAC;QAEnB,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;QAEhC,OAAO,IAAI,CAAC;IACb,CAAC;IAED;;;OAGG;IACI,cAAc,CAAC,WAAmB;QACxC,gDAAgD;QAChD,gCAAmB,CAAC,WAAW,CAAC,CAAC;QAEjC,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,aAAa,EAAE,WAAW,CAAC,CAAC;QAE9C,OAAO,IAAI,CAAC;IACb,CAAC;CACD;AA7BD,4DA6BC","sourcesContent":["import { validateDescription, validateName } from '../Assertions';\n\nexport class SharedNameAndDescription {\n\tpublic readonly name!: string;\n\tpublic readonly description!: string;\n\n\t/**\n\t * Sets the name\n\t * @param name The name\n\t */\n\tpublic setName(name: string) {\n\t\t// Assert the name matches the conditions\n\t\tvalidateName(name);\n\n\t\tReflect.set(this, 'name', name);\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the description\n\t * @param description The description\n\t */\n\tpublic setDescription(description: string) {\n\t\t// Assert the description matches the conditions\n\t\tvalidateDescription(description);\n\n\t\tReflect.set(this, 'description', description);\n\n\t\treturn this;\n\t}\n}\n"]}
@@ -1,7 +0,0 @@
1
- import { ApplicationCommandOptionType } from 'discord-api-types/v9';
2
- import { SlashCommandOptionBase } from '../mixins/CommandOptionBase';
3
- export declare class SlashCommandBooleanOption extends SlashCommandOptionBase {
4
- readonly type: ApplicationCommandOptionType.Boolean;
5
- constructor();
6
- }
7
- //# sourceMappingURL=boolean.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"boolean.d.ts","sourceRoot":"/","sources":["interactions/slashCommands/options/boolean.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAErE,qBAAa,yBAA0B,SAAQ,sBAAsB;IACpE,SAAyB,IAAI,uCAAiD;;CAK9E"}
@@ -1,18 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SlashCommandBooleanOption = void 0;
4
- require("discord-api-types/v9");
5
- const CommandOptionBase_1 = require("../mixins/CommandOptionBase");
6
- class SlashCommandBooleanOption extends CommandOptionBase_1.SlashCommandOptionBase {
7
- constructor() {
8
- super(5 /* Boolean */);
9
- Object.defineProperty(this, "type", {
10
- enumerable: true,
11
- configurable: true,
12
- writable: true,
13
- value: 5 /* Boolean */
14
- });
15
- }
16
- }
17
- exports.SlashCommandBooleanOption = SlashCommandBooleanOption;
18
- //# sourceMappingURL=boolean.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"boolean.js","sourceRoot":"/","sources":["interactions/slashCommands/options/boolean.ts"],"names":[],"mappings":";;;AAAA,gCAAoE;AACpE,mEAAqE;AAErE,MAAa,yBAA0B,SAAQ,0CAAsB;IAGpE;QACC,KAAK,iBAAsC,CAAC;QAH7C;;;;mBAAgC,eAA6C;WAAC;IAI9E,CAAC;CACD;AAND,8DAMC","sourcesContent":["import { ApplicationCommandOptionType } from 'discord-api-types/v9';\nimport { SlashCommandOptionBase } from '../mixins/CommandOptionBase';\n\nexport class SlashCommandBooleanOption extends SlashCommandOptionBase {\n\tpublic override readonly type = ApplicationCommandOptionType.Boolean as const;\n\n\tpublic constructor() {\n\t\tsuper(ApplicationCommandOptionType.Boolean);\n\t}\n}\n"]}
@@ -1,7 +0,0 @@
1
- import { ApplicationCommandOptionType } from 'discord-api-types/v9';
2
- import { SlashCommandOptionBase } from '../mixins/CommandOptionBase';
3
- export declare class SlashCommandChannelOption extends SlashCommandOptionBase {
4
- readonly type: ApplicationCommandOptionType.Channel;
5
- constructor();
6
- }
7
- //# sourceMappingURL=channel.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"channel.d.ts","sourceRoot":"/","sources":["interactions/slashCommands/options/channel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAErE,qBAAa,yBAA0B,SAAQ,sBAAsB;IACpE,SAAyB,IAAI,uCAAiD;;CAK9E"}
@@ -1,18 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SlashCommandChannelOption = void 0;
4
- require("discord-api-types/v9");
5
- const CommandOptionBase_1 = require("../mixins/CommandOptionBase");
6
- class SlashCommandChannelOption extends CommandOptionBase_1.SlashCommandOptionBase {
7
- constructor() {
8
- super(7 /* Channel */);
9
- Object.defineProperty(this, "type", {
10
- enumerable: true,
11
- configurable: true,
12
- writable: true,
13
- value: 7 /* Channel */
14
- });
15
- }
16
- }
17
- exports.SlashCommandChannelOption = SlashCommandChannelOption;
18
- //# sourceMappingURL=channel.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"channel.js","sourceRoot":"/","sources":["interactions/slashCommands/options/channel.ts"],"names":[],"mappings":";;;AAAA,gCAAoE;AACpE,mEAAqE;AAErE,MAAa,yBAA0B,SAAQ,0CAAsB;IAGpE;QACC,KAAK,iBAAsC,CAAC;QAH7C;;;;mBAAgC,eAA6C;WAAC;IAI9E,CAAC;CACD;AAND,8DAMC","sourcesContent":["import { ApplicationCommandOptionType } from 'discord-api-types/v9';\nimport { SlashCommandOptionBase } from '../mixins/CommandOptionBase';\n\nexport class SlashCommandChannelOption extends SlashCommandOptionBase {\n\tpublic override readonly type = ApplicationCommandOptionType.Channel as const;\n\n\tpublic constructor() {\n\t\tsuper(ApplicationCommandOptionType.Channel);\n\t}\n}\n"]}
@@ -1,7 +0,0 @@
1
- import { ApplicationCommandOptionType } from 'discord-api-types/v9';
2
- import { ApplicationCommandOptionWithChoicesBase } from '../mixins/CommandOptionWithChoices';
3
- export declare class SlashCommandIntegerOption extends ApplicationCommandOptionWithChoicesBase<number> {
4
- readonly type: ApplicationCommandOptionType.Integer;
5
- constructor();
6
- }
7
- //# sourceMappingURL=integer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"integer.d.ts","sourceRoot":"/","sources":["interactions/slashCommands/options/integer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,uCAAuC,EAAE,MAAM,oCAAoC,CAAC;AAE7F,qBAAa,yBAA0B,SAAQ,uCAAuC,CAAC,MAAM,CAAC;IAC7F,SAAyB,IAAI,uCAAiD;;CAK9E"}
@@ -1,18 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SlashCommandIntegerOption = void 0;
4
- require("discord-api-types/v9");
5
- const CommandOptionWithChoices_1 = require("../mixins/CommandOptionWithChoices");
6
- class SlashCommandIntegerOption extends CommandOptionWithChoices_1.ApplicationCommandOptionWithChoicesBase {
7
- constructor() {
8
- super(4 /* Integer */);
9
- Object.defineProperty(this, "type", {
10
- enumerable: true,
11
- configurable: true,
12
- writable: true,
13
- value: 4 /* Integer */
14
- });
15
- }
16
- }
17
- exports.SlashCommandIntegerOption = SlashCommandIntegerOption;
18
- //# sourceMappingURL=integer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"integer.js","sourceRoot":"/","sources":["interactions/slashCommands/options/integer.ts"],"names":[],"mappings":";;;AAAA,gCAAoE;AACpE,iFAA6F;AAE7F,MAAa,yBAA0B,SAAQ,kEAA+C;IAG7F;QACC,KAAK,iBAAsC,CAAC;QAH7C;;;;mBAAgC,eAA6C;WAAC;IAI9E,CAAC;CACD;AAND,8DAMC","sourcesContent":["import { ApplicationCommandOptionType } from 'discord-api-types/v9';\nimport { ApplicationCommandOptionWithChoicesBase } from '../mixins/CommandOptionWithChoices';\n\nexport class SlashCommandIntegerOption extends ApplicationCommandOptionWithChoicesBase<number> {\n\tpublic override readonly type = ApplicationCommandOptionType.Integer as const;\n\n\tpublic constructor() {\n\t\tsuper(ApplicationCommandOptionType.Integer);\n\t}\n}\n"]}
@@ -1,7 +0,0 @@
1
- import { ApplicationCommandOptionType } from 'discord-api-types/v9';
2
- import { SlashCommandOptionBase } from '../mixins/CommandOptionBase';
3
- export declare class SlashCommandMentionableOption extends SlashCommandOptionBase {
4
- readonly type: ApplicationCommandOptionType.Mentionable;
5
- constructor();
6
- }
7
- //# sourceMappingURL=mentionable.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mentionable.d.ts","sourceRoot":"/","sources":["interactions/slashCommands/options/mentionable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAErE,qBAAa,6BAA8B,SAAQ,sBAAsB;IACxE,SAAyB,IAAI,2CAAqD;;CAKlF"}
@@ -1,18 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SlashCommandMentionableOption = void 0;
4
- require("discord-api-types/v9");
5
- const CommandOptionBase_1 = require("../mixins/CommandOptionBase");
6
- class SlashCommandMentionableOption extends CommandOptionBase_1.SlashCommandOptionBase {
7
- constructor() {
8
- super(9 /* Mentionable */);
9
- Object.defineProperty(this, "type", {
10
- enumerable: true,
11
- configurable: true,
12
- writable: true,
13
- value: 9 /* Mentionable */
14
- });
15
- }
16
- }
17
- exports.SlashCommandMentionableOption = SlashCommandMentionableOption;
18
- //# sourceMappingURL=mentionable.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mentionable.js","sourceRoot":"/","sources":["interactions/slashCommands/options/mentionable.ts"],"names":[],"mappings":";;;AAAA,gCAAoE;AACpE,mEAAqE;AAErE,MAAa,6BAA8B,SAAQ,0CAAsB;IAGxE;QACC,KAAK,qBAA0C,CAAC;QAHjD;;;;mBAAgC,mBAAiD;WAAC;IAIlF,CAAC;CACD;AAND,sEAMC","sourcesContent":["import { ApplicationCommandOptionType } from 'discord-api-types/v9';\nimport { SlashCommandOptionBase } from '../mixins/CommandOptionBase';\n\nexport class SlashCommandMentionableOption extends SlashCommandOptionBase {\n\tpublic override readonly type = ApplicationCommandOptionType.Mentionable as const;\n\n\tpublic constructor() {\n\t\tsuper(ApplicationCommandOptionType.Mentionable);\n\t}\n}\n"]}
@@ -1,7 +0,0 @@
1
- import { ApplicationCommandOptionType } from 'discord-api-types/v9';
2
- import { SlashCommandOptionBase } from '../mixins/CommandOptionBase';
3
- export declare class SlashCommandRoleOption extends SlashCommandOptionBase {
4
- readonly type: ApplicationCommandOptionType.Role;
5
- constructor();
6
- }
7
- //# sourceMappingURL=role.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"role.d.ts","sourceRoot":"/","sources":["interactions/slashCommands/options/role.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAErE,qBAAa,sBAAuB,SAAQ,sBAAsB;IACjE,SAAyB,IAAI,oCAA8C;;CAK3E"}
@@ -1,18 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SlashCommandRoleOption = void 0;
4
- require("discord-api-types/v9");
5
- const CommandOptionBase_1 = require("../mixins/CommandOptionBase");
6
- class SlashCommandRoleOption extends CommandOptionBase_1.SlashCommandOptionBase {
7
- constructor() {
8
- super(8 /* Role */);
9
- Object.defineProperty(this, "type", {
10
- enumerable: true,
11
- configurable: true,
12
- writable: true,
13
- value: 8 /* Role */
14
- });
15
- }
16
- }
17
- exports.SlashCommandRoleOption = SlashCommandRoleOption;
18
- //# sourceMappingURL=role.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"role.js","sourceRoot":"/","sources":["interactions/slashCommands/options/role.ts"],"names":[],"mappings":";;;AAAA,gCAAoE;AACpE,mEAAqE;AAErE,MAAa,sBAAuB,SAAQ,0CAAsB;IAGjE;QACC,KAAK,cAAmC,CAAC;QAH1C;;;;mBAAgC,YAA0C;WAAC;IAI3E,CAAC;CACD;AAND,wDAMC","sourcesContent":["import { ApplicationCommandOptionType } from 'discord-api-types/v9';\nimport { SlashCommandOptionBase } from '../mixins/CommandOptionBase';\n\nexport class SlashCommandRoleOption extends SlashCommandOptionBase {\n\tpublic override readonly type = ApplicationCommandOptionType.Role as const;\n\n\tpublic constructor() {\n\t\tsuper(ApplicationCommandOptionType.Role);\n\t}\n}\n"]}
@@ -1,7 +0,0 @@
1
- import { ApplicationCommandOptionType } from 'discord-api-types/v9';
2
- import { ApplicationCommandOptionWithChoicesBase } from '../mixins/CommandOptionWithChoices';
3
- export declare class SlashCommandStringOption extends ApplicationCommandOptionWithChoicesBase<string> {
4
- readonly type: ApplicationCommandOptionType.String;
5
- constructor();
6
- }
7
- //# sourceMappingURL=string.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"string.d.ts","sourceRoot":"/","sources":["interactions/slashCommands/options/string.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,uCAAuC,EAAE,MAAM,oCAAoC,CAAC;AAE7F,qBAAa,wBAAyB,SAAQ,uCAAuC,CAAC,MAAM,CAAC;IAC5F,SAAyB,IAAI,sCAAgD;;CAK7E"}
@@ -1,18 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SlashCommandStringOption = void 0;
4
- require("discord-api-types/v9");
5
- const CommandOptionWithChoices_1 = require("../mixins/CommandOptionWithChoices");
6
- class SlashCommandStringOption extends CommandOptionWithChoices_1.ApplicationCommandOptionWithChoicesBase {
7
- constructor() {
8
- super(3 /* String */);
9
- Object.defineProperty(this, "type", {
10
- enumerable: true,
11
- configurable: true,
12
- writable: true,
13
- value: 3 /* String */
14
- });
15
- }
16
- }
17
- exports.SlashCommandStringOption = SlashCommandStringOption;
18
- //# sourceMappingURL=string.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"string.js","sourceRoot":"/","sources":["interactions/slashCommands/options/string.ts"],"names":[],"mappings":";;;AAAA,gCAAoE;AACpE,iFAA6F;AAE7F,MAAa,wBAAyB,SAAQ,kEAA+C;IAG5F;QACC,KAAK,gBAAqC,CAAC;QAH5C;;;;mBAAgC,cAA4C;WAAC;IAI7E,CAAC;CACD;AAND,4DAMC","sourcesContent":["import { ApplicationCommandOptionType } from 'discord-api-types/v9';\nimport { ApplicationCommandOptionWithChoicesBase } from '../mixins/CommandOptionWithChoices';\n\nexport class SlashCommandStringOption extends ApplicationCommandOptionWithChoicesBase<string> {\n\tpublic override readonly type = ApplicationCommandOptionType.String as const;\n\n\tpublic constructor() {\n\t\tsuper(ApplicationCommandOptionType.String);\n\t}\n}\n"]}
@@ -1,7 +0,0 @@
1
- import { ApplicationCommandOptionType } from 'discord-api-types/v9';
2
- import { SlashCommandOptionBase } from '../mixins/CommandOptionBase';
3
- export declare class SlashCommandUserOption extends SlashCommandOptionBase {
4
- readonly type: ApplicationCommandOptionType.User;
5
- constructor();
6
- }
7
- //# sourceMappingURL=user.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"user.d.ts","sourceRoot":"/","sources":["interactions/slashCommands/options/user.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAErE,qBAAa,sBAAuB,SAAQ,sBAAsB;IACjE,SAAyB,IAAI,oCAA8C;;CAK3E"}
@@ -1,18 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SlashCommandUserOption = void 0;
4
- require("discord-api-types/v9");
5
- const CommandOptionBase_1 = require("../mixins/CommandOptionBase");
6
- class SlashCommandUserOption extends CommandOptionBase_1.SlashCommandOptionBase {
7
- constructor() {
8
- super(6 /* User */);
9
- Object.defineProperty(this, "type", {
10
- enumerable: true,
11
- configurable: true,
12
- writable: true,
13
- value: 6 /* User */
14
- });
15
- }
16
- }
17
- exports.SlashCommandUserOption = SlashCommandUserOption;
18
- //# sourceMappingURL=user.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"user.js","sourceRoot":"/","sources":["interactions/slashCommands/options/user.ts"],"names":[],"mappings":";;;AAAA,gCAAoE;AACpE,mEAAqE;AAErE,MAAa,sBAAuB,SAAQ,0CAAsB;IAGjE;QACC,KAAK,cAAmC,CAAC;QAH1C;;;;mBAAgC,YAA0C;WAAC;IAI3E,CAAC;CACD;AAND,wDAMC","sourcesContent":["import { ApplicationCommandOptionType } from 'discord-api-types/v9';\nimport { SlashCommandOptionBase } from '../mixins/CommandOptionBase';\n\nexport class SlashCommandUserOption extends SlashCommandOptionBase {\n\tpublic override readonly type = ApplicationCommandOptionType.User as const;\n\n\tpublic constructor() {\n\t\tsuper(ApplicationCommandOptionType.User);\n\t}\n}\n"]}