Skip to main content
1

Create a Telegram bot via @BotFather

Open Telegram and start a conversation with @BotFather.
/newbot
Follow the prompts to choose a name and username for your bot. BotFather will return a BOT_TOKEN that looks like:
123456789:AbCdefGhIJKlmNoPQRsTUVwxyZ
Keep this token — you will need it in a later step.
2

Get an OpenAI API key

Go to platform.openai.com/api-keys and create a new secret key.The bot uses gpt-4o-mini by default. This model is the most cost-efficient option and is more than sufficient for deal curation. Make sure your account has credits or a payment method attached.
3

Clone the repository

git clone https://github.com/sebasgc0399/steam-deals-ai.git
cd steam-deals-ai
4

Configure environment variables

Copy the example file and fill in your credentials:
cp .env.example .env
The .env.example file contains:
# Telegram Bot Token (obtenido de @BotFather en Telegram)
BOT_TOKEN=123456789:AbCdefGhIJKlmNoPQRsTUVwxyZ

# OpenAI API Key (plataforma OpenAI)
OPENAI_API_KEY=sk-proj-xxxxxxxxxxxxxxxxxxxx

# Modelo a usar (gpt-4o-mini es el más económico y suficiente)
OPENAI_MODEL=gpt-4o-mini

# ─── Filtros CAPA 1 (deterministas, sin costo) ─────────────
MIN_DISCOUNT_PERCENT=50        # Descuento mínimo requerido (%)
MIN_METACRITIC_SCORE=70        # Score mínimo de Metacritic (0 = ignorar)
MIN_STEAM_RATING_PERCENT=70    # Steam rating % mínimo
MAX_PRICE_USD=60               # Precio máximo tras descuento
DEALS_PAGE_SIZE=60             # Cuántos deals traer de CheapShark (máx 60)

# ─── Deduplicación ─────────────────────────────────────────
DEDUP_DAYS=7                   # No repetir un juego por N días

# ─── Scheduler ─────────────────────────────────────────────
# Formato cron estándar. Ver https://crontab.guru
CRON_SCHEDULE=0 9 * * *        # Todos los días a las 9:00am (Colombia UTC-5)
At minimum, set these two required variables in your .env:
VariableRequiredDefaultDescription
BOT_TOKENYesTelegram bot token from @BotFather
OPENAI_API_KEYYesOpenAI API key
OPENAI_MODELNogpt-4o-miniOpenAI model to use for curation
All other variables are optional and have sensible defaults.
5

Install dependencies

npm install
6

Start the bot in development mode

The available npm scripts are:
"dev":        "tsx watch src/bot/index.ts",
"build":      "tsc",
"start":      "node dist/bot/index.js",
"test:deals": "tsx src/scripts/testDeals.ts"
Run the bot with hot-reload using:
npm run dev
You should see:
🚀 Steam Deals Bot iniciado correctamente
7

Send /start to your bot

Open Telegram, search for the username you gave your bot in Step 1, and send:
/start
The bot will confirm that you are now subscribed to daily deal notifications.
8

Send /deals to get your first deal list

/deals
The bot fetches live deals from CheapShark, runs them through the deterministic filter, sends the survivors to GPT-4o-mini for curation, and replies with a formatted list of the best deals — each with a short AI-generated reason.
There is a 45-second cooldown between /deals requests per chat to prevent abuse. If you send the command again too quickly, the bot will tell you how many seconds remain.
You can test the full deals pipeline — both filter layers — without running the bot server by using:
npm run test:deals
This runs src/scripts/testDeals.ts directly and prints results to the terminal. It is the fastest way to validate your API keys and tweak filter thresholds before deploying.

Build docs developers (and LLMs) love