dont print disconnected if quitting
This commit is contained in:
		
							parent
							
								
									b988416ae3
								
							
						
					
					
						commit
						8ea671bad3
					
				
					 2 changed files with 5 additions and 2 deletions
				
			
		| 
						 | 
					@ -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);
 | 
				
			||||||
});
 | 
					});
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -125,8 +125,10 @@ client.on("ready", function () {
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
});
 | 
					});
 | 
				
			||||||
client.on("disconnect", function () {
 | 
					client.on("disconnect", function () {
 | 
				
			||||||
 | 
					  if (!comcord.state.quitting) {
 | 
				
			||||||
    comcord.state.connected = false;
 | 
					    comcord.state.connected = false;
 | 
				
			||||||
    console.log("% Disconnected, retrying...");
 | 
					    console.log("% Disconnected, retrying...");
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
});
 | 
					});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
rpc.on("connected", function () {
 | 
					rpc.on("connected", function () {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue