generated from nhcarrigan/template
fix: use logger everywhere?
This commit is contained in:
@@ -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"
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user