2024-07-28 16:30:19 -04:00
|
|
|
const index = require('../index.js')
|
|
|
|
module.exports = {
|
2024-07-29 01:35:26 -04:00
|
|
|
load: (b) => {
|
2024-07-28 16:30:19 -04:00
|
|
|
b._client.on('end', () => {
|
|
|
|
b.info('bot ' + b.id + ' disconnected')
|
|
|
|
for (const i in b.interval) {
|
|
|
|
clearInterval(b.interval[i])
|
|
|
|
}
|
|
|
|
setTimeout(() => {
|
|
|
|
b.info('Re-connecting bot ' + b.id)
|
|
|
|
index.createBot(b.host, b.id)
|
|
|
|
}, 5000)
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|