@mostfeatured/dbi 0.0.53 → 0.0.55

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 (78) hide show
  1. package/dist/DBI.d.ts +156 -156
  2. package/dist/DBI.js +332 -332
  3. package/dist/Events.d.ts +53 -53
  4. package/dist/Events.js +58 -58
  5. package/dist/data/eventMap.json +234 -234
  6. package/dist/index.d.ts +6 -6
  7. package/dist/index.js +16 -16
  8. package/dist/methods/hookEventListeners.d.ts +3 -3
  9. package/dist/methods/hookEventListeners.js +87 -87
  10. package/dist/methods/hookInteractionListeners.d.ts +3 -3
  11. package/dist/methods/hookInteractionListeners.js +118 -118
  12. package/dist/methods/publishInteractions.d.ts +7 -7
  13. package/dist/methods/publishInteractions.js +238 -238
  14. package/dist/types/Button.d.ts +18 -16
  15. package/dist/types/Button.d.ts.map +1 -1
  16. package/dist/types/Button.js +31 -27
  17. package/dist/types/Button.js.map +1 -1
  18. package/dist/types/ButtonBuilder.d.ts +30 -0
  19. package/dist/types/ButtonBuilder.d.ts.map +1 -0
  20. package/dist/types/ButtonBuilder.js +43 -0
  21. package/dist/types/ButtonBuilder.js.map +1 -0
  22. package/dist/types/ChatInput/ChatInput.d.ts +15 -15
  23. package/dist/types/ChatInput/ChatInput.js +20 -20
  24. package/dist/types/ChatInput/ChatInputOptions.d.ts +162 -161
  25. package/dist/types/ChatInput/ChatInputOptions.d.ts.map +1 -1
  26. package/dist/types/ChatInput/ChatInputOptions.js +161 -160
  27. package/dist/types/ChatInput/ChatInputOptions.js.map +1 -1
  28. package/dist/types/CustomEvent.d.ts +13 -13
  29. package/dist/types/CustomEvent.js +19 -19
  30. package/dist/types/Event.d.ts +263 -263
  31. package/dist/types/Event.js +22 -22
  32. package/dist/types/Interaction.d.ts +47 -47
  33. package/dist/types/Interaction.js +24 -24
  34. package/dist/types/InteractionLocale.d.ts +25 -25
  35. package/dist/types/InteractionLocale.js +14 -14
  36. package/dist/types/Locale.d.ts +21 -21
  37. package/dist/types/Locale.js +38 -38
  38. package/dist/types/MessageContextMenu.d.ts +14 -14
  39. package/dist/types/MessageContextMenu.js +18 -18
  40. package/dist/types/Modal.d.ts +22 -20
  41. package/dist/types/Modal.d.ts.map +1 -1
  42. package/dist/types/Modal.js +29 -25
  43. package/dist/types/Modal.js.map +1 -1
  44. package/dist/types/ModalBuilder.d.ts +31 -0
  45. package/dist/types/ModalBuilder.d.ts.map +1 -0
  46. package/dist/types/ModalBuilder.js +43 -0
  47. package/dist/types/ModalBuilder.js.map +1 -0
  48. package/dist/types/SelectMenu.d.ts +18 -16
  49. package/dist/types/SelectMenu.d.ts.map +1 -1
  50. package/dist/types/SelectMenu.js +31 -27
  51. package/dist/types/SelectMenu.js.map +1 -1
  52. package/dist/types/SelectMenuBuilder.d.ts +28 -0
  53. package/dist/types/SelectMenuBuilder.d.ts.map +1 -0
  54. package/dist/types/SelectMenuBuilder.js +43 -0
  55. package/dist/types/SelectMenuBuilder.js.map +1 -0
  56. package/dist/types/UserContextMenu.d.ts +14 -14
  57. package/dist/types/UserContextMenu.js +18 -18
  58. package/dist/utils/MemoryStore.d.ts +8 -8
  59. package/dist/utils/MemoryStore.js +29 -29
  60. package/dist/utils/UtilTypes.d.ts +7 -7
  61. package/dist/utils/UtilTypes.d.ts.map +1 -1
  62. package/dist/utils/UtilTypes.js +2 -2
  63. package/dist/utils/UtilTypes.js.map +1 -1
  64. package/dist/utils/customId.d.ts +7 -7
  65. package/dist/utils/customId.js +45 -45
  66. package/dist/utils/permissions.d.ts +2 -2
  67. package/dist/utils/permissions.js +8 -8
  68. package/dist/utils/recursiveImport.d.ts +4 -4
  69. package/dist/utils/recursiveImport.js +26 -26
  70. package/package.json +2 -2
  71. package/src/types/Button.ts +7 -2
  72. package/src/types/ButtonBuilder.ts +52 -0
  73. package/src/types/ChatInput/ChatInputOptions.ts +1 -0
  74. package/src/types/Modal.ts +8 -2
  75. package/src/types/ModalBuilder.ts +52 -0
  76. package/src/types/SelectMenu.ts +8 -2
  77. package/src/types/SelectMenuBuilder.ts +52 -0
  78. package/src/utils/UtilTypes.ts +1 -1
