Skip to main content

Discord Bot Library - UI & Image Manipulation for Making Games

Project description

Discord Bot Library - UI & Image Manipulation for Making Games

Requires discord.py & Pillow

Will be a Python package on first full-release

Table of Contents

  1. Installation
  2. Troubleshooting
  3. Getting Help

Installation

Prerequisites

  • Python 3.13 or higher
  • Discord Bot Token
  • Discord.py 2.6.0 or higher
  • Pillow 10.0.0 or higher

Installing CordForge

currently unsupported

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

stuart~OTk3MDA...

Basic Bot Setup

bot.py

from CordForge import Cord

async def main_menu():
    """Your main dashboard function"""
    await Bot.New_Image()
    await Bot.Add_Button("Click Me!", button_callback, [])
    # Add more UI elements here

async def button_callback(interaction):
    """Handle button clicks"""
    await Bot.Reply(interaction)

# Create and start your bot
Bot = Cord("mybot", main_menu)
Bot.Start()

Launch Bot

cordforge bot_file.py token-key

cordforge bot.py mybot

Next Steps

Now that you have a basic bot running, here are some ideas to expand it:

  1. Add more screens - Create different sections for your bot
  2. Use containers - Organize your UI with containers and borders
  3. Add images - Use ListItem with images for richer content
  4. Create games - Build simple games like tic-tac-toe or number guessing
  5. Add persistence - Save user data to files or databases

Version Control

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

__pycache__
.venv
Keys
Data

Troubleshooting

Bot doesn't respond

  • Check that your bot token is correct in the Keys file
  • Make sure your bot is invited to the server with proper permissions
  • Verify the bot is online (check the console output)

Images don't appear

  • Always call await Bot.New_Image() before adding components
  • Make sure to call await Bot.Reply(interaction) to send the interface

Buttons don't work

  • Ensure your callback functions accept an interaction parameter
  • Check that you're calling await Bot.Reply(interaction) in your callbacks

Common Errors

  • "No image found": Call await Bot.New_Image() first
  • "Token not found": Check your Keys file format
  • "Invalid command": Make sure your bot prefix matches what you type

Getting Help

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.1.0.tar.gz (10.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.1.0-py3-none-any.whl (14.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cordforge-0.1.0.tar.gz
  • Upload date:
  • Size: 10.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.1.0.tar.gz
Algorithm Hash digest
SHA256 a3741c622b948915870ac0f4b4a73d017c6e690aef5e0b606a585beb315e49ed
MD5 02c5e954155d74f20e01aea78eb1fa44
BLAKE2b-256 268cf703e2c708311102e331067fb440c31d5a7c67475176363b0b44e8302604

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cordforge-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 14.2 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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ab0745e57770ebc647da0d2c8a160ce1028c781fa1eaaecf0ac7fabb1dd9f8cb
MD5 1c9a529020c28452575deef4027cbfb0
BLAKE2b-256 5ba1c04ce8055d18ca6dd6bff6673a98b569b45724b94c0ff35ac2c6a8a7aa7f

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