dont print disconnected if quitting

This commit is contained in:
Cynthia Foxwell 2023-06-20 20:56:13 -06:00
parent b988416ae3
commit 8ea671bad3
2 changed files with 5 additions and 2 deletions

View File

@ -1,6 +1,7 @@
const {addCommand} = require("../lib/command"); const {addCommand} = require("../lib/command");
addCommand("q", "quit comcord", function () { addCommand("q", "quit comcord", function () {
comcord.state.quitting = true;
comcord.client.disconnect({reconnect: false}); comcord.client.disconnect({reconnect: false});
process.exit(0); process.exit(0);
}); });

View File

@ -125,8 +125,10 @@ client.on("ready", function () {
} }
}); });
client.on("disconnect", function () { client.on("disconnect", function () {
comcord.state.connected = false; if (!comcord.state.quitting) {
console.log("% Disconnected, retrying..."); comcord.state.connected = false;
console.log("% Disconnected, retrying...");
}
}); });
rpc.on("connected", function () { rpc.on("connected", function () {