mirror of
https://github.com/ChomeNS/chomens-bot-mc.git
synced 2024-11-23 15:47:57 -05:00
parent
512c4213ff
commit
e6b64c2386
1 changed files with 6 additions and 3 deletions
|
@ -93,13 +93,16 @@ function inject (bot, dcclient, config) {
|
||||||
})
|
})
|
||||||
|
|
||||||
function endListener (reason) {
|
function endListener (reason) {
|
||||||
client.end(`Bot disconnected with reason: ${util.inspect(reason)}`)
|
|
||||||
bot.off('end', endListener)
|
bot.off('end', endListener)
|
||||||
srv.close()
|
client.end(`Bot disconnected with reason: ${util.inspect(reason)}`)
|
||||||
srv.removeAllListeners()
|
|
||||||
}
|
}
|
||||||
bot.on('end', endListener)
|
bot.on('end', endListener)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
bot.on('end', () => {
|
||||||
|
srv.close()
|
||||||
|
srv.removeAllListeners()
|
||||||
|
})
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = { inject }
|
module.exports = { inject }
|
||||||
|
|
Loading…
Reference in a new issue