catto.js 0.7.3 → 0.7.4
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/Bot.js +4 -6
- package/package.json +2 -2
package/Bot.js
CHANGED
|
@@ -43,7 +43,7 @@ module.exports = class extends EventEmitter {
|
|
|
43
43
|
}
|
|
44
44
|
this.client = new Discord.Client(opts);
|
|
45
45
|
if (this.options.sharded) {
|
|
46
|
-
this.cluster = new ClusterClient(this.client);
|
|
46
|
+
this.client.cluster = new ClusterClient(this.client);
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
this.currentStatus = void 0;
|
|
@@ -175,16 +175,11 @@ module.exports = class extends EventEmitter {
|
|
|
175
175
|
});
|
|
176
176
|
}
|
|
177
177
|
this.emit("running", { Discord });
|
|
178
|
-
});
|
|
179
|
-
this.cluster.on("ready", () => {
|
|
180
178
|
if (this.cluster.id == (this.cluster.count - 1)) {
|
|
181
179
|
this.cluster.broadcastEval(client => client.emit("_runningFull"));
|
|
182
180
|
this.emit("runningFullLast", { Discord });
|
|
183
181
|
}
|
|
184
182
|
});
|
|
185
|
-
this.client.on("_runningFull", () => {
|
|
186
|
-
this.emit("runningFull", { Discord });
|
|
187
|
-
});
|
|
188
183
|
this.client.on("interactionCreate", this.handleInteractionCreate.bind(this));
|
|
189
184
|
this.client.on("messageCreate", message => {
|
|
190
185
|
message.author = new User(message.author, this);
|
|
@@ -226,6 +221,9 @@ module.exports = class extends EventEmitter {
|
|
|
226
221
|
this.emit("botDelete", guild);
|
|
227
222
|
});
|
|
228
223
|
}
|
|
224
|
+
get cluster() {
|
|
225
|
+
return this.client.cluster;
|
|
226
|
+
}
|
|
229
227
|
get servers() {
|
|
230
228
|
var r = Array.from(this.client.guilds.cache.values());
|
|
231
229
|
r.count = r.length;
|