forked from 7cc5c4f330d47060/botv12
:3
This commit is contained in:
parent
e4ec458e6e
commit
0aacd8e7f7
2 changed files with 31 additions and 0 deletions
plugins
14
plugins/rejoin.js
Normal file
14
plugins/rejoin.js
Normal 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 }
|
Loading…
Add table
Add a link
Reference in a new issue