owobot/plugins/rejoin.js
7cc5c4f330d47060 de78065438 Initial commit
2024-07-06 11:02:11 -04:00

19 lines
517 B
JavaScript
Executable file

const index = require('../index.js')
module.exports={
load:()=>{
//console.log("Loaded on global")
},
loadBot:(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)
const b_id = b.id;
index.createBot(b.host,b.id);
},5000)
})
}
}