A Discord bot that lets users play a strategic pickleball game by choosing different shots to outmaneuver their opponents.
- Challenge other players to matches
- Five different shot types with rock-paper-scissors style interactions
- Score tracking and game status monitoring
- Private shot selection through DMs
- Automatic round resolution and scoring
- Match status tracking and forfeit options
Each shot type has specific advantages over others:
-
Drive
- Beats: Dink, Drop
- Countered by: Lob, Smash
-
Lob
- Beats: Drive, Drop
- Countered by: Dink, Smash
-
Dink
- Beats: Drop, Lob
- Countered by: Drive, Smash
-
Drop
- Beats: Drive, Smash
- Countered by: Dink, Lob
-
Smash
- Beats: Dink, Lob
- Countered by: Drop
- Clone this repository
- Install required dependencies:
pip install discord.py python-dotenv- Create a
.envfile in the project root with your Discord bot token:
DISCORD_TOKEN=your_token_here
- Run the bot:
python bot.py!pb-challenge @player- Challenge another player to a match!pb-accept- Accept a pending challenge!pb-shot <shot>- Make your shot (use in DMs with the bot)!pb-status- Check the current match status!pb-forfeit- Forfeit the current match!pb-rules- Display game rules and valid commands
- First player to 11 points wins
- Must win by 2 points
- Points are awarded by winning rounds
- Rounds are won by choosing a shot that beats your opponent's shot
- Tied rounds result in no points awarded
- Shots must be made privately through DMs with the bot
The bot uses:
discord.pyfor Discord integration- Environment variables for secure token storage
- Dictionary-based shot relationship system
- Match state tracking through memory storage
Matches are stored in a dictionary with the following structure:
{
"players": [player1_id, player2_id],
"shots": {player1_id: shot, player2_id: shot},
"score": {player1_id: score, player2_id: score},
"current_player": player_id,
"winner": winner_id,
"started_at": timestamp,
"round": round_number,
"status": "pending|active|completed"
}