2024-07-27 02:39:18 -04:00
|
|
|
const index = require('../index.js')
|
2024-07-28 02:37:31 -04:00
|
|
|
module.exports = {
|
2024-08-12 05:13:32 -04:00
|
|
|
load: (b) => {
|
2024-07-28 02:37:31 -04:00
|
|
|
b._client.on('end', () => {
|
2024-08-12 05:13:32 -04:00
|
|
|
b.info(`Bot ${b.id} disconnected`)
|
2024-07-28 02:37:31 -04:00
|
|
|
for (const i in b.interval) {
|
|
|
|
clearInterval(b.interval[i])
|
|
|
|
}
|
|
|
|
setTimeout(() => {
|
2024-08-12 05:13:32 -04:00
|
|
|
b.info(`Re-connecting bot ${b.id}`)
|
2024-07-28 02:37:31 -04:00
|
|
|
index.createBot(b.host, b.id)
|
|
|
|
}, 5000)
|
|
|
|
})
|
|
|
|
}
|
2024-07-27 02:39:18 -04:00
|
|
|
}
|