Skip to content

Add copy languages command functionality - #305

Open
konard wants to merge 3 commits into
mainfrom
issue-95-c9e51a50
Open

Add copy languages command functionality#305
konard wants to merge 3 commits into
mainfrom
issue-95-c9e51a50

Conversation

@konard

@konard konard commented Sep 13, 2025

Copy link
Copy Markdown
Member

🎯 Summary

This PR implements the ability to copy programming languages from another user's profile using a command, as requested in issue #95.

📋 Issue Reference

Fixes #95

✨ Features Added

  • New Command: copy languages / копировать языки
  • Functionality: Copy all programming languages from another user's profile to your own profile
  • Usage: Send the command as a reply to or forward a message from the user whose languages you want to copy
  • Smart Merging: Only adds new languages that you don't already have
  • User Feedback: Informative messages about successful copies, duplicates, and edge cases

🔧 Implementation Details

  1. Pattern Matching: Added COPY_LANGUAGES regex pattern supporting both English and Russian commands
  2. Command Logic: Implemented copy_languages() method in Commands class with comprehensive error handling
  3. Documentation: Updated README.md with command description and Russian alias
  4. Registration: Integrated the new command into the main bot command registry

🛡️ Edge Case Handling

  • ✅ No forwarded message: Prompts user to forward a message
  • ✅ Self-copy attempt: Rejects and prompts for different user
  • ✅ Source user has no languages: Informs user appropriately
  • ✅ All languages already exist: Notifies user of no new additions
  • ✅ Partial overlap: Reports only new languages added

🎮 Usage Examples

# English command
copy languages
(reply to or forward someone's message)

# Russian command  
копировать языки
(reply to or forward someone's message)

📝 Testing

  • ✅ Regex pattern validation for both English and Russian commands
  • ✅ Syntax validation for all modified Python files
  • ✅ Import verification for new patterns and methods
  • ✅ Edge case logic verification

🤖 Generated with Claude Code

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

Issue: #95
@konard konard self-assigned this Sep 13, 2025
- Add COPY_LANGUAGES regex pattern for 'copy languages' and 'копировать языки' commands
- Implement copy_languages method in Commands class to copy programming languages from forwarded message user
- Register the new command in main bot file
- Update README.md with command documentation and Russian alias
- Command requires forwarded message to select source user
- Handles edge cases: no forwarded message, self-copy attempts, source user without languages
- Provides user feedback on successful copies and already-existing languages

Fixes #95

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

Co-Authored-By: Claude <noreply@anthropic.com>
@konard konard changed the title [WIP] Copy languages from another user's profile Add copy languages command functionality Sep 13, 2025
@konard
konard marked this pull request as ready for review September 13, 2025 09:51
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.

1 participant