Skip to main content

Discord Bot Library - UI & Image Manipulation for Making Games

Project description

Discord Bot Library - UI & Image Manipulation for Making Games Essentially just a wrapper over discord.py and Pillow to make life a little easier for image-based, and gameplay focused Discord bots. Provides:

  • Image creation with a UI system, and sprite management
  • Out-of-the-box persistent data management for players with extensibility to handle anything
  • Various utilities for testing, and debugging to assist in development

Table of Contents

  1. Installation
  2. Troubleshooting
  3. Getting Help

Installation

Installing CordForge

pip install cordforge

Or install from source:

git clone https://github.com/Robert-DeForrest-Reynolds/CordForge
cd CordForge
pip install -e .

Create Your Bot Token

First, create a Discord application and bot at Discord Developer Portal.

Set Up Your Project

Create a Keys file in your project directory: key_name~your_discord_bot_token_here

dev_name=OTk3MDA...

Basic Bot Setup

bot.py

from CordForge import *


# Initial send of dashboard, all other functions are replys/edits of the sent message
async def entry(user_card:Card) -> Card:
    await user_card.new_image()
    panel:Panel = await user_card.panel(border=True)
    await user_card.text("Hello", Vector2(5, 5), parent=panel)
    await user_card.add_button("Some other thing", some_other_card, [])


async def some_other_card(user_card:Card, interaction) -> None:
    await user_card.new_image()
    await user_card.add_button("Home", roc.home, [])
    await roc.reply(user_card, interaction)


bot = Cord(entry_command="cmd", entry=entry)
# any necessary setup, loading images into memory, data management, etc.
bot.launch()

Launch Bot

cordforge bot_file.py token-key

cordforge bot.py dev_name

Version Control

Ensure your Keys file is hidden, here is a recommend .gitignore for example:

__pycache__
.venv
Keys
Data

Getting Help

  • Look at the Examples for more complex use cases.
  • Review the API Reference for all available functionality.

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

cordforge-0.2.4.tar.gz (12.3 kB view details)

Uploaded Source

Built Distribution

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

cordforge-0.2.4-py3-none-any.whl (17.5 kB view details)

Uploaded Python 3

File details

Details for the file cordforge-0.2.4.tar.gz.

File metadata

  • Download URL: cordforge-0.2.4.tar.gz
  • Upload date:
  • Size: 12.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for cordforge-0.2.4.tar.gz
Algorithm Hash digest
SHA256 48e3893e9cb58c37ed398034e1ff8c04ab504881f5c30636ec162aee4d769a23
MD5 cf79c266ff9f7e16f5f50d70945887e1
BLAKE2b-256 229ea26ba867890006c16e7905a7b39b164066fec27d242f77e9afbd3fe82f6c

See more details on using hashes here.

File details

Details for the file cordforge-0.2.4-py3-none-any.whl.

File metadata

  • Download URL: cordforge-0.2.4-py3-none-any.whl
  • Upload date:
  • Size: 17.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for cordforge-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 b7ad29b1bc1c5ea9ccd578029b8e2c40d1f369a03b6a04aad6a14a7ba11dd183
MD5 6351016e750063dbdd3b064f1b60f34d
BLAKE2b-256 28ab9a01a486ae92e4fb8e50c16dcb23b11e3fc750f1ab096fe8ed6c260f03ad

See more details on using hashes here.

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