oopscord.js 0.0.16 → 0.0.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/structures/components/BaseButton.d.ts +1 -1
- package/dist/structures/components/BaseButton.d.ts.map +1 -1
- package/dist/structures/components/BaseButton.js +4 -4
- package/dist/structures/components/BaseModal.d.ts +1 -1
- package/dist/structures/components/BaseModal.d.ts.map +1 -1
- package/dist/structures/components/BaseModal.js +4 -4
- package/dist/structures/components/BaseSelectMenu.d.ts +1 -1
- package/dist/structures/components/BaseSelectMenu.d.ts.map +1 -1
- package/dist/structures/components/BaseSelectMenu.js +4 -4
- package/package.json +1 -1
|
@@ -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
|
|
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,10 +4,10 @@ exports.BaseButton = void 0;
|
|
|
4
4
|
const discord_js_1 = require("discord.js");
|
|
5
5
|
const __1 = require("..");
|
|
6
6
|
class BaseButton {
|
|
7
|
-
static
|
|
7
|
+
static button = null;
|
|
8
8
|
static getButton() {
|
|
9
|
-
if (this
|
|
10
|
-
return this
|
|
9
|
+
if (this.button)
|
|
10
|
+
return this.button;
|
|
11
11
|
const button = new discord_js_1.ButtonBuilder();
|
|
12
12
|
const options = Reflect.getMetadata(__1.BUTTON_OPTIONS_KEY, this.constructor);
|
|
13
13
|
if (!options)
|
|
@@ -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
|
|
37
|
+
this.button = button;
|
|
38
38
|
return button;
|
|
39
39
|
}
|
|
40
40
|
}
|
|
@@ -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
|
|
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,10 +4,10 @@ exports.BaseModal = void 0;
|
|
|
4
4
|
const discord_js_1 = require("discord.js");
|
|
5
5
|
const __1 = require("..");
|
|
6
6
|
class BaseModal {
|
|
7
|
-
static
|
|
7
|
+
static modal = null;
|
|
8
8
|
static getModal() {
|
|
9
|
-
if (this
|
|
10
|
-
return this
|
|
9
|
+
if (this.modal)
|
|
10
|
+
return this.modal;
|
|
11
11
|
const modal = new discord_js_1.ModalBuilder();
|
|
12
12
|
const options = Reflect.getMetadata(__1.MODAL_OPTIONS_KEY, this.constructor);
|
|
13
13
|
const components = Reflect.getMetadata(__1.MODAL_COMPONENTS_KEY, this.constructor) ?? [];
|
|
@@ -17,7 +17,7 @@ class BaseModal {
|
|
|
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
|
|
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
|
-
|
|
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
|
|
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,10 +4,10 @@ exports.BaseSelectMenu = void 0;
|
|
|
4
4
|
const discord_js_1 = require("discord.js");
|
|
5
5
|
const __1 = require("..");
|
|
6
6
|
class BaseSelectMenu {
|
|
7
|
-
static
|
|
7
|
+
static selelctMenu = null;
|
|
8
8
|
static getSelectMenu() {
|
|
9
|
-
if (this
|
|
10
|
-
return this
|
|
9
|
+
if (this.selelctMenu)
|
|
10
|
+
return this.selelctMenu;
|
|
11
11
|
let selectMenu;
|
|
12
12
|
const type = Reflect.getMetadata(__1.SELECT_MENU_TYPE_KEY, this.constructor);
|
|
13
13
|
const options = Reflect.getMetadata(__1.SELECT_MENU_OPTIONS_KEY, this.constructor);
|
|
@@ -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
|
|
51
|
+
this.selelctMenu = selectMenu;
|
|
52
52
|
return selectMenu;
|
|
53
53
|
}
|
|
54
54
|
static withValues(...values) {
|