oopscord.js 0.0.29 → 0.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.
Files changed (106) hide show
  1. package/LICENSE +674 -201
  2. package/README.md +212 -11
  3. package/dist/index.js +1 -0
  4. package/dist/index.js.map +1 -0
  5. package/dist/structures/Constants.d.ts +2 -2
  6. package/dist/structures/Constants.d.ts.map +1 -1
  7. package/dist/structures/Constants.js +1 -0
  8. package/dist/structures/Constants.js.map +1 -0
  9. package/dist/structures/DiscordApp.d.ts +28 -10
  10. package/dist/structures/DiscordApp.d.ts.map +1 -1
  11. package/dist/structures/DiscordApp.js +681 -295
  12. package/dist/structures/DiscordApp.js.map +1 -0
  13. package/dist/structures/Plugin.d.ts +68 -0
  14. package/dist/structures/Plugin.d.ts.map +1 -1
  15. package/dist/structures/Plugin.js +28 -1
  16. package/dist/structures/Plugin.js.map +1 -0
  17. package/dist/structures/PluginManager.d.ts +122 -0
  18. package/dist/structures/PluginManager.d.ts.map +1 -0
  19. package/dist/structures/PluginManager.js +371 -0
  20. package/dist/structures/PluginManager.js.map +1 -0
  21. package/dist/structures/components/BaseButton.d.ts +2 -5
  22. package/dist/structures/components/BaseButton.d.ts.map +1 -1
  23. package/dist/structures/components/BaseButton.js +9 -14
  24. package/dist/structures/components/BaseButton.js.map +1 -0
  25. package/dist/structures/components/BaseModal.d.ts +13 -21
  26. package/dist/structures/components/BaseModal.d.ts.map +1 -1
  27. package/dist/structures/components/BaseModal.js +86 -132
  28. package/dist/structures/components/BaseModal.js.map +1 -0
  29. package/dist/structures/components/BaseSelectMenu.d.ts +2 -5
  30. package/dist/structures/components/BaseSelectMenu.d.ts.map +1 -1
  31. package/dist/structures/components/BaseSelectMenu.js +21 -25
  32. package/dist/structures/components/BaseSelectMenu.js.map +1 -0
  33. package/dist/structures/components/Listener.d.ts +18 -0
  34. package/dist/structures/components/Listener.d.ts.map +1 -0
  35. package/dist/structures/components/Listener.js +22 -0
  36. package/dist/structures/components/Listener.js.map +1 -0
  37. package/dist/structures/components/index.d.ts +1 -0
  38. package/dist/structures/components/index.d.ts.map +1 -1
  39. package/dist/structures/components/index.js +2 -0
  40. package/dist/structures/components/index.js.map +1 -0
  41. package/dist/structures/decorators/CommandDecorator.d.ts +39 -38
  42. package/dist/structures/decorators/CommandDecorator.d.ts.map +1 -1
  43. package/dist/structures/decorators/CommandDecorator.js +145 -250
  44. package/dist/structures/decorators/CommandDecorator.js.map +1 -0
  45. package/dist/structures/decorators/Constants.d.ts +12 -8
  46. package/dist/structures/decorators/Constants.d.ts.map +1 -1
  47. package/dist/structures/decorators/Constants.js +13 -8
  48. package/dist/structures/decorators/Constants.js.map +1 -0
  49. package/dist/structures/decorators/DiscordModuleDecorator.d.ts +11 -19
  50. package/dist/structures/decorators/DiscordModuleDecorator.d.ts.map +1 -1
  51. package/dist/structures/decorators/DiscordModuleDecorator.js +12 -54
  52. package/dist/structures/decorators/DiscordModuleDecorator.js.map +1 -0
  53. package/dist/structures/decorators/EventDecorator.d.ts +45 -0
  54. package/dist/structures/decorators/EventDecorator.d.ts.map +1 -0
  55. package/dist/structures/decorators/EventDecorator.js +52 -0
  56. package/dist/structures/decorators/EventDecorator.js.map +1 -0
  57. package/dist/structures/decorators/ExecutionDecorator.d.ts +19 -0
  58. package/dist/structures/decorators/ExecutionDecorator.d.ts.map +1 -0
  59. package/dist/structures/decorators/ExecutionDecorator.js +23 -0
  60. package/dist/structures/decorators/ExecutionDecorator.js.map +1 -0
  61. package/dist/structures/decorators/InjectionMetadata.d.ts +35 -0
  62. package/dist/structures/decorators/InjectionMetadata.d.ts.map +1 -0
  63. package/dist/structures/decorators/InjectionMetadata.js +34 -0
  64. package/dist/structures/decorators/InjectionMetadata.js.map +1 -0
  65. package/dist/structures/decorators/InteractionHandlerDecorator.d.ts +17 -2
  66. package/dist/structures/decorators/InteractionHandlerDecorator.d.ts.map +1 -1
  67. package/dist/structures/decorators/InteractionHandlerDecorator.js +48 -7
  68. package/dist/structures/decorators/InteractionHandlerDecorator.js.map +1 -0
  69. package/dist/structures/decorators/MessageComponentDecorator.d.ts +25 -40
  70. package/dist/structures/decorators/MessageComponentDecorator.d.ts.map +1 -1
  71. package/dist/structures/decorators/MessageComponentDecorator.js +66 -78
  72. package/dist/structures/decorators/MessageComponentDecorator.js.map +1 -0
  73. package/dist/structures/decorators/Metadata.d.ts +16 -0
  74. package/dist/structures/decorators/Metadata.d.ts.map +1 -0
  75. package/dist/structures/decorators/Metadata.js +50 -0
  76. package/dist/structures/decorators/Metadata.js.map +1 -0
  77. package/dist/structures/decorators/PluginDecorator.d.ts +41 -0
  78. package/dist/structures/decorators/PluginDecorator.d.ts.map +1 -0
  79. package/dist/structures/decorators/PluginDecorator.js +36 -0
  80. package/dist/structures/decorators/PluginDecorator.js.map +1 -0
  81. package/dist/structures/decorators/UseDecorator.d.ts +44 -0
  82. package/dist/structures/decorators/UseDecorator.d.ts.map +1 -0
  83. package/dist/structures/decorators/UseDecorator.js +49 -0
  84. package/dist/structures/decorators/UseDecorator.js.map +1 -0
  85. package/dist/structures/decorators/index.d.ts +4 -0
  86. package/dist/structures/decorators/index.d.ts.map +1 -1
  87. package/dist/structures/decorators/index.js +5 -0
  88. package/dist/structures/decorators/index.js.map +1 -0
  89. package/dist/structures/index.d.ts +3 -1
  90. package/dist/structures/index.d.ts.map +1 -1
  91. package/dist/structures/index.js +5 -1
  92. package/dist/structures/index.js.map +1 -0
  93. package/dist/utils/Util.d.ts +2 -0
  94. package/dist/utils/Util.d.ts.map +1 -1
  95. package/dist/utils/Util.js +23 -8
  96. package/dist/utils/Util.js.map +1 -0
  97. package/dist/utils/cache.d.ts +4 -0
  98. package/dist/utils/cache.d.ts.map +1 -0
  99. package/dist/utils/cache.js +17 -0
  100. package/dist/utils/cache.js.map +1 -0
  101. package/dist/utils/customId.d.ts +12 -0
  102. package/dist/utils/customId.d.ts.map +1 -0
  103. package/dist/utils/customId.js +49 -0
  104. package/dist/utils/customId.js.map +1 -0
  105. package/package.json +35 -9
  106. package/bun.lock +0 -264
