@open-discord-bots/framework 0.0.7 → 0.1.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.
@@ -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, main: ODMain);
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, main) {
529
+ #main = null;
530
+ constructor(debug, console) {
531
531
  super(debug, "livestatus source");
532
- this.renderer = new ODLiveStatusRenderer(main.console);
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`
@@ -1,5 +1,5 @@
1
- import { api } from "../index";
2
- import { ODCliHeaderOpts } from "./cli";
1
+ import * as api from "../api/index";
2
+ import { ODCliHeaderOpts } from ".";
3
3
  export declare class ODCliEditConfigInstance {
4
4
  private readonly opts;
5
5
  private readonly opendiscord;