@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.
- package/dist/DBI.d.ts +156 -156
- package/dist/DBI.js +332 -332
- package/dist/Events.d.ts +53 -53
- package/dist/Events.js +58 -58
- package/dist/data/eventMap.json +234 -234
- package/dist/index.d.ts +6 -6
- package/dist/index.js +16 -16
- package/dist/methods/hookEventListeners.d.ts +3 -3
- package/dist/methods/hookEventListeners.js +87 -87
- package/dist/methods/hookInteractionListeners.d.ts +3 -3
- package/dist/methods/hookInteractionListeners.js +118 -118
- package/dist/methods/publishInteractions.d.ts +7 -7
- package/dist/methods/publishInteractions.js +238 -238
- package/dist/types/Button.d.ts +18 -16
- package/dist/types/Button.d.ts.map +1 -1
- package/dist/types/Button.js +31 -27
- package/dist/types/Button.js.map +1 -1
- package/dist/types/ButtonBuilder.d.ts +30 -0
- package/dist/types/ButtonBuilder.d.ts.map +1 -0
- package/dist/types/ButtonBuilder.js +43 -0
- package/dist/types/ButtonBuilder.js.map +1 -0
- package/dist/types/ChatInput/ChatInput.d.ts +15 -15
- package/dist/types/ChatInput/ChatInput.js +20 -20
- package/dist/types/ChatInput/ChatInputOptions.d.ts +162 -161
- package/dist/types/ChatInput/ChatInputOptions.d.ts.map +1 -1
- package/dist/types/ChatInput/ChatInputOptions.js +161 -160
- package/dist/types/ChatInput/ChatInputOptions.js.map +1 -1
- package/dist/types/CustomEvent.d.ts +13 -13
- package/dist/types/CustomEvent.js +19 -19
- package/dist/types/Event.d.ts +263 -263
- package/dist/types/Event.js +22 -22
- package/dist/types/Interaction.d.ts +47 -47
- package/dist/types/Interaction.js +24 -24
- package/dist/types/InteractionLocale.d.ts +25 -25
- package/dist/types/InteractionLocale.js +14 -14
- package/dist/types/Locale.d.ts +21 -21
- package/dist/types/Locale.js +38 -38
- package/dist/types/MessageContextMenu.d.ts +14 -14
- package/dist/types/MessageContextMenu.js +18 -18
- package/dist/types/Modal.d.ts +22 -20
- package/dist/types/Modal.d.ts.map +1 -1
- package/dist/types/Modal.js +29 -25
- package/dist/types/Modal.js.map +1 -1
- package/dist/types/ModalBuilder.d.ts +31 -0
- package/dist/types/ModalBuilder.d.ts.map +1 -0
- package/dist/types/ModalBuilder.js +43 -0
- package/dist/types/ModalBuilder.js.map +1 -0
- package/dist/types/SelectMenu.d.ts +18 -16
- package/dist/types/SelectMenu.d.ts.map +1 -1
- package/dist/types/SelectMenu.js +31 -27
- package/dist/types/SelectMenu.js.map +1 -1
- package/dist/types/SelectMenuBuilder.d.ts +28 -0
- package/dist/types/SelectMenuBuilder.d.ts.map +1 -0
- package/dist/types/SelectMenuBuilder.js +43 -0
- package/dist/types/SelectMenuBuilder.js.map +1 -0
- package/dist/types/UserContextMenu.d.ts +14 -14
- package/dist/types/UserContextMenu.js +18 -18
- package/dist/utils/MemoryStore.d.ts +8 -8
- package/dist/utils/MemoryStore.js +29 -29
- package/dist/utils/UtilTypes.d.ts +7 -7
- package/dist/utils/UtilTypes.d.ts.map +1 -1
- package/dist/utils/UtilTypes.js +2 -2
- package/dist/utils/UtilTypes.js.map +1 -1
- package/dist/utils/customId.d.ts +7 -7
- package/dist/utils/customId.js +45 -45
- package/dist/utils/permissions.d.ts +2 -2
- package/dist/utils/permissions.js +8 -8
- package/dist/utils/recursiveImport.d.ts +4 -4
- package/dist/utils/recursiveImport.js +26 -26
- package/package.json +2 -2
- package/src/types/Button.ts +7 -2
- package/src/types/ButtonBuilder.ts +52 -0
- package/src/types/ChatInput/ChatInputOptions.ts +1 -0
- package/src/types/Modal.ts +8 -2
- package/src/types/ModalBuilder.ts +52 -0
- package/src/types/SelectMenu.ts +8 -2
- package/src/types/SelectMenuBuilder.ts +52 -0
- package/src/utils/UtilTypes.ts +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ButtonBuilder.d.ts","sourceRoot":"","sources":["../../src/types/ButtonBuilder.ts"],"names":[],"mappings":"AAA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AAE,kBAAkB,GAAG,gBAAgB,CAAC,UAAU,CAAC;IAKzE,YAAY,CAAC,SAAS,EAAE,kBAAkB,GAAG,gBAAgB,CAAC,UAAU,CAAC;IAKzE,MAAM,IAAI,mBAAmB;CAI9B"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DBIButtonBuilder = void 0;
|
|
4
|
+
const stuffs_1 = require("stuffs");
|
|
5
|
+
class DBIButtonBuilder {
|
|
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.DBIButtonBuilder = DBIButtonBuilder;
|
|
43
|
+
//# sourceMapp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AAC,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,4CA4CC","sourcesContent":["import { ButtonComponentData, ButtonStyle } from \"discord.js\";\r\nimport { defaultify } from \"stuffs\";\r\nimport { NamespaceEnums } from \"../../generated/namespaceData\";\r\nimport { DBIButton } from \"./Button\";\r\n\r\nexport type DBIButtonOverrides = { style?: ButtonStyle } & Omit<ButtonComponentData, \"customId\" | \"type\" | \"style\">\r\n\r\nexport class DBIButtonBuilder<TNamespace extends NamespaceEnums> {\r\n component: DBIButton<TNamespace>\r\n overrides: DBIButtonOverrides;\r\n reference: { data: (string | number | object)[], ttl?: number };\r\n constructor(arg: { component: DBIButton<TNamespace>, overrides?: DBIButtonOverrides, 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): DBIButtonBuilder<TNamespace> {\r\n this.reference.ttl = ttl;\r\n return this;\r\n }\r\n\r\n addTTL(ttl: number): DBIButtonBuilder<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)[]): DBIButtonBuilder<TNamespace> {\r\n this.reference.data = data;\r\n return this;\r\n }\r\n\r\n addData(...data: (string | number | object)[]): DBIButtonBuilder<TNamespace> {\r\n this.reference.data = [...this.reference.data, ...data];\r\n return this;\r\n }\r\n\r\n setOverrides(overrides: DBIButtonOverrides): DBIButtonBuilder<TNamespace> {\r\n this.overrides = overrides;\r\n return this;\r\n }\r\n\r\n addOverrides(overrides: DBIButtonOverrides): DBIButtonBuilder<TNamespace> {\r\n this.overrides = defaultify(overrides, this.overrides, true);\r\n return this;\r\n }\r\n\r\n toJSON(): ButtonComponentData {\r\n return this.component.toJSON({ overrides: this.overrides, reference: this.reference });\r\n }\r\n\r\n}"]}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import Discord from "discord.js";
|
|
2
|
-
import { NamespaceEnums } from "../../../generated/namespaceData";
|
|
3
|
-
import { DBI } from "../../DBI";
|
|
4
|
-
import { DBIBaseInteraction, IDBIBaseExecuteCtx } from "../Interaction";
|
|
5
|
-
export interface IDBIChatInputExecuteCtx<TNamespace extends NamespaceEnums> extends IDBIBaseExecuteCtx<TNamespace> {
|
|
6
|
-
interaction: Discord.ChatInputCommandInteraction<"cached">;
|
|
7
|
-
}
|
|
8
|
-
export declare type TDBIChatInputOmitted<TNamespace extends NamespaceEnums> = Omit<DBIChatInput<TNamespace>, "type" | "dbi">;
|
|
9
|
-
export declare class DBIChatInput<TNamespace extends NamespaceEnums> extends DBIBaseInteraction<TNamespace> {
|
|
10
|
-
constructor(dbi: DBI<TNamespace, {}>, cfg: TDBIChatInputOmitted<TNamespace>);
|
|
11
|
-
directMessages?: boolean;
|
|
12
|
-
defaultMemberPermissions?: Discord.PermissionsString[];
|
|
13
|
-
options?: any[];
|
|
14
|
-
onExecute(ctx: IDBIChatInputExecuteCtx<TNamespace>): void;
|
|
15
|
-
}
|
|
1
|
+
import Discord from "discord.js";
|
|
2
|
+
import { NamespaceEnums } from "../../../generated/namespaceData";
|
|
3
|
+
import { DBI } from "../../DBI";
|
|
4
|
+
import { DBIBaseInteraction, IDBIBaseExecuteCtx } from "../Interaction";
|
|
5
|
+
export interface IDBIChatInputExecuteCtx<TNamespace extends NamespaceEnums> extends IDBIBaseExecuteCtx<TNamespace> {
|
|
6
|
+
interaction: Discord.ChatInputCommandInteraction<"cached">;
|
|
7
|
+
}
|
|
8
|
+
export declare type TDBIChatInputOmitted<TNamespace extends NamespaceEnums> = Omit<DBIChatInput<TNamespace>, "type" | "dbi">;
|
|
9
|
+
export declare class DBIChatInput<TNamespace extends NamespaceEnums> extends DBIBaseInteraction<TNamespace> {
|
|
10
|
+
constructor(dbi: DBI<TNamespace, {}>, cfg: TDBIChatInputOmitted<TNamespace>);
|
|
11
|
+
directMessages?: boolean;
|
|
12
|
+
defaultMemberPermissions?: Discord.PermissionsString[];
|
|
13
|
+
options?: any[];
|
|
14
|
+
onExecute(ctx: IDBIChatInputExecuteCtx<TNamespace>): void;
|
|
15
|
+
}
|
|
16
16
|
//# sourceMappingURL=ChatInput.d.ts.map
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DBIChatInput = void 0;
|
|
4
|
-
const Interaction_1 = require("../Interaction");
|
|
5
|
-
class DBIChatInput extends Interaction_1.DBIBaseInteraction {
|
|
6
|
-
constructor(dbi, cfg) {
|
|
7
|
-
super(dbi, {
|
|
8
|
-
...cfg,
|
|
9
|
-
type: "ChatInput",
|
|
10
|
-
name: cfg.name.toLowerCase(),
|
|
11
|
-
options: Array.isArray(cfg.options) ? cfg.options : []
|
|
12
|
-
});
|
|
13
|
-
this.directMessages = cfg.directMessages ?? dbi.config.defaults.directMessages;
|
|
14
|
-
this.defaultMemberPermissions = cfg.defaultMemberPermissions ?? dbi.config.defaults.defaultMemberPermissions;
|
|
15
|
-
}
|
|
16
|
-
directMessages;
|
|
17
|
-
defaultMemberPermissions;
|
|
18
|
-
onExecute(ctx) { }
|
|
19
|
-
}
|
|
20
|
-
exports.DBIChatInput = DBIChatInput;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DBIChatInput = void 0;
|
|
4
|
+
const Interaction_1 = require("../Interaction");
|
|
5
|
+
class DBIChatInput extends Interaction_1.DBIBaseInteraction {
|
|
6
|
+
constructor(dbi, cfg) {
|
|
7
|
+
super(dbi, {
|
|
8
|
+
...cfg,
|
|
9
|
+
type: "ChatInput",
|
|
10
|
+
name: cfg.name.toLowerCase(),
|
|
11
|
+
options: Array.isArray(cfg.options) ? cfg.options : []
|
|
12
|
+
});
|
|
13
|
+
this.directMessages = cfg.directMessages ?? dbi.config.defaults.directMessages;
|
|
14
|
+
this.defaultMemberPermissions = cfg.defaultMemberPermissions ?? dbi.config.defaults.defaultMemberPermissions;
|
|
15
|
+
}
|
|
16
|
+
directMessages;
|
|
17
|
+
defaultMemberPermissions;
|
|
18
|
+
onExecute(ctx) { }
|
|
19
|
+
}
|
|
20
|
+
exports.DBIChatInput = DBIChatInput;
|
|
21
21
|
//# sourceMappingURL=ChatInput.js.map
|
|
@@ -1,162 +1,163 @@
|
|
|
1
|
-
import Discord from "discord.js";
|
|
2
|
-
import { NamespaceEnums } from "../../../generated/namespaceData";
|
|
3
|
-
import { DBI } from "../../DBI";
|
|
4
|
-
import { IDBIBaseExecuteCtx } from "../Interaction";
|
|
5
|
-
export declare type TDBIValueName<T> = {
|
|
6
|
-
value: T;
|
|
7
|
-
name: string;
|
|
8
|
-
};
|
|
9
|
-
export declare type TDBIBaseOption = {
|
|
10
|
-
name: string;
|
|
11
|
-
description: string;
|
|
12
|
-
required?: boolean;
|
|
13
|
-
};
|
|
14
|
-
export declare type TDBIMinMaxLength = {
|
|
15
|
-
maxLength?: number;
|
|
16
|
-
minLength?: number;
|
|
17
|
-
};
|
|
18
|
-
export declare type TDBIMinMaxValue = {
|
|
19
|
-
maxValue?: number;
|
|
20
|
-
minValue?: number;
|
|
21
|
-
};
|
|
22
|
-
export interface IDBICompleteCtx<TNamespace extends NamespaceEnums, TValueType = string | number> extends IDBIBaseExecuteCtx<TNamespace> {
|
|
23
|
-
interaction: Discord.AutocompleteInteraction;
|
|
24
|
-
value: TValueType;
|
|
25
|
-
}
|
|
26
|
-
export declare class DBIChatInputOptions<TNamespace extends NamespaceEnums> {
|
|
27
|
-
dbi: DBI<TNamespace>;
|
|
28
|
-
constructor(dbi: DBI<TNamespace>);
|
|
29
|
-
stringAutocomplete(cfg: TDBIBaseOption & TDBIMinMaxLength & {
|
|
30
|
-
onComplete(ctx: IDBICompleteCtx<TNamespace, string>): Promise<TDBIValueName<string>[]>;
|
|
31
|
-
}): {
|
|
32
|
-
type: Discord.ApplicationCommandOptionType;
|
|
33
|
-
name: string;
|
|
34
|
-
autocomplete: boolean;
|
|
35
|
-
onComplete: (ctx: IDBICompleteCtx<TNamespace, string>) => Promise<TDBIValueName<string>[]>;
|
|
36
|
-
description: string;
|
|
37
|
-
maxLength: number;
|
|
38
|
-
minLength: number;
|
|
39
|
-
required: boolean;
|
|
40
|
-
};
|
|
41
|
-
stringChoices(cfg: TDBIBaseOption & TDBIMinMaxLength & {
|
|
42
|
-
choices: TDBIValueName<string>[];
|
|
43
|
-
}): {
|
|
44
|
-
type: Discord.ApplicationCommandOptionType;
|
|
45
|
-
name: string;
|
|
46
|
-
choices: TDBIValueName<string>[];
|
|
47
|
-
description: string;
|
|
48
|
-
maxLength: number;
|
|
49
|
-
minLength: number;
|
|
50
|
-
required: boolean;
|
|
51
|
-
};
|
|
52
|
-
string(cfg: TDBIBaseOption & TDBIMinMaxLength): {
|
|
53
|
-
type: Discord.ApplicationCommandOptionType;
|
|
54
|
-
name: string;
|
|
55
|
-
description: string;
|
|
56
|
-
maxLength: number;
|
|
57
|
-
minLength: number;
|
|
58
|
-
required: boolean;
|
|
59
|
-
};
|
|
60
|
-
numberAutocomplete(cfg: TDBIBaseOption & TDBIMinMaxValue & {
|
|
61
|
-
onComplete(ctx: IDBICompleteCtx<TNamespace, string>): Promise<TDBIValueName<number>[]>;
|
|
62
|
-
}): {
|
|
63
|
-
type: Discord.ApplicationCommandOptionType;
|
|
64
|
-
name: string;
|
|
65
|
-
autocomplete: boolean;
|
|
66
|
-
onComplete: (ctx: IDBICompleteCtx<TNamespace, string>) => Promise<TDBIValueName<number>[]>;
|
|
67
|
-
description: string;
|
|
68
|
-
maxValue: number;
|
|
69
|
-
minValue: number;
|
|
70
|
-
required: boolean;
|
|
71
|
-
};
|
|
72
|
-
numberChoices(cfg: TDBIBaseOption & TDBIMinMaxValue & {
|
|
73
|
-
choices: TDBIValueName<number>[];
|
|
74
|
-
}): {
|
|
75
|
-
type: Discord.ApplicationCommandOptionType;
|
|
76
|
-
name: string;
|
|
77
|
-
choices: TDBIValueName<number>[];
|
|
78
|
-
description: string;
|
|
79
|
-
maxValue: number;
|
|
80
|
-
minValue: number;
|
|
81
|
-
required: boolean;
|
|
82
|
-
};
|
|
83
|
-
number(cfg: TDBIBaseOption & TDBIMinMaxValue): {
|
|
84
|
-
type: Discord.ApplicationCommandOptionType;
|
|
85
|
-
name: string;
|
|
86
|
-
description: string;
|
|
87
|
-
maxValue: number;
|
|
88
|
-
minValue: number;
|
|
89
|
-
required: boolean;
|
|
90
|
-
};
|
|
91
|
-
integerAutocomplete(cfg: TDBIBaseOption & TDBIMinMaxValue & {
|
|
92
|
-
onComplete(ctx: IDBICompleteCtx<TNamespace, string>): Promise<TDBIValueName<number>[]>;
|
|
93
|
-
}): {
|
|
94
|
-
type: Discord.ApplicationCommandOptionType;
|
|
95
|
-
name: string;
|
|
96
|
-
autocomplete: boolean;
|
|
97
|
-
onComplete: (ctx: IDBICompleteCtx<TNamespace, string>) => Promise<TDBIValueName<number>[]>;
|
|
98
|
-
description: string;
|
|
99
|
-
maxValue: number;
|
|
100
|
-
minValue: number;
|
|
101
|
-
required: boolean;
|
|
102
|
-
};
|
|
103
|
-
integerChoices(cfg: TDBIBaseOption & TDBIMinMaxValue & {
|
|
104
|
-
choices: TDBIValueName<number>[];
|
|
105
|
-
}): {
|
|
106
|
-
type: Discord.ApplicationCommandOptionType;
|
|
107
|
-
name: string;
|
|
108
|
-
choices: TDBIValueName<number>[];
|
|
109
|
-
description: string;
|
|
110
|
-
maxValue: number;
|
|
111
|
-
minValue: number;
|
|
112
|
-
required: boolean;
|
|
113
|
-
};
|
|
114
|
-
integer(cfg: TDBIBaseOption & TDBIMinMaxValue): {
|
|
115
|
-
type: Discord.ApplicationCommandOptionType;
|
|
116
|
-
name: string;
|
|
117
|
-
description: string;
|
|
118
|
-
maxValue: number;
|
|
119
|
-
minValue: number;
|
|
120
|
-
required: boolean;
|
|
121
|
-
};
|
|
122
|
-
boolean(cfg: TDBIBaseOption): {
|
|
123
|
-
type: Discord.ApplicationCommandOptionType;
|
|
124
|
-
name: string;
|
|
125
|
-
description: string;
|
|
126
|
-
required: boolean;
|
|
127
|
-
};
|
|
128
|
-
attachment(cfg: TDBIBaseOption): {
|
|
129
|
-
type: Discord.ApplicationCommandOptionType;
|
|
130
|
-
name: string;
|
|
131
|
-
description: string;
|
|
132
|
-
required: boolean;
|
|
133
|
-
};
|
|
134
|
-
channel(cfg: TDBIBaseOption & {
|
|
135
|
-
channelTypes: Discord.ChannelType[];
|
|
136
|
-
}): {
|
|
137
|
-
type: Discord.ApplicationCommandOptionType;
|
|
138
|
-
name: string;
|
|
139
|
-
description: string;
|
|
140
|
-
channelTypes: Discord.ChannelType[];
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
}
|
|
1
|
+
import Discord from "discord.js";
|
|
2
|
+
import { NamespaceEnums } from "../../../generated/namespaceData";
|
|
3
|
+
import { DBI } from "../../DBI";
|
|
4
|
+
import { IDBIBaseExecuteCtx } from "../Interaction";
|
|
5
|
+
export declare type TDBIValueName<T> = {
|
|
6
|
+
value: T;
|
|
7
|
+
name: string;
|
|
8
|
+
};
|
|
9
|
+
export declare type TDBIBaseOption = {
|
|
10
|
+
name: string;
|
|
11
|
+
description: string;
|
|
12
|
+
required?: boolean;
|
|
13
|
+
};
|
|
14
|
+
export declare type TDBIMinMaxLength = {
|
|
15
|
+
maxLength?: number;
|
|
16
|
+
minLength?: number;
|
|
17
|
+
};
|
|
18
|
+
export declare type TDBIMinMaxValue = {
|
|
19
|
+
maxValue?: number;
|
|
20
|
+
minValue?: number;
|
|
21
|
+
};
|
|
22
|
+
export interface IDBICompleteCtx<TNamespace extends NamespaceEnums, TValueType = string | number> extends IDBIBaseExecuteCtx<TNamespace> {
|
|
23
|
+
interaction: Discord.AutocompleteInteraction;
|
|
24
|
+
value: TValueType;
|
|
25
|
+
}
|
|
26
|
+
export declare class DBIChatInputOptions<TNamespace extends NamespaceEnums> {
|
|
27
|
+
dbi: DBI<TNamespace>;
|
|
28
|
+
constructor(dbi: DBI<TNamespace>);
|
|
29
|
+
stringAutocomplete(cfg: TDBIBaseOption & TDBIMinMaxLength & {
|
|
30
|
+
onComplete(ctx: IDBICompleteCtx<TNamespace, string>): Promise<TDBIValueName<string>[]>;
|
|
31
|
+
}): {
|
|
32
|
+
type: Discord.ApplicationCommandOptionType;
|
|
33
|
+
name: string;
|
|
34
|
+
autocomplete: boolean;
|
|
35
|
+
onComplete: (ctx: IDBICompleteCtx<TNamespace, string>) => Promise<TDBIValueName<string>[]>;
|
|
36
|
+
description: string;
|
|
37
|
+
maxLength: number;
|
|
38
|
+
minLength: number;
|
|
39
|
+
required: boolean;
|
|
40
|
+
};
|
|
41
|
+
stringChoices(cfg: TDBIBaseOption & TDBIMinMaxLength & {
|
|
42
|
+
choices: TDBIValueName<string>[];
|
|
43
|
+
}): {
|
|
44
|
+
type: Discord.ApplicationCommandOptionType;
|
|
45
|
+
name: string;
|
|
46
|
+
choices: TDBIValueName<string>[];
|
|
47
|
+
description: string;
|
|
48
|
+
maxLength: number;
|
|
49
|
+
minLength: number;
|
|
50
|
+
required: boolean;
|
|
51
|
+
};
|
|
52
|
+
string(cfg: TDBIBaseOption & TDBIMinMaxLength): {
|
|
53
|
+
type: Discord.ApplicationCommandOptionType;
|
|
54
|
+
name: string;
|
|
55
|
+
description: string;
|
|
56
|
+
maxLength: number;
|
|
57
|
+
minLength: number;
|
|
58
|
+
required: boolean;
|
|
59
|
+
};
|
|
60
|
+
numberAutocomplete(cfg: TDBIBaseOption & TDBIMinMaxValue & {
|
|
61
|
+
onComplete(ctx: IDBICompleteCtx<TNamespace, string>): Promise<TDBIValueName<number>[]>;
|
|
62
|
+
}): {
|
|
63
|
+
type: Discord.ApplicationCommandOptionType;
|
|
64
|
+
name: string;
|
|
65
|
+
autocomplete: boolean;
|
|
66
|
+
onComplete: (ctx: IDBICompleteCtx<TNamespace, string>) => Promise<TDBIValueName<number>[]>;
|
|
67
|
+
description: string;
|
|
68
|
+
maxValue: number;
|
|
69
|
+
minValue: number;
|
|
70
|
+
required: boolean;
|
|
71
|
+
};
|
|
72
|
+
numberChoices(cfg: TDBIBaseOption & TDBIMinMaxValue & {
|
|
73
|
+
choices: TDBIValueName<number>[];
|
|
74
|
+
}): {
|
|
75
|
+
type: Discord.ApplicationCommandOptionType;
|
|
76
|
+
name: string;
|
|
77
|
+
choices: TDBIValueName<number>[];
|
|
78
|
+
description: string;
|
|
79
|
+
maxValue: number;
|
|
80
|
+
minValue: number;
|
|
81
|
+
required: boolean;
|
|
82
|
+
};
|
|
83
|
+
number(cfg: TDBIBaseOption & TDBIMinMaxValue): {
|
|
84
|
+
type: Discord.ApplicationCommandOptionType;
|
|
85
|
+
name: string;
|
|
86
|
+
description: string;
|
|
87
|
+
maxValue: number;
|
|
88
|
+
minValue: number;
|
|
89
|
+
required: boolean;
|
|
90
|
+
};
|
|
91
|
+
integerAutocomplete(cfg: TDBIBaseOption & TDBIMinMaxValue & {
|
|
92
|
+
onComplete(ctx: IDBICompleteCtx<TNamespace, string>): Promise<TDBIValueName<number>[]>;
|
|
93
|
+
}): {
|
|
94
|
+
type: Discord.ApplicationCommandOptionType;
|
|
95
|
+
name: string;
|
|
96
|
+
autocomplete: boolean;
|
|
97
|
+
onComplete: (ctx: IDBICompleteCtx<TNamespace, string>) => Promise<TDBIValueName<number>[]>;
|
|
98
|
+
description: string;
|
|
99
|
+
maxValue: number;
|
|
100
|
+
minValue: number;
|
|
101
|
+
required: boolean;
|
|
102
|
+
};
|
|
103
|
+
integerChoices(cfg: TDBIBaseOption & TDBIMinMaxValue & {
|
|
104
|
+
choices: TDBIValueName<number>[];
|
|
105
|
+
}): {
|
|
106
|
+
type: Discord.ApplicationCommandOptionType;
|
|
107
|
+
name: string;
|
|
108
|
+
choices: TDBIValueName<number>[];
|
|
109
|
+
description: string;
|
|
110
|
+
maxValue: number;
|
|
111
|
+
minValue: number;
|
|
112
|
+
required: boolean;
|
|
113
|
+
};
|
|
114
|
+
integer(cfg: TDBIBaseOption & TDBIMinMaxValue): {
|
|
115
|
+
type: Discord.ApplicationCommandOptionType;
|
|
116
|
+
name: string;
|
|
117
|
+
description: string;
|
|
118
|
+
maxValue: number;
|
|
119
|
+
minValue: number;
|
|
120
|
+
required: boolean;
|
|
121
|
+
};
|
|
122
|
+
boolean(cfg: TDBIBaseOption): {
|
|
123
|
+
type: Discord.ApplicationCommandOptionType;
|
|
124
|
+
name: string;
|
|
125
|
+
description: string;
|
|
126
|
+
required: boolean;
|
|
127
|
+
};
|
|
128
|
+
attachment(cfg: TDBIBaseOption): {
|
|
129
|
+
type: Discord.ApplicationCommandOptionType;
|
|
130
|
+
name: string;
|
|
131
|
+
description: string;
|
|
132
|
+
required: boolean;
|
|
133
|
+
};
|
|
134
|
+
channel(cfg: TDBIBaseOption & {
|
|
135
|
+
channelTypes: Discord.ChannelType[];
|
|
136
|
+
}): {
|
|
137
|
+
type: Discord.ApplicationCommandOptionType;
|
|
138
|
+
name: string;
|
|
139
|
+
description: string;
|
|
140
|
+
channelTypes: Discord.ChannelType[];
|
|
141
|
+
channel_types: Discord.ChannelType[];
|
|
142
|
+
required: boolean;
|
|
143
|
+
};
|
|
144
|
+
role(cfg: TDBIBaseOption): {
|
|
145
|
+
type: Discord.ApplicationCommandOptionType;
|
|
146
|
+
name: string;
|
|
147
|
+
description: string;
|
|
148
|
+
required: boolean;
|
|
149
|
+
};
|
|
150
|
+
mentionable(cfg: TDBIBaseOption): {
|
|
151
|
+
type: Discord.ApplicationCommandOptionType;
|
|
152
|
+
name: string;
|
|
153
|
+
description: string;
|
|
154
|
+
required: boolean;
|
|
155
|
+
};
|
|
156
|
+
user(cfg: TDBIBaseOption): {
|
|
157
|
+
type: Discord.ApplicationCommandOptionType;
|
|
158
|
+
name: string;
|
|
159
|
+
description: string;
|
|
160
|
+
required: boolean;
|
|
161
|
+
};
|
|
162
|
+
}
|
|
162
163
|
//# sourceMappingURL=ChatInputOptions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatInputOptions.d.ts","sourceRoot":"","sources":["../../../src/types/ChatInput/ChatInputOptions.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,YAAY,CAAC;AACjC,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAClE,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAChC,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAEpD,oBAAY,aAAa,CAAC,CAAC,IAAI;IAAE,KAAK,EAAE,CAAC,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAC1D,oBAAY,cAAc,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAEvF,oBAAY,gBAAgB,GAAG;IAAE,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAC1E,oBAAY,eAAe,GAAG;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAEvE,MAAM,WAAW,eAAe,CAAC,UA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