Skip to content

Configuration

Variables d'environnement

Obligatoires

VariableDescriptionOù la trouver
DISCORD_TOKENToken du botDiscord Developer Portal
DISCORD_CLIENT_IDApplication IDMême portail, section General
DISCORD_GUILD_IDID du serveurClic droit serveur → Copier l'identifiant
DISCORD_LOG_CHANNEL_IDSalon logs adminCréé par /setup init ou manuellement
BOT_OWNER_IDTon Discord user IDClic droit sur toi → Copier l'identifiant
DATABASE_URLURL PostgreSQLpostgresql://discord_bot:discord_bot@localhost:5432/discord_bot

Optionnelles

VariableDescriptionOù la trouver
RIOT_API_KEYAPI Riot Games (TFT, expire 24h)developer.riotgames.com
RIOT_PLATFORMPlateforme Rioteuw1, na1, kr...
RIOT_REGIONRégion Rioteurope, americas, asia
ENABLE_VALORANT_TRACKERActive le module Valoranttrue / false
HENRIK_API_KEYAPI HenrikDev (Valorant)henrikdev.xyz/dashboard
GROQ_API_KEYAPI Groq (IA chat)console.groq.com
GITHUB_TOKENToken GitHub (bug reports)github.com/settings/tokens
GITHUB_REPORepo GitHubowner/repo (ex: alxgb5/igbbot)
HEALTH_PORTPort health check HTTPDéfaut : 3000
LOG_LEVELNiveau de logdebug, info, warn, error
NODE_ENVEnvironnementdevelopment, production, test

Exemple .env

env
# Discord
DISCORD_TOKEN=OTM1MjU2...
DISCORD_CLIENT_ID=935256885576216626
DISCORD_GUILD_ID=628274535677952031
DISCORD_LOG_CHANNEL_ID=1489184508589904013
BOT_OWNER_ID=267404560274817024

# Database
DATABASE_URL=postgresql://discord_bot:discord_bot@localhost:5432/discord_bot

# Riot Games
RIOT_API_KEY=RGAPI-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
RIOT_PLATFORM=euw1
RIOT_REGION=europe

# Valorant
ENABLE_VALORANT_TRACKER=true
HENRIK_API_KEY=HDEV-xxx

# IA
GROQ_API_KEY=gsk_xxx

# GitHub
GITHUB_TOKEN=ghp_xxx
GITHUB_REPO=alxgb5/igbbot

# App
LOG_LEVEL=info
NODE_ENV=development

Sécurité

Ne jamais commiter le .env. Il est dans le .gitignore.