A library to help users easily implement games within their discord bot
Project description
Discord-Games
A library for easily adding games to your discord.py bot.
Installation
From PyPI:
pip install discord-games
Or from GitHub for the latest changes:
pip install git+https://github.com/Tom-the-Bomb/Discord-Games.git
Requires Python 3.9+ and discord.py 1.7+ (button-based games require 2.0+).
Available Games
Reaction-based
These use message reactions for input.
| Game | Class |
|---|---|
| Tic-Tac-Toe | Tictactoe |
| Connect Four | ConnectFour |
| Rock-Paper-Scissors | RockPaperScissors |
| Chess | Chess |
| Battleship | BattleShip |
| Hangman | Hangman |
| Akinator | Akinator |
| 2048 | Twenty48 |
| Wordle | Wordle |
| Type Racer | TypeRacer |
| Country Guesser | CountryGuesser |
| Reaction Test | ReactionGame |
Button-based
These use discord UI components (buttons/modals). Available under discord_games.button_games.
| Game | Class |
|---|---|
| Tic-Tac-Toe | BetaTictactoe |
| Connect Four | BetaConnectFour |
| Rock-Paper-Scissors | BetaRockPaperScissors |
| Chess | BetaChess |
| Battleship | BetaBattleShip |
| Hangman | BetaHangman |
| Akinator | BetaAkinator |
| 2048 | BetaTwenty48 |
| Wordle | BetaWordle |
| Country Guesser | BetaCountryGuesser |
| Reaction Test | BetaReactionGame |
| Memory Game | MemoryGame |
| Number Slider | NumberSlider |
| Lights Out | LightsOut |
| Boggle | Boggle |
| Chimp Test | ChimpTest |
| Verbal Memory | VerbalMemory |
| Number Memory | NumberMemory |
Quick Start
import discord
from discord.ext import commands
from discord_games import button_games
intents = discord.Intents.default()
intents.message_content = True
bot = commands.Bot(command_prefix="!", intents=intents)
@bot.command()
async def wordle(ctx):
game = button_games.BetaWordle()
await game.start(ctx)
@bot.command()
async def tictactoe(ctx, member: discord.Member):
game = button_games.BetaTictactoe(cross=ctx.author, circle=member)
await game.start(ctx)
Every game follows the same pattern:
- Import and create the game class
- Call
await game.start(ctx)with any optional arguments
See the full examples file for more.
License
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file discord_games-1.12.6.tar.gz.
File metadata
- Download URL: discord_games-1.12.6.tar.gz
- Upload date:
- Size: 8.7 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5615a8494aabe63dcfa8e8b39587572bc5500cf9d0d7ebb85b75ba4ba4fe8c3f
|
|
| MD5 |
2b8496c3a4951bd9019502ceb650b895
|
|
| BLAKE2b-256 |
a19d098b076f2a7208e0412bbb95c148d88ded738eeb2e3528654c4503dee2f1
|
Provenance
The following attestation bundles were made for discord_games-1.12.6.tar.gz:
Publisher:
publish.yml on Tom-the-Bomb/Discord-Games
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
discord_games-1.12.6.tar.gz -
Subject digest:
5615a8494aabe63dcfa8e8b39587572bc5500cf9d0d7ebb85b75ba4ba4fe8c3f - Sigstore transparency entry: 1093484977
- Sigstore integration time:
-
Permalink:
Tom-the-Bomb/Discord-Games@e74dc3d4d93f8122db5f8a0f5ae425d8680c68b3 -
Branch / Tag:
refs/tags/v1.12.6 - Owner: https://github.com/Tom-the-Bomb
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e74dc3d4d93f8122db5f8a0f5ae425d8680c68b3 -
Trigger Event:
release
-
Statement type:
File details
Details for the file discord_games-1.12.6-py3-none-any.whl.
File metadata
- Download URL: discord_games-1.12.6-py3-none-any.whl
- Upload date:
- Size: 8.8 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e460de2c12c77f47c0b05f2738b4b4e47f75742158d9aecd0b0ea7a64932ac94
|
|
| MD5 |
d5e0aae3cc63ce8935375634d10a1c72
|
|
| BLAKE2b-256 |
c4b1a1b95420a616d4ba5ea195b9285d9d86ca1ed49a81c5f653805dc653b1da
|
Provenance
The following attestation bundles were made for discord_games-1.12.6-py3-none-any.whl:
Publisher:
publish.yml on Tom-the-Bomb/Discord-Games
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
discord_games-1.12.6-py3-none-any.whl -
Subject digest:
e460de2c12c77f47c0b05f2738b4b4e47f75742158d9aecd0b0ea7a64932ac94 - Sigstore transparency entry: 1093484981
- Sigstore integration time:
-
Permalink:
Tom-the-Bomb/Discord-Games@e74dc3d4d93f8122db5f8a0f5ae425d8680c68b3 -
Branch / Tag:
refs/tags/v1.12.6 - Owner: https://github.com/Tom-the-Bomb
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e74dc3d4d93f8122db5f8a0f5ae425d8680c68b3 -
Trigger Event:
release
-
Statement type: