Command summary
| Command | Description | Rate limit |
|---|---|---|
/start | Subscribe to daily deal notifications | None |
/deals | Fetch and display today’s curated deals | 45 seconds per chat |
/stop | Unsubscribe from daily notifications | None |
/help | Show available commands and bot description | None |
/start
Subscribes the user to daily deal broadcasts. On success, the bot saves the user’s chat_id to data/chat_ids.json and replies with a welcome message listing all available commands.
Sending /start again while already subscribed is safe — the file write is idempotent.
The
chat_id saved by /start is the identifier used by the daily cron job to push deals to all subscribers. If data/chat_ids.json is lost, all users must re-run /start to re-subscribe./deals
Fetches and displays the current day’s curated deals on demand.
Behavior:
- Checks an in-memory rate limit for the requesting
chat_id. If the last request was within the cooldown window, the bot replies with the remaining wait time and exits early. - Sends a
typingchat action so the user sees a typing indicator while the pipeline runs. - Calls
fetchDeals(), which returns a snapshot if one already exists for today, or runs the full two-layer pipeline (deterministic filter → GPT-4o-mini curation). - Fetches the current USD → COP exchange rate and formats the deals message in HTML.
- Replies with the formatted deals list.
chat_id. The cooldown is stored in memory and resets when the process restarts.
If the daily cron job has already run,
/deals serves from the cached data/snapshot.json and responds almost instantly — no API calls are made. The snapshot is cleared at startup if it belongs to a previous day.| Condition | User-facing message |
|---|---|
| Rate limit active | ⏳ Espera Ns antes de volver a consultar ofertas. |
| AI curation unavailable | ⚠️ El servicio de curación con IA no está disponible ahora mismo. |
| No qualifying deals | 🎮 No hay ofertas destacadas en este momento. ¡Vuelve mañana! |
| Unexpected error | ❌ Hubo un error inesperado. Intenta más tarde. |
/stop
Unsubscribes the user from daily notifications. The bot removes their chat_id from data/chat_ids.json immediately and confirms with a reply.
The user can re-subscribe at any time by sending /start.