How go-telegram-bot-api/telegram-bot-api works
This repository is a Go client library wrapping Telegram’s Bot API, not a bot framework: applications construct typed requests, fetch updates by polling or webhook, and send API responses. The central transport and request dispatch live in bot.go; configs.go encodes endpoint-specific requests, helpers.go supplies constructors, and types.go plus passport.go define API payloads. The README documents broad API coverage and both polling and webhook workflows. Unsampled portions prevent mapping individual endpoint families or asserting additional internal call relationships.
Main entry points: bot.go Bot client · configs.go Request configurations · helpers.go Request constructors · types.go API data types
Components 10
Client runtime
- Bot client
bot.go
Requests and models
- Request configurations
configs.go - Request constructors
helpers.go - Parameter encoding
params.go - API data types
types.go - Passport types
passport.go
Update delivery
- Long polling
bot.go - Webhook handling
bot.go
Other components
- Bot application
- Telegram Bot API
Connections 15
- Bot application → Request constructors: constructs requests
README.md - Bot application → Bot client: uses client
README.md - Request constructors → Request configurations: creates configs
helpers.go - Request configurations → Parameter encoding: encodes parameters
configs.go - Bot application → Request configurations: supplies API configs
README.md - Bot client → Parameter encoding: serializes requests
bot.go - Bot client → Telegram Bot API: sends API requests
README.md - Telegram Bot API → Bot client: returns responses
bot.go - Telegram Bot API → Long polling: provides updates
README.md - Long polling → Bot client: fetches updates
bot.go - Telegram Bot API → Webhook handling: delivers updates
README.md - Webhook handling → Bot application: yields updates
README.md - Bot application → Bot client: sends replies
README.md - API data types → Bot client: models payloads
- Passport types → API data types: extends API models