@open-discord-bots/framework 0.1.2 → 0.2.1
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/README.md +21 -19
- 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 +20 -7
- 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 +35 -7
- 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
|
@@ -33,6 +33,15 @@ class ODPluginManager extends base_1.ODManager {
|
|
|
33
33
|
const plugin = this.get(newId);
|
|
34
34
|
return (plugin !== null && plugin.executed);
|
|
35
35
|
}
|
|
36
|
+
get(id) {
|
|
37
|
+
return super.get(id);
|
|
38
|
+
}
|
|
39
|
+
remove(id) {
|
|
40
|
+
return super.remove(id);
|
|
41
|
+
}
|
|
42
|
+
exists(id) {
|
|
43
|
+
return super.exists(id);
|
|
44
|
+
}
|
|
36
45
|
}
|
|
37
46
|
exports.ODPluginManager = ODPluginManager;
|
|
38
47
|
/**## ODPlugin `class`
|
|
@@ -168,5 +177,14 @@ class ODPluginClassManager extends base_1.ODManager {
|
|
|
168
177
|
constructor(debug) {
|
|
169
178
|
super(debug, "plugin class");
|
|
170
179
|
}
|
|
180
|
+
get(id) {
|
|
181
|
+
return super.get(id);
|
|
182
|
+
}
|
|
183
|
+
remove(id) {
|
|
184
|
+
return super.remove(id);
|
|
185
|
+
}
|
|
186
|
+
exists(id) {
|
|
187
|
+
return super.exists(id);
|
|
188
|
+
}
|
|
171
189
|
}
|
|
172
190
|
exports.ODPluginClassManager = ODPluginClassManager;
|
|
@@ -2,6 +2,10 @@ import { ODManager, ODManagerData, ODValidId } from "./base";
|
|
|
2
2
|
import { ODMessageBuildResult, ODMessageBuildSentResult } from "./builder";
|
|
3
3
|
import { ODDebugger } from "./console";
|
|
4
4
|
import * as discord from "discord.js";
|
|
5
|
+
/**## ODPostManagerIdConstraint `type`
|
|
6
|
+
* The constraint/layout for id mappings/interfaces of the `ODPostManager` class.
|
|
7
|
+
*/
|
|
8
|
+
export type ODPostManagerIdConstraint = Record<string, ODPost<discord.GuildBasedChannel>>;
|
|
5
9
|
/**## ODPostManager `class`
|
|
6
10
|
* This is an Open Discord post manager.
|
|
7
11
|
*
|
|
@@ -9,12 +13,18 @@ import * as discord from "discord.js";
|
|
|
9
13
|
*
|
|
10
14
|
* You can use this to get the logs channel of the bot (or some other static channel/category).
|
|
11
15
|
*/
|
|
12
|
-
export declare class ODPostManager extends ODManager<ODPost<discord.GuildBasedChannel>> {
|
|
16
|
+
export declare class ODPostManager<IdList extends ODPostManagerIdConstraint = ODPostManagerIdConstraint> extends ODManager<ODPost<discord.GuildBasedChannel>> {
|
|
13
17
|
#private;
|
|
14
18
|
constructor(debug: ODDebugger);
|
|
15
19
|
add(data: ODPost<discord.GuildBasedChannel>, overwrite?: boolean): boolean;
|
|
16
20
|
/**Initialize the post manager & all posts. */
|
|
17
21
|
init(guild: discord.Guild): Promise<void>;
|
|
22
|
+
get<PostId extends keyof IdList>(id: PostId): IdList[PostId];
|
|
23
|
+
get(id: ODValidId): ODPost<discord.GuildBasedChannel> | null;
|
|
24
|
+
remove<PostId extends keyof IdList>(id: PostId): IdList[PostId];
|
|
25
|
+
remove(id: ODValidId): ODPost<discord.GuildBasedChannel> | null;
|
|
26
|
+
exists(id: keyof IdList): boolean;
|
|
27
|
+
exists(id: ODValidId): boolean;
|
|
18
28
|
}
|
|
19
29
|
/**## ODPost `class`
|
|
20
30
|
* This is an Open Discord post class.
|
package/dist/api/modules/post.js
CHANGED
|
@@ -31,6 +31,15 @@ class ODPostManager extends base_1.ODManager {
|
|
|
31
31
|
await post.init();
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
|
+
get(id) {
|
|
35
|
+
return super.get(id);
|
|
36
|
+
}
|
|
37
|
+
remove(id) {
|
|
38
|
+
return super.remove(id);
|
|
39
|
+
}
|
|
40
|
+
exists(id) {
|
|
41
|
+
return super.exists(id);
|
|
42
|
+
}
|
|
34
43
|
}
|
|
35
44
|
exports.ODPostManager = ODPostManager;
|
|
36
45
|
/**## ODPost `class`
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { ODManager, ODManagerData, ODValidId } from "./base";
|
|
2
2
|
import { ODDebugger } from "./console";
|
|
3
|
+
/**## ODProgressBarRendererManagerIdConstraint `type`
|
|
4
|
+
* The constraint/layout for id mappings/interfaces of the `ODProgressBarRendererManager` class.
|
|
5
|
+
*/
|
|
6
|
+
export type ODProgressBarRendererManagerIdConstraint = Record<string, ODProgressBarRenderer<{}>>;
|
|
3
7
|
/**## ODProgressBarRendererManager `class`
|
|
4
8
|
* This is an Open Discord progress bar renderer manager.
|
|
5
9
|
*
|
|
@@ -7,9 +11,19 @@ import { ODDebugger } from "./console";
|
|
|
7
11
|
*
|
|
8
12
|
* A renderer is a function which will try to visualize the progress bar in the console.
|
|
9
13
|
*/
|
|
10
|
-
export declare class ODProgressBarRendererManager extends ODManager<ODProgressBarRenderer<{}>> {
|
|
14
|
+
export declare class ODProgressBarRendererManager<IdList extends ODProgressBarRendererManagerIdConstraint = ODProgressBarRendererManagerIdConstraint> extends ODManager<ODProgressBarRenderer<{}>> {
|
|
11
15
|
constructor(debug: ODDebugger);
|
|
16
|
+
get<RendererId extends keyof IdList>(id: RendererId): IdList[RendererId];
|
|
17
|
+
get(id: ODValidId): ODProgressBarRenderer<{}> | null;
|
|
18
|
+
remove<RendererId extends keyof IdList>(id: RendererId): IdList[RendererId];
|
|
19
|
+
remove(id: ODValidId): ODProgressBarRenderer<{}> | null;
|
|
20
|
+
exists(id: keyof IdList): boolean;
|
|
21
|
+
exists(id: ODValidId): boolean;
|
|
12
22
|
}
|
|
23
|
+
/**## ODProgressBarManagerIdConstraint `type`
|
|
24
|
+
* The constraint/layout for id mappings/interfaces of the `ODProgressBarManager` class.
|
|
25
|
+
*/
|
|
26
|
+
export type ODProgressBarManagerIdConstraint = Record<string, ODProgressBar>;
|
|
13
27
|
/**## ODProgressBarManager `class`
|
|
14
28
|
* This is an Open Discord progress bar manager.
|
|
15
29
|
*
|
|
@@ -17,9 +31,16 @@ export declare class ODProgressBarRendererManager extends ODManager<ODProgressBa
|
|
|
17
31
|
*
|
|
18
32
|
* There are many types of progress bars available, but you can also create your own!
|
|
19
33
|
*/
|
|
20
|
-
export declare class ODProgressBarManager extends ODManager<ODProgressBar> {
|
|
21
|
-
|
|
34
|
+
export declare class ODProgressBarManager<IdList extends ODProgressBarManagerIdConstraint = ODProgressBarManagerIdConstraint, RendererIdList extends ODProgressBarRendererManagerIdConstraint = ODProgressBarRendererManagerIdConstraint> extends ODManager<ODProgressBar> {
|
|
35
|
+
/**A collection of render types for progress bars. */
|
|
36
|
+
renderers: ODProgressBarRendererManager<ODProgressBarRendererManagerIdConstraint>;
|
|
22
37
|
constructor(debug: ODDebugger);
|
|
38
|
+
get<ProgressBarId extends keyof IdList>(id: ProgressBarId): IdList[ProgressBarId];
|
|
39
|
+
get(id: ODValidId): ODProgressBar | null;
|
|
40
|
+
remove<ProgressBarId extends keyof IdList>(id: ProgressBarId): IdList[ProgressBarId];
|
|
41
|
+
remove(id: ODValidId): ODProgressBar | null;
|
|
42
|
+
exists(id: keyof IdList): boolean;
|
|
43
|
+
exists(id: ODValidId): boolean;
|
|
23
44
|
}
|
|
24
45
|
/**## ODProgressBarRenderFunc `type`
|
|
25
46
|
* This is the render function for an Open Discord console progress bar.
|
|
@@ -20,6 +20,15 @@ class ODProgressBarRendererManager extends base_1.ODManager {
|
|
|
20
20
|
constructor(debug) {
|
|
21
21
|
super(debug, "progress bar renderer");
|
|
22
22
|
}
|
|
23
|
+
get(id) {
|
|
24
|
+
return super.get(id);
|
|
25
|
+
}
|
|
26
|
+
remove(id) {
|
|
27
|
+
return super.remove(id);
|
|
28
|
+
}
|
|
29
|
+
exists(id) {
|
|
30
|
+
return super.exists(id);
|
|
31
|
+
}
|
|
23
32
|
}
|
|
24
33
|
exports.ODProgressBarRendererManager = ODProgressBarRendererManager;
|
|
25
34
|
/**## ODProgressBarManager `class`
|
|
@@ -30,11 +39,21 @@ exports.ODProgressBarRendererManager = ODProgressBarRendererManager;
|
|
|
30
39
|
* There are many types of progress bars available, but you can also create your own!
|
|
31
40
|
*/
|
|
32
41
|
class ODProgressBarManager extends base_1.ODManager {
|
|
42
|
+
/**A collection of render types for progress bars. */
|
|
33
43
|
renderers;
|
|
34
44
|
constructor(debug) {
|
|
35
45
|
super(debug, "progress bar");
|
|
36
46
|
this.renderers = new ODProgressBarRendererManager(debug);
|
|
37
47
|
}
|
|
48
|
+
get(id) {
|
|
49
|
+
return super.get(id);
|
|
50
|
+
}
|
|
51
|
+
remove(id) {
|
|
52
|
+
return super.remove(id);
|
|
53
|
+
}
|
|
54
|
+
exists(id) {
|
|
55
|
+
return super.exists(id);
|
|
56
|
+
}
|
|
38
57
|
}
|
|
39
58
|
exports.ODProgressBarManager = ODProgressBarManager;
|
|
40
59
|
/**## ODProgressBarRenderer `class`
|
|
@@ -11,9 +11,9 @@ import { ODDropdownData, ODMessageBuildResult, ODMessageBuildSentResult, ODModal
|
|
|
11
11
|
*
|
|
12
12
|
* This class can't be used stand-alone & needs to be extended from!
|
|
13
13
|
*/
|
|
14
|
-
export declare class ODResponderImplementation<Instance, Source extends string, Params> extends ODManagerData {
|
|
14
|
+
export declare class ODResponderImplementation<Instance, Source extends string, Params, 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
|
/**The `commandName` or `customId` needs to match this string or regex for this responder to be executed. */
|
|
18
18
|
match: string | RegExp;
|
|
19
19
|
constructor(id: ODValidId, match: string | RegExp, callback?: ODWorkerCallback<Instance, Source, Params>, priority?: number, callbackId?: ODValidId);
|
|
@@ -38,21 +38,29 @@ export type ODResponderTimeoutErrorCallback<Instance, Source extends "slash" | "
|
|
|
38
38
|
* - know where the request came from & parse options/subcommands & without errors!
|
|
39
39
|
* - And so much more!
|
|
40
40
|
*/
|
|
41
|
-
export declare class ODResponderManager {
|
|
41
|
+
export declare class ODResponderManager<CommandIdList extends ODCommandResponderManagerIdConstraint = ODCommandResponderManagerIdConstraint, ButtonIdList extends ODButtonResponderManagerIdConstraint = ODButtonResponderManagerIdConstraint, DropdownIdList extends ODDropdownResponderManagerIdConstraint = ODDropdownResponderManagerIdConstraint, ModalIdList extends ODModalResponderManagerIdConstraint = ODModalResponderManagerIdConstraint, ContextMenuIdList extends ODContextMenuResponderManagerIdConstraint = ODContextMenuResponderManagerIdConstraint, AutocompleteIdList extends ODAutocompleteResponderManagerIdConstraint = ODAutocompleteResponderManagerIdConstraint> {
|
|
42
42
|
/**A manager for all (text & slash) command responders. */
|
|
43
|
-
commands: ODCommandResponderManager
|
|
43
|
+
commands: ODCommandResponderManager<CommandIdList>;
|
|
44
44
|
/**A manager for all button responders. */
|
|
45
|
-
buttons: ODButtonResponderManager
|
|
45
|
+
buttons: ODButtonResponderManager<ButtonIdList>;
|
|
46
46
|
/**A manager for all dropdown/select menu responders. */
|
|
47
|
-
dropdowns: ODDropdownResponderManager
|
|
47
|
+
dropdowns: ODDropdownResponderManager<DropdownIdList>;
|
|
48
48
|
/**A manager for all modal responders. */
|
|
49
|
-
modals: ODModalResponderManager
|
|
49
|
+
modals: ODModalResponderManager<ModalIdList>;
|
|
50
50
|
/**A manager for all context menu responders. */
|
|
51
|
-
contextMenus: ODContextMenuResponderManager
|
|
51
|
+
contextMenus: ODContextMenuResponderManager<ContextMenuIdList>;
|
|
52
52
|
/**A manager for all autocomplete responders. */
|
|
53
|
-
autocomplete: ODAutocompleteResponderManager
|
|
53
|
+
autocomplete: ODAutocompleteResponderManager<AutocompleteIdList>;
|
|
54
54
|
constructor(debug: ODDebugger, client: ODClientManager);
|
|
55
55
|
}
|
|
56
|
+
/**## ODCommandResponderManagerIdConstraint `type`
|
|
57
|
+
* The constraint/layout for id mappings/interfaces of the `ODCommandResponderManager` class.
|
|
58
|
+
*/
|
|
59
|
+
export type ODCommandResponderManagerIdConstraint = Record<string, {
|
|
60
|
+
source: "slash" | "text";
|
|
61
|
+
params: object;
|
|
62
|
+
workers: string;
|
|
63
|
+
}>;
|
|
56
64
|
/**## ODCommandResponderManager `class`
|
|
57
65
|
* This is an Open Discord command responder manager.
|
|
58
66
|
*
|
|
@@ -67,12 +75,18 @@ export declare class ODResponderManager {
|
|
|
67
75
|
* - know where the request came from & parse options/subcommands & without errors!
|
|
68
76
|
* - And so much more!
|
|
69
77
|
*/
|
|
70
|
-
export declare class ODCommandResponderManager extends ODManager<ODCommandResponder<"slash" | "text", any>> {
|
|
78
|
+
export declare class ODCommandResponderManager<IdList extends ODCommandResponderManagerIdConstraint = ODCommandResponderManagerIdConstraint> extends ODManager<ODCommandResponder<"slash" | "text", any>> {
|
|
71
79
|
#private;
|
|
72
80
|
constructor(debug: ODDebugger, debugname: string, client: ODClientManager);
|
|
73
81
|
/**Set the message to send when the response times out! */
|
|
74
82
|
setTimeoutErrorCallback(callback: ODResponderTimeoutErrorCallback<ODCommandResponderInstance, "slash" | "text"> | null, ms: number | null): void;
|
|
75
83
|
add(data: ODCommandResponder<"slash" | "text", any>, overwrite?: boolean): boolean;
|
|
84
|
+
get<CommandResponderId extends keyof IdList>(id: CommandResponderId): ODCommandResponder<IdList[CommandResponderId]["source"], IdList[CommandResponderId]["params"], IdList[CommandResponderId]["workers"]>;
|
|
85
|
+
get(id: ODValidId): ODCommandResponder<"slash" | "text", any> | null;
|
|
86
|
+
remove<CommandResponderId extends keyof IdList>(id: CommandResponderId): ODCommandResponder<IdList[CommandResponderId]["source"], IdList[CommandResponderId]["params"], IdList[CommandResponderId]["workers"]>;
|
|
87
|
+
remove(id: ODValidId): ODCommandResponder<"slash" | "text", any> | null;
|
|
88
|
+
exists(id: keyof IdList): boolean;
|
|
89
|
+
exists(id: ODValidId): boolean;
|
|
76
90
|
}
|
|
77
91
|
/**## ODCommandResponderInstanceOptions `class`
|
|
78
92
|
* This is an Open Discord command responder instance options manager.
|
|
@@ -148,13 +162,21 @@ export declare class ODCommandResponderInstance {
|
|
|
148
162
|
*
|
|
149
163
|
* This class manages all workers which are executed when the related command is triggered.
|
|
150
164
|
*/
|
|
151
|
-
export declare class ODCommandResponder<Source extends "slash" | "text", Params> extends ODResponderImplementation<ODCommandResponderInstance, Source, Params> {
|
|
165
|
+
export declare class ODCommandResponder<Source extends "slash" | "text", Params, WorkerIds extends string = string> extends ODResponderImplementation<ODCommandResponderInstance, Source, Params, WorkerIds> {
|
|
152
166
|
/**The prefix of the text command needs to match this */
|
|
153
167
|
prefix: string;
|
|
154
168
|
constructor(id: ODValidId, prefix: string, match: string | RegExp, callback?: ODWorkerCallback<ODCommandResponderInstance, Source, Params>, priority?: number, callbackId?: ODValidId);
|
|
155
169
|
/**Respond to this command */
|
|
156
170
|
respond(instance: ODCommandResponderInstance, source: Source, params: Params): Promise<void>;
|
|
157
171
|
}
|
|
172
|
+
/**## ODButtonResponderManagerIdConstraint `type`
|
|
173
|
+
* The constraint/layout for id mappings/interfaces of the `ODButtonResponderManager` class.
|
|
174
|
+
*/
|
|
175
|
+
export type ODButtonResponderManagerIdConstraint = Record<string, {
|
|
176
|
+
source: "button";
|
|
177
|
+
params: object;
|
|
178
|
+
workers: string;
|
|
179
|
+
}>;
|
|
158
180
|
/**## ODButtonResponderManager `class`
|
|
159
181
|
* This is an Open Discord button responder manager.
|
|
160
182
|
*
|
|
@@ -168,12 +190,18 @@ export declare class ODCommandResponder<Source extends "slash" | "text", Params>
|
|
|
168
190
|
* - know where the request came from!
|
|
169
191
|
* - And so much more!
|
|
170
192
|
*/
|
|
171
|
-
export declare class ODButtonResponderManager extends ODManager<ODButtonResponder<"button", any>> {
|
|
193
|
+
export declare class ODButtonResponderManager<IdList extends ODButtonResponderManagerIdConstraint = ODButtonResponderManagerIdConstraint> extends ODManager<ODButtonResponder<"button", any>> {
|
|
172
194
|
#private;
|
|
173
195
|
constructor(debug: ODDebugger, debugname: string, client: ODClientManager);
|
|
174
196
|
/**Set the message to send when the response times out! */
|
|
175
197
|
setTimeoutErrorCallback(callback: ODResponderTimeoutErrorCallback<ODButtonResponderInstance, "button"> | null, ms: number | null): void;
|
|
176
198
|
add(data: ODButtonResponder<"button", any>, overwrite?: boolean): boolean;
|
|
199
|
+
get<ButtonResponderId extends keyof IdList>(id: ButtonResponderId): ODButtonResponder<IdList[ButtonResponderId]["source"], IdList[ButtonResponderId]["params"], IdList[ButtonResponderId]["workers"]>;
|
|
200
|
+
get(id: ODValidId): ODButtonResponder<"button", any> | null;
|
|
201
|
+
remove<ButtonResponderId extends keyof IdList>(id: ButtonResponderId): ODButtonResponder<IdList[ButtonResponderId]["source"], IdList[ButtonResponderId]["params"], IdList[ButtonResponderId]["workers"]>;
|
|
202
|
+
remove(id: ODValidId): ODButtonResponder<"button", any> | null;
|
|
203
|
+
exists(id: keyof IdList): boolean;
|
|
204
|
+
exists(id: ODValidId): boolean;
|
|
177
205
|
}
|
|
178
206
|
/**## ODButtonResponderInstance `class`
|
|
179
207
|
* This is an Open Discord button responder instance.
|
|
@@ -219,10 +247,18 @@ export declare class ODButtonResponderInstance {
|
|
|
219
247
|
*
|
|
220
248
|
* This class manages all workers which are executed when the related button is triggered.
|
|
221
249
|
*/
|
|
222
|
-
export declare class ODButtonResponder<Source extends string, Params> extends ODResponderImplementation<ODButtonResponderInstance, Source, Params> {
|
|
250
|
+
export declare class ODButtonResponder<Source extends string, Params, WorkerIds extends string = string> extends ODResponderImplementation<ODButtonResponderInstance, Source, Params, WorkerIds> {
|
|
223
251
|
/**Respond to this button */
|
|
224
252
|
respond(instance: ODButtonResponderInstance, source: Source, params: Params): Promise<void>;
|
|
225
253
|
}
|
|
254
|
+
/**## ODDropdownResponderManagerIdConstraint `type`
|
|
255
|
+
* The constraint/layout for id mappings/interfaces of the `ODDropdownResponderManager` class.
|
|
256
|
+
*/
|
|
257
|
+
export type ODDropdownResponderManagerIdConstraint = Record<string, {
|
|
258
|
+
source: "dropdown";
|
|
259
|
+
params: object;
|
|
260
|
+
workers: string;
|
|
261
|
+
}>;
|
|
226
262
|
/**## ODDropdownResponderManager `class`
|
|
227
263
|
* This is an Open Discord dropdown responder manager.
|
|
228
264
|
*
|
|
@@ -236,12 +272,18 @@ export declare class ODButtonResponder<Source extends string, Params> extends OD
|
|
|
236
272
|
* - know where the request came from!
|
|
237
273
|
* - And so much more!
|
|
238
274
|
*/
|
|
239
|
-
export declare class ODDropdownResponderManager extends ODManager<ODDropdownResponder<"dropdown", any>> {
|
|
275
|
+
export declare class ODDropdownResponderManager<IdList extends ODDropdownResponderManagerIdConstraint = ODDropdownResponderManagerIdConstraint> extends ODManager<ODDropdownResponder<"dropdown", any>> {
|
|
240
276
|
#private;
|
|
241
277
|
constructor(debug: ODDebugger, debugname: string, client: ODClientManager);
|
|
242
278
|
/**Set the message to send when the response times out! */
|
|
243
279
|
setTimeoutErrorCallback(callback: ODResponderTimeoutErrorCallback<ODDropdownResponderInstance, "dropdown"> | null, ms: number | null): void;
|
|
244
280
|
add(data: ODDropdownResponder<"dropdown", any>, overwrite?: boolean): boolean;
|
|
281
|
+
get<DropdownResponderId extends keyof IdList>(id: DropdownResponderId): ODDropdownResponder<IdList[DropdownResponderId]["source"], IdList[DropdownResponderId]["params"], IdList[DropdownResponderId]["workers"]>;
|
|
282
|
+
get(id: ODValidId): ODDropdownResponder<"dropdown", any> | null;
|
|
283
|
+
remove<DropdownResponderId extends keyof IdList>(id: DropdownResponderId): ODDropdownResponder<IdList[DropdownResponderId]["source"], IdList[DropdownResponderId]["params"], IdList[DropdownResponderId]["workers"]>;
|
|
284
|
+
remove(id: ODValidId): ODDropdownResponder<"dropdown", any> | null;
|
|
285
|
+
exists(id: keyof IdList): boolean;
|
|
286
|
+
exists(id: ODValidId): boolean;
|
|
245
287
|
}
|
|
246
288
|
/**## ODDropdownResponderInstanceValues `class`
|
|
247
289
|
* This is an Open Discord dropdown responder instance values manager.
|
|
@@ -308,10 +350,18 @@ export declare class ODDropdownResponderInstance {
|
|
|
308
350
|
*
|
|
309
351
|
* This class manages all workers which are executed when the related dropdown is triggered.
|
|
310
352
|
*/
|
|
311
|
-
export declare class ODDropdownResponder<Source extends string, Params> extends ODResponderImplementation<ODDropdownResponderInstance, Source, Params> {
|
|
353
|
+
export declare class ODDropdownResponder<Source extends string, Params, WorkerIds extends string = string> extends ODResponderImplementation<ODDropdownResponderInstance, Source, Params, WorkerIds> {
|
|
312
354
|
/**Respond to this dropdown */
|
|
313
355
|
respond(instance: ODDropdownResponderInstance, source: Source, params: Params): Promise<void>;
|
|
314
356
|
}
|
|
357
|
+
/**## ODModalResponderManagerIdConstraint `type`
|
|
358
|
+
* The constraint/layout for id mappings/interfaces of the `ODModalResponderManager` class.
|
|
359
|
+
*/
|
|
360
|
+
export type ODModalResponderManagerIdConstraint = Record<string, {
|
|
361
|
+
source: "modal";
|
|
362
|
+
params: object;
|
|
363
|
+
workers: string;
|
|
364
|
+
}>;
|
|
315
365
|
/**## ODModalResponderManager `class`
|
|
316
366
|
* This is an Open Discord modal responder manager.
|
|
317
367
|
*
|
|
@@ -325,12 +375,18 @@ export declare class ODDropdownResponder<Source extends string, Params> extends
|
|
|
325
375
|
* - know where the request came from!
|
|
326
376
|
* - And so much more!
|
|
327
377
|
*/
|
|
328
|
-
export declare class ODModalResponderManager extends ODManager<ODModalResponder<"modal", any>> {
|
|
378
|
+
export declare class ODModalResponderManager<IdList extends ODModalResponderManagerIdConstraint = ODModalResponderManagerIdConstraint> extends ODManager<ODModalResponder<"modal", any>> {
|
|
329
379
|
#private;
|
|
330
380
|
constructor(debug: ODDebugger, debugname: string, client: ODClientManager);
|
|
331
381
|
/**Set the message to send when the response times out! */
|
|
332
382
|
setTimeoutErrorCallback(callback: ODResponderTimeoutErrorCallback<ODModalResponderInstance, "modal"> | null, ms: number | null): void;
|
|
333
383
|
add(data: ODModalResponder<"modal", any>, overwrite?: boolean): boolean;
|
|
384
|
+
get<ModalResponderId extends keyof IdList>(id: ModalResponderId): ODModalResponder<IdList[ModalResponderId]["source"], IdList[ModalResponderId]["params"], IdList[ModalResponderId]["workers"]>;
|
|
385
|
+
get(id: ODValidId): ODModalResponder<"modal", any> | null;
|
|
386
|
+
remove<ModalResponderId extends keyof IdList>(id: ModalResponderId): ODModalResponder<IdList[ModalResponderId]["source"], IdList[ModalResponderId]["params"], IdList[ModalResponderId]["workers"]>;
|
|
387
|
+
remove(id: ODValidId): ODModalResponder<"modal", any> | null;
|
|
388
|
+
exists(id: keyof IdList): boolean;
|
|
389
|
+
exists(id: ODValidId): boolean;
|
|
334
390
|
}
|
|
335
391
|
/**## ODModalResponderInstanceValues `class`
|
|
336
392
|
* This is an Open Discord modal responder instance values manager.
|
|
@@ -377,10 +433,18 @@ export declare class ODModalResponderInstance {
|
|
|
377
433
|
*
|
|
378
434
|
* This class manages all workers which are executed when the related modal is triggered.
|
|
379
435
|
*/
|
|
380
|
-
export declare class ODModalResponder<Source extends string, Params> extends ODResponderImplementation<ODModalResponderInstance, Source, Params> {
|
|
436
|
+
export declare class ODModalResponder<Source extends string, Params, WorkerIds extends string = string> extends ODResponderImplementation<ODModalResponderInstance, Source, Params, WorkerIds> {
|
|
381
437
|
/**Respond to this modal */
|
|
382
438
|
respond(instance: ODModalResponderInstance, source: Source, params: Params): Promise<void>;
|
|
383
439
|
}
|
|
440
|
+
/**## ODContextMenuResponderManagerIdConstraint `type`
|
|
441
|
+
* The constraint/layout for id mappings/interfaces of the `ODContextMenuResponderManager` class.
|
|
442
|
+
*/
|
|
443
|
+
export type ODContextMenuResponderManagerIdConstraint = Record<string, {
|
|
444
|
+
source: "context-menu";
|
|
445
|
+
params: object;
|
|
446
|
+
workers: string;
|
|
447
|
+
}>;
|
|
384
448
|
/**## ODContextMenuResponderManager `class`
|
|
385
449
|
* This is an Open Discord context menu responder manager.
|
|
386
450
|
*
|
|
@@ -394,12 +458,18 @@ export declare class ODModalResponder<Source extends string, Params> extends ODR
|
|
|
394
458
|
* - know where the request came from!
|
|
395
459
|
* - And so much more!
|
|
396
460
|
*/
|
|
397
|
-
export declare class ODContextMenuResponderManager extends ODManager<ODContextMenuResponder<"context-menu", any>> {
|
|
461
|
+
export declare class ODContextMenuResponderManager<IdList extends ODContextMenuResponderManagerIdConstraint = ODContextMenuResponderManagerIdConstraint> extends ODManager<ODContextMenuResponder<"context-menu", any>> {
|
|
398
462
|
#private;
|
|
399
463
|
constructor(debug: ODDebugger, debugname: string, client: ODClientManager);
|
|
400
464
|
/**Set the message to send when the response times out! */
|
|
401
465
|
setTimeoutErrorCallback(callback: ODResponderTimeoutErrorCallback<ODContextMenuResponderInstance, "context-menu"> | null, ms: number | null): void;
|
|
402
466
|
add(data: ODContextMenuResponder<"context-menu", any>, overwrite?: boolean): boolean;
|
|
467
|
+
get<ModalResponderId extends keyof IdList>(id: ModalResponderId): ODContextMenuResponder<IdList[ModalResponderId]["source"], IdList[ModalResponderId]["params"], IdList[ModalResponderId]["workers"]>;
|
|
468
|
+
get(id: ODValidId): ODContextMenuResponder<"context-menu", any> | null;
|
|
469
|
+
remove<ModalResponderId extends keyof IdList>(id: ModalResponderId): ODContextMenuResponder<IdList[ModalResponderId]["source"], IdList[ModalResponderId]["params"], IdList[ModalResponderId]["workers"]>;
|
|
470
|
+
remove(id: ODValidId): ODContextMenuResponder<"context-menu", any> | null;
|
|
471
|
+
exists(id: keyof IdList): boolean;
|
|
472
|
+
exists(id: ODValidId): boolean;
|
|
403
473
|
}
|
|
404
474
|
/**## ODContextMenuResponderInstance `class`
|
|
405
475
|
* This is an Open Discord context menu responder instance.
|
|
@@ -438,10 +508,18 @@ export declare class ODContextMenuResponderInstance {
|
|
|
438
508
|
*
|
|
439
509
|
* This class manages all workers which are executed when the related context menu is triggered.
|
|
440
510
|
*/
|
|
441
|
-
export declare class ODContextMenuResponder<Source extends string, Params> extends ODResponderImplementation<ODContextMenuResponderInstance, Source, Params> {
|
|
511
|
+
export declare class ODContextMenuResponder<Source extends string, Params, WorkerIds extends string = string> extends ODResponderImplementation<ODContextMenuResponderInstance, Source, Params, WorkerIds> {
|
|
442
512
|
/**Respond to this button */
|
|
443
513
|
respond(instance: ODContextMenuResponderInstance, source: Source, params: Params): Promise<void>;
|
|
444
514
|
}
|
|
515
|
+
/**## ODAutocompleteResponderManagerIdConstraint `type`
|
|
516
|
+
* The constraint/layout for id mappings/interfaces of the `ODAutocompleteResponderManager` class.
|
|
517
|
+
*/
|
|
518
|
+
export type ODAutocompleteResponderManagerIdConstraint = Record<string, {
|
|
519
|
+
source: "autocomplete";
|
|
520
|
+
params: object;
|
|
521
|
+
workers: string;
|
|
522
|
+
}>;
|
|
445
523
|
/**## ODAutocompleteResponderManager `class`
|
|
446
524
|
* This is an Open Discord autocomplete responder manager.
|
|
447
525
|
*
|
|
@@ -455,12 +533,18 @@ export declare class ODContextMenuResponder<Source extends string, Params> exten
|
|
|
455
533
|
* - know where the request came from!
|
|
456
534
|
* - And so much more!
|
|
457
535
|
*/
|
|
458
|
-
export declare class ODAutocompleteResponderManager extends ODManager<ODAutocompleteResponder<"autocomplete", any>> {
|
|
536
|
+
export declare class ODAutocompleteResponderManager<IdList extends ODAutocompleteResponderManagerIdConstraint = ODAutocompleteResponderManagerIdConstraint> extends ODManager<ODAutocompleteResponder<"autocomplete", any>> {
|
|
459
537
|
#private;
|
|
460
538
|
constructor(debug: ODDebugger, debugname: string, client: ODClientManager);
|
|
461
539
|
/**Set the message to send when the response times out! */
|
|
462
540
|
setTimeoutErrorCallback(callback: ODResponderTimeoutErrorCallback<ODAutocompleteResponderInstance, "autocomplete"> | null, ms: number | null): void;
|
|
463
541
|
add(data: ODAutocompleteResponder<"autocomplete", any>, overwrite?: boolean): boolean;
|
|
542
|
+
get<AutocompleteResponderId extends keyof IdList>(id: AutocompleteResponderId): ODAutocompleteResponder<IdList[AutocompleteResponderId]["source"], IdList[AutocompleteResponderId]["params"], IdList[AutocompleteResponderId]["workers"]>;
|
|
543
|
+
get(id: ODValidId): ODAutocompleteResponder<"autocomplete", any> | null;
|
|
544
|
+
remove<AutocompleteResponderId extends keyof IdList>(id: AutocompleteResponderId): ODAutocompleteResponder<IdList[AutocompleteResponderId]["source"], IdList[AutocompleteResponderId]["params"], IdList[AutocompleteResponderId]["workers"]>;
|
|
545
|
+
remove(id: ODValidId): ODAutocompleteResponder<"autocomplete", any> | null;
|
|
546
|
+
exists(id: keyof IdList): boolean;
|
|
547
|
+
exists(id: ODValidId): boolean;
|
|
464
548
|
}
|
|
465
549
|
/**## ODAutocompleteResponderInstance `class`
|
|
466
550
|
* This is an Open Discord autocomplete responder instance.
|
|
@@ -497,7 +581,7 @@ export declare class ODAutocompleteResponderInstance {
|
|
|
497
581
|
*
|
|
498
582
|
* This class manages all workers which are executed when the related autocomplete is triggered.
|
|
499
583
|
*/
|
|
500
|
-
export declare class ODAutocompleteResponder<Source extends string, Params> extends ODResponderImplementation<ODAutocompleteResponderInstance, Source, Params> {
|
|
584
|
+
export declare class ODAutocompleteResponder<Source extends string, Params, WorkerIds extends string = string> extends ODResponderImplementation<ODAutocompleteResponderInstance, Source, Params, WorkerIds> {
|
|
501
585
|
/**The slash command of the autocomplete should match the following regex. */
|
|
502
586
|
cmdMatch: string | RegExp;
|
|
503
587
|
constructor(id: ODValidId, cmdMatch: string | RegExp, match: string | RegExp, callback?: ODWorkerCallback<ODAutocompleteResponderInstance, Source, Params>, priority?: number, callbackId?: ODValidId);
|
|
@@ -151,6 +151,15 @@ class ODCommandResponderManager extends base_1.ODManager {
|
|
|
151
151
|
});
|
|
152
152
|
return res;
|
|
153
153
|
}
|
|
154
|
+
get(id) {
|
|
155
|
+
return super.get(id);
|
|
156
|
+
}
|
|
157
|
+
remove(id) {
|
|
158
|
+
return super.remove(id);
|
|
159
|
+
}
|
|
160
|
+
exists(id) {
|
|
161
|
+
return super.exists(id);
|
|
162
|
+
}
|
|
154
163
|
}
|
|
155
164
|
exports.ODCommandResponderManager = ODCommandResponderManager;
|
|
156
165
|
/**## ODCommandResponderInstanceOptions `class`
|
|
@@ -536,6 +545,15 @@ class ODButtonResponderManager extends base_1.ODManager {
|
|
|
536
545
|
});
|
|
537
546
|
return res;
|
|
538
547
|
}
|
|
548
|
+
get(id) {
|
|
549
|
+
return super.get(id);
|
|
550
|
+
}
|
|
551
|
+
remove(id) {
|
|
552
|
+
return super.remove(id);
|
|
553
|
+
}
|
|
554
|
+
exists(id) {
|
|
555
|
+
return super.exists(id);
|
|
556
|
+
}
|
|
539
557
|
}
|
|
540
558
|
exports.ODButtonResponderManager = ODButtonResponderManager;
|
|
541
559
|
/**## ODButtonResponderInstance `class`
|
|
@@ -733,6 +751,15 @@ class ODDropdownResponderManager extends base_1.ODManager {
|
|
|
733
751
|
});
|
|
734
752
|
return res;
|
|
735
753
|
}
|
|
754
|
+
get(id) {
|
|
755
|
+
return super.get(id);
|
|
756
|
+
}
|
|
757
|
+
remove(id) {
|
|
758
|
+
return super.remove(id);
|
|
759
|
+
}
|
|
760
|
+
exists(id) {
|
|
761
|
+
return super.exists(id);
|
|
762
|
+
}
|
|
736
763
|
}
|
|
737
764
|
exports.ODDropdownResponderManager = ODDropdownResponderManager;
|
|
738
765
|
/**## ODDropdownResponderInstanceValues `class`
|
|
@@ -1035,6 +1062,15 @@ class ODModalResponderManager extends base_1.ODManager {
|
|
|
1035
1062
|
});
|
|
1036
1063
|
return res;
|
|
1037
1064
|
}
|
|
1065
|
+
get(id) {
|
|
1066
|
+
return super.get(id);
|
|
1067
|
+
}
|
|
1068
|
+
remove(id) {
|
|
1069
|
+
return super.remove(id);
|
|
1070
|
+
}
|
|
1071
|
+
exists(id) {
|
|
1072
|
+
return super.exists(id);
|
|
1073
|
+
}
|
|
1038
1074
|
}
|
|
1039
1075
|
exports.ODModalResponderManager = ODModalResponderManager;
|
|
1040
1076
|
/**## ODModalResponderInstanceValues `class`
|
|
@@ -1205,6 +1241,15 @@ class ODContextMenuResponderManager extends base_1.ODManager {
|
|
|
1205
1241
|
});
|
|
1206
1242
|
return res;
|
|
1207
1243
|
}
|
|
1244
|
+
get(id) {
|
|
1245
|
+
return super.get(id);
|
|
1246
|
+
}
|
|
1247
|
+
remove(id) {
|
|
1248
|
+
return super.remove(id);
|
|
1249
|
+
}
|
|
1250
|
+
exists(id) {
|
|
1251
|
+
return super.exists(id);
|
|
1252
|
+
}
|
|
1208
1253
|
}
|
|
1209
1254
|
exports.ODContextMenuResponderManager = ODContextMenuResponderManager;
|
|
1210
1255
|
/**## ODContextMenuResponderInstance `class`
|
|
@@ -1370,6 +1415,15 @@ class ODAutocompleteResponderManager extends base_1.ODManager {
|
|
|
1370
1415
|
});
|
|
1371
1416
|
return res;
|
|
1372
1417
|
}
|
|
1418
|
+
get(id) {
|
|
1419
|
+
return super.get(id);
|
|
1420
|
+
}
|
|
1421
|
+
remove(id) {
|
|
1422
|
+
return super.remove(id);
|
|
1423
|
+
}
|
|
1424
|
+
exists(id) {
|
|
1425
|
+
return super.exists(id);
|
|
1426
|
+
}
|
|
1373
1427
|
}
|
|
1374
1428
|
exports.ODAutocompleteResponderManager = ODAutocompleteResponderManager;
|
|
1375
1429
|
/**## ODAutocompleteResponderInstance `class`
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { ODManager, ODManagerData, ODValidId } from "./base";
|
|
2
2
|
import { ODDebugger } from "./console";
|
|
3
|
+
/**## ODSessionManagerIdConstraint `type`
|
|
4
|
+
* The constraint/layout for id mappings/interfaces of the `ODSessionManager` class.
|
|
5
|
+
*/
|
|
6
|
+
export type ODSessionManagerIdConstraint = Record<string, ODSession>;
|
|
3
7
|
/**## ODSessionManager `class`
|
|
4
8
|
* This is an Open Discord session manager.
|
|
5
9
|
*
|
|
@@ -8,8 +12,14 @@ import { ODDebugger } from "./console";
|
|
|
8
12
|
*
|
|
9
13
|
* Visit the `ODSession` class for more info
|
|
10
14
|
*/
|
|
11
|
-
export declare class ODSessionManager extends ODManager<ODSession> {
|
|
15
|
+
export declare class ODSessionManager<IdList extends ODSessionManagerIdConstraint = ODSessionManagerIdConstraint> extends ODManager<ODSession> {
|
|
12
16
|
constructor(debug: ODDebugger);
|
|
17
|
+
get<SessionId extends keyof IdList>(id: SessionId): IdList[SessionId];
|
|
18
|
+
get(id: ODValidId): ODSession | null;
|
|
19
|
+
remove<SessionId extends keyof IdList>(id: SessionId): IdList[SessionId];
|
|
20
|
+
remove(id: ODValidId): ODSession | null;
|
|
21
|
+
exists(id: keyof IdList): boolean;
|
|
22
|
+
exists(id: ODValidId): boolean;
|
|
13
23
|
}
|
|
14
24
|
/**## ODSessionInstance `interface`
|
|
15
25
|
* This interface represents a single session instance. It contains an id, data & some dates.
|
|
@@ -51,6 +51,15 @@ class ODSessionManager extends base_1.ODManager {
|
|
|
51
51
|
constructor(debug) {
|
|
52
52
|
super(debug, "session");
|
|
53
53
|
}
|
|
54
|
+
get(id) {
|
|
55
|
+
return super.get(id);
|
|
56
|
+
}
|
|
57
|
+
remove(id) {
|
|
58
|
+
return super.remove(id);
|
|
59
|
+
}
|
|
60
|
+
exists(id) {
|
|
61
|
+
return super.exists(id);
|
|
62
|
+
}
|
|
54
63
|
}
|
|
55
64
|
exports.ODSessionManager = ODSessionManager;
|
|
56
65
|
/**## ODSession `class`
|
|
@@ -1,26 +1,36 @@
|
|
|
1
1
|
import { ODManager, ODManagerData, ODValidId } from "./base";
|
|
2
|
-
import { ODDebugger, ODLiveStatusManager } from "./console";
|
|
2
|
+
import { ODDebugger, ODLiveStatusManager, ODLiveStatusManagerIdConstraint } from "./console";
|
|
3
3
|
import { ODFlag } from "./flag";
|
|
4
4
|
import { ODPlugin, ODUnknownCrashedPlugin } from "./plugin";
|
|
5
5
|
/**## ODStartScreenComponentRenderCallback `type`
|
|
6
6
|
* This is the render function of a startscreen component. It also sends the location of where the component is rendered.
|
|
7
7
|
*/
|
|
8
8
|
export type ODStartScreenComponentRenderCallback = (location: number) => string | Promise<string>;
|
|
9
|
+
/**## ODStartScreenManagerIdConstraint `type`
|
|
10
|
+
* The constraint/layout for id mappings/interfaces of the `ODStartScreenManager` class.
|
|
11
|
+
*/
|
|
12
|
+
export type ODStartScreenManagerIdConstraint = Record<string, ODStartScreenComponent>;
|
|
9
13
|
/**## ODStartScreenManager `class`
|
|
10
14
|
* This is an Open Discord startscreen manager.
|
|
11
15
|
*
|
|
12
16
|
* This class is responsible for managing & rendering the startscreen of the bot.
|
|
13
17
|
* The startscreen is the part you see when the bot has started up successfully. (e.g. the Open Discord logo, logs, livestatus, flags, ...)
|
|
14
18
|
*/
|
|
15
|
-
export declare class ODStartScreenManager extends ODManager<ODStartScreenComponent> {
|
|
19
|
+
export declare class ODStartScreenManager<IdList extends ODStartScreenManagerIdConstraint = ODStartScreenManagerIdConstraint, LiveStatus extends ODLiveStatusManager = ODLiveStatusManager> extends ODManager<ODStartScreenComponent> {
|
|
16
20
|
#private;
|
|
17
21
|
/**Alias to the livestatus manager. */
|
|
18
|
-
livestatus:
|
|
19
|
-
constructor(debug: ODDebugger, livestatus:
|
|
22
|
+
livestatus: LiveStatus;
|
|
23
|
+
constructor(debug: ODDebugger, livestatus: LiveStatus);
|
|
20
24
|
/**Get all components in sorted order. */
|
|
21
25
|
getSortedComponents(priority: "ascending" | "descending"): ODStartScreenComponent[];
|
|
22
26
|
/**Render all startscreen components in priority order. */
|
|
23
27
|
renderAllComponents(): Promise<void>;
|
|
28
|
+
get<StartScreenId extends keyof IdList>(id: StartScreenId): IdList[StartScreenId];
|
|
29
|
+
get(id: ODValidId): ODStartScreenComponent | null;
|
|
30
|
+
remove<StartScreenId extends keyof IdList>(id: StartScreenId): IdList[StartScreenId];
|
|
31
|
+
remove(id: ODValidId): ODStartScreenComponent | null;
|
|
32
|
+
exists(id: keyof IdList): boolean;
|
|
33
|
+
exists(id: ODValidId): boolean;
|
|
24
34
|
}
|
|
25
35
|
/**## ODStartScreenComponent `class`
|
|
26
36
|
* This is an Open Discord startscreen component.
|
|
@@ -149,10 +159,10 @@ export declare class ODStartScreenPluginsCategoryComponent extends ODStartScreen
|
|
|
149
159
|
* This component will render a livestatus category to the startscreen. This will list the livestatus messages in the category.
|
|
150
160
|
* An optional priority can be specified to choose the location of the component.
|
|
151
161
|
*/
|
|
152
|
-
export declare class ODStartScreenLiveStatusCategoryComponent extends ODStartScreenCategoryComponent {
|
|
162
|
+
export declare class ODStartScreenLiveStatusCategoryComponent<LiveStatus extends ODLiveStatusManager<ODLiveStatusManagerIdConstraint>> extends ODStartScreenCategoryComponent {
|
|
153
163
|
/**A reference to the Open Discord livestatus manager. */
|
|
154
|
-
livestatus:
|
|
155
|
-
constructor(id: ODValidId, priority: number, livestatus:
|
|
164
|
+
livestatus: LiveStatus;
|
|
165
|
+
constructor(id: ODValidId, priority: number, livestatus: LiveStatus);
|
|
156
166
|
}
|
|
157
167
|
/**## ODStartScreenLogsCategoryComponent `class`
|
|
158
168
|
* This is an Open Discord startscreen logs category component.
|
|
@@ -52,6 +52,15 @@ class ODStartScreenManager extends base_1.ODManager {
|
|
|
52
52
|
location++;
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
|
+
get(id) {
|
|
56
|
+
return super.get(id);
|
|
57
|
+
}
|
|
58
|
+
remove(id) {
|
|
59
|
+
return super.remove(id);
|
|
60
|
+
}
|
|
61
|
+
exists(id) {
|
|
62
|
+
return super.exists(id);
|
|
63
|
+
}
|
|
55
64
|
}
|
|
56
65
|
exports.ODStartScreenManager = ODStartScreenManager;
|
|
57
66
|
/**## ODStartScreenComponent `class`
|