mirror of
https://github.com/ChomeNS/chomens-bot-mc.git
synced 2024-11-27 01:25:33 -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) {
|
||||
client.end(`Bot disconnected with reason: ${util.inspect(reason)}`)
|
||||
bot.off('end', endListener)
|
||||
srv.close()
|
||||
srv.removeAllListeners()
|
||||
client.end(`Bot disconnected with reason: ${util.inspect(reason)}`)
|
||||
}
|
||||
bot.on('end', endListener)
|
||||
})
|
||||
|
||||
bot.on('end', () => {
|
||||
srv.close()
|
||||
srv.removeAllListeners()
|
||||
})
|
||||
};
|
||||
|
||||
module.exports = { inject }
|
||||
|
|
Loading…
Reference in a new issue