Skip to content

VK Bot: Questions desk in pinned message - #299

Open
konard wants to merge 3 commits into
mainfrom
issue-106-4cca6719
Open

VK Bot: Questions desk in pinned message#299
konard wants to merge 3 commits into
mainfrom
issue-106-4cca6719

Conversation

@konard

@konard konard commented Sep 13, 2025

Copy link
Copy Markdown
Member

📋 Issue Reference

Fixes #106 - VK Bot: Questions desk in pinned message

✨ Features Implemented

Questions Desk System

This PR implements a comprehensive questions desk feature for the VK bot that allows users to:

  1. Submit Questions with karma rewards

    • Command: ask [question] [reward]
    • Optional karma reward that gets deducted from user's karma
    • Questions are stored persistently with metadata
  2. Resolve Questions and receive karma rewards

    • Command: resolve [ID]
    • Solver receives the karma reward
    • Question is marked as resolved
  3. View Questions Desk

    • Command: questions / вопросы / desk / доска
    • Shows all open questions sorted by reward amount
    • Displays question ID, text, author, and reward
  4. Automatic Pinned Message Management

    • Questions desk automatically pins/updates a message in chat
    • Shows top 10 questions with highest rewards
    • Updates automatically when questions are added/resolved

Implementation Details

  • Data Persistence: Questions stored in JSON files with full metadata
  • Karma Integration: Integrates with existing karma system
  • Multi-language Support: Commands work in both English and Russian
  • Error Handling: Comprehensive validation and error messages
  • Chat Filtering: Questions are chat-specific
  • Status Tracking: Questions have open/resolved status

Files Added/Modified

  • python/modules/questions_service.py - Core questions management service
  • python/patterns.py - Added regex patterns for new commands
  • python/modules/commands.py - Added question commands and VK integration
  • python/__main__.py - Added pinning methods and command registration
  • python/modules/commands_builder.py - Updated help messages
  • python/README.md - Added documentation section
  • python/tests.py - Added comprehensive test coverage

🧪 Testing

The implementation includes comprehensive tests covering:

  • Question submission and validation
  • Question resolution and karma distribution
  • Pinned message management
  • Regex pattern validation
  • Questions desk message generation

All core functionality has been tested and verified to work correctly.

📖 Documentation

Updated documentation includes:

  • Command reference in help messages
  • README section with usage examples
  • Code comments and docstrings
  • Command aliases for multilingual support

🚀 Usage Examples

# Submit a question with 10 karma reward
ask How to use Python decorators? 10

# Resolve question with ID 123
resolve 123

# View questions desk
questions

The pinned message automatically updates to show the most valuable questions, creating an incentive system for both asking good questions and providing helpful answers.


🤖 Generated with Claude Code

Adding CLAUDE.md with task information for AI processing.
This file will be removed when the task is complete.

Issue: #106
@konard konard self-assigned this Sep 13, 2025
This implementation adds a comprehensive questions desk system to the VK bot as requested in issue #106.

Features:
- Question submission with karma rewards using 'ask [question] [reward]'
- Question resolution with karma distribution using 'resolve [ID]'
- Automatic pinned message updates with top questions
- Questions sorted by karma reward amount
- Full documentation and help integration
- Comprehensive test coverage

The system allows users to:
1. Submit questions with optional karma rewards
2. Resolve questions and receive karma rewards
3. View the questions desk with 'questions' command
4. Automatically maintain a pinned message with top questions

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@konard konard changed the title [WIP] VK Bot: Questions desk in pinned message VK Bot: Questions desk in pinned message Sep 13, 2025
@konard
konard marked this pull request as ready for review September 13, 2025 04:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

VK Bot: Questions desk in pinned message

1 participant