Discord Bot Library - UI & Image Manipulation for Making Games
Project description
Discord Bot Library - UI & Image Manipulation for Making Games
Table of Contents
Installation
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:
- Add more screens - Create different sections for your bot
- Use containers - Organize your UI with containers and borders
- Add images - Use ListItem with images for richer content
- Create games - Build simple games like tic-tac-toe or number guessing
- 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
Keysfile - 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
interactionparameter - 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
Keysfile format - "Invalid command": Make sure your bot prefix matches what you type
Getting Help
- Look at the Examples for more complex use cases
- Review the API Reference for all available methods
Project details
Release history Release notifications | RSS feed
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 cordforge-0.1.1.tar.gz.
File metadata
- Download URL: cordforge-0.1.1.tar.gz
- Upload date:
- Size: 10.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5185b5dddfd47a458293ed65a7a6ec59638c851212d5835b325dfa426fe7dee2
|
|
| MD5 |
50a4f10a41408af2a962f1612e4529f5
|
|
| BLAKE2b-256 |
3d33b33692c61cfa83d7fceeef9da706122060098738ebf37aa2347083a97c4c
|
File details
Details for the file cordforge-0.1.1-py3-none-any.whl.
File metadata
- Download URL: cordforge-0.1.1-py3-none-any.whl
- Upload date:
- Size: 14.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2672b46e38491464f14888585f5c6fe4b03ce251ba2537af5d957a5faefcca7d
|
|
| MD5 |
84c125d11de7d7d00716200086226d46
|
|
| BLAKE2b-256 |
db788a144f573bf06ce0ebb3887a452c8a500b5585618acf3c080022cfc88293
|