log errors to console

This commit is contained in:
Neko-Life 2021-08-06 21:57:30 +07:00
parent d1d6dd6b98
commit fe2a2e53a4

26
Main.js
View file

@ -198,15 +198,31 @@ client.on("commandRun", async (c, u, msg) => {
if (msg.guild && !msg.guild.DB) await msg.guild.dbLoad(); if (msg.guild && !msg.guild.DB) await msg.guild.dbLoad();
}); });
client.on("warn", a => console.log("warn", typeof a, a)); client.on("warn", e => {
client.on("error", e => errLog(e, null, client)); console.error(e);
errLog(e, null, client);
});
client.on("error", e => {
console.error(e);
errLog(e, null, client);
});
client.on("commandError", (c, e, m) => { client.on("commandError", (c, e, m) => {
console.error(e);
errLog(e, m, client); errLog(e, m, client);
m?.channel.stopTyping(); m?.channel.stopTyping();
}); });
process.on("uncaughtException", e => errLog(e, null, client)); process.on("uncaughtException", e => {
process.on("unhandledRejection", e => errLog(e, null, client)); console.error(e);
process.on("warning", e => errLog(e, null, client)); errLog(e, null, client);
});
process.on("unhandledRejection", e => {
console.error(e);
errLog(e, null, client);
});
process.on("warning", e => {
console.error(e);
errLog(e, null, client);
});
client.login(configFile.token); client.login(configFile.token);