Files
jigaido/apps/telegram-bot
shokollm 7957947a04 Add tests + fix db.py SQLite commit pattern
Tests:
- tests/test_commands.py: parse_args, extract_args, format_bounty
- tests/test_db.py: full CRUD + tracking + reminders
- tests/conftest.py: temp DB fixture
- requirements-dev.txt: pytest + pytest-asyncio

db.py fixes:
- Explicit conn.commit() after every write (SQLite row_factory
  disables implicit transaction management)
- fetchone() before commit() (can't commit while cursor open)
- Functions return dict instead of sqlite3.Row
2026-04-01 08:41:44 +00:00
..
2026-04-01 08:05:10 +00:00
2026-04-01 08:05:10 +00:00
2026-04-01 08:05:10 +00:00
2026-04-01 08:05:10 +00:00
2026-04-01 08:05:10 +00:00
2026-04-01 08:05:10 +00:00
2026-04-01 08:05:10 +00:00
2026-04-01 08:05:10 +00:00

Telegram Bot

A Telegram bot for managing and tracking bounties in groups and DMs.

Setup

cd apps/telegram-bot
cp .env.example .env
# Edit .env and add your bot token
pip install -r requirements.txt

Run

python bot.py

Reminders

Schedule a daily cron job:

# crontab -e
0 9 * * * cd /path/to/jigaido/apps/telegram-bot && JIGAIDO_BOT_TOKEN="..." python cron.py

Commands

Command Where Who Description
/bounty Group / DM Anyone List all bounties
/my Group / DM Anyone List your tracked bounties
/add <text> [link] [due> Group Admin Add bounty
/add <text> [link] [due> DM Anyone Add personal bounty
/update <id> [text] [link] [due> Group Admin Update bounty
/delete <id> Group Admin Delete bounty
/track <id> Group / DM Anyone Track a bounty
/untrack <id> Group / DM Anyone Stop tracking
/admin_add <user> Group Creator Promote to admin
/admin_remove <user> Group Creator Demote admin
/start Group / DM Anyone Re-initialize
/help Anywhere Anyone Show help