From baf2f5177337ca258a8ed4604812a521585e0d48 Mon Sep 17 00:00:00 2001 From: laika Date: Fri, 13 Mar 2026 23:56:35 +1100 Subject: [PATCH] added stuff i forgot cos im silly and am a bit rash --- src/bot.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/bot.js b/src/bot.js index 4ec5582..d8fadba 100644 --- a/src/bot.js +++ b/src/bot.js @@ -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,7 +64,7 @@ module.exports.handleMessageCreate = async function(message) { } } catch(error) { - if(process.env.DEBUG == "TRUE"){console.error("An error occurred at unix timestamp " + Date.now() + "while processing the command: " + command + " with error:" + error);} + if(debug){console.error("An error occurred at unix timestamp " + Date.now() + "while processing the command: " + command + " 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 } @@ -71,6 +72,7 @@ module.exports.handleMessageCreate = async function(message) { client.on(Events.Ready, () => { console.log(`Logged in as ${client.user?.username}`); + if(debug){console.log(`Currently running in debug mode!`)} }); let guildCount = 0;