@@ -4,6 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.BaseModal = void 0;
7
+ const Metadata_1 = require("../decorators/Metadata");
7
8
  const discord_js_1 = require("discord.js");
8
9
  const __1 = require("..");
9
10
  const node_crypto_1 = __importDefault(require("node:crypto"));
@@ -13,8 +14,8 @@ const Util_1 = require("../../utils/Util");
13
14
  *
14
15
  * @example
15
16
  * ```ts
16
- * import { ModalSubmitInteraction } from "discord.js";
17
- * import { Modal, BaseModal, Interaction, Run } from "oopscord.js";
17
+ * import { ModalSubmitInteraction, TextInputStyle } from "discord.js";
18
+ * import { Modal, ModalLabel, BaseModal, Interaction, Run, TextInputFieldInjection } from "oopscord.js";
18
19
  *
19
20
  * @Modal({
20
21
  * customId: "my_modal",
@@ -26,9 +27,11 @@ const Util_1 = require("../../utils/Util");
26
27
  * component: { type: "text_input", customId: "my_text_input", style: TextInputStyle.Short, placeholder: "Enter something...", required: true }
27
28
  * })
28
29
  * class MyModal extends BaseModal {
29
- * constructor(@Interaction readonly interaction: ModalSubmitInteraction, @TextInputFieldInjection("my_text_input") readonly textInputValue: string) {
30
- * super();
31
- * }
30
+ * @Interaction
31
+ * interaction!: ModalSubmitInteraction;
32
+ *
33
+ * @TextInputFieldInjection("my_text_input")
34
+ * textInputValue!: string;
32
35
  *
33
36
  * @Run
34
37
  * async run() {
@@ -38,146 +41,97 @@ const Util_1 = require("../../utils/Util");
38
41
  * ```
39
42
  */
