@mostfeatured/dbi 0.0.31 → 0.0.34
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/types/Modal.d.ts +5 -1
- package/dist/types/Modal.d.ts.map +1 -1
- package/dist/types/Modal.js.map +1 -1
- package/package.json +1 -1
- package/readme.md +3 -1
- package/src/types/Modal.ts +7 -2
package/dist/types/Modal.d.ts
CHANGED
|
@@ -5,10 +5,14 @@ export interface IDBIModalExecuteCtx extends IDBIBaseExecuteCtx {
|
|
|
5
5
|
interaction: Discord.ModalSubmitInteraction<"cached">;
|
|
6
6
|
data: TDBIReferencedData[];
|
|
7
7
|
}
|
|
8
|
+
export interface ModalComponentData {
|
|
9
|
+
title: string;
|
|
10
|
+
components: (Discord.ActionRowData<Discord.ModalActionRowComponentData>)[];
|
|
11
|
+
}
|
|
8
12
|
export declare type TDBIModalOmitted = Omit<DBIModal, "type" | "description" | "dbi" | "toJSON">;
|
|
9
13
|
export declare class DBIModal extends DBIBaseInteraction {
|
|
10
14
|
constructor(dbi: DBI, args: TDBIModalOmitted);
|
|
11
|
-
options:
|
|
15
|
+
options: ModalComponentData | ((data: TDBIReferencedData[]) => ModalComponentData);
|
|
12
16
|
onExecute(ctx: IDBIModalExecuteCtx): Promise<any> | any;
|
|
13
17
|
referenceTTL?: number;
|
|
14
18
|
toJSON(...customData: (string | number | object)[]): Discord.ModalComponentData;
|
|
@@ -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;AAGjC,MAAM,WAAW,mBAAoB,SAAQ,kBAAkB;IAC7D,WAAW,EAAE,OAAO,CAAC,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,YAAY,CAAC,EAAE,MAAM,CAAC;IAE9B,MAAM,CAAC,GAAG,UAAU,EAAE,CAAC,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC,EAAE,GAAG,OAAO,CAAC,kBAAkB;CAMhF"}
|
package/dist/types/Modal.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Modal.js","sourceRoot":"","sources":["../../src/types/Modal.ts"],"names":[],"mappings":";;;AACA,+CAA2F;AAE3F,gDAAoD;
|
|
1
|
+
{"version":3,"file":"Modal.js","sourceRoot":"","sources":["../../src/types/Modal.ts"],"names":[],"mappings":";;;AACA,+CAA2F;AAE3F,gDAAoD;AAepD,MAAa,QAAS,SAAQ,gCAAkB;IAC9C,YAAY,GAAQ,EAAE,IAAsB;QAC1C,KAAK,CAAC,GAAG,EAAE;YACT,GAAI,IAAY;YAChB,IAAI,EAAE,OAAO;SACd,CAAC,CAAC;QACH,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC;IACxC,CAAC;IAIQ,SAAS,CAAC,GAAwB,IAAwB,CAAC;IAAA,CAAC;IAIrE,MAAM,CAAC,GAAG,UAAwC;QAChD,OAAO;YACL,GAAG,CAAC,OAAO,IAAI,CAAC,OAAO,IAAI,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,UAAiB,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC;YACvF,QAAQ,EAAE,IAAA,0BAAe,EAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,IAAI,EAAE,UAAU,EAAE,IAAI,CAAC,YAAY,CAAC;SACvE,CAAC;IACX,CAAC;IAAA,CAAC;CACH;AArBD,4BAqBC","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\n\r\nexport interface IDBIModalExecuteCtx extends IDBIBaseExecuteCtx {\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 = Omit<DBIModal, \"type\" | \"description\" | \"dbi\" | \"toJSON\">;\r\n\r\nexport class DBIModal extends DBIBaseInteraction {\r\n constructor(dbi: DBI, args: TDBIModalOmitted) {\r\n super(dbi, {\r\n ...(args as any),\r\n type: \"Modal\"\r\n });\r\n this.referenceTTL = args.referenceTTL;\r\n }\r\n\r\n declare options: ModalComponentData | ((data: TDBIReferencedData[]) => ModalComponentData);\r\n\r\n override onExecute(ctx: IDBIModalExecuteCtx): Promise<any> | any { };\r\n\r\n declare referenceTTL?: number;\r\n\r\n toJSON(...customData: (string | number | object)[]): Discord.ModalComponentData {\r\n return {\r\n ...(typeof this.options == \"function\" ? this.options(customData as any) : this.options),\r\n customId: customIdBuilder(this.dbi, this.name, customData, this.referenceTTL)\r\n } as any;\r\n };\r\n}"]}
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -109,7 +109,7 @@ dbi.register(({ ChatInput, Event })=>{
|
|
|
109
109
|
```
|
|
110
110
|
Unutmayın ki aynı anda istediğiniz kadar özelliği çağırabilirsiniz!
|
|
111
111
|
|
|
112
|
-
#ChatInput & ChatInputOptions
|
|
112
|
+
# ChatInput & ChatInputOptions
|
|
113
113
|
|
|
114
114
|
`ChatInput` sizin anlayacağınız şekilde "Slash Komut" olarak tanımlanmaktadır.
|
|
115
115
|
|
|
@@ -249,6 +249,8 @@ Bir eşsiz özelliği daha sizlere sunuyoruz. Artık her kullanıcıya özel kom
|
|
|
249
249
|
<sub>`src/interactionlocales.js` dosyası:</sub>
|
|
250
250
|
|
|
251
251
|
```js
|
|
252
|
+
const dbi = require("../dbi");
|
|
253
|
+
|
|
252
254
|
dbi.register(({ InteractionLocale })=>{
|
|
253
255
|
InteractionLocale({
|
|
254
256
|
name: "cinsiyet seç",
|
package/src/types/Modal.ts
CHANGED
|
@@ -9,6 +9,11 @@ export interface IDBIModalExecuteCtx extends IDBIBaseExecuteCtx {
|
|
|
9
9
|
data: TDBIReferencedData[];
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
+
export interface ModalComponentData {
|
|
13
|
+
title: string;
|
|
14
|
+
components: (Discord.ActionRowData<Discord.ModalActionRowComponentData>)[];
|
|
15
|
+
}
|
|
16
|
+
|
|
12
17
|
export type TDBIModalOmitted = Omit<DBIModal, "type" | "description" | "dbi" | "toJSON">;
|
|
13
18
|
|
|
14
19
|
export class DBIModal extends DBIBaseInteraction {
|
|
@@ -20,7 +25,7 @@ export class DBIModal extends DBIBaseInteraction {
|
|
|
20
25
|
this.referenceTTL = args.referenceTTL;
|
|
21
26
|
}
|
|
22
27
|
|
|
23
|
-
declare options:
|
|
28
|
+
declare options: ModalComponentData | ((data: TDBIReferencedData[]) => ModalComponentData);
|
|
24
29
|
|
|
25
30
|
override onExecute(ctx: IDBIModalExecuteCtx): Promise<any> | any { };
|
|
26
31
|
|
|
@@ -28,7 +33,7 @@ export class DBIModal extends DBIBaseInteraction {
|
|
|
28
33
|
|
|
29
34
|
toJSON(...customData: (string | number | object)[]): Discord.ModalComponentData {
|
|
30
35
|
return {
|
|
31
|
-
...(typeof this.options == "function" ? this.options(customData) : this.options),
|
|
36
|
+
...(typeof this.options == "function" ? this.options(customData as any) : this.options),
|
|
32
37
|
customId: customIdBuilder(this.dbi, this.name, customData, this.referenceTTL)
|
|
33
38
|
} as any;
|
|
34
39
|
};
|