4 Commits

View File

@@ -10,6 +10,7 @@ const { AppDataSource } = require("../database/data-source");
env.config();
const token = process.env.FLUXER_BOT_TOKEN;
const debug = process.env.debug;
if (!token) {
console.error("Missing FLUXER_BOT_TOKEN environment variable.");
@@ -63,12 +64,15 @@ module.exports.handleMessageCreate = async function(message) {
}
}
catch(error) {
console.error(error);
if(debug){console.error("An error occurred at unix timestamp " + Date.now() + "while processing the command: " + message + " with error:" + error);}
else{console.error(error);}
process.exit(2); //need this for now just to make sure the bot continues to restart on errors, since it would seem that fluxer.js doesn't define custom error types. TODO: map out some exit codes
}
}
client.on(Events.Ready, () => {
console.log(`Logged in as ${client.user?.username}`);
if(debug){console.log(Date.now() + `: Currently running in debug mode!`)}
});
let guildCount = 0;