@@ -1,25 +1,25 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DBIBaseInteraction = void 0;
4
- class DBIBaseInteraction {
5
- constructor(dbi, cfg) {
6
- this.dbi = dbi;
7
- this.name = cfg.name;
8
- this.description = cfg.description;
9
- this.onExecute = cfg.onExecute;
10
- this.type = cfg.type;
11
- this.options = cfg.options;
12
- this.other = cfg.other;
13
- }
14
- dbi;
15
- name;
16
- description;
17
- type;
18
- options;
19
- other;
20
- rateLimits;
21
- onExecute(ctx) {
22
- }
23
- }
24
- exports.DBIBaseInteraction = DBIBaseInteraction;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DBIBaseInteraction = void 0;
4
+ class DBIBaseInteraction {
5
+ constructor(dbi, cfg) {
6
+ this.dbi = dbi;
7
+ this.name = cfg.name;
8
+ this.description = cfg.description;
9
+ this.onExecute = cfg.onExecute;
10
+ this.type = cfg.type;
11
+ this.options = cfg.options;
12
+ this.other = cfg.other;
13
+ }
14
+ dbi;
15
+ name;
16
+ description;
17
+ type;
18
+ options;
19
+ other;
20
+ rateLimits;
21
+ onExecute(ctx) {
22
+ }
23
+ }
24
+ exports.DBIBaseInteraction = DBIBaseInteraction;
25
25
  //# sourceMappingURL=Interaction.js.map
@@ -1,26 +1,26 @@
1
- import { NamespaceEnums } from "../../generated/namespaceData";
2
- import { DBI } from "../DBI";
3
- import { TDBILocaleString } from "./Locale";
4
- export declare type TDBIInteractionLocaleData = {
5
- [K in TDBILocaleString]?: {
6
- name: string;
7
- description: string;
8
- options?: {
9
- [k: string]: {
10
- name: string;
11
- description: string;
12
- choices?: {
13
- [k: string]: string;
14
- };
15
- };
16
- };
17
- };
18
- };
19
- export declare type TDBIInteractionLocaleOmitted = Omit<DBIInteractionLocale, "dbi">;
20
- export declare class DBIInteractionLocale {
21
- name: string;
22
- data: TDBIInteractionLocaleData;
23
- dbi: DBI<NamespaceEnums>;
24
- constructor(dbi: any, cfg: TDBIInteractionLocaleOmitted);
25
- }
1
+ import { NamespaceEnums } from "../../generated/namespaceData";
2
+ import { DBI } from "../DBI";
3
+ import { TDBILocaleString } from "./Locale";
4
+ export declare type TDBIInteractionLocaleData = {
5
+ [K in TDBILocaleString]?: {
6
+ name: string;
7
+ description: string;
8
+ options?: {
9
+ [k: string]: {
10
+ name: string;
11
+ description: string;
12
+ choices?: {
13
+ [k: string]: string;
14
+ };
15
+ };
16
+ };
17
+ };
18
+ };
19
+ export declare type TDBIInteractionLocaleOmitted = Omit<DBIInteractionLocale, "dbi">;
20
+ export declare class DBIInteractionLocale {
21
+ name: string;
22
+ data: TDBIInteractionLocaleData;
23
+ dbi: DBI<NamespaceEnums>;
24
+ constructor(dbi: any, cfg: TDBIInteractionLocaleOmitted);
25
+ }
26
26
  //# sourceMappingURL=InteractionLocale.d.ts.map
@@ -1,15 +1,15 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DBIInteractionLocale = void 0;
4
- class DBIInteractionLocale {
5
- name;
6
- data;
7
- dbi;
8
- constructor(dbi, cfg) {
9
- this.dbi = dbi;
10
- this.name = cfg.name;
11
- this.data = cfg.data;
12
- }
13
- }
14
- exports.DBIInteractionLocale = DBIInteractionLocale;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DBIInteractionLocale = void 0;
4
+ class DBIInteractionLocale {
5
+ name;
6
+ data;
7
+ dbi;
8
+ constructor(dbi, cfg) {
9
+ this.dbi = dbi;
10
+ this.name = cfg.name;
11
+ this.data = cfg.data;
12
+ }
13
+ }
14
+ exports.DBIInteractionLocale = DBIInteractionLocale;
15
15
  //# sourceMappingURL=InteractionLocale.js.map
@@ -1,22 +1,22 @@
1
- import { NamespaceData, NamespaceEnums } from "../../generated/namespaceData";
2
- import { DBI } from "../DBI";
3
- export interface DBILangObject {
4
- [property: string]: DBILangObject & ((...args: any[]) => string);
5
- }
6
- export interface DBILangConstructorObject {
7
- [property: string]: DBILangConstructorObject | string;
8
- }
9
- export declare type TDBILocaleString = "en" | "bg" | "zh" | "hr" | "cs" | "da" | "nl" | "fi" | "fr" | "de" | "el" | "hi" | "hu" | "it" | "ja" | "ko" | "no" | "pl" | "pt" | "ro" | "ru" | "es" | "sv" | "th" | "tr" | "uk" | "vi";
10
- export declare type TDBILocaleConstructor<TNamespace extends NamespaceEnums> = Omit<DBILocale<TNamespace>, "data" | "dbi" | "mergeLocale"> & {
11
- data: DBILangConstructorObject;
12
- };
13
- export declare class DBILocale<TNamespace extends NamespaceEnums> {
14
- name: TDBILocaleString;
15
- data: NamespaceData[TNamespace]["contentLocale"];
16
- private _data;
17
- dbi: DBI<TNamespace, {}>;
18
- constructor(dbi: DBI<TNamespace, {}>, cfg: TDBILocaleConstructor<TNamespace>);
19
- mergeLocale(locale: DBILocale<TNamespace>): DBILocale<TNamespace>;
20
- }
21
- export declare function convertLang<TNamespace extends NamespaceEnums>(data: DBILangConstructorObject): NamespaceData[TNamespace]["contentLocale"];
1
+ import { NamespaceData, NamespaceEnums } from "../../generated/namespaceData";
2
+ import { DBI } from "../DBI";
3
+ export interface DBILangObject {
4
+ [property: string]: DBILangObject & ((...args: any[]) => string);
5
+ }
6
+ export interface DBILangConstructorObject {
7
+ [property: string]: DBILangConstructorObject | string;
8
+ }
9
+ export declare type TDBILocaleString = "en" | "bg" | "zh" | "hr" | "cs" | "da" | "nl" | "fi" | "fr" | "de" | "el" | "hi" | "hu" | "it" | "ja" | "ko" | "no" | "pl" | "pt" | "ro" | "ru" | "es" | "sv" | "th" | "tr" | "uk" | "vi";
10
+ export declare type TDBILocaleConstructor<TNamespace extends NamespaceEnums> = Omit<DBILocale<TNamespace>, "data" | "dbi" | "mergeLocale"> & {
11
+ data: DBILangConstructorObject;
12
+ };
13
+ export declare class DBILocale<TNamespace extends NamespaceEnums> {
14
+ name: TDBILocaleString;
15
+ data: NamespaceData[TNamespace]["contentLocale"];
16
+ private _data;
17
+ dbi: DBI<TNamespace, {}>;
18
+ constructor(dbi: DBI<TNamespace, {}>, cfg: TDBILocaleConstructor<TNamespace>);
19
+ mergeLocale(locale: DBILocale<TNamespace>): DBILocale<TNamespace>;
20
+ }
21
+ export declare function convertLang<TNamespace extends NamespaceEnums>(data: DBILangConstructorObject): NamespaceData[TNamespace]["contentLocale"];
22
22
  //# sourceMappingURL=Locale.d.ts.map
@@ -1,39 +1,39 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.convertLang = exports.DBILocale = void 0;
4
- const tslib_1 = require("tslib");
5
- const stuffs_1 = tslib_1.__importDefault(require("stuffs"));
6
- class DBILocale {
7
- name;
8
- data;
9
- _data;
10
- dbi;
11
- constructor(dbi, cfg) {
12
- this.dbi = dbi;
13
- this.name = cfg.name;
14
- this._data = cfg.data;
15
- this.data = convertLang(cfg.data);
16
- }
17
- mergeLocale(locale) {
18
- this._data = stuffs_1.default.defaultify(locale._data, this._data, true);
19
- this.data = convertLang(this._data);
20
- locale.data = this.data;
21
- locale._data = this._data;
22
- return this;
23
- }
24
- }
25
- exports.DBILocale = DBILocale;
26
- function convertLang(data) {
27
- return Object.fromEntries(Object.entries(data).map(([key, value]) => {
28
- if (typeof value === "string") {
29
- return [key, (...args) => {
30
- return stuffs_1.default.mapReplace(value, args.map((t, i) => [new RegExp(`\\{${i}(;[^}]+)?\\}`, "g"), t]));
31
- }];
32
- }
33
- else {
34
- return [key, convertLang(value)];
35
- }
36
- }));
37
- }
38
- exports.convertLang = convertLang;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.convertLang = exports.DBILocale = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const stuffs_1 = tslib_1.__importDefault(require("stuffs"));
6
+ class DBILocale {
7
+ name;
8
+ data;
9
+ _data;
10
+ dbi;
11
+ constructor(dbi, cfg) {
12
+ this.dbi = dbi;
13
+ this.name = cfg.name;
14
+ this._data = cfg.data;
15
+ this.data = convertLang(cfg.data);
16
+ }
17
+ mergeLocale(locale) {
18
+ this._data = stuffs_1.default.defaultify(locale._data, this._data, true);
19
+ this.data = convertLang(this._data);
20
+ locale.data = this.data;
21
+ locale._data = this._data;
22
+ return this;
23
+ }
24
+ }
25
+ exports.DBILocale = DBILocale;
26
+ function convertLang(data) {
27
+ return Object.fromEntries(Object.entries(data).map(([key, value]) => {
28
+ if (typeof value === "string") {
29
+ return [key, (...args) => {
30
+ return stuffs_1.default.mapReplace(value, args.map((t, i) => [new RegExp(`\\{${i}(;[^}]+)?\\}`, "g"), t]));
31
+ }];
32
+ }
33
+ else {
34
+ return [key, convertLang(value)];
35
+ }
36
+ }));
37
+ }
38
+ exports.convertLang = convertLang;
39
39
  //# sourceMappingURL=Locale.js.map
@@ -1,15 +1,15 @@
1
- import { DBI } from "../DBI";
2
- import { DBIBaseInteraction, IDBIBaseExecuteCtx } from "./Interaction";
3
- import Discord from "discord.js";
4
- import { NamespaceEnums } from "../../generated/namespaceData";
5
- export declare type TDBIMessageContextMenuOmitted<TNamespace extends NamespaceEnums> = Omit<DBIMessageContextMenu<TNamespace>, "type" | "description" | "dbi" | "options">;
6
- export interface IDBIMessageContextMenuExecuteCtx<TNamespace extends NamespaceEnums> extends IDBIBaseExecuteCtx<TNamespace> {
7
- interaction: Discord.MessageContextMenuCommandInteraction<"cached">;
8
- }
9
- export declare class DBIMessageContextMenu<TNamespace extends NamespaceEnums> extends DBIBaseInteraction<TNamespace> {
10
- constructor(dbi: DBI<TNamespace>, cfg: TDBIMessageContextMenuOmitted<TNamespace>);
11
- directMessages?: boolean;
12
- defaultMemberPermissions?: Discord.PermissionsString[];
13
- onExecute(ctx: IDBIMessageContextMenuExecuteCtx<TNamespace>): Promise<void> | void;
14
- }
1
+ import { DBI } from "../DBI";
2
+ import { DBIBaseInteraction, IDBIBaseExecuteCtx } from "./Interaction";
3
+ import Discord from "discord.js";
4
+ import { NamespaceEnums } from "../../generated/namespaceData";
5
+ export declare type TDBIMessageContextMenuOmitted<TNamespace extends NamespaceEnums> = Omit<DBIMessageContextMenu<TNamespace>, "type" | "description" | "dbi" | "options">;
6
+ export interface IDBIMessageContextMenuExecuteCtx<TNamespace extends NamespaceEnums> extends IDBIBaseExecuteCtx<TNamespace> {
7
+ interaction: Discord.MessageContextMenuCommandInteraction<"cached">;
8
+ }
9
+ export declare class DBIMessageContextMenu<TNamespace extends NamespaceEnums> extends DBIBaseInteraction<TNamespace> {
10
+ constructor(dbi: DBI<TNamespace>, cfg: TDBIMessageContextMenuOmitted<TNamespace>);
11
+ directMessages?: boolean;
12
+ defaultMemberPermissions?: Discord.PermissionsString[];
13
+ onExecute(ctx: IDBIMessageContextMenuExecuteCtx<TNamespace>): Promise<void> | void;
14
+ }
15
15
  //# sourceMappingURL=MessageContextMenu.d.ts.map
