DOCUMENTATION

Status checker and API

What each part does, how to set it up, and what your members see.

Connect anything that has code to your Discord: a FiveM, RedM or Minecraft server, an app, a website, a bot. It reports in; Lunar shows its status, says when it goes down, and answers the questions a whitelist or a login check asks.

Premium+. The status checker comes with Premium+ and every plan above it. When a plan lapses, reports are turned away with a 403 that says so and the status message stops changing; settings and keys are kept.

Connect a service

  1. On the dashboard open Utility, then Status checker, and add a service. You get its key once: lunar_srv_.... Keep it like a password.
  2. FiveM and RedM: drop the lunar-status script into resources/ and add set lunar_key "..." and ensure lunar-status to server.cfg. Anything else: send the heartbeat below about once a minute.
  3. In the service's settings choose a channel for the status message and one for down and back-up alerts. Anyone can run /status.

The API

Base address https://api.thelunarbot.com/v1. Every request carries the service's key as Authorization: Bearer lunar_srv_.... A key belongs to one service in one Discord, so there's no server id to pass and nothing else it can reach. Fields are only ever added to these shapes, never renamed.

Endpoints

POST /heartbeatReport in. JSON body, all optional: players, maxPlayers, playerNames (up to 100), address, version, map, motd, and status, which is "online" unless you send "stopping" on shutdown. A service that says nothing for three minutes (you choose how long) reads as offline. For something that isn't a game, players is shown as how many are online and map as a line of detail. Every text field is cut to length and made inert before it reaches Discord, so nothing in a report can ping, link or format anything.
GET /members/{discordId}Who this Discord account is to your server: inServer, banned, roles (id and name), nickname, level, xp, joinedAt. This is what a role whitelist, a priority queue or "banned in Discord means banned in game" asks at the door.
GET /meWhich service and Discord this key belongs to. Useful for checking a key.
๐ŸŒ™Keep keys to yourself. A service key goes in server.cfg or an environment variable and nowhere else, never in a chat, a screenshot, a public repository or anything users download. Service keys don't expire, so an old key never takes your service offline without warning; replace one every few months from the dashboard, and at once if it may have leaked.
๐ŸŒ™What a key can't do. A service key can only report and look members up. Alerts are limited to one every five minutes per service and the status message to one edit a minute. Over a limit the answer is 429 with a Retry-After.
๐ŸŒ™Limits: 120 requests a minute per key, 60 of them member lookups, 120 member lookups a minute across one Discord, and up to 5 services per Discord. Privacy: Lunar never shows the address reports come from; the address in Discord is the one you typed or the script sent. Player names are optional and aren't kept once they leave.

FiveM whitelist in two lines

With the script installed, set lunar_whitelist_role "Whitelisted" lets in only members holding that role, and set lunar_block_banned "true" turns away anyone banned in your Discord. The role can be a name or an id. Players need Discord open when they start FiveM so the server can see their account.