Skip to main content

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 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:

  1. Import and create the game class
  2. Call await game.start(ctx) with any optional arguments

See the full examples file for more.

License

MIT

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

discord_games-1.12.2.tar.gz (8.7 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

discord_games-1.12.2-py3-none-any.whl (8.8 MB view details)

Uploaded Python 3

File details

Details for the file discord_games-1.12.2.tar.gz.

File metadata

  • Download URL: discord_games-1.12.2.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

Hashes for discord_games-1.12.2.tar.gz
Algorithm Hash digest
SHA256 a9a840fa3f0ffa3b0e548f42591b0854677dcf86f99836bce46ea11fd8b4ce15
MD5 d8137d9a887e1968aef28071b47c98be
BLAKE2b-256 5236631f4e98e7952e99c37c10c20027b60ad674f7d81fdaca301b1c522557a2

See more details on using hashes here.

Provenance

The following attestation bundles were made for discord_games-1.12.2.tar.gz:

Publisher: publish.yml on Tom-the-Bomb/Discord-Games

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file discord_games-1.12.2-py3-none-any.whl.

File metadata

  • Download URL: discord_games-1.12.2-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

Hashes for discord_games-1.12.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8e58e4dcc4deeb54d553e8d5cae0c027d688a94fada0d994f7801f9b19222e9d
MD5 aa4cc948419049587f7f0d4838724a81
BLAKE2b-256 38a31744a9a2a909bbb1ccc55f9edf330a516e686a224c1db53460fcaa41f350

See more details on using hashes here.

Provenance

The following attestation bundles were made for discord_games-1.12.2-py3-none-any.whl:

Publisher: publish.yml on Tom-the-Bomb/Discord-Games

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page