@@ -1,19 +1,19 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DBIMessageContextMenu = void 0;
4
- const Interaction_1 = require("./Interaction");
5
- class DBIMessageContextMenu extends Interaction_1.DBIBaseInteraction {
6
- constructor(dbi, cfg) {
7
- super(dbi, {
8
- ...cfg,
9
- type: "MessageContextMenu"
10
- });
11
- this.directMessages = cfg.directMessages ?? dbi.config.defaults.directMessages;
12
- this.defaultMemberPermissions = cfg.defaultMemberPermissions ?? dbi.config.defaults.defaultMemberPermissions;
13
- }
14
- directMessages;
15
- defaultMemberPermissions;
16
- onExecute(ctx) { }
17
- }
18
- exports.DBIMessageContextMenu = DBIMessageContextMenu;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DBIMessageContextMenu = void 0;
4
+ const Interaction_1 = require("./Interaction");
5
+ class DBIMessageContextMenu extends Interaction_1.DBIBaseInteraction {
6
+ constructor(dbi, cfg) {
7
+ super(dbi, {
8
+ ...cfg,
9
+ type: "MessageContextMenu"
10
+ });
11
+ this.directMessages = cfg.directMessages ?? dbi.config.defaults.directMessages;
12
+ this.defaultMemberPermissions = cfg.defaultMemberPermissions ?? dbi.config.defaults.defaultMemberPermissions;
13
+ }
14
+ directMessages;
15
+ defaultMemberPermissions;
16
+ onExecute(ctx) { }
17
+ }
18
+ exports.DBIMessageContextMenu = DBIMessageContextMenu;
19
19
  //# sourceMappingURL=MessageContextMenu.js.map
@@ -1,21 +1,23 @@
1
- import { DBI } from "../DBI";
2
- import { DBIBaseInteraction, IDBIBaseExecuteCtx, TDBIReferencedData } from "./Interaction";
3
- import Discord from "discord.js";
4
- import { IDBIToJSONArgs } from "../utils/UtilTypes";
5
- import { NamespaceEnums } from "../../generated/namespaceData";
6
- export interface IDBIModalExecuteCtx<TNamespace extends NamespaceEnums> extends IDBIBaseExecuteCtx<TNamespace> {
7
- interaction: Discord.ModalSubmitInteraction<"cached">;
8
- data: TDBIReferencedData[];
9
- }
10
- export interface ModalComponentData {
11
- title: string;
12
- components: (Discord.ActionRowData<Discord.ModalActionRowComponentData>)[];
13
- }
14
- export declare type TDBIModalOmitted<TNamespace extends NamespaceEnums> = Omit<DBIModal<TNamespace>, "type" | "description" | "dbi" | "toJSON">;
15
- export declare class DBIModal<TNamespace extends NamespaceEnums> extends DBIBaseInteraction<TNamespace> {
16
- constructor(dbi: DBI<TNamespace>, args: TDBIModalOmitted<TNamespace>);
17
- options: ModalComponentData;
18
- onExecute(ctx: IDBIModalExecuteCtx<TNamespace>): Promise<void> | void;
19
- toJSON(arg?: IDBIToJSONArgs<ModalComponentData>): Discord.ModalComponentData;
20
- }
1
+ import { DBI } from "../DBI";
2
+ import { DBIBaseInteraction, IDBIBaseExecuteCtx, TDBIReferencedData } from "./Interaction";
3
+ import Discord from "discord.js";
4
+ import { IDBIToJSONArgs } from "../utils/UtilTypes";
5
+ import { NamespaceEnums } from "../../generated/namespaceData";
6
+ import { DBIModalBuilder, DBIModalOverrides } from "./ModalBuilder";
7
+ export interface IDBIModalExecuteCtx<TNamespace extends NamespaceEnums> extends IDBIBaseExecuteCtx<TNamespace> {
8
+ interaction: Discord.ModalSubmitInteraction<"cached">;
9
+ data: TDBIReferencedData[];
10
+ }
11
+ export interface ModalComponentData {
12
+ title: string;
13
+ components: (Discord.ActionRowData<Discord.ModalActionRowComponentData>)[];
14
+ }
15
+ export declare type TDBIModalOmitted<TNamespace extends NamespaceEnums> = Omit<DBIModal<TNamespace>, "type" | "description" | "dbi" | "toJSON" | "createBuilder">;
16
+ export declare class DBIModal<TNamespace extends NamespaceEnums> extends DBIBaseInteraction<TNamespace> {
17
+ constructor(dbi: DBI<TNamespace>, args: TDBIModalOmitted<TNamespace>);
18
+ options: ModalComponentData;
19
+ onExecute(ctx: IDBIModalExecuteCtx<TNamespace>): Promise<void> | void;
20
+ toJSON(arg?: IDBIToJSONArgs<DBIModalOverrides>): Discord.ModalComponentData;
21
+ createBuilder(arg?: IDBIToJSONArgs<DBIModalOverrides>): DBIModalBuilder<TNamespace>;
22
+ }
21
23
  //# sourceMappingURL=Modal.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Modal.d.ts","sourceRoot":"","sources":["../../src/types/Modal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAC;AAC7B,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAC3F,OAAO,OAAO,MAAM,YAAY,CAAC;AAEjC,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAI/D,MAAM,WAAW,mBAAmB,CAAC,UAAU,SAAS,cAAc,CAAE,SAAQ,kBAAkB,CAAC,UAAU,CAAC;IAC5G,WAAW,EAAE,OAAO,CAAC,sBAAsB,CAAC,QAAQ,CAAC,CAAC;IAEtD,IAAI,EAAE,kBAAkB,EAAE,CAAC;CAC5B;AAED,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAA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D,IAAI,EAAE,kBAAkB,EAAE,CAAC;CAC5B;AAED,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,CAAC,OAAO,CAAC,aAAa,CAAC,OAAO,CAAC,2BAA2B,CAAC,CAAC,EAAE,CAAC;CAC5E;AAED,oBAAY,gBAAgB,CAAC,UAAU,SAAS,cAAc,IAAI,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,aAAa,GAAG,KAAK,GAAG,QAAQ,GAAG,eAAe,CAAC,CAAC;AAE1J,qBAAa,QAAQ,CAAC,UAAU,SAAS,cAAc,CAAE,SAAQ,kBAAkB,CAAC,UAAU,CAAC;gBACjF,GAAG,EAAE,GAAG,CAAC,UAAU,CAAC,EAAE,IAAI,EAAE,gBAAgB,CAAC,UAAU,CAAC;IAO5D,OAAO,EAAE,kBAAkB,CAAC;IAE3B,SAAS,CAAC,GAAG,EAAE,mBAAmB,CAAC,UAAU,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI;IAE9E,MAAM,CAAC,GAAG,GAAE,cAAc,CAAC,iBAAiB,CAAM,GAAG,OAAO,CAAC,kBAAkB;IAO/E,aAAa,CAAC,GAAG,GAAE,cAAc,CAAC,iBAAiB,CAAM,GAAG,eAAe,CAAC,UAAU,CAAC;CAIxF"}
