Multipurpose Discord bot with AI-powered Q&A, game stats, and utility commands. Built with discord.js v14 and TypeScript.
Ask any question in natural language. The bot responds using AI (Gemini or Ollama).
/preguntar ¿Cuál es la capital de Francia?
→ 🇫🇷 La capital de Francia es París.
Shows the last 10 competitive matches of any Valorant player via HenrikDev API.
Displays:
- Agent played per match
- K/D/A and headshot percentage
- Match result (Victory/Defeat) and score
- Rank tier
- Global stats: total K/D, win/loss ratio
/valorant nombre:TenZ tag:666
→ ✅ 1. TenZ — 22/15/8 (KD 1.47) — 32.5% HS — Radiant
Shows the last 10 matches of any League of Legends player via Riot Games API.
Displays:
- Champion played per match
- KDA ratio
- CS (creep score)
- Win/loss result
- Game mode and duration
- Global stats: average KDA, average CS, win/loss ratio
/lol nombre:Faker tag:EUW
→ ✅ 1. Faker — 12/2/15 (KDA 13.50) — 280 CS — CLASSIC
Shows a random cat image from TheCatAPI.
/gato
→ 🐱 ¡Mira este gato! (embed con imagen aleatoria)
Shows info about Electrod, the best electrical service in Granada, with a link to their website.
/electrod
→ ⚡ Electrod — ¿Necesitas al mejor electricista de Granada? https://www.electrod.es/
| Key | Where to get it |
|---|---|
DISCORD_TOKEN & CLIENT_ID |
Discord Developer Portal → New Application → Bot → Reset Token |
GEMINI_API_KEY |
Google AI Studio |
VALORANT_API_KEY |
HenrikDev API (free) |
LOL_API_KEY |
Riot Developer Portal → Register Project. The free dev key expires in 24h. Apply for a Personal key (no expiry) for small projects; needs a website (GitHub Pages works). |
git clone <repo>
cd bot
npm installCopy .env.example to .env and fill in the values:
DISCORD_TOKEN=your_token
CLIENT_ID=your_client_id
GUILD_IDS=server_id_1,server_id_2 # optional — instant command registration
GEMINI_API_KEY=your_gemini_key
VALORANT_API_KEY=your_henrikdev_key
LOL_API_KEY=your_riot_api_keyRun:
npm run deploy # Register slash commands
npm run dev # Development (hot reload)docker compose up -dOr without compose:
docker build -t discord-bot .
docker run --env-file .env discord-botRequires Docker installed. The image includes ffmpeg automatically.
The bot includes an HTTP health-check server needed by Render (free tier sleeps after 15 min of inactivity; the WebSocket reconnects automatically on wake).
Option 1 — Node runtime
-
Push your repo to GitHub
-
Go to render.com → New Web Service → connect your repo
-
Set Runtime to Node
-
Fill in:
Field Value Branch mainRoot Directory (leave blank) Build Command npm install && npm run buildStart Command npm run startPlan Free
Option 2 — Docker runtime (no build/start commands needed)
- Same steps, but set Runtime to Docker — Render will detect the
Dockerfileautomatically
Environment variables (add these in the Render dashboard):
| Key | Value |
|---|---|
DISCORD_TOKEN |
Your bot token |
CLIENT_ID |
Your application ID |
GUILD_IDS |
Server ID(s) for instant commands (optional) |
GEMINI_API_KEY |
Google Gemini API key |
VALORANT_API_KEY |
HenrikDev API key |
LOL_API_KEY |
Riot Games API key |
PORT |
3000 |
- Go to Discord Developer Portal → your app → OAuth2 → URL Generator
- Scopes:
bot+applications.commands - Permissions:
Send Messages,Read Messages/View Channels,Use Slash Commands - Open the generated URL and select your server
| Command | Description |
|---|---|
npm run dev |
Run with hot reload (tsx watch) |
npm run build |
Compile TypeScript to dist/ |
npm run start |
Run compiled JS (production) |
npm run deploy |
Register slash commands on Discord |
npm run lint |
Run ESLint |
npm run format |
Run Prettier |
├── src/
│ ├── commands/ # Slash commands (one file each)
│ │ ├── preguntar.ts
│ │ ├── valorant.ts
│ │ ├── lol.ts
│ │ ├── electrod.ts
│ │ └── gato.ts
│ ├── events/
│ │ ├── ready.ts
│ │ └── interactionCreate.ts
│ ├── handlers/
│ │ └── qaHandler.ts
│ ├── utils/
│ │ ├── loader.ts
│ │ ├── gemini.ts
│ │ ├── ollama.ts
│ │ ├── valorantApi.ts
│ │ └── lolApi.ts
│ ├── config/
│ │ └── env.ts
│ ├── types.ts
│ ├── index.ts
│ └── deploy-commands.ts
├── Dockerfile
├── docker-compose.yml
├── package.json
└── tsconfig.json
Node.js · TypeScript · discord.js v14 · Gemini AI · Ollama · Riot Games API · HenrikDev API
MIT