import { logger } from './logger.js';

export function checkEnv() {
  const required = [
    'ZAI_API_KEY',
    'GLM_BASE_URL',
  ];

  const missing = [];

  for (const key of required) {
    if (!process.env[key]) {
      missing.push(key);
    }
  }

  return {
    valid: missing.length === 0,
    missing,
    ZAI_API_KEY: process.env.ZAI_API_KEY || '',
    GLM_BASE_URL: process.env.GLM_BASE_URL || '',
    TELEGRAM_BOT_TOKEN: process.env.TELEGRAM_BOT_TOKEN || '',
    TELEGRAM_ALLOWED_USERS: process.env.TELEGRAM_ALLOWED_USERS || '',
    DISCORD_TOKEN: process.env.DISCORD_TOKEN || '',
  };
}
