Commit Graph

5 Commits

Author SHA1 Message Date
5acad376b0 Remove obsolete manage command and related modules
- Deleted `manage.py` and related classes
- Removed unused `PendingManageAction` and repository calls
- Updated references to obsolete manage features in tests:
  - Deleted `test_statistics.py`
  - Deleted `test_cron.py`
  - Deleted `test_kurigram_compat.py`
- Cleaned up outdated functionality for managing questions, schedules, and statistics via `/manage`.
2026-04-05 18:44:10 +02:00
6c6ef263be Fix poll handler for kurigram compatibility
Changes:
- Replace PollAnswerHandler with RawUpdateHandler
- Handle UpdateMessagePollVote instead of PollAnswer
- Parse options as Vector<bytes> per Telegram API spec
- Extract user_id from PeerUser properly
- Add test_kurigram_compat.py for validation
- Update STATISTICS_GUIDE.md with correct handler info

Fixes ImportError with kurigram's handler structure.
Now compatible with Telegram MTProto API Layer 222.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-05 12:33:52 +02:00
ab8e129277 Implement automatic poll answer statistics tracking
Features:
- Add poll_mappings table to link Telegram poll_id with question_id
- Add PollStatisticsHandler to automatically record user votes
- Implement save_poll_mapping, get_question_id_by_poll methods
- Implement get_answer_id_by_option_index for answer lookup
- Update scheduler to save poll mappings on publish
- Add comprehensive test suite (test_statistics.py)
- Add STATISTICS_GUIDE.md with detailed documentation
- Update README.md with statistics features

Statistics features:
✅ Automatic vote counting for each answer option
✅ Percentage distribution display
✅ Anonymous tracking (no user data stored)
✅ View statistics via /manage → 📊 Statistics
✅ Support for multiple poll publications per question

All tests passing successfully!

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-05 12:27:45 +02:00
25380e7c1f Add schedule examples and cron testing utility
- Add SCHEDULE_EXAMPLES.md with ready-to-use schedule templates
- Add test_cron.py utility for testing cron expressions
- Include examples for daily, weekly, interval-based schedules
- Add timezone conversion examples
- Add testing recommendations

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-05 12:19:50 +02:00
b7c1905671 Add scheduler system with cron support
- Implement QuestionPublisherScheduler with full cron expression parser
- Add schedule management in /manage command (add, edit, delete)
- Create schedules and schedule_runs tables in database
- Add delete_schedule method to repository
- Create comprehensive SCHEDULER_GUIDE.md with examples
- Add README.md with project overview
- Support for active/inactive schedules
- Automatic question publishing based on cron schedules
- Protection against duplicate runs in the same minute

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-05 12:18:08 +02:00