feat: enforce strict AI env validation and force close

This commit is contained in:
MythEclipse committed 2026-05-26 00:59:32 +07:00
1 parent 7126959548
commit c1c149855a
2 files changed
+15

No files matched your search

+5
View File
@@ -14,6 +14,11 @@ import { createGracefulShutdown } from "./shutdown.js";
export async function initializeApp() {
const logger = createChildLogger("bot");
if (!config.AI_LLM_API_KEY) {
logger.error("AI_LLM_API_KEY is missing from environment. Force closing application as AI environment is required.");
process.exit(1);
}
const token = config.DISCORD_TOKEN;
logger.info(
{ hasToken: token.length > 0, tokenLength: token.length },