@open-discord-bots/framework 0.1.2 → 0.2.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.
- package/dist/api/modules/action.d.ts +26 -4
- package/dist/api/modules/action.js +16 -0
- package/dist/api/modules/base.d.ts +12 -2
- package/dist/api/modules/base.js +11 -1
- package/dist/api/modules/builder.d.ts +117 -21
- package/dist/api/modules/builder.js +72 -0
- package/dist/api/modules/checker.d.ts +111 -15
- package/dist/api/modules/checker.js +201 -9
- package/dist/api/modules/client.d.ts +45 -22
- package/dist/api/modules/client.js +58 -34
- package/dist/api/modules/code.d.ts +11 -1
- package/dist/api/modules/code.js +9 -0
- package/dist/api/modules/config.d.ts +15 -5
- package/dist/api/modules/config.js +9 -0
- package/dist/api/modules/console.d.ts +11 -1
- package/dist/api/modules/console.js +9 -0
- package/dist/api/modules/cooldown.d.ts +11 -1
- package/dist/api/modules/cooldown.js +9 -0
- package/dist/api/modules/database.d.ts +36 -4
- package/dist/api/modules/database.js +9 -17
- package/dist/api/modules/event.d.ts +10 -1
- package/dist/api/modules/event.js +6 -0
- package/dist/api/modules/flag.d.ts +11 -1
- package/dist/api/modules/flag.js +9 -0
- package/dist/api/modules/helpmenu.d.ts +22 -2
- package/dist/api/modules/helpmenu.js +18 -0
- package/dist/api/modules/language.d.ts +15 -1
- package/dist/api/modules/language.js +9 -4
- package/dist/api/modules/permission.d.ts +11 -1
- package/dist/api/modules/permission.js +9 -0
- package/dist/api/modules/plugin.d.ts +23 -3
- package/dist/api/modules/plugin.js +18 -0
- package/dist/api/modules/post.d.ts +11 -1
- package/dist/api/modules/post.js +9 -0
- package/dist/api/modules/progressbar.d.ts +24 -3
- package/dist/api/modules/progressbar.js +19 -0
- package/dist/api/modules/responder.d.ts +105 -21
- package/dist/api/modules/responder.js +54 -0
- package/dist/api/modules/session.d.ts +11 -1
- package/dist/api/modules/session.js +9 -0
- package/dist/api/modules/startscreen.d.ts +17 -7
- package/dist/api/modules/startscreen.js +9 -0
- package/dist/api/modules/stat.d.ts +42 -8
- package/dist/api/modules/stat.js +18 -4
- package/dist/api/modules/verifybar.d.ts +18 -4
- package/dist/api/modules/verifybar.js +9 -0
- package/dist/api/modules/worker.d.ts +7 -1
- package/dist/api/modules/worker.js +9 -0
- package/dist/utilities/index.js +1 -0
- package/package.json +1 -1
- package/src/api/main.ts +10 -10
- package/src/api/modules/action.ts +37 -4
- package/src/api/modules/base.ts +30 -3
- package/src/api/modules/builder.ts +226 -21
- package/src/api/modules/checker.ts +292 -17
- package/src/api/modules/client.ts +129 -43
- package/src/api/modules/code.ts +27 -1
- package/src/api/modules/config.ts +33 -7
- package/src/api/modules/console.ts +27 -1
- package/src/api/modules/cooldown.ts +27 -1
- package/src/api/modules/database.ts +55 -4
- package/src/api/modules/event.ts +24 -1
- package/src/api/modules/flag.ts +27 -1
- package/src/api/modules/helpmenu.ts +55 -2
- package/src/api/modules/language.ts +35 -1
- package/src/api/modules/permission.ts +27 -1
- package/src/api/modules/plugin.ts +55 -3
- package/src/api/modules/post.ts +27 -1
- package/src/api/modules/progressbar.ts +56 -3
- package/src/api/modules/responder.ts +184 -21
- package/src/api/modules/session.ts +27 -1
- package/src/api/modules/startscreen.ts +33 -7
- package/src/api/modules/stat.ts +79 -8
- package/src/api/modules/verifybar.ts +31 -5
- package/src/api/modules/worker.ts +22 -1
- package/src/utilities/index.ts +1 -0
|
@@ -8,13 +8,22 @@ import { ODDebugger } from "./console";
|
|
|
8
8
|
*
|
|
9
9
|
* This class can't be used stand-alone & needs to be extended from!
|
|
10
10
|
*/
|
|
11
|
-
export declare class ODActionImplementation<Source extends string, Params extends object, Result extends object> extends ODManagerData {
|
|
11
|
+
export declare class ODActionImplementation<Source extends string, Params extends object, Result extends object, WorkerIds extends string = string> extends ODManagerData {
|
|
12
12
|
/**The manager that has all workers of this implementation */
|
|
13
|
-
workers: ODWorkerManager<object, Source, Params>;
|
|
13
|
+
workers: ODWorkerManager<object, Source, Params, WorkerIds>;
|
|
14
14
|
constructor(id: ODValidId, callback?: ODWorkerCallback<object, Source, Params>, priority?: number, callbackId?: ODValidId);
|
|
15
15
|
/**Execute all workers & return the result. */
|
|
16
16
|
run(source: Source, params: Params): Promise<Partial<Result>>;
|
|
17
17
|
}
|
|
18
|
+
/**## ODActionManagerIdConstraint `type`
|
|
19
|
+
* The constraint/layout for id mappings/interfaces of the `ODActionManager` class.
|
|
20
|
+
*/
|
|
21
|
+
export type ODActionManagerIdConstraint = Record<string, {
|
|
22
|
+
source: string;
|
|
23
|
+
params: object;
|
|
24
|
+
result: object;
|
|
25
|
+
workers: string;
|
|
26
|
+
}>;
|
|
18
27
|
/**## ODActionManager `class`
|
|
19
28
|
* This is an Open Discord action manager.
|
|
20
29
|
*
|
|
@@ -25,10 +34,23 @@ export declare class ODActionImplementation<Source extends string, Params extend
|
|
|
25
34
|
*
|
|
26
35
|
* It's recommended to use this system in combination with Open Discord responders!
|
|
27
36
|
*/
|
|
28
|
-
export declare class ODActionManager extends ODManager<ODAction<string, {}, {}>> {
|
|
37
|
+
export declare class ODActionManager<IdList extends ODActionManagerIdConstraint = ODActionManagerIdConstraint> extends ODManager<ODAction<string, {}, {}, string>> {
|
|
29
38
|
constructor(debug: ODDebugger);
|
|
39
|
+
get<ActionId extends keyof IdList>(id: ActionId): ODAction<IdList[ActionId]["source"], IdList[ActionId]["params"], IdList[ActionId]["result"], IdList[ActionId]["workers"]>;
|
|
40
|
+
get(id: ODValidId): ODAction<string, {}, {}, string> | null;
|
|
41
|
+
remove<ActionId extends keyof IdList>(id: ActionId): ODAction<IdList[ActionId]["source"], IdList[ActionId]["params"], IdList[ActionId]["result"], IdList[ActionId]["workers"]>;
|
|
42
|
+
remove(id: ODValidId): ODAction<string, {}, {}, string> | null;
|
|
43
|
+
exists(id: keyof IdList): boolean;
|
|
44
|
+
exists(id: ODValidId): boolean;
|
|
30
45
|
}
|
|
31
|
-
|
|
46
|
+
/**## ODAction `class`
|
|
47
|
+
* This is an Open Discord action.
|
|
48
|
+
*
|
|
49
|
+
* It is a collection of functions/workers to execute a complex workflow (e.g. creating a ticket, banning a user, ...).
|
|
50
|
+
*
|
|
51
|
+
* Can be used standalone.
|
|
52
|
+
*/
|
|
53
|
+
export declare class ODAction<Source extends string, Params extends object, Result extends object, WorkerIds extends string = string> extends ODActionImplementation<Source, Params, Result, WorkerIds> {
|
|
32
54
|
/**Run this action */
|
|
33
55
|
run(source: Source, params: Params): Promise<Partial<Result>>;
|
|
34
56
|
}
|
|
@@ -42,8 +42,24 @@ class ODActionManager extends base_1.ODManager {
|
|
|
42
42
|
constructor(debug) {
|
|
43
43
|
super(debug, "action");
|
|
44
44
|
}
|
|
45
|
+
get(id) {
|
|
46
|
+
return super.get(id);
|
|
47
|
+
}
|
|
48
|
+
remove(id) {
|
|
49
|
+
return super.remove(id);
|
|
50
|
+
}
|
|
51
|
+
exists(id) {
|
|
52
|
+
return super.exists(id);
|
|
53
|
+
}
|
|
45
54
|
}
|
|
46
55
|
exports.ODActionManager = ODActionManager;
|
|
56
|
+
/**## ODAction `class`
|
|
57
|
+
* This is an Open Discord action.
|
|
58
|
+
*
|
|
59
|
+
* It is a collection of functions/workers to execute a complex workflow (e.g. creating a ticket, banning a user, ...).
|
|
60
|
+
*
|
|
61
|
+
* Can be used standalone.
|
|
62
|
+
*/
|
|
47
63
|
class ODAction extends ODActionImplementation {
|
|
48
64
|
/**Run this action */
|
|
49
65
|
async run(source, params) {
|
|
@@ -21,7 +21,7 @@ export type ODProjectType = "openticket" | "openmoderation";
|
|
|
21
21
|
*
|
|
22
22
|
* You will see this type in many functions from Open Discord.
|
|
23
23
|
*/
|
|
24
|
-
export type ODValidId = string | ODId;
|
|
24
|
+
export type ODValidId = string | number | symbol | ODId;
|
|
25
25
|
/**## ODValidJsonType `type`
|
|
26
26
|
* This is a collection of all types that can be stored in a JSON file!
|
|
27
27
|
*
|
|
@@ -149,13 +149,23 @@ export declare class ODManagerWithSafety<DataType extends ODManagerData> extends
|
|
|
149
149
|
*/
|
|
150
150
|
getSafe(id: ODValidId): DataType;
|
|
151
151
|
}
|
|
152
|
+
/**## ODVersionManagerIdConstraint `type`
|
|
153
|
+
* The constraint/layout for id mappings/interfaces of the `ODVersionManager` class.
|
|
154
|
+
*/
|
|
155
|
+
export type ODVersionManagerIdConstraint = Record<string, ODVersion>;
|
|
152
156
|
/**## ODVersionManager `class`
|
|
153
157
|
* A Open Discord version manager.
|
|
154
158
|
*
|
|
155
159
|
* It is used to manage different `ODVersion`'s from the bot. You will use it to check which version of the bot is used.
|
|
156
160
|
*/
|
|
157
|
-
export declare class ODVersionManager extends ODManager<ODVersion> {
|
|
161
|
+
export declare class ODVersionManager<IdList extends ODVersionManagerIdConstraint = ODVersionManagerIdConstraint> extends ODManager<ODVersion> {
|
|
158
162
|
constructor();
|
|
163
|
+
get<VersionId extends keyof IdList>(id: VersionId): IdList[VersionId];
|
|
164
|
+
get(id: ODValidId): ODVersion | null;
|
|
165
|
+
remove<VersionId extends keyof IdList>(id: VersionId): IdList[VersionId];
|
|
166
|
+
remove(id: ODValidId): ODVersion | null;
|
|
167
|
+
exists(id: keyof IdList): boolean;
|
|
168
|
+
exists(id: ODValidId): boolean;
|
|
159
169
|
}
|
|
160
170
|
/**## ODVersion `class`
|
|
161
171
|
* This is an Open Discord version.
|
package/dist/api/modules/base.js
CHANGED
|
@@ -361,9 +361,10 @@ class ODManagerWithSafety extends ODManager {
|
|
|
361
361
|
* ### ⚠️ This should only be used when the data doesn't need to be written/edited
|
|
362
362
|
*/
|
|
363
363
|
getSafe(id) {
|
|
364
|
+
const newId = new ODId(id);
|
|
364
365
|
const data = super.get(id);
|
|
365
366
|
if (!data) {
|
|
366
|
-
process.emit("uncaughtException", new ODSystemError("ODManagerWithSafety:getSafe(\"" +
|
|
367
|
+
process.emit("uncaughtException", new ODSystemError("ODManagerWithSafety:getSafe(\"" + newId.value + "\") => Unknown Id => Used backup data (" + this.#debugname + " manager)"));
|
|
367
368
|
return this.#backupCreator();
|
|
368
369
|
}
|
|
369
370
|
else
|
|
@@ -380,6 +381,15 @@ class ODVersionManager extends ODManager {
|
|
|
380
381
|
constructor() {
|
|
381
382
|
super();
|
|
382
383
|
}
|
|
384
|
+
get(id) {
|
|
385
|
+
return super.get(id);
|
|
386
|
+
}
|
|
387
|
+
remove(id) {
|
|
388
|
+
return super.remove(id);
|
|
389
|
+
}
|
|
390
|
+
exists(id) {
|
|
391
|
+
return super.exists(id);
|
|
392
|
+
}
|
|
383
393
|
}
|
|
384
394
|
exports.ODVersionManager = ODVersionManager;
|
|
385
395
|
/**## ODVersion `class`
|
|
@@ -11,9 +11,9 @@ import { ODDebugger } from "./console";
|
|
|
11
11
|
*/
|
|
12
12
|
export declare class ODBuilderImplementation<Instance, Source extends string, Params, BuildType extends {
|
|
13
13
|
id: ODId;
|
|
14
|
-
}> extends ODManagerData {
|
|
14
|
+
}, WorkerIds extends string = string> extends ODManagerData {
|
|
15
15
|
/**The manager that has all workers of this implementation */
|
|
16
|
-
workers: ODWorkerManager<Instance, Source, Params>;
|
|
16
|
+
workers: ODWorkerManager<Instance, Source, Params, WorkerIds>;
|
|
17
17
|
/**Cache a build or create it every time from scratch when this.build() gets executed. */
|
|
18
18
|
allowCache: boolean;
|
|
19
19
|
/**Did the build already got created/cached? */
|
|
@@ -42,19 +42,19 @@ export declare class ODBuilderImplementation<Instance, Source extends string, Pa
|
|
|
42
42
|
* - get to know the source of the build request for a specific message, button, etc
|
|
43
43
|
* - And so much more!
|
|
44
44
|
*/
|
|
45
|
-
export declare class ODBuilderManager {
|
|
45
|
+
export declare class ODBuilderManager<ButtonIdList extends ODButtonManagerIdConstraint = ODButtonManagerIdConstraint, DropdownIdList extends ODDropdownManagerIdConstraint = ODDropdownManagerIdConstraint, FileIdList extends ODFileManagerIdConstraint = ODFileManagerIdConstraint, EmbedIdList extends ODEmbedManagerIdConstraint = ODEmbedManagerIdConstraint, MessageIdList extends ODMessageManagerIdConstraint = ODMessageManagerIdConstraint, ModalIdList extends ODModalManagerIdConstraint = ODModalManagerIdConstraint> {
|
|
46
46
|
/**The manager for all button builders */
|
|
47
|
-
buttons: ODButtonManager
|
|
47
|
+
buttons: ODButtonManager<ButtonIdList>;
|
|
48
48
|
/**The manager for all dropdown builders */
|
|
49
|
-
dropdowns: ODDropdownManager
|
|
49
|
+
dropdowns: ODDropdownManager<DropdownIdList>;
|
|
50
50
|
/**The manager for all file/attachment builders */
|
|
51
|
-
files: ODFileManager
|
|
51
|
+
files: ODFileManager<FileIdList>;
|
|
52
52
|
/**The manager for all embed builders */
|
|
53
|
-
embeds: ODEmbedManager
|
|
53
|
+
embeds: ODEmbedManager<EmbedIdList>;
|
|
54
54
|
/**The manager for all message builders */
|
|
55
|
-
messages: ODMessageManager
|
|
55
|
+
messages: ODMessageManager<MessageIdList>;
|
|
56
56
|
/**The manager for all modal builders */
|
|
57
|
-
modals: ODModalManager
|
|
57
|
+
modals: ODModalManager<ModalIdList>;
|
|
58
58
|
constructor(debug: ODDebugger);
|
|
59
59
|
}
|
|
60
60
|
/**## ODComponentBuildResult `interface`
|
|
@@ -66,6 +66,14 @@ export interface ODComponentBuildResult {
|
|
|
66
66
|
/**The discord component or `\n` when it is a spacer between action rows */
|
|
67
67
|
component: discord.MessageActionRowComponentBuilder | "\n" | null;
|
|
68
68
|
}
|
|
69
|
+
/**## ODButtonManagerIdConstraint `type`
|
|
70
|
+
* The constraint/layout for id mappings/interfaces of the `ODButtonManager` class.
|
|
71
|
+
*/
|
|
72
|
+
export type ODButtonManagerIdConstraint = Record<string, {
|
|
73
|
+
source: string;
|
|
74
|
+
params: object;
|
|
75
|
+
workers: string;
|
|
76
|
+
}>;
|
|
69
77
|
/**## ODButtonManager `class`
|
|
70
78
|
* This is an Open Discord button manager.
|
|
71
79
|
*
|
|
@@ -73,10 +81,18 @@ export interface ODComponentBuildResult {
|
|
|
73
81
|
*
|
|
74
82
|
* It's recommended to use this system in combination with all the other Open Discord builders!
|
|
75
83
|
*/
|
|
76
|
-
export declare class ODButtonManager extends ODManagerWithSafety<ODButton<string,
|
|
84
|
+
export declare class ODButtonManager<IdList extends ODButtonManagerIdConstraint = ODButtonManagerIdConstraint> extends ODManagerWithSafety<ODButton<string, {}, string>> {
|
|
77
85
|
constructor(debug: ODDebugger);
|
|
78
86
|
/**Get a newline component for buttons & dropdowns! */
|
|
79
87
|
getNewLine(id: ODValidId): ODComponentBuildResult;
|
|
88
|
+
get<ButtonId extends keyof IdList>(id: ButtonId): ODButton<IdList[ButtonId]["source"], IdList[ButtonId]["params"], IdList[ButtonId]["workers"]>;
|
|
89
|
+
get(id: ODValidId): ODButton<string, {}, string> | null;
|
|
90
|
+
remove<ButtonId extends keyof IdList>(id: ButtonId): ODButton<IdList[ButtonId]["source"], IdList[ButtonId]["params"], IdList[ButtonId]["workers"]>;
|
|
91
|
+
remove(id: ODValidId): ODButton<string, {}, string> | null;
|
|
92
|
+
exists(id: keyof IdList): boolean;
|
|
93
|
+
exists(id: ODValidId): boolean;
|
|
94
|
+
getSafe<ButtonId extends keyof IdList>(id: ButtonId): ODButton<IdList[ButtonId]["source"], IdList[ButtonId]["params"], IdList[ButtonId]["workers"]>;
|
|
95
|
+
getSafe(id: ODValidId): ODButton<string, {}, string>;
|
|
80
96
|
}
|
|
81
97
|
/**## ODButtonData `interface`
|
|
82
98
|
* This interface contains the data to build a button.
|
|
@@ -128,7 +144,7 @@ export declare class ODButtonInstance {
|
|
|
128
144
|
*
|
|
129
145
|
* This is possible by using "workers" or multiple functions that will be executed in priority order!
|
|
130
146
|
*/
|
|
131
|
-
export declare class ODButton<Source extends string, Params> extends ODBuilderImplementation<ODButtonInstance, Source, Params, ODComponentBuildResult> {
|
|
147
|
+
export declare class ODButton<Source extends string, Params, WorkerIds extends string = string> extends ODBuilderImplementation<ODButtonInstance, Source, Params, ODComponentBuildResult, WorkerIds> {
|
|
132
148
|
/**Build this button & compile it for discord.js */
|
|
133
149
|
build(source: Source, params: Params): Promise<ODComponentBuildResult>;
|
|
134
150
|
}
|
|
@@ -149,6 +165,14 @@ export declare class ODQuickButton {
|
|
|
149
165
|
/**Build this button & compile it for discord.js */
|
|
150
166
|
build(): Promise<ODComponentBuildResult>;
|
|
151
167
|
}
|
|
168
|
+
/**## ODDropdownManagerIdConstraint `type`
|
|
169
|
+
* The constraint/layout for id mappings/interfaces of the `ODDropdownManager` class.
|
|
170
|
+
*/
|
|
171
|
+
export type ODDropdownManagerIdConstraint = Record<string, {
|
|
172
|
+
source: string;
|
|
173
|
+
params: object;
|
|
174
|
+
workers: string;
|
|
175
|
+
}>;
|
|
152
176
|
/**## ODDropdownManager `class`
|
|
153
177
|
* This is an Open Discord dropdown manager.
|
|
154
178
|
*
|
|
@@ -156,10 +180,18 @@ export declare class ODQuickButton {
|
|
|
156
180
|
*
|
|
157
181
|
* It's recommended to use this system in combination with all the other Open Discord builders!
|
|
158
182
|
*/
|
|
159
|
-
export declare class ODDropdownManager extends ODManagerWithSafety<ODDropdown<string,
|
|
183
|
+
export declare class ODDropdownManager<IdList extends ODDropdownManagerIdConstraint = ODDropdownManagerIdConstraint> extends ODManagerWithSafety<ODDropdown<string, {}, string>> {
|
|
160
184
|
constructor(debug: ODDebugger);
|
|
161
185
|
/**Get a newline component for buttons & dropdowns! */
|
|
162
186
|
getNewLine(id: ODValidId): ODComponentBuildResult;
|
|
187
|
+
get<DropdownId extends keyof IdList>(id: DropdownId): ODDropdown<IdList[DropdownId]["source"], IdList[DropdownId]["params"], IdList[DropdownId]["workers"]>;
|
|
188
|
+
get(id: ODValidId): ODDropdown<string, {}, string> | null;
|
|
189
|
+
remove<DropdownId extends keyof IdList>(id: DropdownId): ODDropdown<IdList[DropdownId]["source"], IdList[DropdownId]["params"], IdList[DropdownId]["workers"]>;
|
|
190
|
+
remove(id: ODValidId): ODDropdown<string, {}, string> | null;
|
|
191
|
+
exists(id: keyof IdList): boolean;
|
|
192
|
+
exists(id: ODValidId): boolean;
|
|
193
|
+
getSafe<DropdownId extends keyof IdList>(id: DropdownId): ODDropdown<IdList[DropdownId]["source"], IdList[DropdownId]["params"], IdList[DropdownId]["workers"]>;
|
|
194
|
+
getSafe(id: ODValidId): ODDropdown<string, {}, string>;
|
|
163
195
|
}
|
|
164
196
|
/**## ODDropdownData `interface`
|
|
165
197
|
* This interface contains the data to build a dropdown.
|
|
@@ -231,7 +263,7 @@ export declare class ODDropdownInstance {
|
|
|
231
263
|
*
|
|
232
264
|
* This is possible by using "workers" or multiple functions that will be executed in priority order!
|
|
233
265
|
*/
|
|
234
|
-
export declare class ODDropdown<Source extends string, Params> extends ODBuilderImplementation<ODDropdownInstance, Source, Params, ODComponentBuildResult> {
|
|
266
|
+
export declare class ODDropdown<Source extends string, Params, WorkerIds extends string = string> extends ODBuilderImplementation<ODDropdownInstance, Source, Params, ODComponentBuildResult, WorkerIds> {
|
|
235
267
|
/**Build this dropdown & compile it for discord.js */
|
|
236
268
|
build(source: Source, params: Params): Promise<ODComponentBuildResult>;
|
|
237
269
|
}
|
|
@@ -252,6 +284,14 @@ export declare class ODQuickDropdown {
|
|
|
252
284
|
/**Build this dropdown & compile it for discord.js */
|
|
253
285
|
build(): Promise<ODComponentBuildResult>;
|
|
254
286
|
}
|
|
287
|
+
/**## ODFileManagerIdConstraint `type`
|
|
288
|
+
* The constraint/layout for id mappings/interfaces of the `ODFileManager` class.
|
|
289
|
+
*/
|
|
290
|
+
export type ODFileManagerIdConstraint = Record<string, {
|
|
291
|
+
source: string;
|
|
292
|
+
params: object;
|
|
293
|
+
workers: string;
|
|
294
|
+
}>;
|
|
255
295
|
/**## ODFileManager `class`
|
|
256
296
|
* This is an Open Discord file manager.
|
|
257
297
|
*
|
|
@@ -259,8 +299,16 @@ export declare class ODQuickDropdown {
|
|
|
259
299
|
*
|
|
260
300
|
* It's recommended to use this system in combination with all the other Open Discord builders!
|
|
261
301
|
*/
|
|
262
|
-
export declare class ODFileManager extends ODManagerWithSafety<ODFile<string,
|
|
302
|
+
export declare class ODFileManager<IdList extends ODFileManagerIdConstraint = ODFileManagerIdConstraint> extends ODManagerWithSafety<ODFile<string, {}, string>> {
|
|
263
303
|
constructor(debug: ODDebugger);
|
|
304
|
+
get<FileId extends keyof IdList>(id: FileId): ODFile<IdList[FileId]["source"], IdList[FileId]["params"], IdList[FileId]["workers"]>;
|
|
305
|
+
get(id: ODValidId): ODFile<string, {}, string> | null;
|
|
306
|
+
remove<FileId extends keyof IdList>(id: FileId): ODFile<IdList[FileId]["source"], IdList[FileId]["params"], IdList[FileId]["workers"]>;
|
|
307
|
+
remove(id: ODValidId): ODFile<string, {}, string> | null;
|
|
308
|
+
exists(id: keyof IdList): boolean;
|
|
309
|
+
exists(id: ODValidId): boolean;
|
|
310
|
+
getSafe<FileId extends keyof IdList>(id: FileId): ODFile<IdList[FileId]["source"], IdList[FileId]["params"], IdList[FileId]["workers"]>;
|
|
311
|
+
getSafe(id: ODValidId): ODFile<string, {}, string>;
|
|
264
312
|
}
|
|
265
313
|
/**## ODFileData `interface`
|
|
266
314
|
* This interface contains the data to build a file.
|
|
@@ -311,7 +359,7 @@ export declare class ODFileInstance {
|
|
|
311
359
|
*
|
|
312
360
|
* This is possible by using "workers" or multiple functions that will be executed in priority order!
|
|
313
361
|
*/
|
|
314
|
-
export declare class ODFile<Source extends string, Params> extends ODBuilderImplementation<ODFileInstance, Source, Params, ODFileBuildResult> {
|
|
362
|
+
export declare class ODFile<Source extends string, Params, WorkerIds extends string = string> extends ODBuilderImplementation<ODFileInstance, Source, Params, ODFileBuildResult, WorkerIds> {
|
|
315
363
|
/**Build this attachment & compile it for discord.js */
|
|
316
364
|
build(source: Source, params: Params): Promise<ODFileBuildResult>;
|
|
317
365
|
}
|
|
@@ -332,6 +380,14 @@ export declare class ODQuickFile {
|
|
|
332
380
|
/**Build this attachment & compile it for discord.js */
|
|
333
381
|
build(): Promise<ODFileBuildResult>;
|
|
334
382
|
}
|
|
383
|
+
/**## ODEmbedManagerIdConstraint `type`
|
|
384
|
+
* The constraint/layout for id mappings/interfaces of the `ODEmbedManager` class.
|
|
385
|
+
*/
|
|
386
|
+
export type ODEmbedManagerIdConstraint = Record<string, {
|
|
387
|
+
source: string;
|
|
388
|
+
params: object;
|
|
389
|
+
workers: string;
|
|
390
|
+
}>;
|
|
335
391
|
/**## ODEmbedManager `class`
|
|
336
392
|
* This is an Open Discord embed manager.
|
|
337
393
|
*
|
|
@@ -339,8 +395,16 @@ export declare class ODQuickFile {
|
|
|
339
395
|
*
|
|
340
396
|
* It's recommended to use this system in combination with all the other Open Discord builders!
|
|
341
397
|
*/
|
|
342
|
-
export declare class ODEmbedManager extends ODManagerWithSafety<ODEmbed<string,
|
|
398
|
+
export declare class ODEmbedManager<IdList extends ODEmbedManagerIdConstraint = ODEmbedManagerIdConstraint> extends ODManagerWithSafety<ODEmbed<string, {}, string>> {
|
|
343
399
|
constructor(debug: ODDebugger);
|
|
400
|
+
get<EmbedId extends keyof IdList>(id: EmbedId): ODEmbed<IdList[EmbedId]["source"], IdList[EmbedId]["params"], IdList[EmbedId]["workers"]>;
|
|
401
|
+
get(id: ODValidId): ODEmbed<string, {}, string> | null;
|
|
402
|
+
remove<EmbedId extends keyof IdList>(id: EmbedId): ODEmbed<IdList[EmbedId]["source"], IdList[EmbedId]["params"], IdList[EmbedId]["workers"]>;
|
|
403
|
+
remove(id: ODValidId): ODEmbed<string, {}, string> | null;
|
|
404
|
+
exists(id: keyof IdList): boolean;
|
|
405
|
+
exists(id: ODValidId): boolean;
|
|
406
|
+
getSafe<EmbedId extends keyof IdList>(id: EmbedId): ODEmbed<IdList[EmbedId]["source"], IdList[EmbedId]["params"], IdList[EmbedId]["workers"]>;
|
|
407
|
+
getSafe(id: ODValidId): ODEmbed<string, {}, string>;
|
|
344
408
|
}
|
|
345
409
|
/**## ODEmbedData `interface`
|
|
346
410
|
* This interface contains the data to build an embed.
|
|
@@ -423,7 +487,7 @@ export declare class ODEmbedInstance {
|
|
|
423
487
|
*
|
|
424
488
|
* This is possible by using "workers" or multiple functions that will be executed in priority order!
|
|
425
489
|
*/
|
|
426
|
-
export declare class ODEmbed<Source extends string, Params> extends ODBuilderImplementation<ODEmbedInstance, Source, Params, ODEmbedBuildResult> {
|
|
490
|
+
export declare class ODEmbed<Source extends string, Params, WorkerIds extends string = string> extends ODBuilderImplementation<ODEmbedInstance, Source, Params, ODEmbedBuildResult, WorkerIds> {
|
|
427
491
|
/**Build this embed & compile it for discord.js */
|
|
428
492
|
build(source: Source, params: Params): Promise<ODEmbedBuildResult>;
|
|
429
493
|
}
|
|
@@ -444,6 +508,14 @@ export declare class ODQuickEmbed {
|
|
|
444
508
|
/**Build this embed & compile it for discord.js */
|
|
445
509
|
build(): Promise<ODEmbedBuildResult>;
|
|
446
510
|
}
|
|
511
|
+
/**## ODMessageManagerIdConstraint `type`
|
|
512
|
+
* The constraint/layout for id mappings/interfaces of the `ODMessageManager` class.
|
|
513
|
+
*/
|
|
514
|
+
export type ODMessageManagerIdConstraint = Record<string, {
|
|
515
|
+
source: string;
|
|
516
|
+
params: object;
|
|
517
|
+
workers: string;
|
|
518
|
+
}>;
|
|
447
519
|
/**## ODMessageManager `class`
|
|
448
520
|
* This is an Open Discord message manager.
|
|
449
521
|
*
|
|
@@ -451,8 +523,16 @@ export declare class ODQuickEmbed {
|
|
|
451
523
|
*
|
|
452
524
|
* It's recommended to use this system in combination with all the other Open Discord builders!
|
|
453
525
|
*/
|
|
454
|
-
export declare class ODMessageManager extends ODManagerWithSafety<ODMessage<string,
|
|
526
|
+
export declare class ODMessageManager<IdList extends ODMessageManagerIdConstraint = ODMessageManagerIdConstraint> extends ODManagerWithSafety<ODMessage<string, {}, string>> {
|
|
455
527
|
constructor(debug: ODDebugger);
|
|
528
|
+
get<MessageId extends keyof IdList>(id: MessageId): ODMessage<IdList[MessageId]["source"], IdList[MessageId]["params"], IdList[MessageId]["workers"]>;
|
|
529
|
+
get(id: ODValidId): ODMessage<string, {}, string> | null;
|
|
530
|
+
remove<MessageId extends keyof IdList>(id: MessageId): ODMessage<IdList[MessageId]["source"], IdList[MessageId]["params"], IdList[MessageId]["workers"]>;
|
|
531
|
+
remove(id: ODValidId): ODMessage<string, {}, string> | null;
|
|
532
|
+
exists(id: keyof IdList): boolean;
|
|
533
|
+
exists(id: ODValidId): boolean;
|
|
534
|
+
getSafe<MessageId extends keyof IdList>(id: MessageId): ODMessage<IdList[MessageId]["source"], IdList[MessageId]["params"], IdList[MessageId]["workers"]>;
|
|
535
|
+
getSafe(id: ODValidId): ODMessage<string, {}, string>;
|
|
456
536
|
}
|
|
457
537
|
/**## ODMessageData `interface`
|
|
458
538
|
* This interface contains the data to build a message.
|
|
@@ -540,7 +620,7 @@ export declare class ODMessageInstance {
|
|
|
540
620
|
*
|
|
541
621
|
* This is possible by using "workers" or multiple functions that will be executed in priority order!
|
|
542
622
|
*/
|
|
543
|
-
export declare class ODMessage<Source extends string, Params> extends ODBuilderImplementation<ODMessageInstance, Source, Params, ODMessageBuildResult> {
|
|
623
|
+
export declare class ODMessage<Source extends string, Params, WorkerIds extends string = string> extends ODBuilderImplementation<ODMessageInstance, Source, Params, ODMessageBuildResult, WorkerIds> {
|
|
544
624
|
/**Build this message & compile it for discord.js */
|
|
545
625
|
build(source: Source, params: Params): Promise<ODMessageBuildResult>;
|
|
546
626
|
}
|
|
@@ -561,6 +641,14 @@ export declare class ODQuickMessage {
|
|
|
561
641
|
/**Build this message & compile it for discord.js */
|
|
562
642
|
build(): Promise<ODMessageBuildResult>;
|
|
563
643
|
}
|
|
644
|
+
/**## ODModalManagerIdConstraint `type`
|
|
645
|
+
* The constraint/layout for id mappings/interfaces of the `ODModalManager` class.
|
|
646
|
+
*/
|
|
647
|
+
export type ODModalManagerIdConstraint = Record<string, {
|
|
648
|
+
source: string;
|
|
649
|
+
params: object;
|
|
650
|
+
workers: string;
|
|
651
|
+
}>;
|
|
564
652
|
/**## ODModalManager `class`
|
|
565
653
|
* This is an Open Discord modal manager.
|
|
566
654
|
*
|
|
@@ -568,8 +656,16 @@ export declare class ODQuickMessage {
|
|
|
568
656
|
*
|
|
569
657
|
* It's recommended to use this system in combination with all the other Open Discord builders!
|
|
570
658
|
*/
|
|
571
|
-
export declare class ODModalManager extends ODManagerWithSafety<ODModal<string,
|
|
659
|
+
export declare class ODModalManager<IdList extends ODModalManagerIdConstraint = ODModalManagerIdConstraint> extends ODManagerWithSafety<ODModal<string, {}, string>> {
|
|
572
660
|
constructor(debug: ODDebugger);
|
|
661
|
+
get<ModalId extends keyof IdList>(id: ModalId): ODModal<IdList[ModalId]["source"], IdList[ModalId]["params"], IdList[ModalId]["workers"]>;
|
|
662
|
+
get(id: ODValidId): ODModal<string, {}, string> | null;
|
|
663
|
+
remove<ModalId extends keyof IdList>(id: ModalId): ODModal<IdList[ModalId]["source"], IdList[ModalId]["params"], IdList[ModalId]["workers"]>;
|
|
664
|
+
remove(id: ODValidId): ODModal<string, {}, string> | null;
|
|
665
|
+
exists(id: keyof IdList): boolean;
|
|
666
|
+
exists(id: ODValidId): boolean;
|
|
667
|
+
getSafe<ModalId extends keyof IdList>(id: ModalId): ODModal<IdList[ModalId]["source"], IdList[ModalId]["params"], IdList[ModalId]["workers"]>;
|
|
668
|
+
getSafe(id: ODValidId): ODModal<string, {}, string>;
|
|
573
669
|
}
|
|
574
670
|
/**## ODModalDataQuestion `interface`
|
|
575
671
|
* This interface contains the data to build a modal question.
|
|
@@ -641,7 +737,7 @@ export declare class ODModalInstance {
|
|
|
641
737
|
*
|
|
642
738
|
* This is possible by using "workers" or multiple functions that will be executed in priority order!
|
|
643
739
|
*/
|
|
644
|
-
export declare class ODModal<Source extends string, Params> extends ODBuilderImplementation<ODModalInstance, Source, Params, ODModalBuildResult> {
|
|
740
|
+
export declare class ODModal<Source extends string, Params, WorkerIds extends string = string> extends ODBuilderImplementation<ODModalInstance, Source, Params, ODModalBuildResult, WorkerIds> {
|
|
645
741
|
/**Build this modal & compile it for discord.js */
|
|
646
742
|
build(source: Source, params: Params): Promise<ODModalBuildResult>;
|
|
647
743
|
}
|
|
@@ -145,6 +145,18 @@ class ODButtonManager extends base_1.ODManagerWithSafety {
|
|
|
145
145
|
component: "\n"
|
|
146
146
|
};
|
|
147
147
|
}
|
|
148
|
+
get(id) {
|
|
149
|
+
return super.get(id);
|
|
150
|
+
}
|
|
151
|
+
remove(id) {
|
|
152
|
+
return super.remove(id);
|
|
153
|
+
}
|
|
154
|
+
exists(id) {
|
|
155
|
+
return super.exists(id);
|
|
156
|
+
}
|
|
157
|
+
getSafe(id) {
|
|
158
|
+
return super.getSafe(id);
|
|
159
|
+
}
|
|
148
160
|
}
|
|
149
161
|
exports.ODButtonManager = ODButtonManager;
|
|
150
162
|
/**## ODButtonInstance `class`
|
|
@@ -339,6 +351,18 @@ class ODDropdownManager extends base_1.ODManagerWithSafety {
|
|
|
339
351
|
component: "\n"
|
|
340
352
|
};
|
|
341
353
|
}
|
|
354
|
+
get(id) {
|
|
355
|
+
return super.get(id);
|
|
356
|
+
}
|
|
357
|
+
remove(id) {
|
|
358
|
+
return super.remove(id);
|
|
359
|
+
}
|
|
360
|
+
exists(id) {
|
|
361
|
+
return super.exists(id);
|
|
362
|
+
}
|
|
363
|
+
getSafe(id) {
|
|
364
|
+
return super.getSafe(id);
|
|
365
|
+
}
|
|
342
366
|
}
|
|
343
367
|
exports.ODDropdownManager = ODDropdownManager;
|
|
344
368
|
/**## ODDropdownInstance `class`
|
|
@@ -692,6 +716,18 @@ class ODFileManager extends base_1.ODManagerWithSafety {
|
|
|
692
716
|
});
|
|
693
717
|
}, debug, "file");
|
|
694
718
|
}
|
|
719
|
+
get(id) {
|
|
720
|
+
return super.get(id);
|
|
721
|
+
}
|
|
722
|
+
remove(id) {
|
|
723
|
+
return super.remove(id);
|
|
724
|
+
}
|
|
725
|
+
exists(id) {
|
|
726
|
+
return super.exists(id);
|
|
727
|
+
}
|
|
728
|
+
getSafe(id) {
|
|
729
|
+
return super.getSafe(id);
|
|
730
|
+
}
|
|
695
731
|
}
|
|
696
732
|
exports.ODFileManager = ODFileManager;
|
|
697
733
|
/**## ODFileInstance `class`
|
|
@@ -827,6 +863,18 @@ class ODEmbedManager extends base_1.ODManagerWithSafety {
|
|
|
827
863
|
});
|
|
828
864
|
}, debug, "embed");
|
|
829
865
|
}
|
|
866
|
+
get(id) {
|
|
867
|
+
return super.get(id);
|
|
868
|
+
}
|
|
869
|
+
remove(id) {
|
|
870
|
+
return super.remove(id);
|
|
871
|
+
}
|
|
872
|
+
exists(id) {
|
|
873
|
+
return super.exists(id);
|
|
874
|
+
}
|
|
875
|
+
getSafe(id) {
|
|
876
|
+
return super.getSafe(id);
|
|
877
|
+
}
|
|
830
878
|
}
|
|
831
879
|
exports.ODEmbedManager = ODEmbedManager;
|
|
832
880
|
/**## ODEmbedInstance `class`
|
|
@@ -1064,6 +1112,18 @@ class ODMessageManager extends base_1.ODManagerWithSafety {
|
|
|
1064
1112
|
});
|
|
1065
1113
|
}, debug, "message");
|
|
1066
1114
|
}
|
|
1115
|
+
get(id) {
|
|
1116
|
+
return super.get(id);
|
|
1117
|
+
}
|
|
1118
|
+
remove(id) {
|
|
1119
|
+
return super.remove(id);
|
|
1120
|
+
}
|
|
1121
|
+
exists(id) {
|
|
1122
|
+
return super.exists(id);
|
|
1123
|
+
}
|
|
1124
|
+
getSafe(id) {
|
|
1125
|
+
return super.getSafe(id);
|
|
1126
|
+
}
|
|
1067
1127
|
}
|
|
1068
1128
|
exports.ODMessageManager = ODMessageManager;
|
|
1069
1129
|
/**## ODMessageInstance `class`
|
|
@@ -1341,6 +1401,18 @@ class ODModalManager extends base_1.ODManagerWithSafety {
|
|
|
1341
1401
|
});
|
|
1342
1402
|
}, debug, "modal");
|
|
1343
1403
|
}
|
|
1404
|
+
get(id) {
|
|
1405
|
+
return super.get(id);
|
|
1406
|
+
}
|
|
1407
|
+
remove(id) {
|
|
1408
|
+
return super.remove(id);
|
|
1409
|
+
}
|
|
1410
|
+
exists(id) {
|
|
1411
|
+
return super.exists(id);
|
|
1412
|
+
}
|
|
1413
|
+
getSafe(id) {
|
|
1414
|
+
return super.getSafe(id);
|
|
1415
|
+
}
|
|
1344
1416
|
}
|
|
1345
1417
|
exports.ODModalManager = ODModalManager;
|
|
1346
1418
|
/**## ODModalInstance `class`
|