40
43
  class BaseModal {
41
- static modal = null;
42
- static options;
43
- static components = [];
44
- /** Returns a new {@link ModalBuilder} that was created from the modal options and components. */
44
+ /** Creates an independent builder from the decorated template. */
45
45
  static getModal() {
46
- if (this.modal)
47
- return discord_js_1.ModalBuilder.from(this.modal.toJSON());
48
- const options = Reflect.getMetadata(__1.MODAL_OPTIONS_KEY, this);
49
- const components = Reflect.getMetadata(__1.MODAL_COMPONENTS_KEY, this) ?? [];
50
- if (!options || !components)
51
- throw new TypeError("Failed to get the modal.");
52
- // Reverse the components because they are added to the modal in reverse order due to the way the decorators work.
53
- const reversedComponents = [...components].reverse();
54
- this.options = options;
55
- this.components = [...reversedComponents];
56
- this.modal = create(options, reversedComponents.map(c => c.component));
57
- return discord_js_1.ModalBuilder.from(this.modal.toJSON());
46
+ const options = (0, Metadata_1.getMetadata)(__1.MODAL_OPTIONS_KEY, this);
47
+ const components = [...((0, Metadata_1.getMetadata)(__1.MODAL_COMPONENTS_KEY, this) ?? [])].reverse();
48
+ if (!options)
49
+ throw new TypeError("Failed to get the modal options.");
50
+ return discord_js_1.ModalBuilder.from(create(options, components.map(c => c.component)).toJSON());
58
51
  }
59
- /**
60
- * Returns a new {@link ModalBuilder} with the specified options and component values merged with the default options and components defined in the class.
61
- *
62
- * @param options The options to merge with the default options.
63
- * @param values The component values to merge with the default components. The `customId` property is used to match the values with the correct components, and the `type` property is used to determine which type of component the value is for.
64
- */
52
+ /** Overrides a copy of the template; label IDs and inner field IDs are distinct. */
65
53
  static override(options = {}, ...values) {
66
- const currentOptions = this.options ?? Reflect.getMetadata(__1.MODAL_OPTIONS_KEY, this);
67
- const currentComponents = this.components.length > 0 ? this.components : Reflect.getMetadata(__1.MODAL_COMPONENTS_KEY, this)?.reverse();
68
- if (!currentOptions)
54
+ const defaults = (0, Metadata_1.getMetadata)(__1.MODAL_OPTIONS_KEY, this);
55
+ if (!defaults)
69
56
  throw new TypeError("Failed to get the modal options.");
70
- const newOptions = Util_1.Util.mergeDefault(currentOptions, options);
71
- const newComponents = currentComponents.map(c => {
72
- const { customId, component } = c;
73
- if (component instanceof discord_js_1.LabelBuilder) {
74
- const updatedComponent = new discord_js_1.LabelBuilder(component.toJSON());
75
- const matchingLabelValue = values.find(v => v.customId === customId && v.type === 'label');
76
- if (matchingLabelValue) {
77
- if (matchingLabelValue.label)
78
- updatedComponent.setLabel(matchingLabelValue.label);
79
- if (matchingLabelValue.description)
80
- updatedComponent.setDescription(matchingLabelValue.description);
81
- }
82
- if (component.data.component instanceof discord_js_1.TextInputBuilder) {
83
- const matchingTextInputValue = values.find(v => v.customId === component.data.component.data.custom_id && v.type === 'text_input');
84
- if (matchingTextInputValue) {
85
- if ("value" in component.data.component.data) {
86
- const updatedTextInput = discord_js_1.TextInputBuilder.from(component.data.component.toJSON());
87
- updatedTextInput.setValue(matchingTextInputValue.value);
88
- updatedComponent.setTextInputComponent(updatedTextInput);
89
- }
90
- }
91
- }
92
- else if (component.data.component instanceof discord_js_1.StringSelectMenuBuilder) {
93
- const matchingStringSelectValue = values.find(v => v.customId === component.data.component.data.custom_id && v.type === 'string_select');
94
- if (matchingStringSelectValue) {
95
- const updatedComponent = discord_js_1.StringSelectMenuBuilder.from(component.data.component.toJSON());
96
- updatedComponent.setOptions(matchingStringSelectValue.options);
97
- component.setStringSelectMenuComponent(updatedComponent);
98
- }
99
- }
100
- else if (component.data.component instanceof discord_js_1.RadioGroupBuilder) {
101
- const matchingRadioGroupValue = values.find(v => v.customId === component.data.component.data.custom_id && v.type === 'radio_group');
102
- if (matchingRadioGroupValue) {
103
- const updatedComponent = new discord_js_1.RadioGroupBuilder(component.data.component.toJSON());
104
- if ("required" in matchingRadioGroupValue)
105
- updatedComponent.setRequired(matchingRadioGroupValue.required);
106
- updatedComponent.setOptions(matchingRadioGroupValue.options);
107
- component.setRadioGroupComponent(updatedComponent);
108
- }
109
- }
110
- else if (component.data.component instanceof discord_js_1.CheckboxGroupBuilder) {
111
- const matchingCheckboxGroupValue = values.find(v => v.customId === component.data.component.data.custom_id && v.type === 'checkbox_group');
112
- if (matchingCheckboxGroupValue) {
113
- const updatedComponent = new discord_js_1.CheckboxGroupBuilder(component.data.component.toJSON());
114
- if (typeof matchingCheckboxGroupValue.minValues == "number")
115
- updatedComponent.setMinValues(matchingCheckboxGroupValue.minValues);
116
- if (typeof matchingCheckboxGroupValue.maxValues == "number")
117
- updatedComponent.setMaxValues(matchingCheckboxGroupValue.maxValues);
118
- if ("required" in matchingCheckboxGroupValue)
119
- updatedComponent.setRequired(matchingCheckboxGroupValue.required);
120
- updatedComponent.setOptions(matchingCheckboxGroupValue.options);
121
- component.setCheckboxGroupComponent(updatedComponent);
122
- }
123
- }
124
- else if (component.data.component instanceof discord_js_1.CheckboxBuilder) {
125
- const matchingCheckboxValue = values.find(v => v.customId === component.data.component.data.custom_id && v.type === 'checkbox');
126
- if (matchingCheckboxValue) {
127
- const updatedComponent = new discord_js_1.CheckboxBuilder(component.data.component.toJSON());
128
- if ("default" in matchingCheckboxValue)
129
- updatedComponent.setDefault(matchingCheckboxValue.default);
130
- component.setCheckboxComponent(updatedComponent);
131
- }
132
- }
133
- return { customId, component: updatedComponent };
57
+ const components = [...((0, Metadata_1.getMetadata)(__1.MODAL_COMPONENTS_KEY, this) ?? [])].reverse();
58
+ const builders = components.map(({ customId, component }) => {
59
+ if (component instanceof discord_js_1.TextDisplayBuilder) {
60
+ const copy = new discord_js_1.TextDisplayBuilder(component.toJSON());
61
+ const value = values.find(v => v.type === "text_display" && v.customId === customId);
62
+ if (value?.type === "text_display")
63
+ copy.setContent(value.content);
64
+ return copy;
65
+ }
66
+ const copy = new discord_js_1.LabelBuilder(component.toJSON());
67
+ const label = values.find(v => v.type === "label" && v.customId === customId);
68
+ if (label?.type === "label") {
69
+ if (label.label !== undefined)
70
+ copy.setLabel(label.label);
71
+ if (label.description !== undefined)
72
+ copy.setDescription(label.description);
73
+ }
74
+ const inner = copy.data.component;
75
+ if (!inner)
76
+ return copy;
77
+ const value = values.find(v => v.type !== "label" && v.customId === inner.data.custom_id);
78
+ if (!value)
79
+ return copy;
80
+ if (inner.data.type === discord_js_1.ComponentType.TextInput && value.type === "text_input") {
81
+ inner.setValue(value.value);
82
+ }
83
+ else if (inner.data.type === discord_js_1.ComponentType.StringSelect && value.type === "string_select") {
84
+ inner.setOptions(value.options);
85
+ }
86
+ else if (inner.data.type === discord_js_1.ComponentType.RadioGroup && value.type === "radio_group") {
87
+ inner.setOptions(value.options);
88
+ if (value.required !== undefined)
89
+ inner.setRequired(value.required);
90
+ }
91
+ else if (inner.data.type === discord_js_1.ComponentType.CheckboxGroup && value.type === "checkbox_group") {
92
+ inner.setOptions(value.options);
93
+ if (value.minValues !== undefined)
94
+ inner.setMinValues(value.minValues);
95
+ if (value.maxValues !== undefined)
96
+ inner.setMaxValues(value.maxValues);
97
+ if (value.required !== undefined)
98
+ inner.setRequired(value.required);
134
99
  }
135
- else if (component instanceof discord_js_1.TextDisplayBuilder) {
136
- const updatedComponent = new discord_js_1.TextDisplayBuilder(component.toJSON());
137
- const matchingTextDisplayValue = values.find(v => v.customId === customId && v.type === 'text_display');
138
- if (matchingTextDisplayValue) {
139
- updatedComponent.setContent(matchingTextDisplayValue.content);
140
- }
141
- return { customId, component: updatedComponent };
100
+ else if (inner.data.type === discord_js_1.ComponentType.Checkbox && value.type === "checkbox") {
101
+ if (value.default !== undefined)
102
+ inner.setDefault(value.default);
142
103
  }
143
- return { customId, component };
104
+ return copy;
144
105
  });
145
- const modal = create(newOptions, [...newComponents].map(c => c.component));
146
- return modal;
106
+ return create(Util_1.Util.mergeDefault(defaults, options), builders);
147
107
  }
148
- /**
149
- * Shows modal to user and recieve the input.
150
- * @param itr The interaction to show the modal to. Must be a command or button interaction.
151
- * @returns The fields submitted by the user in the modal.
152
- */
153
- static getInput(itr) {
154
- return new Promise((r, j) => {
155
- if (itr.replied || itr.deferred)
156
- return j("Interaction already replied.");
157
- const id = node_crypto_1.default.createHash("md5")
158
- .update(Math.floor(Math.random() * (99999999 - 10000000) + 10000000).toString())
159
- .digest("hex");
160
- itr.showModal(this.getModal().setCustomId(id));
161
- let listener = async (itr) => {
162
- if (!itr.isModalSubmit() || itr.customId != id)
163
- return;
164
- await itr.deferUpdate();
165
- r(itr.fields);
166
- itr.client.off("interactionCreate", listener);
167
- };
168
- itr.client.on("interactionCreate", listener);
169
- setTimeout(() => {
170
- itr.client.off("interactionCreate", listener);
171
- j("Timed out");
172
- }, 180 * 1000);
108
+ /** Shows a modal and collects input from the invoking user. Errors reject immediately. */
109
+ static async getInput(itr, options = {}) {
110
+ if (itr.replied || itr.deferred)
111
+ throw new Error("Interaction already replied.");
112
+ const time = options.time ?? 180_000;
113
+ if (!Number.isFinite(time) || time <= 0)
114
+ throw new RangeError("Modal timeout must be positive.");
115
+ const id = node_crypto_1.default.randomUUID();
116
+ await itr.showModal(this.getModal().setCustomId(id));
117
+ const submission = await itr.awaitModalSubmit({
118
+ filter: candidate => candidate.customId === id && candidate.user.id === itr.user.id,
119
+ time
173
120
  });
121
+ if (submission.isFromMessage()) {
122
+ await submission.deferUpdate();
123
+ }
124
+ else {
125
+ await submission.deferReply({ flags: discord_js_1.MessageFlags.Ephemeral });
126
+ await submission.deleteReply();
127
+ }
128
+ return submission.fields;
174
129
  }
175
130
  }
176
131
  exports.BaseModal = BaseModal;
177
132
  function create(options, components) {
178
- const modal = new discord_js_1.ModalBuilder()
179
- .setTitle(options.title)
180
- .setCustomId(options.customId);
133
+ const modal = new discord_js_1.ModalBuilder().setTitle(options.title).setCustomId(options.customId);
181
134
  modal.components.push(...components);
182
135
  return modal;
183
136
  }
137
+ //# sourceMappingURL=BaseModal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BaseModal.js","sourceRoot":"","sources":["../../../src/structures/components/BaseModal.ts"],"names":[],"mappings":";;;;;;AAAA,qDAAqD;AACrD,2CAA+Q;AAC/Q,0BAAsH;AACtH,8DAAiC;AACjC,2CAAwC;AAWxC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,MAAa,SAAS;IAClB,kEAAkE;IAClE,MAAM,CAAC,QAAQ;QACX,MAAM,OAAO,GAAG,IAAA,sBAAW,EAAC,qBAAiB,EAAE,IAAI,CAA6B,CAAC;QACjF,MAAM,UAAU,GAAG,CAAC,GAAG,CAAC,IAAA,sBAAW,EAAC,wBAAoB,EAAE,IAAI,CAAyB,IAAI,EAA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AAU,CAAC,IAAI,CAAC,GAAG,UAAU,CAAC,CAAC;IACrC,OAAO,KAAK,CAAC;AACjB,CAAC"}
@@ -24,9 +24,8 @@ import { ChannelSelectMenuOptions, MentionableSelectMenuOptions, RoleSelectMenuO
24
24
  * ]
25
25
  * })
26
26
  * class MySelectMenu extends BaseSelectMenu {
27
- * constructor(@Interaction readonly interaction: StringSelectMenuInteraction) {
28
- * super();
29
- * }
27
+ * @Interaction
28
+ * interaction!: StringSelectMenuInteraction;
30
29
  *
31
30
  * @Run
32
31
  * async run() {
@@ -36,8 +35,6 @@ import { ChannelSelectMenuOptions, MentionableSelectMenuOptions, RoleSelectMenuO
36
35
  * ```
37
36
  */
38
37
  export declare class BaseSelectMenu {
39
- private static genericSelectMenu;
40
- private static options;
41
38
  /** Returns a new {@link SelectMenuBuilder} that was created from the select menu options. */
42
39
  static getSelectMenu(): StringSelectMenuBuilder | UserSelectMenuBuilder | ChannelSelectMenuBuilder | RoleSelectMenuBuilder | MentionableSelectMenuBuilder;
43
40
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"BaseSelectMenu.d.ts","sourceRoot":"","sources":["../../../src/structures/components/BaseSelectMenu.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,4BAA4B,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAC3J,OAAO,EAAyB,wBAAwB,EAAE,4BAA4B,EAAE,qBAAqB,EAAiD,uBAAuB,EAAE,qBAAqB,EAAE,MAAM,IAAI,CAAC;AAGzN;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,qBAAa,cAAc;IACvB,OAAO,CAAC,MAAM,CAAC,iBAAiB,CAAoC;IACpE,OAAO,CAAC,MAAM,CAAC,OAAO,CAAwB;IAE9C,6FAA6F;IAC7F,MAAM,CAAC,aAAa;IAiBpB;;;;;OAKG;IACH,MAAM,CAAC,QAAQ,CAAC,CAAC,SAAS,cAA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CAAC,CAAC,SAAS,CAAC,CAAC"}
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.BaseSelectMenu = void 0;
4
+ const Metadata_1 = require("../decorators/Metadata");
4
5
  const discord_js_1 = require("discord.js");
5
6
  const __1 = require("..");
6
7
  const Util_1 = require("../../utils/Util");
@@ -28,9 +29,8 @@ const Util_1 = require("../../utils/Util");
28
29
  * ]
29
30
  * })
30
31
  * class MySelectMenu extends BaseSelectMenu {
31
- * constructor(@Interaction readonly interaction: StringSelectMenuInteraction) {
32
- * super();
33
- * }
32
+ * @Interaction
33
+ * interaction!: StringSelectMenuInteraction;
34
34
  *
35
35
  * @Run
36
36
  * async run() {
@@ -40,20 +40,13 @@ const Util_1 = require("../../utils/Util");
40
40
  * ```
41
41
  */
42
42
  class BaseSelectMenu {
43
- static genericSelectMenu;
44
- static options;
45
43
  /** Returns a new {@link SelectMenuBuilder} that was created from the select menu options. */
46
44
  static getSelectMenu() {
47
- if (this.genericSelectMenu)
48
- return this.genericSelectMenu.copy();
49
- const type = Reflect.getMetadata(__1.SELECT_MENU_TYPE_KEY, this);
50
- const options = Reflect.getMetadata(__1.SELECT_MENU_OPTIONS_KEY, this);
45
+ const type = (0, Metadata_1.getMetadata)(__1.SELECT_MENU_TYPE_KEY, this);
46
+ const options = (0, Metadata_1.getMetadata)(__1.SELECT_MENU_OPTIONS_KEY, this);
51
47
  if (!options)
52
48
  throw new TypeError("Failed to get the select menu.");
53
- this.genericSelectMenu = new GenericSelectMenu(type);
54
- this.genericSelectMenu.create(options);
55
- this.options = options;
56
- return this.genericSelectMenu.copy();
49
+ return new GenericSelectMenu(type).create(options);
57
50
  }
58
51
  /**
59
52
  * Returns a new {@link SelectMenuBuilder} with the specified options merged with the default options defined in the class, and the specified values merged with the default values defined in the class if the options include a `options` property (for StringSelectMenu) or `defaultUsers`/`defaultRoles`/`defaultChannels` property (for UserSelectMenu, RoleSelectMenu, ChannelSelectMenu, and MentionableSelectMenu).
@@ -62,16 +55,15 @@ class BaseSelectMenu {
62
55
  * @param values The component values to merge with the default components. The `customId` property is used to match the values with the correct components, and the `type` property is used to determine which type of component the value is for.
63
56
  */
64
57
  static override(options = {}, ...values) {
65
- if (!this.genericSelectMenu) {
66
- this.getSelectMenu();
67
- }
68
- const currentOptions = (this.options ?? Reflect.getMetadata(__1.SELECT_MENU_OPTIONS_KEY, this));
58
+ const type = (0, Metadata_1.getMetadata)(__1.SELECT_MENU_TYPE_KEY, this);
59
+ const currentOptions = (0, Metadata_1.getMetadata)(__1.SELECT_MENU_OPTIONS_KEY, this);
60
+ const selectMenu = new GenericSelectMenu(type);
69
61
  if (!currentOptions)
70
62
  throw new TypeError("Failed to get the select menu options.");
71
- if (values.length > 0 && !this.genericSelectMenu.isStringSelect())
63
+ if (values.length > 0 && !selectMenu.isStringSelect())
72
64
  throw new TypeError("Values can only be overridden for StringSelectMenu.");
73
65
  const newOptions = values.length > 0 ? Util_1.Util.mergeDefault(currentOptions, { ...options, options: values }) : Util_1.Util.mergeDefault(currentOptions, options);
74
- return this.genericSelectMenu.create(newOptions);
66
+ return selectMenu.create(newOptions);
75
67
  }
76
68
  }
77
69
  exports.BaseSelectMenu = BaseSelectMenu;
@@ -105,13 +97,16 @@ class GenericSelectMenu {
105
97
  else if (this.isRoleSelect() && "defaultRoles" in options) {
106
98
  menu.setDefaultRoles(options.defaultRoles ?? []);
107
99
  }
108
- else if (this.isChannelSelect() && "channelTypes" in options) {
109
- menu.setChannelTypes(options.channelTypes ?? [])
110
- .setDefaultChannels(options.defaultChannels ?? []);
100
+ else if (this.isChannelSelect()) {
101
+ const channelOptions = options;
102
+ if (channelOptions.channelTypes)
103
+ menu.setChannelTypes(channelOptions.channelTypes);
104
+ menu.setDefaultChannels(channelOptions.defaultChannels ?? []);
111
105
  }
112
- else if (this.isMentionableSelect() && "defaultUsers" in options && "defaultRoles" in options) {
113
- menu.addDefaultUsers(options.defaultUsers ?? [])
114
- .addDefaultRoles(options.defaultRoles ?? []);
106
+ else if (this.isMentionableSelect()) {
107
+ const mentionableOptions = options;
108
+ menu.addDefaultUsers(mentionableOptions.defaultUsers ?? [])
109
+ .addDefaultRoles(mentionableOptions.defaultRoles ?? []);
115
110
  }
116
111
  menu.setCustomId(options.customId);
117
112
  if (options.placeholder)
@@ -131,3 +126,4 @@ class GenericSelectMenu {
131
126
  return this.selectMenu.constructor.from(this.selectMenu.toJSON());
132
127
  }
133
128
  }
129
+ //# sourceMappingURL=BaseSelectMenu.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BaseSelectMenu.js","sourceRoot":"","sources":["../../../src/structures/components/BaseSelectMenu.ts"],"names":[],"mappings":";;;AAAA,qDAAqD;AACrD,2CAA2J;AAC3J,0BAAyN;AACzN,2CAAwC;AAExC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,MAAa,cAAc;IACvB,6FAA6F;IAC7F,MAAM,CAAC,aAAa;QAChB,MAAM,IAAI,GAAG,IAAA,sBAAW,EAAC,wBAAoB,EAAE,IAAI,CAAmB,CAAC;QACvE,MAAM,OAAO,GAAG,IAAA,sBAAW,EAAC,2BAAuB,EAAE,IAAI,CAA0B,CAAC;QAEpF,IAAI,CAAC,OAAO;YAAE,MAAM,IAAI,SAAS,CAAC,gCAAgC,CAAC,CAAC;QAEpE,OAAO,IAAI,iBAAiB,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IACvD,CAAC;IAED;;;;;OAKG;IACH,MAAM,CAAC,QAAQ,CAA2B,UAAuC,EAAE,EAAE,GAAG,MAAgF;QACpK,MAAM,IAAI,GAAG,IAAA,sBAAW,EAAC,wBAAoB,EAAE,IAAI,CAAM,CAAC;QAC1D,MAAM,cAAc,GAAG,IAAA,sBAAW,EAAC,2BAAuB,EAAE,IAAI,CAAuB,CAAC;QACxF,MAAM,UAAU,GAAG,IAAI,iBAAiB,CAAC,IAAI,CAAC,CAAC;QA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,IAAI,OAAO,CAAC,QAAQ;YAAE,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QACzD,IAAI,OAAO,OAAO,CAAC,SAAS,KAAK,QAAQ;YAAE,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QAChF,IAAI,OAAO,OAAO,CAAC,SAAS,KAAK,QAAQ;YAAE,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QAEhF,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;QAEvB,OAAQ,OAAe,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;IAChD,CAAC;IAED,IAAI;QACA,IAAI,CAAC,IAAI,CAAC,UAAU;YAAE,MAAM,IAAI,SAAS,CAAC,uCAAuC,CAAC,CAAC;QAEnF,OAAQ,IAAI,CAAC,UAAU,CAAC,WAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,CAAkB,CAAC;IAChG,CAAC;CACJ"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Marker class for event listeners. This class is used to identify event listener classes in the event module system.
3
+ *
4
+ * @example
5
+ * ```ts
6
+ * import { Listener } from "oopscord.js";
7
+ *
8
+ * class MyListener extends Listener {
9
+ * @EventHandler("messageCreate")
10
+ * onMessageCreate(message: Message) {
11
+ * message.reply("Hello, World!");
12
+ * }
13
+ * }
14
+ * ```
15
+ */
16
+ export declare class Listener {
17
+ }
18
+ //# sourceMappingURL=Listener.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Listener.d.ts","sourceRoot":"","sources":["../../../src/structures/components/Listener.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,qBAAa,QAAQ;CAAG"}
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Listener = void 0;
4
+ /**
5
+ * Marker class for event listeners. This class is used to identify event listener classes in the event module system.
6
+ *
7
+ * @example
8
+ * ```ts
9
+ * import { Listener } from "oopscord.js";
10
+ *
11
+ * class MyListener extends Listener {
12
+ * @EventHandler("messageCreate")
13
+ * onMessageCreate(message: Message) {
14
+ * message.reply("Hello, World!");
15
+ * }
16
+ * }
17
+ * ```
18
+ */
19
+ class Listener {
20
+ }
21
+ exports.Listener = Listener;
22
+ //# sourceMappingURL=Listener.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Listener.js","sourceRoot":"","sources":["../../../src/structures/components/Listener.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;GAcG;AACH,MAAa,QAAQ;CAAG;AAAxB,4BAAwB"}
@@ -1,4 +1,5 @@
1
1
  export * from "./BaseButton";
2
2
  export * from "./BaseSelectMenu";
3
3
  export * from "./BaseModal";
4
+ export * from "./Listener";
4
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/structures/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/structures/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC"}
@@ -17,3 +17,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./BaseButton"), exports);
18
18
  __exportStar(require("./BaseSelectMenu"), exports);
19
19
  __exportStar(require("./BaseModal"), exports);
20
+ __exportStar(require("./Listener"), exports);
21
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/structures/components/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA6B;AAC7B,mDAAiC;AACjC,8CAA4B;AAC5B,6CAA2B"}
@@ -1,7 +1,9 @@
1
- import { ApplicationCommandOptionAllowedChannelTypes, CommandInteractionOptionResolver, ContextMenuCommandType } from "discord.js";
1
+ import { StandardClassDecorator } from "./Metadata";
2
+ import { ApplicationCommandOptionAllowedChannelTypes, ContextMenuCommandType } from "discord.js";
2
3
  import { APIApplicationCommandOptionChoice, ApplicationIntegrationType } from "discord-api-types/v10";
4
+ import { InjectionDecorator } from "./InjectionMetadata";
3
5
  export type CommandModuleOptions = {
4
- commands: (new (...args: any[]) => any)[];
6
+ commands?: (new (...args: any[]) => any)[];
5
7
  };
6
8
  export type CommandOptions = {
7
9
  name: string;
@@ -11,8 +13,9 @@ export type ContextMenuOptions = {
11
13
  name: string;
12
14
  type: ContextMenuCommandType;
13
15
  };
16
+ /** Option names default to the decorated property name. Optional values are injected as null. */
14
17
  export type BaseOptions = {
15
- name: string;
18
+ name?: string;
16
19
  description: string;
17
20
  required?: boolean;
18
21
  };
@@ -30,40 +33,38 @@ export type NumericOptions = BaseOptions & {
30
33
  autocomplete?: boolean;
31
34
  };
32
35
  export type ChannelOptions = BaseOptions & {
33
- channelTypes: ApplicationCommandOptionAllowedChannelTypes[];
34
- };
35
- export type OptionsIndex = {
36
- name: string;
37
- getMethod: keyof Omit<CommandInteractionOptionResolver, "getMessage" | "getFocused">;
38
- index: number;
36
+ channelTypes?: ApplicationCommandOptionAllowedChannelTypes[];
39
37
  };
40
- export declare function CommandModule(options: CommandModuleOptions): ClassDecorator;
41
- export declare function IntegrationTypes(...types: ApplicationIntegrationType[][] | ApplicationIntegrationType[]): ClassDecorator;
42
- export declare function Command(option: CommandOptions): ClassDecorator;
43
- export declare function Subcommand(option: CommandOptions): ClassDecorator;
44
- export declare function Private(guild: string): <TFunction extends Function>(constructor: TFunction) => void;
45
- export declare function AddSubcommand(subcommand: Function): <T extends Function>(constructor: T) => void;
46
- export declare function AddSubcommandGroup(option: BaseOptions, ...subcommands: Function[]): <T extends Function>(constructor: T) => void;
47
- export declare function StringOption(option: StringOptions): ClassDecorator;
48
- export declare function StringOptionWithChoices(option: OptionWithChoices<string>): ClassDecorator;
49
- export declare function IntegerOption(option: NumericOptions): ClassDecorator;
50
- export declare function IntegerOptionWithChoices(option: OptionWithChoices<number>): ClassDecorator;
51
- export declare function NumberOption(option: NumericOptions): ClassDecorator;
52
- export declare function NumberOptionWithChoices(option: OptionWithChoices<number>): ClassDecorator;
53
- export declare function BooleanOption(option: BaseOptions): <T extends Function>(constructor: T) => void;
54
- export declare function UserOption(option: BaseOptions): <T extends Function>(constructor: T) => void;
55
- export declare function ChannelOption(option: ChannelOptions): <T extends Function>(constructor: T) => void;
56
- export declare function RoleOption(option: BaseOptions): <T extends Function>(constructor: T) => void;
57
- export declare function MentionableOption(option: BaseOptions): <T extends Function>(constructor: T) => void;
58
- export declare function AttachmentOption(option: BaseOptions): <T extends Function>(constructor: T) => void;
59
- export declare function StringOptionInjection(name: string): (target: Object, _propertyKey: string | symbol | undefined, parameterIndex: number) => void;
60
- export declare function IntegerOptionInjection(name: string): (target: Object, _propertyKey: string | symbol | undefined, parameterIndex: number) => void;
61
- export declare function NumberOptionInjection(name: string): (target: Object, _propertyKey: string | symbol | undefined, parameterIndex: number) => void;
62
- export declare function BooleanOptionInjection(name: string): (target: Object, _propertyKey: string | symbol | undefined, parameterIndex: number) => void;
63
- export declare function UserOptionInjection(name: string): (target: Object, _propertyKey: string | symbol | undefined, parameterIndex: number) => void;
64
- export declare function ChannelOptionInjection(name: string): (target: Object, _propertyKey: string | symbol | undefined, parameterIndex: number) => void;
65
- export declare function RoleOptionInjection(name: string): (target: Object, _propertyKey: string | symbol | undefined, parameterIndex: number) => void;
66
- export declare function MentionableOptionInjection(name: string): (target: Object, _propertyKey: string | symbol | undefined, parameterIndex: number) => void;
67
- export declare function AttachmentOptionInjection(name: string): (target: Object, _propertyKey: string | symbol | undefined, parameterIndex: number) => void;
68
- export declare function ContextMenu(option: ContextMenuOptions): ClassDecorator;
38
+ export declare function CommandModule(options: CommandModuleOptions): StandardClassDecorator;
39
+ export declare function IntegrationTypes(...types: ApplicationIntegrationType[][] | ApplicationIntegrationType[]): StandardClassDecorator;
40
+ export declare function Command(option: CommandOptions): StandardClassDecorator;
41
+ export declare function Subcommand(option: CommandOptions): StandardClassDecorator;
42
+ export declare function Private(guild: string): StandardClassDecorator;
43
+ export declare function AddSubcommand(subcommand: Function): StandardClassDecorator;
44
+ export declare function AddSubcommandGroup(option: CommandOptions, ...subcommands: Function[]): StandardClassDecorator;
45
+ /** Declares a command option and injects its value into this property. */
46
+ export declare function StringOption(option: StringOptions): InjectionDecorator;
47
+ /** Declares a command option and injects its value into this property. */
48
+ export declare function StringOptionWithChoices(option: OptionWithChoices<string>): InjectionDecorator;
49
+ /** Declares a command option and injects its value into this property. */
50
+ export declare function IntegerOption(option: NumericOptions): InjectionDecorator;
51
+ /** Declares a command option and injects its value into this property. */
52
+ export declare function IntegerOptionWithChoices(option: OptionWithChoices<number>): InjectionDecorator;
53
+ /** Declares a command option and injects its value into this property. */
54
+ export declare function NumberOption(option: NumericOptions): InjectionDecorator;
55
+ /** Declares a command option and injects its value into this property. */
56
+ export declare function NumberOptionWithChoices(option: OptionWithChoices<number>): InjectionDecorator;
57
+ /** Declares a command option and injects its value into this property. */
58
+ export declare function BooleanOption(option: BaseOptions): InjectionDecorator;
59
+ /** Declares a command option and injects its value into this property. */
60
+ export declare function UserOption(option: BaseOptions): InjectionDecorator;
61
+ /** Declares a command option and injects its value into this property. */
62
+ export declare function ChannelOption(option: ChannelOptions): InjectionDecorator;
63
+ /** Declares a command option and injects its value into this property. */
64
+ export declare function RoleOption(option: BaseOptions): InjectionDecorator;
65
+ /** Declares a command option and injects its value into this property. */
66
+ export declare function MentionableOption(option: BaseOptions): InjectionDecorator;
67
+ /** Declares a command option and injects its value into this property. */
68
+ export declare function AttachmentOption(option: BaseOptions): InjectionDecorator;
69
+ export declare function ContextMenu(option: ContextMenuOptions): StandardClassDecorator;
69
70
  //# sourceMappingURL=CommandDecorator.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CommandDecorator.d.ts","sourceRoot":"","sources":["../../../src/structures/decorators/CommandDecorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2CAA2C,EAAE,gCAAgC,EAAE,sBAAsB,EAAuV,MAAM,YAAY,CAAC;AACxd,OAAO,EAAe,iCAAiC,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AAInH,MAAM,MAAM,oBAAoB,GAAG;IAAE,QAAQ,EAAE,CAAC,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC,EAAE,CAAA;CAAE,CAAA;AAChF,MAAM,MAAM,cAAc,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,CAAA;AAClE,MAAM,MAAM,kBAAkB,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,sBAAsB,CAAA;CAAE,CAAA;AAC/E,MAAM,MAAM,WAAW,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,CAAA;AACnF,MAAM,MAAM,iBAAiB,CAAC,SAAS,SAAS,CAAC,MAAM,GAAG,MAAM,CAAC,IAAI,WAAW,GAAG;IAAE,OAAO,EAAE,iCAAiC,CAAC,SAAS,CAAC,EAAE,CAAA;CAAE,CAAA;AAC9I,MAAM,MAAM,aAAa,GAAG,WAAW,GAAG;IAAE,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,YAAY,CAAC,EAAE,OAAO,CAAA;CAAE,CAAA;AAC5G,MAAM,MAAM,cAAc,GAAG,WAAW,GAAG;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,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