oopscord.js 0.0.15 → 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 +2 -2
- package/dist/structures/components/BaseButton.d.ts.map +1 -1
- package/dist/structures/components/BaseButton.js +5 -5
- package/dist/structures/components/BaseModal.d.ts +3 -3
- package/dist/structures/components/BaseModal.d.ts.map +1 -1
- package/dist/structures/components/BaseModal.js +6 -6
- package/dist/structures/components/BaseSelectMenu.d.ts +3 -3
- package/dist/structures/components/BaseSelectMenu.d.ts.map +1 -1
- package/dist/structures/components/BaseSelectMenu.js +6 -6
- 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
|
-
|
|
8
|
-
getButton() {
|
|
9
|
-
if (this
|
|
10
|
-
return this
|
|
7
|
+
static button = null;
|
|
8
|
+
static getButton() {
|
|
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,8 +1,8 @@
|
|
|
1
1
|
import { ModalBuilder } from "discord.js";
|
|
2
2
|
export declare class BaseModal {
|
|
3
|
-
|
|
4
|
-
getModal(): ModalBuilder;
|
|
5
|
-
withDefaultValues(...values: {
|
|
3
|
+
static modal: ModalBuilder | null;
|
|
4
|
+
static getModal(): ModalBuilder;
|
|
5
|
+
static withDefaultValues(...values: {
|
|
6
6
|
customId: string;
|
|
7
7
|
value: string;
|
|
8
8
|
}[]): ModalBuilder;
|
|
@@ -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
|
-
|
|
8
|
-
getModal() {
|
|
9
|
-
if (this
|
|
10
|
-
return this
|
|
7
|
+
static modal = null;
|
|
8
|
+
static getModal() {
|
|
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,10 +17,10 @@ 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
|
-
withDefaultValues(...values) {
|
|
23
|
+
static withDefaultValues(...values) {
|
|
24
24
|
const modal = discord_js_1.ModalBuilder.from(this.getModal().toJSON());
|
|
25
25
|
modal.setComponents(modal.components.map(c => c.setComponents(c.components.map(input => {
|
|
26
26
|
const value = values.find(v => v.customId == input.data.custom_id);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ChannelSelectMenuBuilder, MentionableSelectMenuBuilder, RoleSelectMenuBuilder, StringSelectMenuBuilder, UserSelectMenuBuilder } from "discord.js";
|
|
2
2
|
export declare class BaseSelectMenu {
|
|
3
|
-
|
|
4
|
-
getSelectMenu(): StringSelectMenuBuilder | UserSelectMenuBuilder | RoleSelectMenuBuilder | ChannelSelectMenuBuilder | MentionableSelectMenuBuilder;
|
|
5
|
-
withValues(...values: {
|
|
3
|
+
static selelctMenu: StringSelectMenuBuilder | UserSelectMenuBuilder | RoleSelectMenuBuilder | ChannelSelectMenuBuilder | MentionableSelectMenuBuilder | null;
|
|
4
|
+
static getSelectMenu(): StringSelectMenuBuilder | UserSelectMenuBuilder | RoleSelectMenuBuilder | ChannelSelectMenuBuilder | MentionableSelectMenuBuilder;
|
|
5
|
+
static withValues(...values: {
|
|
6
6
|
label: string;
|
|
7
7
|
value: string;
|
|
8
8
|
description?: 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
|
-
|
|
8
|
-
getSelectMenu() {
|
|
9
|
-
if (this
|
|
10
|
-
return this
|
|
7
|
+
static selelctMenu = null;
|
|
8
|
+
static getSelectMenu() {
|
|
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,10 +48,10 @@ 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
|
-
withValues(...values) {
|
|
54
|
+
static withValues(...values) {
|
|
55
55
|
if (this.getSelectMenu().data.type != discord_js_1.ComponentType.StringSelect)
|
|
56
56
|
throw new TypeError("withValues is only available for StringSelectMenu.");
|
|
57
57
|
const selectMenu = discord_js_1.StringSelectMenuBuilder.from(this.getSelectMenu().toJSON());
|