How mofeed63/stratz-telegram-bot works
This is an asynchronous Telegram bot for retrieving and presenting Dota 2 player statistics. A user selects or supplies a Steam profile; the bot resolves it to an account ID, requests player data from STRATZ, and formats the selected category for Telegram. It also provides saved account slots, inline topic navigation, and a documented alternate parser for Cloudflare-blocked connections. The graph follows the sampled calls; the alternate parser’s use is documented but its wiring is not shown in the excerpts.
Main entry points: main.py Bot handlers and topics · steam_id.py Steam ID resolver · parser.py STRATZ GraphQL parser · formatters.py Stats formatter
Components 11
Telegram interaction
- Bot handlers and topics
main.py - Telegram Bot API
Account management
- Steam ID resolver
steam_id.py - Saved account slots
database.py - Steam Community
Statistics retrieval
- STRATZ GraphQL parser
parser.py - Cloudflare alternate parser
parser_server.py - Stats formatter
formatters.py - Hero and rank constants
constants.py - STRATZ GraphQL API
Other components
- Telegram user
Connections 10
- Telegram user → Bot handlers and topics: sends commands
main.py - Bot handlers and topics → Telegram Bot API: replies and edits
main.py - Bot handlers and topics → Saved account slots: reads slots
main.py - Bot handlers and topics → Steam ID resolver: resolves profile
main.py - Steam ID resolver → Steam Community: fetches profile XML
steam_id.py - Bot handlers and topics → STRATZ GraphQL parser: requests player data
main.py - STRATZ GraphQL parser → STRATZ GraphQL API: posts GraphQL query
parser.py - Bot handlers and topics → Stats formatter: formats selected topic
main.py - Stats formatter → Hero and rank constants: looks up labels
formatters.py - Bot handlers and topics → Cloudflare alternate parser: uses if blocked
README.md