Telegram bot to tracks and logs your submissions from Codeforces and LeetCode.
  • Python 98.6%
  • Shell 1%
  • Dockerfile 0.4%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-08-31 23:12:44 +05:30
.github/workflows chore: add dev dependency group, pytest/ruff config and CI workflow 2026-08-31 22:45:17 +05:30
assets fix(assets): vendor fonts and logo under assets/, keep data/ runtime-only 2026-08-31 22:45:50 +05:30
chronos chore: standardize logging on module-level loggers 2026-08-31 22:46:48 +05:30
tests test: isolate settings mutations with mocker.patch.object 2026-08-31 22:46:04 +05:30
.dockerignore fix(docker): stop ignoring uv.lock so frozen sync works in build 2026-08-31 23:12:44 +05:30
.env.example chore: drop unused dependencies and dead config 2026-08-31 22:43:23 +05:30
.gitignore chore: add pillow dependency and configuration settings 2026-06-04 20:20:12 +05:30
.python-version cf 2025-06-07 22:50:53 +05:30
deploy.sh chore(deploy): parameterize deploy script and build before stopping 2026-08-31 22:47:37 +05:30
Dockerfile build(docker): run on Python 3.12 and install deps with uv 2026-08-31 22:42:44 +05:30
pyproject.toml chore: add dev dependency group, pytest/ruff config and CI workflow 2026-08-31 22:45:17 +05:30
README.md docs: refresh README project structure and add development guide 2026-08-31 22:47:16 +05:30
uv.lock chore: add dev dependency group, pytest/ruff config and CI workflow 2026-08-31 22:45:17 +05:30

Chronos

Telegram bot to monitor and log solved problems on LeetCode and Codeforces. It formats solved problems as clean image cards and broadcasts them to a configured Telegram channel. Additionally, the bot supports private chat commands for querying personal statistics and configuring daily, weekly, or monthly coding targets.


Project Structure

.
├── .dockerignore
├── .env.example
├── .github/
│   └── workflows/
│       └── ci.yml
├── assets/                  # Static preview assets + vendored fonts/logos
│   ├── fonts/
│   ├── solve_codeforces.png
│   ├── solve_leetcode.png
│   └── summary_daily.png
├── chronos/
│   ├── bot/
│   │   ├── handlers.py      # Commands, summaries, image orchestration
│   │   ├── image_generator.py
│   │   └── messaging.py
│   ├── config/
│   │   ├── constants.py
│   │   └── settings.py
│   ├── data/
│   │   ├── database.py      # SQLAlchemy ORM service + wrappers
│   │   ├── models.py
│   │   └── state_manager.py
│   ├── integrations/
│   │   ├── codeforces.py
│   │   └── leetcode.py
│   └── main.py
├── Dockerfile
├── deploy.sh
├── pyproject.toml
└── tests/
    ├── conftest.py
    ├── test_database.py
    ├── test_image_generator.py
    ├── test_integrations.py
    ├── test_owner_restriction.py
    ├── test_settings.py
    └── test_stats_handlers.py

The data/ directory is runtime-only (SQLite database and any downloaded asset fallbacks) and is excluded from the Docker build context.


Development

uv sync                 # install runtime + dev dependencies from uv.lock
uv run pytest -q        # run the test suite
uv run ruff check .     # lint

Image Cards Preview

When SEND_AS_IMAGE=True is enabled in the configuration, the bot generates and posts image cards to the Telegram channel instead of standard text messages.

Solve Cards

LeetCode Solve Card Codeforces Solve Card
LeetCode Solve Codeforces Solve

Summary Cards

Daily / Weekly / Monthly Progress Summary
Summary Card

Available Bot Commands

All commands must be executed in a private chat with the bot.

Command Usage Description
/help /help Lists all available bot commands and their usages.
/ping /ping Verifies bot latency and returns connection response.
/stats /stats Retrieves coding statistics and target progress for the current day.
/wstats /wstats Retrieves coding statistics and target progress for the current week (MondaySunday).
/mstats /mstats Retrieves coding statistics and target progress for the current month.
/pstats /pstats Retrieves coding statistics for the previous day.
/pwstats /pwstats Retrieves coding statistics for the previous week.
/dset /dset <easy> <medium> <hard> Configures daily LeetCode targets (e.g., /dset 2 1 0 for 2 Easy, 1 Medium, 0 Hard).
/wset /wset <easy> <medium> <hard> Configures weekly LeetCode targets (e.g., /wset 10 5 1 for 10 Easy, 5 Medium, 1 Hard).
/mset /mset <easy> <medium> <hard> Configures monthly LeetCode targets (e.g., /mset 40 20 5 for 40 Easy, 20 Medium, 5 Hard).

Configuration

Refer to the .env.example file for details on setting up scraper credentials and configuring bot features, including SEND_AS_IMAGE.