1
0
Fork 0
This commit is contained in:
7cc5c4f330d47060 2024-10-21 17:47:49 -04:00
parent e4ec458e6e
commit 0aacd8e7f7
Signed by: 7cc5c4f330d47060
SSH key fingerprint: SHA256:e+4tcZut1nBpe10PqjaO+Rvie0Q7W4qIvFzcUw+7riA
2 changed files with 31 additions and 0 deletions
plugins

14
plugins/rejoin.js Normal file
View file

@ -0,0 +1,14 @@
import { createBot } from "../index.js"
const 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}`)
createBot(b.host, b.id)
}, 5000)
})
}
export { load }