Skip to content
This repository has been archived by the owner on Nov 11, 2024. It is now read-only.

Commit

Permalink
chore: update env config
Browse files Browse the repository at this point in the history
  • Loading branch information
noxzym committed Nov 8, 2023
1 parent 43db76e commit 70ac382
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 15 deletions.
8 changes: 4 additions & 4 deletions .env_example
Original file line number Diff line number Diff line change
Expand Up @@ -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"
12 changes: 3 additions & 9 deletions src/config/env.ts
Original file line number Diff line number Diff line change
@@ -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");
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -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({
Expand Down

0 comments on commit 70ac382

Please sign in to comment.