updated the loader to autorestart

This commit is contained in:
FreeApp2014 2018-07-10 18:50:25 +03:00
parent a1480c53e9
commit 40aec683b7
1 changed files with 7 additions and 0 deletions

View File

@ -10,4 +10,11 @@ var a = async (message) => {
botInstance.on("message", a)
}
}
botInstance.on("exit", async (code) => {
if (code != 0){
console.log("Bot crashed...");
botInstance = await require("child_process").fork("bot.js");
botInstance.on("message", a)
}
})
botInstance.on("message", a)