fix: use logger everywhere?
Code Analysis / SonarQube (push) Failing after 15s
Node.js CI / Lint and Test (push) Successful in 42s

This commit is contained in:
2025-07-07 16:38:36 -07:00
parent 9ea5a1f6d1
commit c47c46e69a
11 changed files with 30 additions and 61 deletions
+1 -8
View File
@@ -1,5 +1,3 @@
import { WebhookClient } from "discord.js";
import { ExtendedClient } from "../interfaces/ExtendedClient";
import { logHandler } from "../utils/logHandler";
@@ -9,18 +7,13 @@ import { logHandler } from "../utils/logHandler";
* @returns {ExtendedClient["env"]} The environment variable object to attach to the bot.
*/
export const validateEnv = (): ExtendedClient["env"] => {
if (
!process.env.BOT_TOKEN ||
!process.env.DEBUG_HOOK ||
!process.env.MONGO_URI
) {
if (!process.env.BOT_TOKEN || !process.env.MONGO_URI) {
logHandler.log("warn", "Missing environment variables!");
process.exit(1);
}
return {
token: process.env.BOT_TOKEN,
debugHook: new WebhookClient({ url: process.env.DEBUG_HOOK }),
mongoUri: process.env.MONGO_URI,
devMode: process.env.NODE_ENV !== "production"
};