@mostfeatured/dbi 0.0.70 → 0.0.71-dev.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.
@@ -1 +1 @@
1
- {"version":3,"file":"SelectMenu.js","sourceRoot":"","sources":["../../src/types/SelectMenu.ts"],"names":[],"mappings":";;;;AAAA,oEAAiC;AAEjC,+CAA2F;AAC3F,gDAAkD;AAGlD,4DAA4B;AAC5B,2DAAmF;AAUnF,MAAa,aAAiD,SAAQ,gCAA8B;IAClG,YAAY,GAAoB,EAAE,IAAuC;QACvE,KAAK,CAAC,GAAG,EAAE;YACT,GAAI,IAAY;YAChB,IAAI,EAAE,YAAY;SACnB,CAAC,CAAC;IACL,CAAC;IAIQ,SAAS,CAAC,GAAyC,IAA0B,CAAC;IAAA,CAAC;IAExF,MAAM,CAAC,MAA8C,EAAE;QACrD,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,wBAAa,EAAC,IAAI,CAAC,GAAU,EAAE,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE,SAAS,EAAE,IAAI,IAAI,EAAE,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,CAAC;YACpG,IAAI,EAAE,oBAAO,CAAC,aAAa,CAAC,UAAU;SAChC,CAAC;IACX,CAAC;IAAA,CAAC;IAEF,aAAa,CAAC,MAA8C,EAAE;QAC5D,OAAO,IAAI,wCAAoB,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,GAAG,EAAE,CAAC,CAAA;IAC9D,CAAC;CAEF;AAxBD,sCAwBC","sourcesContent":["import Discord from \"discord.js\";\r\nimport { DBI } from \"../DBI\";\r\nimport { DBIBaseInteraction, IDBIBaseExecuteCtx, TDBIReferencedData } from \"./Interaction\";\r\nimport { buildCustomId } from \"../utils/customId\";\r\nimport { IDBIToJSONArgs } from \"../utils/UtilTypes\";\r\nimport { NamespaceEnums } from \"../../generated/namespaceData\";\r\nimport stuffs from \"stuffs\";\r\nimport { DBISelectMenuBuilder, DBISelectMenuOverrides } from \"./SelectMenuBuilder\";\r\n\r\n\r\nexport interface IDBISelectMenuExecuteCtx<TNamespace extends NamespaceEnums> extends IDBIBaseExecuteCtx<TNamespace> {\r\n interaction: Discord.ButtonInteraction<\"cached\">;\r\n data: TDBIReferencedData[];\r\n}\r\n\r\nexport type TDBISelectMenuOmitted<TNamespace extends NamespaceEnums> = Omit<DBISelectMenu<TNamespace>, \"type\" | \"description\" | \"dbi\" | \"toJSON\" | \"createBuilder\">;\r\n\r\nexport class DBISelectMenu<TNamespace extends NamespaceEnums> extends DBIBaseInteraction<TNamespace> {\r\n constructor(dbi: DBI<TNamespace>, args: TDBISelectMenuOmitted<TNamespace>) {\r\n super(dbi, {\r\n ...(args as any),\r\n type: \"SelectMenu\",\r\n });\r\n }\r\n\r\n declare options: Omit<Discord.BaseSelectMenuComponentData, \"customId\" | \"type\">;\r\n\r\n override onExecute(ctx: IDBISelectMenuExecuteCtx<TNamespace>): Promise<void> | void { };\r\n\r\n toJSON(arg: IDBIToJSONArgs<DBISelectMenuOverrides> = {}): Discord.BaseSelectMenuComponentData {\r\n return {\r\n ...stuffs.defaultify((arg?.overrides || {}), this.options || {}, true),\r\n customId: buildCustomId(this.dbi as any, this.name, arg?.reference?.data || [], arg?.reference?.ttl),\r\n type: Discord.ComponentType.SelectMenu,\r\n } as any;\r\n };\r\n\r\n createBuilder(arg: IDBIToJSONArgs<DBISelectMenuOverrides> = {}): DBISelectMenuBuilder<TNamespace> {\r\n return new DBISelectMenuBuilder({ component: this, ...arg })\r\n }\r\n\r\n}"]}
1
+ {"version":3,"file":"SelectMenu.js","sourceRoot":"","sources":["../../src/types/SelectMenu.ts"],"names":[],"mappings":";;;;AAAA,oEAAiC;AAEjC,+CAA2F;AAC3F,gDAAkD;AAGlD,4DAA4B;AAC5B,2DAAmF;AAWnF,MAAa,aAAiD,SAAQ,gCAA8B;IAClG,YAAY,GAAoB,EAAE,IAAuC;QACvE,KAAK,CAAC,GAAG,EAAE;YACT,GAAI,IAAY;YAChB,IAAI,EAAE,YAAY;SACnB,CAAC,CAAC;IACL,CAAC;IAIQ,SAAS,CAAC,GAAyC,IAA0B,CAAC;IAAA,CAAC;IAExF,MAAM,CAAC,MAA8C,EAAE;QACrD,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,wBAAa,EAAC,IAAI,CAAC,GAAU,EAAE,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE,SAAS,EAAE,IAAI,IAAI,EAAE,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,CAAC;YACpG,IAAI,EAAE,oBAAO,CAAC,aAAa,CAAC,YAAY;SAClC,CAAC;IACX,CAAC;IAAA,CAAC;IAEF,aAAa,CAAC,MAA8C,EAAE;QAC5D,OAAO,IAAI,wCAAoB,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,GAAG,EAAE,CAAC,CAAA;IAC9D,CAAC;CAEF;AAxBD,sCAwBC","sourcesContent":["import Discord from \"discord.js\";\r\nimport { DBI } from \"../DBI\";\r\nimport { DBIBaseInteraction, IDBIBaseExecuteCtx, TDBIReferencedData } from \"./Interaction\";\r\nimport { buildCustomId } from \"../utils/customId\";\r\nimport { IDBIToJSONArgs } from \"../utils/UtilTypes\";\r\nimport { NamespaceEnums } from \"../../generated/namespaceData\";\r\nimport stuffs from \"stuffs\";\r\nimport { DBISelectMenuBuilder, DBISelectMenuOverrides } from \"./SelectMenuBuilder\";\r\n\r\nexport interface IDBISelectMenuExecuteCtx<TNamespace extends NamespaceEnums> extends IDBIBaseExecuteCtx<TNamespace> {\r\n interaction: Discord.ButtonInteraction<\"cached\">;\r\n data: TDBIReferencedData[];\r\n}\r\n\r\nexport type TDBISelectMenuOmitted<TNamespace extends NamespaceEnums> = Omit<DBISelectMenu<TNamespace>, \"type\" | \"description\" | \"dbi\" | \"toJSON\" | \"createBuilder\">;\r\n\r\nexport type SelectMenuDefaultOptions = Required<Pick<Discord.StringSelectMenuComponentData, \"options\">> & Omit<Discord.StringSelectMenuComponentData, \"customId\" | \"type\" | \"options\">;\r\n\r\nexport class DBISelectMenu<TNamespace extends NamespaceEnums> extends DBIBaseInteraction<TNamespace> {\r\n constructor(dbi: DBI<TNamespace>, args: TDBISelectMenuOmitted<TNamespace>) {\r\n super(dbi, {\r\n ...(args as any),\r\n type: \"SelectMenu\",\r\n });\r\n }\r\n\r\n declare options: SelectMenuDefaultOptions;\r\n\r\n override onExecute(ctx: IDBISelectMenuExecuteCtx<TNamespace>): Promise<void> | void { };\r\n\r\n toJSON(arg: IDBIToJSONArgs<DBISelectMenuOverrides> = {}): Discord.BaseSelectMenuComponentData {\r\n return {\r\n ...stuffs.defaultify((arg?.overrides || {}), this.options || {}, true),\r\n customId: buildCustomId(this.dbi as any, this.name, arg?.reference?.data || [], arg?.reference?.ttl),\r\n type: Discord.ComponentType.StringSelect,\r\n } as any;\r\n };\r\n\r\n createBuilder(arg: IDBIToJSONArgs<DBISelectMenuOverrides> = {}): DBISelectMenuBuilder<TNamespace> {\r\n return new DBISelectMenuBuilder({ component: this, ...arg })\r\n }\r\n\r\n}"]}
@@ -1,7 +1,7 @@
1
- import { BaseSelectMenuComponentData } from "discord.js";
1
+ import { BaseSelectMenuComponentData, StringSelectMenuComponentData } from "discord.js";
2
2
  import { NamespaceEnums } from "../../generated/namespaceData";
