Commit Graph

6 Commits

Author SHA1 Message Date
shokollm
dfaf633707 feat(/admin): add /admin command for admin management
- Add /admin remove @username - removes user from admin list
- Add /admin add @username - adds user to admin list (bonus)
- Add /admin list - lists all admins

Resolves #52
2026-04-04 07:01:40 +00:00
shokollm
67d801d9de refactor(telegram-bot): add /edit command and make bot.py minimal entrypoint
- Add cmd_edit as alias for cmd_update
- Update bot.py to import commands directly instead of via module
- Register /edit command in bot and post_init commands list
- Clean up unused imports in bot.py

Fixes #14
2026-04-03 14:27:01 +00:00
shokollm
5b1634ebca refactor(commands): use core services instead of storage module
Refactor commands.py to be thin Telegram wrappers around core services.

Changes:
- Replace 'import storage' with imports from core.services and adapters.storage
- Create module-level service instances (BountyService, TrackingService)
- Update format_bounty() to work with Bounty dataclass instead of dict
- Add get_room_id() helper for unified group/DM handling
- Each command handler is now a thin wrapper that:
  1. Extracts Telegram types (update, user_id, room_id)
  2. Calls appropriate core service
  3. Formats and sends response

Kept from original:
- parse_args()
- format_bounty()
- extract_args()

Commands now use services:
- cmd_bounty: BOUNTY_SERVICE.list_bounties()
- cmd_my: BOUNTY_SERVICE.list_bounties() or TRACKING_SERVICE.get_tracked_bounties()
- cmd_add: BOUNTY_SERVICE.add_bounty()
- cmd_update: BOUNTY_SERVICE.update_bounty()
- cmd_delete: BOUNTY_SERVICE.delete_bounty()
- cmd_track: TRACKING_SERVICE.track_bounty() (groups only)
- cmd_untrack: TRACKING_SERVICE.untrack_bounty() (groups only)

Fixes #13
2026-04-03 12:39:23 +00:00
shokollm
7c2bd09ada feat: implement new storage design per issue #2
- Storage: Change from per-user to per-group JSON files
- Data location: ~/.jigaido/ instead of apps/telegram-bot/data/
- Group bounties: data/{group_id}/group.json
- User tracking: data/{group_id}/{user_id}.json
- Personal bounties: data/{user_id}/user.json
- Update commands.py for new storage model
- Update bot.py to remove admin handlers
- Update tests to reflect created_by_user_id field
- Update SPEC.md with new design

Addresses user feedback from issue #2
2026-04-02 14:56:42 +00:00
shokollm
8bb964fdd0 feat: Replace SQLite with per-user JSON storage (fixes #2)
- Add storage.py with load_user(), save_user(), next_bounty_id()
- Rewrite commands.py to use JSON storage (simplified)
- Remove db.py, schema.sql, cron.py, test_db.py
- Update SPEC.md to reflect new architecture
- Admin model removed (anyone can add, creator only can edit/delete)
- No reminders in v1
2026-04-01 10:02:51 +00:00
shokollm
9f0ad2d404 Refactor to apps/ structure
JIGAIDO is now a platform with apps/ as the container.
All telegram-bot files moved to apps/telegram-bot/:
- bot.py, commands.py, cron.py, db.py, schema.sql
- requirements.txt, .env.example, README.md
- Root now holds SPEC.md, README.md, CONTRIBUTING.md only.

Structure:
jigaido/
├── apps/
│   └── telegram-bot/
└── SPEC.md, README.md, CONTRIBUTING.md
2026-04-01 08:05:10 +00:00