diff --git a/src/bot.ts b/src/bot.ts index 8a4e281..26b8d52 100755 --- a/src/bot.ts +++ b/src/bot.ts @@ -1,15 +1,12 @@ import { createBot, Intents, startBot } from "npm:discordeno@18.0.1"; -import * as dotenv from "jsr:@std/dotenv"; import { messagehandler } from "./messages.ts"; -const env = dotenv.loadSync(); - -if (typeof env.BOT_TOKEN !== "string") { - throw new Error("Bot token is required in .env file"); +const BOT_TOKEN = Deno.env.get("BOT_TOKEN") ?? ""; +if (!BOT_TOKEN) { + throw new Error("BOT_TOKEN is missing!"); } - const bot = createBot({ - token: env.BOT_TOKEN, + token: BOT_TOKEN, intents: Intents.Guilds | Intents.GuildMessages | Intents.MessageContent | Intents.DirectMessages, events: {