@@ -1,26 +1,30 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DBIModal = void 0;
4
- const tslib_1 = require("tslib");
5
- const Interaction_1 = require("./Interaction");
6
- const customId_1 = require("../utils/customId");
7
- const stuffs_1 = tslib_1.__importDefault(require("stuffs"));
8
- class DBIModal extends Interaction_1.DBIBaseInteraction {
9
- constructor(dbi, args) {
10
- super(dbi, {
11
- ...args,
12
- type: "Modal"
13
- });
14
- }
15
- onExecute(ctx) { }
16
- ;
17
- toJSON(arg = {}) {
18
- return {
19
- ...stuffs_1.default.defaultify((arg?.overrides || {}), this.options || {}, true),
20
- customId: (0, customId_1.customIdBuilder)(this.dbi, this.name, arg?.reference?.data || [], arg?.reference?.ttl)
21
- };
22
- }
23
- ;
24
- }
25
- exports.DBIModal = DBIModal;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DBIModal = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const Interaction_1 = require("./Interaction");
6
+ const customId_1 = require("../utils/customId");
7
+ const stuffs_1 = tslib_1.__importDefault(require("stuffs"));
8
+ const ModalBuilder_1 = require("./ModalBuilder");
9
+ class DBIModal extends Interaction_1.DBIBaseInteraction {
10
+ constructor(dbi, args) {
11
+ super(dbi, {
12
+ ...args,
13
+ type: "Modal"
14
+ });
15
+ }
16
+ onExecute(ctx) { }
17
+ ;
18
+ toJSON(arg = {}) {
19
+ return {
20
+ ...stuffs_1.default.defaultify((arg?.overrides || {}), this.options || {}, true),
21
+ customId: (0, customId_1.customIdBuilder)(this.dbi, this.name, arg?.reference?.data || [], arg?.reference?.ttl)
22
+ };
23
+ }
24
+ ;
25
+ createBuilder(arg = {}) {
26
+ return new ModalBuilder_1.DBIModalBuilder({ component: this, ...arg });
27
+ }
28
+ }
29
+ exports.DBIModal = DBIModal;
26
30
  //# sourceMappingURL=Modal.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Modal.js","sourceRoot":"","sources":["../../src/types/Modal.ts"],"names":[],"mappings":";;;;AACA,+CAA2F;AAE3F,gDAAoD;AAGpD,4DAA4B;AAgB5B,MAAa,QAA4C,SAAQ,gCAA8B;IAC7F,YAAY,GAAoB,EAAE,IAAkC;QAClE,KAAK,CAAC,GAAG,EAAE;YACT,GAAI,IAAY;YAChB,IAAI,EAAE,OAAO;SACd,CAAC,CAAC;IACL,CAAC;IAIQ,SAAS,CAAC,GAAoC,IAA0B,CAAC;IAAA,CAAC;IAEnF,MAAM,CAAC,MAA0C,EAAS;QACxD,OAAO;YACL,GAAG,gBAAM,CAAC,UAAU,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,EAAE,CAAC,EAAE,IAAI,CAAC,OAAO,IAAI,EAAE,EAAE,IAAI,CAAC;YACtE,QAAQ,EAAE,IAAA,0BAAe,EAAC,IAAI,CAAC,GAAU,EAAE,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE,SAAS,EAAE,IAAI,IAAI,EAAE,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,CAAC;SAChG,CAAC;IACX,CAAC;IAAA,CAAC;CACH;AAlBD,4BAkBC","sourcesContent":["import { DBI } from \"../DBI\";\r\nimport { DBIBaseInteraction, IDBIBaseExecuteCtx, TDBIReferencedData } from \"./Interaction\";\r\nimport Discord from \"discord.js\";\r\nimport { customIdBuilder } from \"../utils/customId\";\r\nimport { IDBIToJSONArgs } from \"../utils/UtilTypes\";\r\nimport { NamespaceEnums } from \"../../generated/namespaceData\";\r\nimport stuffs from \"stuffs\";\r\n\r\n\r\nexport interface IDBIModalExecuteCtx<TNamespace extends NamespaceEnums> extends IDBIBaseExecuteCtx<TNamespace> {\r\n interaction: Discord.ModalSubmitInteraction<\"cached\">;\r\n\r\n data: TDBIReferencedData[];\r\n}\r\n\r\nexport interface ModalComponentData {\r\n title: string;\r\n components: (Discord.ActionRowData<Discord.ModalActionRowComponentData>)[];\r\n}\r\n\r\nexport type TDBIModalOmitted<TNamespace extends NamespaceEnums> = Omit<DBIModal<TNamespace>, \"type\" | \"description\" | \"dbi\" | \"toJSON\">;\r\n\r\nexport class DBIModal<TNamespace extends NamespaceEnums> extends DBIBaseInteraction<TNamespace> {\r\n constructor(dbi: DBI<TNamespace>, args: TDBIModalOmitted<TNamespace>) {\r\n super(dbi, {\r\n ...(args as any),\r\n type: \"Modal\"\r\n });\r\n }\r\n\r\n declare options: ModalComponentData;\r\n\r\n override onExecute(ctx: IDBIModalExecuteCtx<TNamespace>): Promise<void> | void { };\r\n\r\n toJSON(arg: IDBIToJSONArgs<ModalComponentData> = {} as any): Discord.ModalComponentData {\r\n return {\r\n ...stuffs.defaultify((arg?.overrides || {}), this.options || {}, true),\r\n customId: customIdBuilder(this.dbi as any, this.name, arg?.reference?.data || [], arg?.reference?.ttl)\r\n } as any;\r\n };\r\n}"]}
