CyberNex
CyberNex
services
Back to Tutorials
Control Panel8 min readJune 27, 2026

How to Connect Your Discord Bot to Your Game Server

Why Integrate Discord with Your Game Server?

Discord-game server integration bridges your community's chat hub with the actual game. Players in Discord can: see who's online on the server, receive server status alerts (online/offline/crash), get in-game chat mirrored to Discord channels, and execute server commands from Discord (restart, ban, broadcast). For Minecraft, FiveM, and Rust servers, this integration is the #1 quality-of-life feature communities request. It keeps offline players engaged and lets admins manage servers from their phone.

Minecraft Discord Integration with DiscordSRV

DiscordSRV is the standard Minecraft-Discord bridge. Install the plugin in /plugins. Configure config.yml: set Discord bot token, set main Discord channel ID for chat sync, configure Discord-to-Minecraft chat format, Minecraft-to-Discord chat format, and console channel (server logs forwarded to Discord). Features: player join/leave messages in Discord, /discord command in-game showing invite link, console commands from Discord (via bot commands), and player list command. DiscordSRV requires the bot to have Read Messages, Send Messages, and Manage Webhooks permissions.

FiveM Discord Integration with DiscordAcePerms

FiveM integration requires a server-side resource. DiscordAcePerms is the most popular — it syncs Discord roles with FiveM permissions. Install the resource and configure config.lua: bot token, guild ID, role-to-ace mapping (Discord 'Admin' role = FiveM 'group.admin' permission). Additional features: FiveM chat bridged to Discord channel, in-game reports forwarded to Discord with player info, and server status updates in a Discord embed. Use txAdmin to install and configure Discord resources.

Building a Custom Discord Bot for Game Servers

Build a self-hosted Discord bot using Node.js (discord.js) or Python (discord.py). Essential features: !status command showing server IP, player count, and online status (fetch via server query API), !players command showing online player list, !restart command (restricted to admins) that sends RCON commands to the game server, and automated messages when the server crashes or restarts. Host this bot on our Discord Bot Hosting plan for 24/7 uptime — it costs €6.40/month and includes auto-restart on crash.

RCON — Remote Server Control

RCON (Remote Console) lets external applications send commands to your game server. For Minecraft: enable RCON in server.properties (enable-rcon=true, rcon.port=25575, rcon.password=strongpassword). For Rust: enable in server config (+rcon.web 1 +rcon.port 28016 +rcon.password strong). Your Discord bot connects via TCP to the RCON port, authenticates with the password, and sends console commands. Always use a strong RCON password — anyone with RCON access has full server control. Restrict RCON port access with firewall rules.

Security Best Practices

Never hardcode tokens or passwords in your code — use environment variables or config files outside the web root. Limit bot permissions to only what's needed. Create a separate Discord bot for each server (don't share tokens). Add command cooldowns to prevent abuse. Log all admin commands sent from Discord to a private staff channel. Regularly rotate RCON passwords and bot tokens. If your Discord bot is compromised, the attacker could wipe your game server — treat bot security as seriously as server security.

Related Hosting Services
// Frequently Asked Questions

FAQ

Was this guide helpful?

Join our Discord for more guides and direct help from our engineering team.

// Initialize Deployment

Deploy your server in 60 seconds

Get your Minecraft, FiveM, Rust, or CS2 server running on our global infrastructure before your coffee gets cold. Starting at € 3.50/month with instant provisioning, 17 Tbit DDoS protection, and 24/7 engineer support.

How to Connect Your Discord Bot to Your Game Server | CyberNex | CyberNex