Skip to content

Conversation

Copy link

Copilot AI commented Jul 19, 2025

Adds a new /rps slash command that allows users to challenge each other to Rock Paper Scissors games, similar to the existing /duel command.

Features

  • Interactive Challenge System: /rps @user creates a challenge with Rock 🪨, Paper 📄, and Scissors ✂️ buttons
  • Real-time Status Updates: Embed updates to show when players make their choices
  • Choice Flexibility: Players can change their selection until both have decided
  • Complete Results Display: Shows both players' choices with emojis and declares the winner
  • Automatic Timeout: Games expire after 5 minutes with proper cleanup
  • Validation: Prevents self-challenges, bot challenges, and duplicate games between users

Implementation Details

The implementation follows the existing duel command pattern in UserSlashModule.cs:

  • Uses ConcurrentDictionary for thread-safe game state management
  • Implements proper Discord interaction patterns with button components
  • Includes comprehensive error handling and validation
  • Maintains consistency with existing bot architecture

Game Flow

  1. User runs /rps @opponent to create a challenge
  2. Interactive embed displays with three choice buttons
  3. Both players can click buttons to make/change their choices
  4. Embed updates to show when someone has decided
  5. Once both choose, results are displayed with winner determination
  6. Games automatically expire after 5 minutes if incomplete

Code Quality

  • 264 lines added, 0 deleted - Pure addition with no breaking changes
  • All existing functionality preserved
  • Follows established patterns and coding conventions
  • Comprehensive input validation and error handling

Fixes #337.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

@deepsource-io
Copy link

deepsource-io bot commented Jul 19, 2025

Here's the code health analysis summary for commits cff4d0d..b6e5976. View details on DeepSource ↗.

Analysis Summary

AnalyzerStatusSummaryLink
DeepSource C# LogoC#❌ Failure
❗ 2 occurences introduced
View Check ↗

💡 If you’re a repository administrator, you can configure the quality gates from the settings.

@github-actions
Copy link

🚀 Deploy this PR to an environment

You can deploy this PR to either development or staging environment:

  • Comment /deploy_dev to deploy to the development environment

Alternatively, you can:

  1. Go to Actions tab
  2. Click on "Manual Deploy to Firebase" workflow
  3. Click the "Run workflow" button
  4. Select branch: copilot/fix-337
  5. Choose environment: DEV
  6. Enter a deployment message
  7. Click "Run workflow"

Co-authored-by: Pierre-Demessence <1756398+Pierre-Demessence@users.noreply.github.com>
Copilot AI changed the title [WIP] Rock Paper Scissors Implement Rock Paper Scissors command for Discord bot Jul 19, 2025
Copilot AI requested a review from Pierre-Demessence July 19, 2025 18:21
@Pierre-Demessence
Copy link
Member

/deploy_dev

@github-actions
Copy link

🚀 Starting deployment of Unity-Developer-Community/UDC-Bot:copilot/fix-337 to development...

@Pierre-Demessence
Copy link
Member

/deploy_dev

@github-actions
Copy link

🚀 Starting deployment of Unity-Developer-Community/UDC-Bot:copilot/fix-337 to development...

@Pierre-Demessence
Copy link
Member

/deploy_dev

@github-actions
Copy link

🚀 Starting deployment of Unity-Developer-Community/UDC-Bot:copilot/fix-337 to development...

@Pierre-Demessence
Copy link
Member

/deploy_dev

@github-actions
Copy link

🚀 Starting deployment of Unity-Developer-Community/UDC-Bot:copilot/fix-337 to development...

@Pierre-Demessence
Copy link
Member

/deploy_dev

@Pierre-Demessence Pierre-Demessence marked this pull request as ready for review July 19, 2025 18:48
Copilot AI review requested due to automatic review settings July 19, 2025 18:48
@github-actions
Copy link

🚀 Starting deployment of Unity-Developer-Community/UDC-Bot:copilot/fix-337 to development...

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Implements a new /rps slash command that allows Discord users to challenge each other to interactive Rock Paper Scissors games with real-time status updates and automatic timeout handling.

  • Adds complete Rock Paper Scissors game system with challenge creation, choice handling, and result determination
  • Implements thread-safe game state management using ConcurrentDictionary and Discord button interactions
  • Includes comprehensive validation, error handling, and automatic 5-minute game expiration

@Pierre-Demessence Pierre-Demessence merged commit 2c438a1 into master Jul 19, 2025
7 of 8 checks passed
@Pierre-Demessence Pierre-Demessence deleted the copilot/fix-337 branch July 19, 2025 18:50
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.

Rock Paper Scissors

2 participants