LookAtMySuitBot/js/node_modules/mineflayer/lib/plugins/kick.js

15 lines
341 B
JavaScript
Raw Normal View History

2023-12-24 20:08:39 -05:00
module.exports = inject
function inject (bot) {
bot._client.on('kick_disconnect', (packet) => {
bot.emit('kicked', packet.reason, true)
})
bot._client.on('disconnect', (packet) => {
bot.emit('kicked', packet.reason, false)
})
bot.quit = (reason) => {
reason = reason ?? 'disconnect.quitting'
bot.end(reason)
}
}