|
**π‘οΈ Security**
- Antinuke β ban, kick, channel & role flood, webhook abuse, bot adds, prune
- Automod β spam, caps, links, invites, mass mentions, emoji spam
- Anti-member update protection
- Whitelist / unwhitelist system
- Emergency lockdown mode
|
**π΅ Music**
- Lavalink v4 powered playback
- YouTube, SoundCloud, JioSaavn search
- Queue, loop, autoplay, shuffle
- Seek, rewind, forward controls
- Fully configurable via `.env`
|
|
**βοΈ Management**
- Moderation β ban, kick, mute, warn, lock, jail, and more
- Full logging system
- Reaction roles, vanity roles, invite tracker
- Tickets, giveaways, verification
- Join-to-create voice channels
|
**π Dashboard**
- Discord OAuth2 login
- Per-server settings management
- Live bot stats & metrics
- Fully branded & customisable
- HTTPS via Cloudflare Tunnel (permanent URL)
- Deploys to Vercel in minutes
|
|
**π Engagement**
- Leveling & XP system with leaderboard
- Birthday tracker
- 12+ mini-games (chess, battleship, wordle, 2048β¦)
- AFK system, autorole, autoresponder, sticky messages
- Counting, blackjack, slots, booster perks
|
**π§ Developer**
- Application emoji auto-sync on startup
- Jishaku eval support
- Slash + prefix commands
- FastAPI backend with API key auth + rate limiting
- Cloudflare Tunnel β unlimited bandwidth, permanent URL, zero system installs
- HexaHost watermark on every source file
|
---
## β¦ Prerequisites
| Requirement | Version / Notes |
|---|---|
| Python | 3.10 or higher |
| Node.js | 18 or higher |
| Lavalink node | v4 |
| Discord bot token | β |
| Discord OAuth app | for dashboard login |
| Cloudflare account (free) | for HTTPS tunnel |
---
## β¦ Bot Setup
**1 β Clone the repo**
```bash
git clone https://github.com/theoneandonlymace/HexaHost-CV2-With-Dashboard
cd HexaHost-CV2-With-Dashboard/bot
```
**2 β Install dependencies**
```bash
python -m venv .venv
# Windows
.venv\Scripts\activate
# Linux / macOS
source .venv/bin/activate
pip install -r requirements.txt
```
**3 β Configure the environment**
Copy `.env.example` to `.env` and fill in the values:
```env
# ββ Core ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
TOKEN = your_discord_bot_token
brand_name = 'HexaHost'
# ββ Owner IDs (REQUIRED β your Discord user ID) βββββββββββββββββββ
OWNER_IDS = YOUR_DISCORD_USER_ID_HERE
# ββ Lavalink ββββββββββββββββββββββββββββββββββββββββββββββββββββββ
LAVALINK_HOST = "your-lavalink-host"
LAVALINK_PASSWORD = "your_password"
LAVALINK_SECURE = "true"
LAVALINK_PORT = ""
# ββ Emoji Sync ββββββββββββββββββββββββββββββββββββββββββββββββββββ
EMOJI_SYNC = "false"
# ββ API / Dashboard Backend βββββββββββββββββββββββββββββββββββββββ
API_ENABLED = "false"
API_HOST = "127.0.0.1"
API_PORT = "8000"
DASHBOARD_API_KEY = "change_this_to_a_strong_secret"
DASHBOARD_ADMIN_IDS = YOUR_DISCORD_USER_ID_HERE
CORS_ORIGINS = ""
# ββ Cloudflare Tunnel (optional) ββββββββββββββββββββββββββββββββββ
TUNNEL_ENABLED = "false"
CF_TUNNEL_TOKEN = "your_tunnel_token"
CF_TUNNEL_URL = "https://api.yourdomain.com"
# ββ Webhooks (optional β leave unset to disable) ββββββββββββββββββ
# CMD_WEBHOOK_URL = "https://discord.com/api/webhooks/ID/TOKEN"
```
**4 β Run the bot**
```bash
python HexaHost.py
```
---
## β¦ Dashboard Setup
**1 β Install dependencies**
```bash
cd dashboard
npm install
```
**2 β Configure the environment**
Copy `.env.example` to `.env.local`:
```env
DASHBOARD_API_URL = http://127.0.0.1:8000/api/v1
DASHBOARD_API_KEY = same_secret_as_bot_DASHBOARD_API_KEY
NEXTAUTH_URL = http://localhost:3000
NEXTAUTH_SECRET = a_long_random_string
DISCORD_CLIENT_ID = your_discord_oauth_client_id
DISCORD_CLIENT_SECRET = your_discord_oauth_client_secret
ADMIN_IDS = your_discord_user_id
NEXT_PUBLIC_ADMIN_IDS = your_discord_user_id
NEXT_PUBLIC_BRAND_NAME = "HexaHost"
NEXT_PUBLIC_BRAND_NAME_WORD = "ZX"
```
**3 β Run locally**
```bash
npm run dev
```
Open [http://localhost:3000](http://localhost:3000)
---
## β¦ Environment Reference
### Bot β `bot/.env`
| Variable | Default | Description |
|---|---|---|
| `TOKEN` | β | Discord bot token |
| `OWNER_IDS` | _(required)_ | Comma-separated owner Discord user IDs β **must be your own ID** |
| `LAVALINK_HOST` | β | Lavalink server hostname (no protocol) |
| `LAVALINK_PASSWORD` | β | Lavalink password |
| `LAVALINK_SECURE` | `true` | `true` = HTTPS, `false` = HTTP |
| `LAVALINK_PORT` | _(empty)_ | Port β only needed when `LAVALINK_SECURE=false` |
| `EMOJI_SYNC` | `false` | Run application emoji sync on startup |
| `JISHAKU_ENABLED` | `false` | Enable owner debug REPL (disable in production) |
| `API_ENABLED` | `false` | Start the FastAPI dashboard backend |
| `API_HOST` | `127.0.0.1` | Bind address β use `127.0.0.1` unless behind a reverse proxy |
| `API_PORT` | `8000` | Port the backend listens on |
| `DASHBOARD_API_KEY` | β | Shared secret between bot API and dashboard (server-side only) |
| `DASHBOARD_ADMIN_IDS` | β | Discord user IDs allowed to use admin API routes |
| `CORS_ORIGINS` | _(empty)_ | Extra CORS-allowed origins, comma-separated |
| `CMD_WEBHOOK_URL` | _(empty)_ | Optional Discord webhook for command logging |
| `TUNNEL_ENABLED` | `false` | Expose the API over HTTPS via Cloudflare Tunnel |
| `CF_TUNNEL_TOKEN` | β | Token from Cloudflare Zero Trust dashboard |
| `CF_TUNNEL_URL` | β | Your permanent public URL (e.g. `https://api.yourdomain.com`) |
| `LOG_CHANNEL_ID` | _(empty)_ | Optional channel for join/leave logs |
### Dashboard β `dashboard/.env.local`
| Variable | Description |
|---|---|
| `DASHBOARD_API_URL` | Bot API URL (server-side, e.g. `http://127.0.0.1:8000/api/v1`) |
| `DASHBOARD_API_KEY` | Must match `DASHBOARD_API_KEY` in the bot β **never use NEXT_PUBLIC_** |
| `NEXTAUTH_URL` | Your dashboard's public URL |
| `NEXTAUTH_SECRET` | Random secret for NextAuth session signing |
| `DISCORD_CLIENT_ID` | Discord OAuth2 client ID |
| `DISCORD_CLIENT_SECRET` | Discord OAuth2 client secret |
| `ADMIN_IDS` | Comma-separated Discord user IDs with admin panel access (server-side) |
| `NEXT_PUBLIC_ADMIN_IDS` | Same IDs for client-side admin UI visibility |
| `NEXT_PUBLIC_BRAND_NAME` | Bot name shown in the dashboard UI |
| `NEXT_PUBLIC_BRAND_NAME_WORD` | Short abbreviation shown in the dashboard |
> **API security:** Guild routes require a valid Discord OAuth token with Manage Server permission. The dashboard forwards this automatically via `/api/proxy`.
---
## β¦ HTTPS Tunnel (Cloudflare)
The bot uses **pycloudflared** β a Python package that downloads the `cloudflared` binary automatically on first run. No CLI installs, no system packages β works on Pterodactyl and any Python host.
**Why Cloudflare over ngrok:**
- β
Unlimited bandwidth & requests β no monthly caps
- β
Permanent URL that never changes between restarts
- β
Free β no paid plan needed
- β
Zero system installs β binary downloads via Python
**Setup (browser only, no CLI needed):**
1. Go to [one.dash.cloudflare.com](https://one.dash.cloudflare.com) β **Networks β Tunnels β Create a tunnel**
2. Choose **Cloudflared**, give it a name (e.g. `hexahost-api`), save
3. On the **Install connector** step, copy the token from the command shown:
```
cloudflared tunnel run --token