Recipe 15 — Build a Telegram bot using webhooks
Status: ⚠️ partial What ships Day-0:
/v1/payments/telegramwebhook (Telegram Stars only) What's deferred: full bot pattern (M6+)
The CryptoAI Gateway has a partial Telegram surface today: the M1-S3
payment-FSM listens on /v1/payments/telegram for Telegram Stars webhook
events with HMAC verification (seed CRYPTOAI_TELEGRAM_BOT_TOKEN). A full
bot pattern (read price quotes, execute swaps from a chat, subscribe to
strategy events) is part of the M6+ webhook gate (tz10-webhook-tiers).
Skeleton today (Telegram Stars payments only)
# Receive Telegram Stars webhook → forward to /v1/payments/telegram
# (HMAC over raw body verifies origin; SDK is not the consumer here —
# this is a server-to-server inbound webhook handler, not an SDK call.)
When the full bot pattern lands (M6+)
Recipe will cover:
- Subscribing the SDK to the user's strategy events
- Forwarding events into Telegram via Bot API outbound calls
- Two-way command parsing (e.g.
/quote 1 USDC USDT) - Authentication via Telegram-issued JWT exchange