schizofour-coulombot/src/config/mod.ts

14 lines
724 B
TypeScript

/*
Manages loading environment variables and configuration settings.
*/
import { load } from "https://deno.land/std@0.208.0/dotenv/mod.ts";
await load({ export: true });
export const BOT_TOKEN = Deno.env.get("BOT_TOKEN") ?? (() => { throw new Error("BOT_TOKEN is unset") })();
export const CHANNEL_ID = Deno.env.get("CHANNEL_ID") ?? (() => { throw new Error("CHANNEL_ID is unset") })();
export const GROUP_ID = Deno.env.get("GROUP_ID") ?? (() => { throw new Error("GROUP_ID is unset") })();
export const COMMUNITY_GROUP_ID = Deno.env.get("COMMUNITY_GROUP_ID") ?? (() => { throw new Error("COMMUNITY_GROUP_ID is unset") })();
export const ANON_CREDITS = Deno.readTextFileSync("./src/config/anon_credits.txt").split("\n");