1
+ {"version":3,"file":"Modal.js","sourceRoot":"","sources":["../../src/types/Modal.ts"],"names":[],"mappings":";;;;AACA,+CAA2F;AAE3F,gDAAoD;AAGpD,4DAA4B;AAC5B,iDAAoE;AAgBpE,MAAa,QAA4C,SAAQ,gCAA8B;IAC7F,YAAY,GAAoB,EAAE,IAAkC;QAClE,KAAK,CAAC,GAAG,EAAE;YACT,GAAI,IAAY;YAChB,IAAI,EAAE,OAAO;SACd,CAAC,CAAC;IACL,CAAC;IAIQ,SAAS,CAAC,GAAoC,IAA0B,CAAC;IAAA,CAAC;IAEnF,MAAM,CAAC,MAAyC,EAAE;QAChD,OAAO;YACL,GAAG,gBAAM,CAAC,UAAU,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,EAAE,CAAC,EAAE,IAAI,CAAC,OAAO,IAAI,EAAE,EAAE,IAAI,CAAC;YACtE,QAAQ,EAAE,IAAA,0BAAe,EAAC,IAAI,CAAC,GAAU,EAAE,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE,SAAS,EAAE,IAAI,IAAI,EAAE,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,CAAC;SAChG,CAAC;IACX,CAAC;IAAA,CAAC;IAEF,aAAa,CAAC,MAAyC,EAAE;QACvD,OAAO,IAAI,8BAAe,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,GAAG,EAAE,CAAC,CAAA;IACzD,CAAC;CAEF;AAvBD,4BAuBC","sourcesContent":["import { DBI } from \"../DBI\";\r\nimport { DBIBaseInteraction, IDBIBaseExecuteCtx, TDBIReferencedData } from \"./Interaction\";\r\nimport Discord from \"discord.js\";\r\nimport { customIdBuilder } from \"../utils/customId\";\r\nimport { IDBIToJSONArgs } from \"../utils/UtilTypes\";\r\nimport { NamespaceEnums } from \"../../generated/namespaceData\";\r\nimport stuffs from \"stuffs\";\r\nimport { DBIModalBuilder, DBIModalOverrides } from \"./ModalBuilder\";\r\n\r\n\r\nexport interface IDBIModalExecuteCtx<TNamespace extends NamespaceEnums> extends IDBIBaseExecuteCtx<TNamespace> {\r\n interaction: Discord.ModalSubmitInteraction<\"cached\">;\r\n\r\n data: TDBIReferencedData[];\r\n}\r\n\r\nexport interface ModalComponentData {\r\n title: string;\r\n components: (Discord.ActionRowData<Discord.ModalActionRowComponentData>)[];\r\n}\r\n\r\nexport type TDBIModalOmitted<TNamespace extends NamespaceEnums> = Omit<DBIModal<TNamespace>, \"type\" | \"description\" | \"dbi\" | \"toJSON\" | \"createBuilder\">;\r\n\r\nexport class DBIModal<TNamespace extends NamespaceEnums> extends DBIBaseInteraction<TNamespace> {\r\n constructor(dbi: DBI<TNamespace>, args: TDBIModalOmitted<TNamespace>) {\r\n super(dbi, {\r\n ...(args as any),\r\n type: \"Modal\"\r\n });\r\n }\r\n\r\n declare options: ModalComponentData;\r\n\r\n override onExecute(ctx: IDBIModalExecuteCtx<TNamespace>): Promise<void> | void { };\r\n\r\n toJSON(arg: IDBIToJSONArgs<DBIModalOverrides> = {}): Discord.ModalComponentData {\r\n return {\r\n ...stuffs.defaultify((arg?.overrides || {}), this.options || {}, true),\r\n customId: customIdBuilder(this.dbi as any, this.name, arg?.reference?.data || [], arg?.reference?.ttl)\r\n } as any;\r\n };\r\n\r\n createBuilder(arg: IDBIToJSONArgs<DBIModalOverrides> = {}): DBIModalBuilder<TNamespace> {\r\n return new DBIModalBuilder({ component: this, ...arg })\r\n }\r\n\r\n}"]}
@@ -0,0 +1,31 @@
1
+ import { ActionRowData, APIActionRowComponent, APITextInputComponent, JSONEncodable, ModalActionRowComponentData, ModalComponentData } from "discord.js";
2
+ import { NamespaceEnums } from "../../generated/namespaceData";
3
+ import { DBIModal } from "./Modal";
4
+ export declare type DBIModalOverrides = {
5
+ components?: (JSONEncodable<APIActionRowComponent<APITextInputComponent>> | ActionRowData<ModalActionRowComponentData>)[];
6
+ title?: string;
7
+ } & Omit<ModalComponentData, "customId" | "type" | "title" | "components">;
8
+ export declare class DBIModalBuilder<TNamespace extends NamespaceEnums> {
9
+ component: DBIModal<TNamespace>;
10
+ overrides: DBIModalOverrides;
11
+ reference: {
12
+ data: (string | number | object)[];
13
+ ttl?: number;
14
+ };
15
+ constructor(arg: {
16
+ component: DBIModal<TNamespace>;
17
+ overrides?: DBIModalOverrides;
18
+ reference?: {
19
+ data: (string | number | object)[];
20
+ ttl?: number;
21
+ };
22
+ });
23
+ setTTL(ttl: number): DBIModalBuilder<TNamespace>;
24
+ addTTL(ttl: number): DBIModalBuilder<TNamespace>;
25
+ setData(...data: (string | number | object)[]): DBIModalBuilder<TNamespace>;
26
+ addData(...data: (string | number | object)[]): DBIModalBuilder<TNamespace>;
27
+ setOverrides(overrides: DBIModalOverrides): DBIModalBuilder<TNamespace>;
28
+ addOverrides(overrides: DBIModalOverrides): DBIModalBuilder<TNamespace>;
29
+ toJSON(): ModalComponentData;
30
+ }
31
+ //# sourceMappingURL=ModalBuilder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ModalBuilder.d.ts","sourceRoot":"","sources":["../../src/types/ModalBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,aAAa,EAAE,2BAA2B,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAEzJ,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEnC,oBAAY,iBAAiB,GAAG;IAAE,UAAU,CAAC,EAAE,CAAC,aAAa,CAAC,qBAAqB,CAAC,qBAAqB,CAAC,CAAC,GAAG,aAAa,CAAC,2BAA2B,CAAC,CAAC,EAAE,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAAC,kBAAkB,EA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 = require("stuffs");
5
+ class DBIModalBuilder {
6
+ component;
7
+ overrides;
8
+ reference;
9
+ constructor(arg) {
10
+ this.component = arg.component;
11
+ this.overrides = arg.overrides ?? {};
12
+ this.reference = arg.reference ?? { data: [] };
13
+ }
14
+ setTTL(ttl) {
15
+ this.reference.ttl = ttl;
16
+ return this;
17
+ }
18
+ addTTL(ttl) {
19
+ this.reference.ttl = (this.reference.ttl ?? 0) + ttl;
20
+ return this;
21
+ }
22
+ setData(...data) {
23
+ this.reference.data = data;
24
+ return this;
25
+ }
26
+ addData(...data) {
27
+ this.reference.data = [...this.reference.data, ...data];
28
+ return this;
29
+ }
30
+ setOverrides(overrides) {
31
+ this.overrides = overrides;
32
+ return this;
33
+ }
34
+ addOverrides(overrides) {
35
+ this.overrides = (0, stuffs_1.defaultify)(overrides, this.overrides, true);
36
+ return this;
37
+ }
38
+ toJSON() {
39
+ return this.component.toJSON({ overrides: this.overrides, reference: this.reference });
40
+ }
41
+ }
42
+ exports.DBIModalBuilder = DBIModalBuilder;
43
+ //# sourceMappingURL=ModalBuilder.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ModalBuilder.js","sourceRoot":"","sources":["../../src/types/ModalBuilder.ts"],"names":[],"mappings":";;;AACA,mCAAoC;AAMpC,MAAa,eAAe;IAC1B,SAAS,CAAsB;IAC/B,SAAS,CAAoB;IAC7B,SAAS,CAAuD;IAChE,YAAY,GAAyI;QACnJ,IAAI,CAAC,SAAS,GAAG,GAAG,CAAC,SAAS,CAAC;QAC/B,IAAI,CAAC,SAAS,GAAG,GAAG,CAAC,SAAS,IAAI,EAAE,CAAC;QACrC,IAAI,CAAC,SAAS,GAAG,GAAG,CAAC,SAAS,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC;IACjD,CAAC;IAED,MAAM,CAAC,GAAW;QAChB,IAAI,CAAC,SAAS,CAAC,GAAG,GAAG,GAAG,CAAC;QACzB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,CAAC,GAAW;QAChB,IAAI,CAAC,SAAS,CAAC,GAAG,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC,CAAC,GAAG,GAAG,CAAC;QACrD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,CAAC,GAAG,IAAkC;QAC3C,IAAI,CAAC,SAAS,CAAC,IAAI,GAAG,IAAI,CAAC;QAC3B,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,CAAC,GAAG,IAAkC;QAC3C,IAAI,CAAC,SAAS,CAAC,IAAI,GAAG,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC,CAAC;QACxD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,YAAY,CAAC,SAA4B;QACvC,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,OAAO,IAAI,CAAC;IACd,CAAC;IAED,YAAY,CAAC,SAA4B;QACvC,IAAI,CAAC,SAAS,GAAG,IAAA,mBAAU,EAAC,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;QAC7D,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM;QACJ,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC;IACzF,CAAC;CAEF;AA5CD,0CA4CC","sourcesContent":["import { ActionRowData, APIActionRowComponent, APITextInputComponent, JSONEncodable, ModalActionRowComponentData, ModalComponentData } from \"discord.js\";\r\nimport { defaultify } from \"stuffs\";\r\nimport { NamespaceEnums } from \"../../generated/namespaceData\";\r\nimport { DBIModal } from \"./Modal\";\r\n\r\nexport type DBIModalOverrides = { components?: (JSONEncodable<APIActionRowComponent<APITextInputComponent>> | ActionRowData<ModalActionRowComponentData>)[], title?: string } & Omit<ModalComponentData, \"customId\" | \"type\" | \"title\" | \"components\">\r\n\r\nexport class DBIModalBuilder<TNamespace extends NamespaceEnums> {\r\n component: DBIModal<TNamespace>\r\n overrides: DBIModalOverrides;\r\n reference: { data: (string | number | object)[], ttl?: number };\r\n constructor(arg: { component: DBIModal<TNamespace>, overrides?: DBIModalOverrides, reference?: { data: (string | number | object)[], ttl?: number } }) {\r\n this.component = arg.component;\r\n this.overrides = arg.overrides ?? {};\r\n this.reference = arg.reference ?? { data: [] };\r\n }\r\n\r\n setTTL(ttl: number): DBIModalBuilder<TNamespace> {\r\n this.reference.ttl = ttl;\r\n return this;\r\n }\r\n\r\n addTTL(ttl: number): DBIModalBuilder<TNamespace> {\r\n this.reference.ttl = (this.reference.ttl ?? 0) + ttl;\r\n return this;\r\n }\r\n\r\n setData(...data: (string | number | object)[]): DBIModalBuilder<TNamespace> {\r\n this.reference.data = data;\r\n return this;\r\n }\r\n\r\n addData(...data: (string | number | object)[]): DBIModalBuilder<TNamespace> {\r\n this.reference.data = [...this.reference.data, ...data];\r\n return this;\r\n }\r\n\r\n setOverrides(overrides: DBIModalOverrides): DBIModalBuilder<TNamespace> {\r\n this.overrides = overrides;\r\n return this;\r\n }\r\n\r\n addOverrides(overrides: DBIModalOverrides): DBIModalBuilder<TNamespace> {\r\n this.overrides = defaultify(overrides, this.overrides, true);\r\n return this;\r\n }\r\n\r\n toJSON(): ModalComponentData {\r\n return this.component.toJSON({ overrides: this.overrides, reference: this.reference });\r\n }\r\n\r\n}"]}
@@ -1,17 +1,19 @@
1
- import Discord from "discord.js";
2
- import { DBI } from "../DBI";
3
- import { DBIBaseInteraction, IDBIBaseExecuteCtx, TDBIReferencedData } from "./Interaction";
4
- import { IDBIToJSONArgs } from "../utils/UtilTypes";
5
- import { NamespaceEnums } from "../../generated/namespaceData";
6
- export interface IDBISelectMenuExecuteCtx<TNamespace extends NamespaceEnums> extends IDBIBaseExecuteCtx<TNamespace> {
7
- interaction: Discord.ButtonInteraction<"cached">;
8
- data: TDBIReferencedData[];
9
- }
10
- export declare type TDBISelectMenuOmitted<TNamespace extends NamespaceEnums> = Omit<DBISelectMenu<TNamespace>, "type" | "description" | "dbi" | "toJSON">;
11
- export declare class DBISelectMenu<TNamespace extends NamespaceEnums> extends DBIBaseInteraction<TNamespace> {
12
- constructor(dbi: DBI<TNamespace>, args: TDBISelectMenuOmitted<TNamespace>);
13
- options: Omit<Discord.SelectMenuComponentData, "customId" | "type">;
14
- onExecute(ctx: IDBISelectMenuExecuteCtx<TNamespace>): Promise<void> | void;
15
- toJSON(arg?: IDBIToJSONArgs<Omit<Discord.SelectMenuComponentData, "customId" | "type">>): Discord.SelectMenuComponentData;
16
- }
1
+ import Discord from "discord.js";
2
+ import { DBI } from "../DBI";
3
+ import { DBIBaseInteraction, IDBIBaseExecuteCtx, TDBIReferencedData } from "./Interaction";
4
+ import { IDBIToJSONArgs } from "../utils/UtilTypes";
5
+ import { NamespaceEnums } from "../../generated/namespaceData";
6
+ import { DBISelectMenuBuilder, DBISelectMenuOverrides } from "./SelectMenuBuilder";
7
+ export interface IDBISelectMenuExecuteCtx<TNamespace extends NamespaceEnums> extends IDBIBaseExecuteCtx<TNamespace> {
8
+ interaction: Discord.ButtonInteraction<"cached">;
9
+ data: TDBIReferencedData[];
10
+ }
11
+ export declare type TDBISelectMenuOmitted<TNamespace extends NamespaceEnums> = Omit<DBISelectMenu<TNamespace>, "type" | "description" | "dbi" | "toJSON" | "createBuilder">;
12
+ export declare class DBISelectMenu<TNamespace extends NamespaceEnums> extends DBIBaseInteraction<TNamespace> {
13
+ constructor(dbi: DBI<TNamespace>, args: TDBISelectMenuOmitted<TNamespace>);
14
+ options: Omit<Discord.SelectMenuComponentData, "customId" | "type">;
15
+ onExecute(ctx: IDBISelectMenuExecuteCtx<TNamespace>): Promise<void> | void;
16
+ toJSON(arg?: IDBIToJSONArgs<DBISelectMenuOverrides>): Discord.SelectMenuComponentData;
17
+ createBuilder(arg?: IDBIToJSONArgs<DBISelectMenuOverrides>): DBISelectMenuBuilder<TNamespace>;
18
+ }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