3
3
  import { DBISelectMenu } from "./SelectMenu";
4
- export declare type DBISelectMenuOverrides = Omit<BaseSelectMenuComponentData, "customId" | "type">;
4
+ export declare type DBISelectMenuOverrides = Omit<StringSelectMenuComponentData, "customId" | "type">;
5
5
  export declare class DBISelectMenuBuilder<TNamespace extends NamespaceEnums> {
6
6
  component: DBISelectMenu<TNamespace>;
7
7
  overrides: DBISelectMenuOverrides;
@@ -1 +1 @@
1
- {"version":3,"file":"SelectMenuBuilder.d.ts","sourceRoot":"","sources":["../../src/types/SelectMenuBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,YAAY,CAAC;AAEzD,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,oBAAY,sBAAsB,GAAG,IAAI,CAAC,2BAA2B,EAAE,UAAU,GAAG,MAAM,CAAC,CAAA;AAE3F,qBAAa,oBAAoB,CAAC,UAAU,SAAS,cAAc;IACjE,SAAS,EAAE,aAAa,CAAC,UAAU,CAAC,CAAA;IACpC,SAAS,EAAE,sBAAsB,CAAC;IAClC,SAAS,EAAE;QAAE,IAAI,EAAE,CAAC,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;gBACpD,GAAG,EAAE;QAAE,SAAS,EAAE,aAAa,CAAC,UAAU,CAAC,CAAC;QAAC,SAAS,CAAC,EAAE,sBAAsB,CAAC;QAAC,SAAS,CAAC,EAAE;YAAE,IAAI,EAAE,CAAC,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;YAAC,GAAG,CAAC,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE;IAM/J,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,oBAAoB,CAAC,UAAU,CAAC;IAKrD,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,oBAAoB,CAAC,UAAU,CAAC;IAKrD,OAAO,CAAC,GAAG,IAAI,EAAE,CAAC,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC,EAAE,GAAG,oBAAoB,CAAC,UAAU,CAAC;IAKhF,OAAO,CAA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AAI,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,SAAiC;QAC5C,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,OAAO,IAAI,CAAC;IACd,CAAC;IAED,YAAY,CAAC,SAAiC;QAC5C,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,oDA4CC","sourcesContent":["import { BaseSelectMenuComponentData } from \"discord.js\";\r\nimport { defaultify } from \"stuffs\";\r\nimport { NamespaceEnums } from \"../../generated/namespaceData\";\r\nimport { DBISelectMenu } from \"./SelectMenu\";\r\n\r\nexport type DBISelectMenuOverrides = Omit<BaseSelectMenuComponentData, \"customId\" | \"type\">\r\n\r\nexport class DBISelectMenuBuilder<TNamespace extends NamespaceEnums> {\r\n component: DBISelectMenu<TNamespace>\r\n overrides: DBISelectMenuOverrides;\r\n reference: { data: (string | number | object)[], ttl?: number };\r\n constructor(arg: { component: DBISelectMenu<TNamespace>, overrides?: DBISelectMenuOverrides, 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): DBISelectMenuBuilder<TNamespace> {\r\n this.reference.ttl = ttl;\r\n return this;\r\n }\r\n\r\n addTTL(ttl: number): DBISelectMenuBuilder<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)[]): DBISelectMenuBuilder<TNamespace> {\r\n this.reference.data = data;\r\n return this;\r\n }\r\n\r\n addData(...data: (string | number | object)[]): DBISelectMenuBuilder<TNamespace> {\r\n this.reference.data = [...this.reference.data, ...data];\r\n return this;\r\n }\r\n\r\n setOverrides(overrides: DBISelectMenuOverrides): DBISelectMenuBuilder<TNamespace> {\r\n this.overrides = overrides;\r\n return this;\r\n }\r\n\r\n addOverrides(overrides: DBISelectMenuOverrides): DBISelectMenuBuilder<TNamespace> {\r\n this.overrides = defaultify(overrides, this.overrides, true);\r\n return this;\r\n }\r\n\r\n toJSON(): BaseSelectMenuComponentData {\r\n return this.component.toJSON({ overrides: this.overrides, reference: this.reference });\r\n }\r\n\r\n}"]}
1
+ {"version":3,"file":"SelectMenuBuilder.js","sourceRoot":"","sources":["../../src/types/SelectMenuBuilder.ts"],"names":[],"mappings":";;;AACA,mCAAoC;AAMpC,MAAa,oBAAoB;IAC/B,SAAS,CAA2B;IACpC,SAAS,CAAyB;IAClC,SAAS,CAAuD;IAChE,YAAY,GAAmJ;QAC7J,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,SAAiC;QAC5C,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,OAAO,IAAI,CAAC;IACd,CAAC;IAED,YAAY,CAAC,SAAiC;QAC5C,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,oDA4CC","sourcesContent":["import { BaseSelectMenuComponentData, StringSelectMenuComponentData } from \"discord.js\";\r\nimport { defaultify } from \"stuffs\";\r\nimport { NamespaceEnums } from \"../../generated/namespaceData\";\r\nimport { DBISelectMenu } from \"./SelectMenu\";\r\n\r\nexport type DBISelectMenuOverrides = Omit<StringSelectMenuComponentData, \"customId\" | \"type\">\r\n\r\nexport class DBISelectMenuBuilder<TNamespace extends NamespaceEnums> {\r\n component: DBISelectMenu<TNamespace>\r\n overrides: DBISelectMenuOverrides;\r\n reference: { data: (string | number | object)[], ttl?: number };\r\n constructor(arg: { component: DBISelectMenu<TNamespace>, overrides?: DBISelectMenuOverrides, 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): DBISelectMenuBuilder<TNamespace> {\r\n this.reference.ttl = ttl;\r\n return this;\r\n }\r\n\r\n addTTL(ttl: number): DBISelectMenuBuilder<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)[]): DBISelectMenuBuilder<TNamespace> {\r\n this.reference.data = data;\r\n return this;\r\n }\r\n\r\n addData(...data: (string | number | object)[]): DBISelectMenuBuilder<TNamespace> {\r\n this.reference.data = [...this.reference.data, ...data];\r\n return this;\r\n }\r\n\r\n setOverrides(overrides: DBISelectMenuOverrides): DBISelectMenuBuilder<TNamespace> {\r\n this.overrides = overrides;\r\n return this;\r\n }\r\n\r\n addOverrides(overrides: DBISelectMenuOverrides): DBISelectMenuBuilder<TNamespace> {\r\n this.overrides = defaultify(overrides, this.overrides, true);\r\n return this;\r\n }\r\n\r\n toJSON(): BaseSelectMenuComponentData {\r\n return this.component.toJSON({ overrides: this.overrides, reference: this.reference });\r\n }\r\n\r\n}"]}
package/package.json CHANGED
@@ -3,21 +3,23 @@
3
3
  "@discordjs/rest": "^1.0.1",
4
4
  "async-and-quick": "^1.0.2",
5
5
  "discord-api-types": "^0.37.0",
6
- "discord-hybrid-sharding": "^1.7.4",
6
+ "discord-hybrid-sharding": "github:meister03/discord-hybrid-sharding",
7
7
  "discord.js": "^14.7.1",
8
8
  "lodash": "^4.17.21",
9
9
  "snakecase-keys": "^5.4.2",
10
10
  "stuffs": "^0.1.21"
11
11
  },
12
12
  "name": "@mostfeatured/dbi",
13
- "version": "0.0.70",
13
+ "version": "0.0.71-dev.0",
14
14
  "main": "dist/index.js",
15
15
  "type": "commonjs",
16
16
  "private": false,
17
17
  "scripts": {
18
18
  "test": "npx tsc && node dist/test",
19
19
  "build": "npx tsc",
20
- "prepublish": "npx tsc"
20
+ "prepublish": "npx tsc",
21
+ "publish:dev": "npx tsc && npm publish --tag dev",
22
+ "publish:release": "npx tsc && npm publish"
21
23
  },
22
24
  "repository": {
23
25
  "type": "git",
@@ -38,4 +40,4 @@
38
40
  "access": "public",
39
41
  "registry": "https://registry.npmjs.org/"
40
42
  }
41
- }
43
+ }
package/src/DBI.ts CHANGED
@@ -138,7 +138,7 @@ export class DBI<TNamespace extends NamespaceEnums, TOtherData = Record<string,
138
138
  }
