Most "build a Telegram bot" tutorials stop at an echo bot. This one builds something you'd actually leave running: a bot that answers /price BTC ETH with live prices and pings you when a coin crosses a price you set.
No API keys (besides your bot token), no database, one file. Full code is below, MIT-licensed, copy it freely.
What we're building
/price BTC ETH SOL -> live price + 24h change /alert BTC above 70000 -> one-time alert /alerts -> list your alerts
Enter fullscreen mode
Exit fullscreen mode
Stack:
aiogram 3 : a modern async Telegram bot framework
httpx : async HTTP client
Binance public market data ( data-api.binance.vision ): free, no key needed for read-only market data
1. Get a bot token
Open Telegram, message @botfather , send /newbot , pick a name and a username ending in bot . BotFather replies with a token like 123456:ABC... . Treat it like a password.
2.β¦