@open-discord-bots/framework 0.0.7 → 0.0.8
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.
|
@@ -288,9 +288,11 @@ export declare class ODLiveStatusManager extends ODManager<ODLiveStatusSource> {
|
|
|
288
288
|
#private;
|
|
289
289
|
/**The class responsible for rendering the livestatus messages. */
|
|
290
290
|
renderer: ODLiveStatusRenderer;
|
|
291
|
-
constructor(debug: ODDebugger,
|
|
291
|
+
constructor(debug: ODDebugger, console: ODConsoleManager);
|
|
292
292
|
/**Get the messages from all sources combined! */
|
|
293
293
|
getAllMessages(): Promise<ODLiveStatusSourceData[]>;
|
|
294
|
+
/**Set the opendiscord `ODMain` class to use for fetching message filters. */
|
|
295
|
+
useMain(main: ODMain): void;
|
|
294
296
|
}
|
|
295
297
|
/**## ODLiveStatusRenderer `class`
|
|
296
298
|
* This is the Open Discord livestatus renderer.
|
|
@@ -526,14 +526,15 @@ class ODLiveStatusManager extends base_1.ODManager {
|
|
|
526
526
|
/**The class responsible for rendering the livestatus messages. */
|
|
527
527
|
renderer;
|
|
528
528
|
/**A reference to the ODMain or "opendiscord" global variable */
|
|
529
|
-
#main;
|
|
530
|
-
constructor(debug,
|
|
529
|
+
#main = null;
|
|
530
|
+
constructor(debug, console) {
|
|
531
531
|
super(debug, "livestatus source");
|
|
532
|
-
this.renderer = new ODLiveStatusRenderer(
|
|
533
|
-
this.#main = main;
|
|
532
|
+
this.renderer = new ODLiveStatusRenderer(console);
|
|
534
533
|
}
|
|
535
534
|
/**Get the messages from all sources combined! */
|
|
536
535
|
async getAllMessages() {
|
|
536
|
+
if (!this.#main)
|
|
537
|
+
throw new base_1.ODSystemError("ODLiveStatusManager:getAllMessages() --> Unable to get messages, 'opendiscord/ODMain' has not been connected!");
|
|
537
538
|
const messages = [];
|
|
538
539
|
for (const source of this.getAll()) {
|
|
539
540
|
try {
|
|
@@ -543,6 +544,10 @@ class ODLiveStatusManager extends base_1.ODManager {
|
|
|
543
544
|
}
|
|
544
545
|
return messages;
|
|
545
546
|
}
|
|
547
|
+
/**Set the opendiscord `ODMain` class to use for fetching message filters. */
|
|
548
|
+
useMain(main) {
|
|
549
|
+
this.#main = main;
|
|
550
|
+
}
|
|
546
551
|
}
|
|
547
552
|
exports.ODLiveStatusManager = ODLiveStatusManager;
|
|
548
553
|
/**## ODLiveStatusRenderer `class`
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-discord-bots/framework",
|
|
3
3
|
"author": "DJj123dj",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.8",
|
|
5
5
|
"description": "The core framework of the popular open-source discord bots: Open Ticket & Open Moderation.",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"module": "dist/index.js",
|
|
@@ -592,16 +592,16 @@ export class ODLiveStatusManager extends ODManager<ODLiveStatusSource> {
|
|
|
592
592
|
/**The class responsible for rendering the livestatus messages. */
|
|
593
593
|
renderer: ODLiveStatusRenderer
|
|
594
594
|
/**A reference to the ODMain or "opendiscord" global variable */
|
|
595
|
-
#main: ODMain
|
|
595
|
+
#main: ODMain|null = null
|
|
596
596
|
|
|
597
|
-
constructor(debug:ODDebugger,
|
|
597
|
+
constructor(debug:ODDebugger,console:ODConsoleManager){
|
|
598
598
|
super(debug,"livestatus source")
|
|
599
|
-
this.renderer = new ODLiveStatusRenderer(
|
|
600
|
-
this.#main = main
|
|
599
|
+
this.renderer = new ODLiveStatusRenderer(console)
|
|
601
600
|
}
|
|
602
601
|
|
|
603
602
|
/**Get the messages from all sources combined! */
|
|
604
603
|
async getAllMessages(): Promise<ODLiveStatusSourceData[]> {
|
|
604
|
+
if (!this.#main) throw new ODSystemError("ODLiveStatusManager:getAllMessages() --> Unable to get messages, 'opendiscord/ODMain' has not been connected!")
|
|
605
605
|
const messages: ODLiveStatusSourceData[] = []
|
|
606
606
|
for (const source of this.getAll()){
|
|
607
607
|
try {
|
|
@@ -610,6 +610,10 @@ export class ODLiveStatusManager extends ODManager<ODLiveStatusSource> {
|
|
|
610
610
|
}
|
|
611
611
|
return messages
|
|
612
612
|
}
|
|
613
|
+
/**Set the opendiscord `ODMain` class to use for fetching message filters. */
|
|
614
|
+
useMain(main:ODMain){
|
|
615
|
+
this.#main = main
|
|
616
|
+
}
|
|
613
617
|
}
|
|
614
618
|
|
|
615
619
|
/**## ODLiveStatusRenderer `class`
|