144 lines
3.8 KiB
Markdown
144 lines
3.8 KiB
Markdown
# Pterodactyl Panel Deployment Guide
|
|
|
|
This guide will help you deploy the OC Bot using Pterodactyl Panel.
|
|
|
|
**Compatible with:**
|
|
- Pterodactyl Panel v1.13.0+
|
|
- Wings v1.12.3+
|
|
|
|
## 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 🎨**
|