Added ENV management

This commit is contained in:
fzzinchemical
2025-04-02 19:30:28 +02:00
parent e24bae3322
commit d00df57aea
3 changed files with 27 additions and 7 deletions

View File

@@ -1,12 +1,11 @@
import { createBot, Intents, startBot } from "npm:discordeno@18.0.1";
import { messagehandler } from "./messages.ts";
import { EnvConst, loadConfig } from "@root/core/configLoader.ts";
const env: EnvConst = loadConfig()
const BOT_TOKEN = Deno.env.get("BOT_TOKEN") ?? "";
if (!BOT_TOKEN) {
throw new Error("BOT_TOKEN is missing!");
}
const bot = createBot({
token: BOT_TOKEN,
token: env.BOT_TOKEN,
intents: Intents.Guilds | Intents.GuildMessages | Intents.MessageContent |
Intents.DirectMessages,
events: {