How kimheng-sok/telegram_bots works
This is a bilingual Telegram bot for creating football matches, collecting availability, and managing match announcements in group chats. The main workflow is: a group user submits /newmatch, the wizard parses and previews the form, saves the match, and posts a pinned card; users then vote through commands or inline buttons, updating the card. Administrators can close or reopen voting, while group-language settings and help are separate capabilities. utils.py provides parsing, rendering, and Telegram-message helpers. The excerpts show handler registration and database operations; external database configuration supports multiple engines, but deployment-specific wiring is not mapped.
Main entry points: main.py Bot entrypoint · database.py Match and vote data · match_wizard.py Match wizard · voting.py Voting and controls
Components 10
Bot runtime
- Bot entrypoint
main.py
Group workflows
- Match wizard
handlers/match_wizard.py - Voting and controls
handlers/voting.py - Help and language
handlers/general.py
Language and presentation
- Form and card helpers
utils.py - English and Khmer
strings.py
Configuration and data
- Bot configuration
config.py - Match and vote data
database.py
Other components
- Group users
- Telegram API
Connections 22
- Group users → Telegram API: send updates
README.md - Telegram API → Bot entrypoint: poll updates
main.py - Bot entrypoint → Bot configuration: loads token
main.py - Bot entrypoint → Match and vote data: initializes
main.py - Bot entrypoint → Match wizard: registers wizard
main.py - Bot entrypoint → Voting and controls: registers commands
main.py - Bot entrypoint → Help and language: registers commands
main.py - Match wizard → Form and card helpers: parses and renders
handlers/match_wizard.py - Match wizard → Match and vote data: creates match
handlers/match_wizard.py - Match wizard → English and Khmer: formats prompts
handlers/match_wizard.py - Match wizard → Telegram API: posts and pins
handlers/match_wizard.py - Voting and controls → Match and vote data: records votes
handlers/voting.py - Voting and controls → Form and card helpers: refreshes card
handlers/voting.py - Voting and controls → English and Khmer: formats replies
handlers/voting.py - Voting and controls → Telegram API: updates match card
handlers/voting.py - Help and language → Match and vote data: reads and sets language
handlers/general.py - Help and language → Form and card helpers: checks and cleans
handlers/general.py - Help and language → English and Khmer: formats replies
handlers/general.py - Help and language → Telegram API: sends menus
handlers/general.py - Form and card helpers → Match and vote data: loads match and votes
utils.py - Form and card helpers → English and Khmer: renders labels
utils.py - Match and vote data → Bot configuration: reads database settings
database.py