updated the loader to autorestart
This commit is contained in:
parent
a1480c53e9
commit
40aec683b7
7
start.js
7
start.js
|
@ -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)
|
Loading…
Reference in New Issue