diff --git a/.env_example b/.env_example index c8e91efb..3ab1b79c 100644 --- a/.env_example +++ b/.env_example @@ -23,7 +23,7 @@ DEVS="" #============================================================================== # IMPORTANT - What mode should the bot run in? -# Example: MODE="dev" -# Default: dev -# Options: dev, prod -MODE="prod" +# Example: NODE_ENV="development" +# Default: development +# Options: development, production +NODE_ENV="production" diff --git a/src/config/env.ts b/src/config/env.ts index ee080069..9efb9326 100644 --- a/src/config/env.ts +++ b/src/config/env.ts @@ -1,16 +1,10 @@ import { resolve } from "path"; -export const botName = process.env.BOT_NAME?.length - ? process.env.BOT_NAME - : "Clytage Bot"; +export const botName = process.env.BOT_NAME?.length ? process.env.BOT_NAME : "Clytage Bot"; export const stickerPack = process.env.STICKER_PACK?.length ? process.env.STICKER_PACK : "Clytage Sticker Pack"; export const prefix = process.env.PREFIX?.length ? process.env.PREFIX : "/"; export const devs = process.env.DEVS?.split(",") ?? []; -export const mode = (process.env.MODE as "dev" | "prod" | undefined) ?? "prod"; -process.env.FFMPEG_PATH = resolve( - "node_modules", - "ffmpeg-static", - "ffmpeg.exe" -); +export const isDev = process.env.NODE_ENV === "development"; +process.env.FFMPEG_PATH = resolve("node_modules", "ffmpeg-static", "ffmpeg.exe"); diff --git a/src/index.ts b/src/index.ts index 3e8bf3df..32821ffd 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,12 +1,12 @@ import { makeWASocket, makeCacheableSignalKeyStore, useMultiFileAuthState } from "@whiskeysockets/baileys"; -import { mode, prefix } from "./config/env.js"; +import { isDev, prefix } from "./config/env.js"; import { WhatsAppBot } from "./structures/WhatsAppBot.js"; import { container } from "@sapphire/pieces"; import { createLogger } from "@clytage/liqueur"; const logger = createLogger({ name: "WhatsApp-bot", - debug: mode === "dev" + debug: isDev }); const client = new WhatsAppBot({