import { config } from 'dotenv';
import { hostname } from 'os';
config();

const generateInstanceId = () => {
  return process.env.INSTANCE_ID || hostname() || `kord-${Math.random().toString(36).substring(2, 7)}`;
};

export const env = {
  NODE_ENV: process.env.NODE_ENV || 'development',
  DISCORD_TOKEN: process.env.DISCORD_TOKEN || '',
  DISCORD_CLIENT_ID: process.env.DISCORD_CLIENT_ID || '',
  DATABASE_URL: process.env.DATABASE_URL || '',
  VOICE_WAITING_ROOM_ID: process.env.VOICE_WAITING_ROOM_ID || '',
  VOICE_CATEGORY_ID: process.env.VOICE_CATEGORY_ID || '',
  INSTANCE_ID: generateInstanceId(),
};
