Skip to content

Conversation

Copilot
Copy link

@Copilot Copilot AI commented Jul 31, 2025

This PR implements a comprehensive casino shop system where users can spend their tokens on various items. The shop provides a clean Discord interface for browsing and purchasing items, with full transaction tracking and integration with the existing casino system.

Key Features

Shop Interface

  • New /casino shop slash command displays an ephemeral embed with all available items
  • Shows user's current token balance and item descriptions with prices
  • Uses dropdown selection for purchasing (better UX than buttons for multiple items)
  • Items already purchased are displayed as struck-through with ✅ OWNED status
  • Items are automatically removed from the dropdown once purchased

Default Shop Items

  • Auto Daily Tokens - 20,000 tokens (placeholder for future auto-daily functionality)
  • Badge: Casino Lover - 1,000 tokens
  • Badge: High Roller - 10,000 tokens
  • Badge: Token Master - 100,000 tokens
  • Badge: Millionaire - 1,000,000 tokens

Transaction System

  • New TransactionType.Shop for tracking token expenditures
  • All purchases are logged in the transaction history with item details
  • Shop purchases appear in /casino tokens history as "Bought [Item Name]"
  • Proper token balance validation prevents overspending
  • Duplicate purchase prevention - users can't buy items they already own

Database Schema

  • Two new tables: shop_items and shop_purchases
  • Foreign key relationships ensure data integrity
  • Automatic table creation for both new installations and existing deployments
  • Shop purchases are properly cleared during /casino reset

Error Handling

  • Comprehensive validation for insufficient funds, invalid items, and duplicate purchases
  • User-friendly error messages with clear explanations
  • Full exception logging for debugging
  • Graceful fallbacks for edge cases

The implementation follows existing code patterns and maintains backward compatibility while extending the casino system with this new functionality.

Fixes #358.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits July 31, 2025 03:05
…lity

Co-authored-by: Pierre-Demessence <1756398+Pierre-Demessence@users.noreply.github.com>
Co-authored-by: Pierre-Demessence <1756398+Pierre-Demessence@users.noreply.github.com>
@Copilot Copilot AI changed the title [WIP] Shop for tokens Implement casino shop feature for token purchases Jul 31, 2025
@Copilot Copilot AI requested a review from Pierre-Demessence July 31, 2025 03:08
Copilot finished work on behalf of Pierre-Demessence July 31, 2025 03:08
@Pierre-Demessence
Copy link
Member

/deploy_dev

Copy link

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

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.

Shop for tokens
2 participants