botv12/plugins/rejoin.js

14 lines
334 B
JavaScript
Raw Permalink Normal View History

2024-11-19 20:05:19 -05:00
import { createBot } from '../index.js'
2024-10-23 22:59:54 -04:00
export default function load (b) {
2024-10-21 17:47:49 -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}`)
createBot(b.host, b.id)
}, 5000)
})
2024-11-19 20:05:19 -05:00
}