zumito-framework 1.2.4 → 1.2.5

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.
@@ -17,6 +17,7 @@ export declare class StatusManager {
17
17
  * @private
18
18
  */
19
19
  private delegateEvents;
20
+ initialize(): void;
20
21
  /**
21
22
  * Sets the status of the bot.
22
23
  * If no presence data is provided, the status will be set to next in the queue.
@@ -18,12 +18,22 @@ export class StatusManager {
18
18
  * @private
19
19
  */
20
20
  delegateEvents() {
21
- this.framework.client.on("ready", () => {
22
- this.setStatus();
21
+ if (this.framework.client.isReady()) {
22
+ this.initialize();
23
+ }
24
+ else {
25
+ this.framework.client.on("ready", () => {
26
+ this.initialize();
27
+ });
28
+ }
29
+ }
30
+ initialize() {
31
+ this.setStatus();
32
+ if (this.options.updateInterval) {
23
33
  setInterval(() => {
24
34
  this.setStatus();
25
35
  }, this.options.updateInterval);
26
- });
36
+ }
27
37
  }
28
38
  /**
29
39
  * Sets the status of the bot.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zumito-framework",
3
- "version": "1.2.4",
3
+ "version": "1.2.5",
4
4
  "description": "Discord.js bot framework",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",