reconnection messages
This commit is contained in:
parent
05fb6a3437
commit
e3e6fe419c
1 changed files with 10 additions and 0 deletions
10
src/index.js
10
src/index.js
|
@ -31,6 +31,7 @@ process.title = "comcord";
|
||||||
global.comcord = {
|
global.comcord = {
|
||||||
config,
|
config,
|
||||||
state: {
|
state: {
|
||||||
|
connected: true,
|
||||||
rpcConnected: false,
|
rpcConnected: false,
|
||||||
startTime: Date.now(),
|
startTime: Date.now(),
|
||||||
currentGuild: null,
|
currentGuild: null,
|
||||||
|
@ -118,6 +119,15 @@ client.once("ready", function () {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
client.on("error", function () {});
|
client.on("error", function () {});
|
||||||
|
client.on("ready", function () {
|
||||||
|
if (comcord.state.connected === false) {
|
||||||
|
console.log("% Reconnected");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
client.on("disconnect", function () {
|
||||||
|
comcord.state.connected = false;
|
||||||
|
console.log("% Disconnected, retrying...");
|
||||||
|
});
|
||||||
|
|
||||||
rpc.on("connected", function () {
|
rpc.on("connected", function () {
|
||||||
comcord.state.rpcConnected = true;
|
comcord.state.rpcConnected = true;
|
||||||
|
|
Loading…
Reference in a new issue