This repository has been archived on 2024-08-08. You can view files and clone it, but cannot push or open issues or pull requests.
botvX_forgejo2/plugins/rejoin.js
2024-08-02 02:33:31 -04:00

15 lines
367 B
JavaScript
Executable file

const index = require('../index.js')
module.exports = {
load: (b) => {
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)
})
}
}