Add gambling system cog with 6 commands for Discord bot#2
Conversation
Co-authored-by: Me-in-U <44316764+Me-in-U@users.noreply.github.com>
Co-authored-by: Me-in-U <44316764+Me-in-U@users.noreply.github.com>
/돈줘 기능을 사용할 수 있다. 해당 유저의 잔고에 돈을 10000원 추가한다.
2. 사용자는 다른 사용자에게 송금할수 있다. /송금 (대상유저선택) (돈입력)
3. 사용자는 /잔액 으로 보유 돈을 확인할 수 있다.
4. 배팅 기능 사용시 해당 유저의 배팅금액을 제거한 이후 도박 로직 실행 이후 결과만큼 잔고 업데이트
`/가위바위보 (가위 or 바위 or 보) (배...|
@copilot 추가된 도박 기능에 대해서 custom_help 작성 |
Co-authored-by: Me-in-U <44316764+Me-in-U@users.noreply.github.com>
|
@copilot README.md 업데이트 해주고 main에 merge 해줘 |
I don't have permissions to merge pull requests. You'll need to merge this PR yourself using GitHub's interface or the |
README.md was already updated in commit aaac8fb with all gambling system documentation. Regarding merging to main: I don't have permissions to merge pull requests - you'll need to merge this PR yourself using GitHub's interface or the |
There was a problem hiding this comment.
Pull Request Overview
This PR adds a comprehensive gambling system to the Discord bot with 6 commands that handle daily allowances, money transfers, and three different gambling games. The system uses per-guild JSON-based balance tracking to maintain isolated economies for each Discord server.
- Complete gambling cog with persistent balance management and Seoul timezone handling
- Money transfer system with comprehensive validation (no self-transfers, no bot transfers, sufficient balance checks)
- Three gambling games: rock-paper-scissors, random chance gambling, and instant lottery with specified probability distributions
Reviewed Changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| cogs/gambling.py | New gambling system implementation with 6 commands and JSON-based balance persistence |
| cogs/custom_help.py | Added "도박" category with all gambling commands to the help menu |
| README.md | Updated documentation to include gambling system features |
| .github/copilot-instructions.md | New file with repository architecture and development guidelines |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| if user_choice == bot_choice: | ||
| # 무승부 | ||
| result = "무승부" | ||
| prize = 배팅금액 // 2 |
There was a problem hiding this comment.
Using integer division (//) for the draw prize calculation will truncate the result. For odd betting amounts, the user loses money even on a draw. Use regular division and round appropriately, or ensure the result is at least half the original amount.
| # 당첨 확률 결정 (30% ~ 70%) | ||
| win_chance = random.randint(30, 70) |
There was a problem hiding this comment.
[nitpick] The win chance is randomly generated for each gambling attempt, making the game unpredictable for users. Consider using a fixed probability or clearly documenting that the win rate varies per game in the command description.
| # 당첨 확률 결정 (30% ~ 70%) | |
| win_chance = random.randint(30, 70) | |
| # 당첨 확률 결정 (고정 50%) | |
| win_chance = 50 |
…2-fc230942b529 Add gambling system cog with 6 commands for Discord bot
…2-fc230942b529 Add gambling system cog with 6 commands for Discord bot
🎰 Overview
Implements a complete gambling system for the Discord bot with per-guild balance tracking, daily allowances, money transfers, and three different gambling games.
✨ Features Implemented
Commands
/돈줘- Daily Allowance/잔액- Balance Check/송금 [유저] [금액]- Money Transfer/가위바위보 [선택] [배팅금액]- Rock-Paper-Scissors/도박 [배팅금액]- Random Gambling/즉석복권- Instant LotteryTechnical Implementation
gambling_balance.json📁 Files Changed
cogs/gambling.py(new): 407 lines implementing the complete gambling systemcogs/custom_help.py: Added "도박" category with all 6 gambling commands.gitignore: Addedgambling_balance.jsonto prevent committing user dataREADME.md: Updated documentation with gambling system commands🧪 Testing
All game logic has been tested and verified:
📋 Requirements Met
All requirements from the issue have been implemented:
/돈줘command with 10,000원 allowance/송금with proper validations/잔액Closes #[issue_number]
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.