Discord Bot
Set up the StaffHQ Discord bot to expose slash commands to your moderation team.
The StaffHQ Discord bot gives your moderation team instant access to player data from Discord. You can either self-host the bot on your own infrastructure, or pay for managed hosting and let us handle it.
Self-host
Run the bot on your own server. Requires Python 3.10+ and a systemd service (or Docker). Free.
Managed hosting
We run, monitor, and update the bot. Enable it from the dashboard. Costs 299 credits (GBP 2.99) per month.
Step 1: Create a Discord application
Open the Discord Developer Portal
Create a bot user
Enable required intents
- + Server Members Intent
- + Message Content Intent
Invite the bot to your server
- + Send Messages
- + Embed Links
- + Read Message History
- + View Channels
Step 2: Register your guild in the dashboard
Go to the Discord page
Enter bot credentials
- Client ID - from the OAuth2 General tab in the developer portal
- Bot Token - from the Bot tab
- Guild ID - right-click your Discord server and select Copy Server ID
- Alert Channel ID - right-click the channel for bot alerts and select Copy Channel ID
Save and verify
Self-host setup
The bot is open source at github.com/AkidHunter/staffhq-bot.
Requirements
- + Python 3.10 or later
- + pip packages: discord.py, aiohttp, python-dotenv
Installation
git clone https://github.com/AkidHunter/staffhq-bot
cd staffhq-bot
pip install -r requirements.txt
cp .env.example .env.env file
DISCORD_TOKEN=your_bot_token_here
STAFFHQ_API_KEY=your_dashboard_api_key_here
DASHBOARD_API_URL=https://dash.staffhq.netRun with Python
python bot.pySystemd service (recommended for production)
[Unit]
Description=StaffHQ Discord Bot
After=network.target
[Service]
Type=simple
User=staffhq
WorkingDirectory=/opt/staffhq-bot
EnvironmentFile=/opt/staffhq-bot/.env
ExecStart=/usr/bin/python3 bot.py
Restart=on-failure
RestartSec=5
[Install]
WantedBy=multi-user.targetsudo systemctl daemon-reload
sudo systemctl enable --now staffhq-bot
sudo systemctl status staffhq-botManaged hosting
With managed hosting, StaffHQ runs the bot for you. You do not need a server or Python environment.
- +Cost: 299 credits (GBP 2.99) per month, deducted from your credit balance
- +Includes automatic bot updates when new slash commands are released
- +24/7 uptime monitoring
- +Enable and disable from the dashboard at any time
To enable, open Discord in the dashboard and toggle Managed Hosting. You will still need to provide your bot token and guild credentials.