Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Sep 22, 2025

This PR implements a new !call command that allows users to send direct messages to other users through the bot. The command supports both user mentions and direct user IDs for maximum flexibility.

Changes Made

New Command Implementation

  • Added !call command that accepts @user <message> or <userID> <message> format
  • Implements smart message parsing that filters out mention strings when using @user format
  • Sends DMs with contextual format: 📞 Съобщение от {sender} ({guild}):\n{message}

Error Handling & Validation

  • Validates user existence through Discord API
  • Handles users with disabled DMs gracefully
  • Validates numeric user IDs with regex pattern
  • Provides clear Bulgarian error messages for all failure cases

User Experience

  • Added command to help text in the public commands section
  • Success confirmation: "✅ Съобщението беше изпратено на {user} като DM"
  • Clear usage instructions: "ℹ️ Ползвай: !call @user съобщение или !call <userID> съобщение"

Bug Fixes

  • Fixed critical syntax error: Removed duplicate onNickChange function that was causing parse errors
  • Moved nickname cache initialization code to proper location in ready event handler
  • Ensured proper function structure and closing braces

Usage Examples

!call @username Hello, how are you?
!call 123456789012345678 This is a test message

The implementation follows existing codebase patterns, uses Bulgarian localization consistent with other commands, and includes comprehensive error handling for production use.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@Scorpions95 Scorpions95 marked this pull request as ready for review September 22, 2025 21:29
@Scorpions95 Scorpions95 merged commit 0b909a8 into main Sep 22, 2025
1 check passed
Copilot AI changed the title [WIP] Добави команда !call която да праща съобщение като DM чрез @user или ID Add !call command for sending DMs to users via mention or ID Sep 22, 2025
Copilot AI requested a review from Scorpions95 September 22, 2025 21:38
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.

2 participants