139
139
  };
140
140
  events: Events<TNamespace>;
141
- cluster?: Sharding.Client;
141
+ cluster?: Sharding.ClusterClient<Discord.Client>;
142
142
  private _loaded: boolean;
143
143
  private _hooked: boolean;
144
144
  constructor(namespace: TNamespace, config: DBIConfigConstructor) {
@@ -209,8 +209,8 @@ export class DBI<TNamespace extends NamespaceEnums, TOtherData = Record<string,
209
209
  let client = new Discord.Client({
210
210
  ...(clientContext.options || {}) as any,
211
211
  ...(config.sharding == "hybrid" ? {
212
- shards: (Sharding as any).data.SHARD_LIST,
213
- shardCount: (Sharding as any).data.TOTAL_SHARDS
212
+ shards: Sharding.getInfo().SHARD_LIST,
213
+ shardCount: Sharding.getInfo().TOTAL_SHARDS
214
214
  } : {})
215
215
  });
216
216
  clientContext.client = client;
@@ -220,7 +220,7 @@ export class DBI<TNamespace extends NamespaceEnums, TOtherData = Record<string,
220
220
  if (this.data.clients.length !== 1 && !(config.sharding && config.sharding === "off"))
221
221
  throw new Error("Sharding only supports 1 client.");
222
222
 
223
- this.cluster = config.sharding == "hybrid" ? new Sharding.Client(this.data.clients[0].client) : undefined;
223
+ this.cluster = config.sharding == "hybrid" ? new Sharding.ClusterClient(this.data.clients[0].client) : undefined;
224
224
  this._loaded = false;
225
225
  this._hooked = false;
226
226
  }
