01
How it works
A status bot does two things, in a loop:
- it queries the game server, with the game's query protocol: the server answers with its name, player count, slots, sometimes the map and the player list. If it does not answer, the bot marks it offline;
- it shows the result on Discord: most often by editing the same message over and over (a box, or embed), sometimes by changing a channel's topic or the bot's status.
Editing a single message is the cleanest method: the channel does not fill up, and the information stays at the top. Discord also limits how often a channel can be renamed or have its topic changed: a player counter in a channel's name therefore cannot follow the server minute by minute.
The bot does not need to be on the same machine as the game server: it queries it by its public address, just as the game would.
02
What the bot queries
Minecraft (Java Edition) offers two methods, described by the Minecraft wiki:
- the server list ping, on the game port in TCP (25565 by default): this is what the game does to show the message of the day and player count on the Multiplayer screen. It works with no setup, as long as
enable-status stays true in server.properties: set to false, the server appears offline;
- the Query protocol, in UDP, more complete (player list, version, plugins on Bukkit-type servers). It must be enabled with
enable-query=true; its port is set with query.port, 25565 by default, and must be open in UDP.
Both settings are explained in the guide server.properties. Bedrock Edition uses another protocol: check that the tool you choose supports it.
FiveM answers over HTTP on its port (30120 by default). The Cfx.re documentation mentions the addresses /info.json (server information), /players.json (connected players) and /dynamic.json: open http://203.0.113.10:30120/info.json in a browser to see what a bot receives. The sv_requestParanoia setting, used against some attacks, can block these requests from level 2 upwards: if your bot no longer sees the server, check whether it is in the server.cfg.
03
No-code solutions
- FiveM with txAdmin: txAdmin, FiveM's official administration tool, has its own Discord bot. Once the bot is set up in txAdmin > Settings > Discord Bot, the
/status add command, typed in a channel where the bot can post, creates a box that txAdmin updates every minute: state, players, next scheduled restart, uptime, connect button. The content can be customised on the same page. The bot runs with txAdmin: no extra machine. See the guide txAdmin.
- Minecraft with DiscordSRV: this plugin links the game chat to a Discord channel, and can also write the number of online players and the uptime into the channel's topic. The update runs every 10 minutes by default (
ChannelTopicUpdaterRateInMinutes in config.yml), and the bot must be allowed to manage the channel. Installation is in the guide DiscordSRV.
- For every game, DiscordGSM (Discord Game Server Monitor): an open-source bot, under the MIT licence, that supports several hundred games, including Minecraft Java and Bedrock, FiveM and RedM. Its authors offer a public bot, limited to 10 monitored servers per Discord server: you invite it, then add the game server with the
/addserver command. It can also alert you when the server goes down.
Before inviting a public bot, look at the permissions it asks for, and remove the ones it does not need.
04
Hosting your own bot on a VPS
Two reasons to move to a bot you host yourself: going beyond a public bot's limits, or showing exactly what you want.
- Self-hosted DiscordGSM: the code is published on GitHub (repository
DiscordGSM/GameServerMonitor), in Python, with a Docker image. It is configured through environment variables, including APP_TOKEN (your bot's token) and WHITELIST_GUILDS (the allowed Discord servers). Follow its installation guide; the guide installing Docker on a VPS prepares the machine.
- Your own code, with discord.js or discord.py: a task repeated every minute queries the server (server list ping or Query for Minecraft,
/info.json and /players.json for FiveM), then edits the existing message instead of posting a new one. Store the message ID in a file so you can find it again after a restart.
A bot must run day and night: a VPS is a good fit, and one is enough for several bots. The bot opens its own connections to Discord and to the game server: it has no port to open. The token, the equivalent of a password, goes in an environment variable, never in the code. The systemd service, logs and updates are explained in the guide hosting a Discord bot.
05
Common errors
- The bot shows the server offline while it is running: wrong address or port in the bot, query port closed (Minecraft Query in UDP),
enable-status=false on Minecraft, or requests blocked by the server. Test from the bot's machine: for FiveM, curl http://203.0.113.10:30120/info.json should print JSON.
- A new message at every update: the bot lost its message ID, or its permissions in the channel changed. Delete the duplicates and check its permissions.
- Querying too often: one request a minute is plenty. Beyond that, you load the game server for nothing and get closer to Discord's limits.
- The player count does not match: the tools read the value the server announces. For Minecraft, the ping only returns a sample of the player list; for the full list, use Query.
- The bot's token published (in a screenshot, a Git repository): regenerate it right away on Discord's developer portal.
06
On CloudFive
On our game plans, such as FiveM hosting or Minecraft hosting, the IP address and port to give the bot are shown in the customer area manager.cloudfive.fr. txAdmin is included on FiveM: its status box needs no extra machine. Every game plan has Anti-DDoS Premium, with a profile specific to the game: if your bot gets no answer while the game works, support, in French 7 days a week, checks that its requests get through.
To host your own bot, the VPS for Discord bots page compares our two options: Node.js & Python hosting, with no system to manage, and the Intel or Ryzen VPS, with root access for Docker. The Ryzen VPS, from €5.99 a month, runs on a Ryzen 9 9950X with DDR5 and NVMe, in France, monthly with no commitment.
07
Frequently asked questions
How do I show my server's player count on Discord?
Use a status bot, which queries the game server regularly and updates a message or a channel's topic. For FiveM, txAdmin's bot does it with /status add; for Minecraft, DiscordSRV; for most games, a bot such as DiscordGSM.
How do I show a FiveM server's status on Discord?
Set up txAdmin's Discord bot in Settings, then Discord Bot, and type /status add in the channel you want. txAdmin updates the box every minute, with the server's state, the player count and a connect button.
Do I need enable-query for a Minecraft status bot?
Not always. Many tools use the server list ping, on the game port in TCP, which works with no setup as long as enable-status is true. Query, enabled with enable-query=true and opened in UDP, also gives the full player list.
Where should I host a Discord status bot?
On a machine that stays on all the time, such as a VPS: one is enough for several bots. The bot does not need to be on the same machine as the game server, since it queries it by its public address, and it has no port to open.
Why does my bot show the server as offline?
Check the address and port set in the bot, that the query port is open (Minecraft Query in UDP) and that the server is not set to refuse these requests, such as enable-status=false on Minecraft. For FiveM, test http://address:30120/info.json from the bot's machine.