From 0f587bcfffcb957e13f93b48a847a06d8e141d69 Mon Sep 17 00:00:00 2001 From: Lucian Date: Tue, 23 Feb 2021 12:58:40 -0800 Subject: [PATCH] Add bind to SIGINT --- index.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 2dc87f5..3852abf 100644 --- a/index.js +++ b/index.js @@ -97,4 +97,10 @@ const init = async () => { }; }; -init(); \ No newline at end of file +process.on('SIGINT', function(){ + client.logger.info("Disconnecting...") + client.destroy(); + process.exit(); +}); + +init();