@@ -7,7 +7,6 @@ import { NamespaceEnums } from "../../generated/namespaceData";
7
7
  import stuffs from "stuffs";
8
8
  import { DBISelectMenuBuilder, DBISelectMenuOverrides } from "./SelectMenuBuilder";
9
9
 
10
-
11
10
  export interface IDBISelectMenuExecuteCtx<TNamespace extends NamespaceEnums> extends IDBIBaseExecuteCtx<TNamespace> {
12
11
  interaction: Discord.ButtonInteraction<"cached">;
13
12
  data: TDBIReferencedData[];
@@ -15,6 +14,8 @@ export interface IDBISelectMenuExecuteCtx<TNamespace extends NamespaceEnums> ext
15
14
 
16
15
  export type TDBISelectMenuOmitted<TNamespace extends NamespaceEnums> = Omit<DBISelectMenu<TNamespace>, "type" | "description" | "dbi" | "toJSON" | "createBuilder">;
17
16
 
17
+ export type SelectMenuDefaultOptions = Required<Pick<Discord.StringSelectMenuComponentData, "options">> & Omit<Discord.StringSelectMenuComponentData, "customId" | "type" | "options">;
18
+
18
19
  export class DBISelectMenu<TNamespace extends NamespaceEnums> extends DBIBaseInteraction<TNamespace> {
19
20
  constructor(dbi: DBI<TNamespace>, args: TDBISelectMenuOmitted<TNamespace>) {
20
21
  super(dbi, {
@@ -23,7 +24,7 @@ export class DBISelectMenu<TNamespace extends NamespaceEnums> extends DBIBaseInt
23
24
  });
24
25
  }
25
26
 
26
- declare options: Omit<Discord.BaseSelectMenuComponentData, "customId" | "type">;
27
+ declare options: SelectMenuDefaultOptions;
27
28
 
28
29
  override onExecute(ctx: IDBISelectMenuExecuteCtx<TNamespace>): Promise<void> | void { };
29
30
 
@@ -31,7 +32,7 @@ export class DBISelectMenu<TNamespace extends NamespaceEnums> extends DBIBaseInt
31
32
  return {
32
33
  ...stuffs.defaultify((arg?.overrides || {}), this.options || {}, true),
33
34
  customId: buildCustomId(this.dbi as any, this.name, arg?.reference?.data || [], arg?.reference?.ttl),
34
- type: Discord.ComponentType.SelectMenu,
35
+ type: Discord.ComponentType.StringSelect,
35
36
  } as any;
36
37
  };
37
38
 
@@ -1,9 +1,9 @@
1
- import { BaseSelectMenuComponentData } from "discord.js";
1
+ import { BaseSelectMenuComponentData, StringSelectMenuComponentData } from "discord.js";
2
2
  import { defaultify } from "stuffs";
3
3
  import { NamespaceEnums } from "../../generated/namespaceData";
4
4
  import { DBISelectMenu } from "./SelectMenu";
5
5
 
6
- export type DBISelectMenuOverrides = Omit<BaseSelectMenuComponentData, "customId" | "type">
6
+ export type DBISelectMenuOverrides = Omit<StringSelectMenuComponentData, "customId" | "type">
7
7
 
8
8
  export class DBISelectMenuBuilder<TNamespace extends NamespaceEnums> {
9
9
  component: DBISelectMenu<TNamespace>