2024-07-30 05:56:23 -04:00
|
|
|
const index = require('../index.js')
|
|
|
|
module.exports = {
|
|
|
|
load: (b) => {
|
|
|
|
b._client.on('end', () => {
|
2024-08-08 03:01:25 -04:00
|
|
|
b.info(`Bot ${b.id} disconnected`)
|
2024-07-30 05:56:23 -04:00
|
|
|
for (const i in b.interval) {
|
|
|
|
clearInterval(b.interval[i])
|
|
|
|
}
|
|
|
|
setTimeout(() => {
|
2024-08-08 03:01:25 -04:00
|
|
|
b.info(`Re-connecting bot ${b.id}`)
|
2024-07-30 05:56:23 -04:00
|
|
|
index.createBot(b.host, b.id)
|
|
|
|
}, 5000)
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|