pterodactyl

This commit is contained in:
2026-06-17 12:54:35 -05:00
parent 910269e5b6
commit 8be615d51b
2 changed files with 235 additions and 0 deletions

View File

@@ -0,0 +1,139 @@
# Pterodactyl Panel Deployment Guide
This guide will help you deploy the OC Bot using Pterodactyl Panel.
## What is an Egg?
A Pterodactyl "egg" is a JSON configuration file that defines how your application should be installed, configured, and run within a Pterodactyl Panel server.
## Installation Steps
### 1. Import the Egg into Pterodactyl
1. Log in to your Pterodactyl Panel as an administrator
2. Navigate to **Admin Panel****Nests & Eggs****Nests**
3. Click on an existing nest (e.g., "Discord" or create a new one)
4. Click **Import Egg**
5. Copy the contents of `egg-oc-bot.json` and paste it into the import field
6. Click **Import**
### 2. Create a New Server
1. Go to **Servers****Create New Server**
2. Select the nest containing the OC Bot egg
3. Select the **OC Bot** egg
4. Configure the following settings:
#### Environment Variables (Required)
These are configurable in the Pterodactyl Panel:
- **Discord Bot Token** - Get from [Discord Developer Portal](https://discord.com/developers/applications)
- Create a new application
- Add a Bot
- Enable "Message Content Intent"
- Copy the token
- **Database Host** - MariaDB/MySQL server address
- Default: `localhost`
- Use container IP if running in Docker: `host.docker.internal` or the service name
- **Database User** - Database username
- Default: `root`
- **Database Password** - Database password
- Leave empty if no password set
- **Database Name** - Database name
- Default: `rp_bot`
### 3. Database Setup
Before starting the bot, ensure your MariaDB database is set up:
```sql
CREATE DATABASE rp_bot;
```
The bot will automatically create the necessary tables on first run.
### 4. Start the Server
1. Click the **Create Server** button
2. Go to your new server's console
3. Click **Start** to launch the bot
4. You should see "started" in the console when ready
### 5. Configure Discord
1. Go to [Discord Developer Portal](https://discord.com/developers/applications)
2. Select your application
3. Go to **OAuth2****URL Generator**
4. Select scopes: `bot`
5. Select permissions:
- Send Messages
- Manage Messages
- Manage Webhooks
- Read Message History
- Embed Links
6. Copy the generated URL
7. Open the URL in your browser and add the bot to your server
## Environment Variables Explained
| Variable | Purpose | Example |
|----------|---------|---------|
| `DISCORD_TOKEN` | Bot authentication token | `MTk4NjIyNDgzNDU4Njc4Ng...` |
| `DB_HOST` | Database server address | `localhost` or `mariadb` |
| `DB_USER` | Database username | `root` |
| `DB_PASSWORD` | Database password | `mypassword` |
| `DB_NAME` | Database name | `rp_bot` |
| `STARTUP_CMD` | Command to start the bot | `python bot.py` |
## Troubleshooting
### Bot won't start
- Check Discord token is correct
- Ensure "Message Content Intent" is enabled in Developer Portal
- Check logs for database connection errors
### Database connection error
- Verify database is running and accessible
- Check credentials are correct
- Ensure database exists: `SHOW DATABASES;`
### Webhook errors
- Ensure bot has "Manage Webhooks" permission
- Check Discord token has necessary scopes
## File Structure in Panel
```
server/
├── bot.py
├── database.py
├── requirements.txt
├── .env (auto-generated from variables)
├── README.md
├── SETUP.md
└── cogs/
├── __init__.py
├── oc.py
├── help.py
├── utils.py
└── config.py
```
## Updating the Bot
1. Upload new files via the file manager
2. Restart the server
3. Changes take effect immediately
## Support
For issues or questions, refer to [SETUP.md](SETUP.md) or consult the [Pterodactyl Documentation](https://pterodactyl.io/community/customization/eggs/egg_variables.html).
---
**Coded by Ball Studios 🎨**

View File

@@ -0,0 +1,96 @@
{
"meta": {
"version": "PTDL_v2",
"update_url": null
},
"exported_at": "2026-06-17T00:00:00+00:00",
"name": "OC Bot",
"author": "Ball Studios",
"description": "An Original Character management Discord bot with prefix-based commands",
"features": [
"eula"
],
"docker_images": {
"ghcr.io/pterodactyl/games:python3.13": "ghcr.io/pterodactyl/games:python3.13"
},
"file_denylist": [],
"startup": "{{STARTUP_CMD}}",
"config": {
"files": "{}",
"startup": "{\n \"done\": \"started\"\n}",
"log": {
"custom": false,
"location": "logs/latest.log"
},
"stop": "^C"
},
"scripts": {
"installation": {
"script": "#!/bin/bash\nset -e\n\necho \"OC Bot - Installation Starting\"\necho \"Installing Python dependencies...\"\n\npip install --upgrade pip\npip install -r requirements.txt\n\necho \"Installation Complete!\"\necho \"Make sure to configure your .env file with:\"\necho \" - DISCORD_TOKEN\"\necho \" - DB_HOST\"\necho \" - DB_USER\"\necho \" - DB_PASSWORD\"\necho \" - DB_NAME\"\n",
"container": "ghcr.io/pterodactyl/games:python3.13",
"entrypoint": "bash"
}
},
"variables": [
{
"name": "Discord Bot Token",
"description": "Your Discord bot token from the Developer Portal (https://discord.com/developers/applications)",
"env_variable": "DISCORD_TOKEN",
"default_value": "",
"user_viewable": false,
"user_editable": true,
"rules": "required|string|max:255",
"field_type": "text"
},
{
"name": "Database Host",
"description": "MariaDB/MySQL database hostname (default: localhost)",
"env_variable": "DB_HOST",
"default_value": "localhost",
"user_viewable": true,
"user_editable": true,
"rules": "required|string|max:255",
"field_type": "text"
},
{
"name": "Database User",
"description": "MariaDB/MySQL database username",
"env_variable": "DB_USER",
"default_value": "root",
"user_viewable": true,
"user_editable": true,
"rules": "required|string|max:255",
"field_type": "text"
},
{
"name": "Database Password",
"description": "MariaDB/MySQL database password",
"env_variable": "DB_PASSWORD",
"default_value": "",
"user_viewable": false,
"user_editable": true,
"rules": "string|max:255",
"field_type": "text"
},
{
"name": "Database Name",
"description": "MariaDB/MySQL database name",
"env_variable": "DB_NAME",
"default_value": "rp_bot",
"user_viewable": true,
"user_editable": true,
"rules": "required|string|max:255",
"field_type": "text"
},
{
"name": "Startup Command",
"description": "Command to start the bot",
"env_variable": "STARTUP_CMD",
"default_value": "python bot.py",
"user_viewable": true,
"user_editable": false,
"rules": "required|string",
"field_type": "text"
}
]
}