feat: implement /recover command and fix /admin list #83

Merged
shoko merged 1 commits from fix/issue-49-50-recover-admin-list into main 2026-04-04 16:42:07 +02:00
Owner

Summary

Implements /recover command for Telegram bot and fixes /admin list display to show @username instead of admin_id.

Changes

New Features

/recover Command (Issue #49)

  • /recover - List recoverable (soft-deleted) bounties, sorted by deletion time (admin only)
  • /recover <id> [<id>...] - Recover specific bounty(ies) by ID (admin only)

Example output for /recover:

Recoverable bounties:
[#1] Fix bug... | 🔗 https://example.com | 🗑️ Deleted 4 Apr 2026
[#3] Another bounty | 🗑️ Deleted 1 Apr 2026

Bug Fixes

/admin list (Issue #50)

  • Fixed to show @username instead of admin_id:{uid}
  • Now looks up usernames from bounty creator data

Example output:

Room Admins:
- @user1
- @user2

Files Changed

  • core/services.py - Added get_deleted_bounty, recover_bounty, recover_bounties methods
  • apps/telegram-bot/commands.py - Added cmd_recover, fixed cmd_admin list
  • apps/telegram-bot/bot.py - Added recover handler, updated command menu

Testing

  • All 97 tests pass
  • Manual testing in Telegram bot confirms functionality
## Summary Implements `/recover` command for Telegram bot and fixes `/admin list` display to show @username instead of admin_id. ## Changes ### New Features #### `/recover` Command (Issue #49) - `/recover` - List recoverable (soft-deleted) bounties, sorted by deletion time (admin only) - `/recover <id> [<id>...]` - Recover specific bounty(ies) by ID (admin only) Example output for `/recover`: ``` Recoverable bounties: [#1] Fix bug... | 🔗 https://example.com | 🗑️ Deleted 4 Apr 2026 [#3] Another bounty | 🗑️ Deleted 1 Apr 2026 ``` ### Bug Fixes #### `/admin list` (Issue #50) - Fixed to show `@username` instead of `admin_id:{uid}` - Now looks up usernames from bounty creator data Example output: ``` Room Admins: - @user1 - @user2 ``` ## Files Changed - `core/services.py` - Added `get_deleted_bounty`, `recover_bounty`, `recover_bounties` methods - `apps/telegram-bot/commands.py` - Added `cmd_recover`, fixed `cmd_admin` list - `apps/telegram-bot/bot.py` - Added recover handler, updated command menu ## Testing - All 97 tests pass - Manual testing in Telegram bot confirms functionality
shoko added 1 commit 2026-04-04 16:30:00 +02:00
- Add /recover command for listing and recovering soft-deleted bounties
  - /recover - list recoverable bounties (admin only)
  - /recover <id> [<id>...] - recover specific bounties (admin only)
- Fix /admin list to show @username instead of admin_id
- Add recover_bounty and recover_bounties methods to BountyService
- Add get_deleted_bounty method to BountyService
- Clean up duplicate cmd_admin functions
- Add /recover to bot command menu
- Fixes #49 and #50
han approved these changes 2026-04-04 16:40:35 +02:00
han left a comment
Collaborator

lgtm

lgtm
shoko merged commit 5502de96ad into main 2026-04-04 16:42:07 +02:00
Sign in to join this conversation.
No Reviewers
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: shoko/jigaido#83