mirror of
https://code.chipmunk.land/Parker2991/NitoriBot/
synced 2026-12-01 06:35:41 -05:00
15 lines
310 B
JavaScript
15 lines
310 B
JavaScript
const mc = require('minecraft-protocol')
|
|
|
|
function inject (bot, options) {
|
|
bot.reconnectDelay = options.reconnectDelay ?? 1000
|
|
|
|
bot.on('end', () => {
|
|
if (bot.reconnectDelay < 0) return
|
|
|
|
bot._client = mc.createClient(options)
|
|
bot.emit('init_client', bot._client)
|
|
})
|
|
}
|
|
|
|
module.exports = inject
|