oopscord.js 0.0.16 → 0.0.18

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.
@@ -1,6 +1,6 @@
1
1
  import { ButtonBuilder } from "discord.js";
2
2
  export declare class BaseButton {
3
- #private;
3
+ static button: ButtonBuilder | null;
4
4
  static getButton(): ButtonBuilder;
5
5
  }
6
6
  //# sourceMappingURL=BaseButton.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"BaseButton.d.ts","sourceRoot":"","sources":["../../../src/structures/components/BaseButton.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAe,MAAM,YAAY,CAAC;AAGxD,qBAAa,UAAU;;IAGnB,MAAM,CAAC,SAAS;CAkCnB"}
1
+ {"version":3,"file":"BaseButton.d.ts","sourceRoot":"","sources":["../../../src/structures/components/BaseButton.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAe,MAAM,YAAY,CAAC;AAGxD,qBAAa,UAAU;IACnB,MAAM,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI,CAAQ;IAE3C,MAAM,CAAC,SAAS;CAkCnB"}
@@ -4,12 +4,12 @@ exports.BaseButton = void 0;
4
4
  const discord_js_1 = require("discord.js");
5
5
  const __1 = require("..");
6
6
  class BaseButton {
7
- static #button = null;
7
+ static button = null;
8
8
  static getButton() {
9
- if (this.#button)
10
- return this.#button;
9
+ if (this.button)
10
+ return this.button;
11
11
  const button = new discord_js_1.ButtonBuilder();
12
- const options = Reflect.getMetadata(__1.BUTTON_OPTIONS_KEY, this.constructor);
12
+ const options = Reflect.getMetadata(__1.BUTTON_OPTIONS_KEY, this);
13
13
  if (!options)
14
14
  throw new TypeError("Failed to get the button.");
15
15
  if (options.style == discord_js_1.ButtonStyle.Premium) {
@@ -34,7 +34,7 @@ class BaseButton {
34
34
  button.setEmoji(options.emoji);
35
35
  if (options.disabled)
36
36
  button.setDisabled(options.disabled);
37
- this.#button = button;
37
+ this.button = button;
38
38
  return button;
39
39
  }
40
40
  }
@@ -1,6 +1,6 @@
1
1
  import { ModalBuilder } from "discord.js";
2
2
  export declare class BaseModal {
3
- #private;
3
+ static modal: ModalBuilder | null;
4
4
  static getModal(): ModalBuilder;
5
5
  static withDefaultValues(...values: {
6
6
  customId: string;
@@ -1 +1 @@
1
- {"version":3,"file":"BaseModal.d.ts","sourceRoot":"","sources":["../../../src/structures/components/BaseModal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoD,YAAY,EAAE,MAAM,YAAY,CAAC;AAG5F,qBAAa,SAAS;;IAGlB,MAAM,CAAC,QAAQ;IAoBf,MAAM,CAAC,iBAAiB,CAAC,GAAG,MAAM,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE;CAc5E"}
1
+ {"version":3,"file":"BaseModal.d.ts","sourceRoot":"","sources":["../../../src/structures/components/BaseModal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoD,YAAY,EAAE,MAAM,YAAY,CAAC;AAG5F,qBAAa,SAAS;IAClB,MAAM,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI,CAAQ;IAEzC,MAAM,CAAC,QAAQ;IAoBf,MAAM,CAAC,iBAAiB,CAAC,GAAG,MAAM,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE;CAc5E"}
@@ -4,20 +4,20 @@ exports.BaseModal = void 0;
4
4
  const discord_js_1 = require("discord.js");
5
5
  const __1 = require("..");
6
6
  class BaseModal {
7
- static #modal = null;
7
+ static modal = null;
8
8
  static getModal() {
9
- if (this.#modal)
10
- return this.#modal;
9
+ if (this.modal)
10
+ return this.modal;
11
11
  const modal = new discord_js_1.ModalBuilder();
12
- const options = Reflect.getMetadata(__1.MODAL_OPTIONS_KEY, this.constructor);
13
- const components = Reflect.getMetadata(__1.MODAL_COMPONENTS_KEY, this.constructor) ?? [];
12
+ const options = Reflect.getMetadata(__1.MODAL_OPTIONS_KEY, this);
13
+ const components = Reflect.getMetadata(__1.MODAL_COMPONENTS_KEY, this) ?? [];
14
14
  if (!options)
15
15
  throw new TypeError("Failed to get the modal.");
16
16
  modal
17
17
  .setTitle(options.title)
18
18
  .setCustomId(options.customId);
19
19
  modal.setComponents(new discord_js_1.ActionRowBuilder(...components.map(c => c.toJSON())));
20
- this.#modal = modal;
20
+ this.modal = modal;
21
21
  return modal;
22
22
  }
23
23
  static withDefaultValues(...values) {
@@ -1,6 +1,6 @@
1
1
  import { ChannelSelectMenuBuilder, MentionableSelectMenuBuilder, RoleSelectMenuBuilder, StringSelectMenuBuilder, UserSelectMenuBuilder } from "discord.js";
2
2
  export declare class BaseSelectMenu {
3
- #private;
3
+ static selelctMenu: StringSelectMenuBuilder | UserSelectMenuBuilder | RoleSelectMenuBuilder | ChannelSelectMenuBuilder | MentionableSelectMenuBuilder | null;
4
4
  static getSelectMenu(): StringSelectMenuBuilder | UserSelectMenuBuilder | RoleSelectMenuBuilder | ChannelSelectMenuBuilder | MentionableSelectMenuBuilder;
5
5
  static withValues(...values: {
6
6
  label: string;
@@ -1 +1 @@
1
- {"version":3,"file":"BaseSelectMenu.d.ts","sourceRoot":"","sources":["../../../src/structures/components/BaseSelectMenu.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,wBAAwB,EAAiB,4BAA4B,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAGpM,qBAAa,cAAc;;IAGvB,MAAM,CAAC,aAAa;IAkDpB,MAAM,CAAC,UAAU,CAAC,GAAG,MAAM,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE;CASxG"}
1
+ {"version":3,"file":"BaseSelectMenu.d.ts","sourceRoot":"","sources":["../../../src/structures/components/BaseSelectMenu.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,wBAAwB,EAAiB,4BAA4B,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAGpM,qBAAa,cAAc;IACvB,MAAM,CAAC,WAAW,EAAE,uBAAuB,GAAG,qBAAqB,GAAG,qBAAqB,GAAG,wBAAwB,GAAG,4BAA4B,GAAG,IAAI,CAAQ;IAEpK,MAAM,CAAC,aAAa;IAkDpB,MAAM,CAAC,UAAU,CAAC,GAAG,MAAM,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE;CASxG"}
@@ -4,13 +4,13 @@ exports.BaseSelectMenu = void 0;
4
4
  const discord_js_1 = require("discord.js");
5
5
  const __1 = require("..");
6
6
  class BaseSelectMenu {
7
- static #selectMenu = null;
7
+ static selelctMenu = null;
8
8
  static getSelectMenu() {
9
- if (this.#selectMenu)
10
- return this.#selectMenu;
9
+ if (this.selelctMenu)
10
+ return this.selelctMenu;
11
11
  let selectMenu;
12
- const type = Reflect.getMetadata(__1.SELECT_MENU_TYPE_KEY, this.constructor);
13
- const options = Reflect.getMetadata(__1.SELECT_MENU_OPTIONS_KEY, this.constructor);
12
+ const type = Reflect.getMetadata(__1.SELECT_MENU_TYPE_KEY, this);
13
+ const options = Reflect.getMetadata(__1.SELECT_MENU_OPTIONS_KEY, this);
14
14
  if (!options)
15
15
  throw new TypeError("Failed to get the select menu.");
16
16
  switch (type) {
@@ -48,7 +48,7 @@ class BaseSelectMenu {
48
48
  selectMenu.setMinValues(options.minValues);
49
49
  if (typeof options.maxValues == 'number')
50
50
  selectMenu.setMaxValues(options.maxValues);
51
- this.#selectMenu = selectMenu;
51
+ this.selelctMenu = selectMenu;
52
52
  return selectMenu;
53
53
  }
54
54
  static withValues(...values) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oopscord.js",
3
- "version": "0.0.16",
3
+ "version": "0.0.18",
4
4
  "description": "An easy way to make discord apps in typescript.",
5
5
  "main": "dist",
6
6
  "scripts": {