dressed
Version:
A sleek, serverless-ready Discord bot framework.
17 lines • 771 B
JavaScript
var _a;
import { env } from "node:process";
import { loadEnvConfig } from "./dotenv.js";
loadEnvConfig();
// @ts-expect-error Compatability with 1.10.0
// TODO Remove globalThis.DRESSED_CONFIG before next major version
export const serverConfig = (_a = globalThis.DRESSED_CONFIG) !== null && _a !== void 0 ? _a : {};
export const botEnv = new Proxy({}, {
get(_, key) {
var _a, _b, _c;
const value = (_c = (_b = (_a = serverConfig.requests) === null || _a === void 0 ? void 0 : _a.env) === null || _b === void 0 ? void 0 : _b[key]) !== null && _c !== void 0 ? _c : env[key];
if (!value)
throw new Error(`Missing ${key}: please set it in your environment variables.`);
return value;
},
});
//# sourceMappingURL=env.js.map