Skip to main content

Discord Bot Setup Guide

Invite the GameGrid Discord Bot, create a key with the right scopes, link it, decide which Discord roles get which level of control, and point commands at the right server.

What you need first

Three things, and the order matters:

  • Manage Server permission in the Discord server you are setting up, or ownership of it.
  • At least one GameGrid server on your account.
  • An API key created for the bot, with the scopes below. Create it before you start - /setup will not accept anything else.

Setting up takes about five minutes. The bot never asks for your GameGrid password; the API key is the only credential it holds.

Step 1 - Create the key

In the customer panel, go to Account โ†’ API Keys and create a key named for the bot - discord-bot is fine.

Do not reuse a key you already use for scripts. A dedicated key means you can rotate or revoke the bot without breaking anything else, and the audit trail shows which integration made each call.

Then choose scopes. (Limiting a key to particular servers is enforced by the platform but is not on the create form โ€” open a ticket if you want the bot's key restricted that way.)

The scopes, by what you want to enable

Grant only the rows you want. Each block is independent - skipping one just means those commands return a scope error.

To enableGrant
The minimum useful bot - /servers, /server, /status, /check-update, and how anyone finds a server idservers:read
Start, stop, restart, and the restart button on a settings changeservers:lifecycle
Setting an auto-restart schedule with /auto-restart <hours>servers:write
/console, console mirroring with /config live-console, and linking a channel with /chat-link / /chat-unlinkconsole:read
/commandconsole:write
Log mirroring with /config live-logslogs:read
/filesfiles:read
/settings view and /settings getsettings:read
/settings setsettings:read and settings:write
/playersplayers:read and servers:read
/backups listbackups:read
/backups createbackups:create
/backups deletebackups:write
/backups restorebackups:restore
/mods list and /mods searchmods:read
/mods install, /mods uninstall, /mods togglemods:write
Every /windrose subcommand - status, config and get as well as set, enable and disablewindrose:admin
/accountaccount:read
/billingbilling:read
/tickets and /tickettickets:read
Player economy commands and the chat bridge readingeconomy:read
/buy, /kits claim, /link, /unlink, /daily, and Discord-to-game chateconomy:write
/award, /refund, /shop-admin, /economy-stats, /economy-config, /economy-earn, /economy-links, /economy-link-removeeconomy:admin
/preset list, /preset view, /event list, /event status, /event logconfig_events:read
/preset delete, /event schedule, /event updateconfig_events:write
/event start, /event end, /event cancelconfig_events:control
/preset applyconfig_events:write and config_events:control
/map link, /map players, /map status, /map region, /map leaderboard, /map share, /dayz map, /dayz ring-mapmap:read
/dayz players and /dayz killfeedingame:read
/dayz broadcastingame:message
/command-schedule list, /command-schedule catalog, /command-schedule show, /command-schedule historycommand_schedules:read
/command-schedule create, /command-schedule edit, /command-schedule delete, /command-schedule togglecommand_schedules:write
/command-schedule runcommand_schedules:control
/metrics summary, /metrics uptime, /metrics peak, /metrics placesmetrics:read
/metrics top, /metrics player, /metrics sessions, /metrics killfeed, /config killfeed-channelplayer_metrics:read
/metrics new-seasonmetrics:admin (and a key created by the account owner or an administrator)
/leaderboard setup, /leaderboard post, and the bot posting your leaderboardsleaderboards:write
/leaderboard kills and the other boards, /config summary-channelmetrics:read
/my stats, /my playtime, /my travel, /my wealth, /my eventsplayers_self:read
/my leaderboard-hide, /my leaderboard-mention, /my api-token create, /my api-token revokeplayers_self:write

To enable every command the bot has, grant all 38 of these: servers:read, servers:write, servers:lifecycle, console:read, console:write, logs:read, files:read, settings:read, settings:write, players:read, backups:read, backups:create, backups:write, backups:restore, mods:read, mods:write, windrose:admin, account:read, billing:read, tickets:read, economy:read, economy:write, economy:admin, config_events:read, config_events:write, config_events:control, map:read, ingame:read, ingame:message, command_schedules:read, command_schedules:write, command_schedules:control, metrics:read, player_metrics:read, metrics:admin, leaderboards:write, players_self:read, players_self:write.

The Discord bot preset in the key-creation screen is a starting point, not the full set. It covers the common read and control commands but omits logs:read, files:read, settings:write, servers:write, the three write-side backup scopes, mods:write, windrose:admin, billing:read, all three economy scopes, map:read and metrics:admin. If you want the economy commands, the chat bridge, backups beyond listing, or log mirroring, add those scopes yourself.

map:read is the one the preset leaves out on purpose rather than for brevity: it reads where your players are standing, and that is a thing to hand a bot deliberately. Tick it yourself if you want the map commands. The key-creation screen says the same next to the preset, and the bot names the missing scope when a map command is refused.

The preset does include player_metrics:read, which lets /metrics top, /metrics player and /metrics sessions read your players' statistics by name. Those replies are only ever shown to the person who asked, and the abilities behind them start at the operator preset. It never reads live positions or addresses. metrics:admin (starting a new stats season) is in no preset: tick it yourself, on a key you create as the account owner or an administrator. The preset also includes leaderboards:write, so the bot can set up and post the leaderboards you switch on, and players_self:read and players_self:write for /my: each member sees only their own statistics, and only once you switch player self-service on in Player access.

Copy the key. It is shown once.

Step 2 - Invite the bot

Use the invite link on the Discord Bot page in the panel. It requests four Discord permissions and nothing more:

PermissionWhy
View ChannelTo see the channel it is asked to post in
Send MessagesTo answer commands
Embed LinksCommand replies are embeds
Use Application CommandsTo register its slash commands

It does not ask to read message history, manage messages, mention everyone, kick, ban, or manage roles. Pick your Discord server and authorize. Commands appear within a minute or two.

Step 3 - Link the key

In any channel the bot can see:

/setup api-key:gsk_your_key_here

The reply is private, so your key is never posted to the channel. The bot verifies the key against the API before storing anything, then encrypts it at rest.

If you seeIt means
Setup completeDone - move on to roles
The key was rejectedWrong key, a typo, or the key has been revoked. Check it in the panel
You need Manage ServerAsk the Discord server owner to run it, or to give you that permission

Who can re-run `/setup` later is narrower than who can run it first. The first /setup needs Manage Server. Re-linking a different key afterwards is limited to the Discord server owner and the person who ran `/setup` originally, while they still hold Manage Server. And a re-link with a key from a different GameGrid account clears every role grant, channel binding and live mirror (a key from the same account keeps them) - see Discord Bot Permissions & Security before you rotate.

Step 4 - Decide who can do what

Until you grant a role, nobody can run anything except the setup user and the Discord server owner. Every role starts with nothing.

The bot binds abilities to your own Discord roles - whatever you called them. Start from a preset and then adjust:

/permissions preset role:@Members preset:member
/permissions preset role:@Admins preset:moderator
/permissions grant role:@Helpers capability:server.restart
/permissions revoke role:@Helpers capability:settings.write
PresetCovers
nothingNothing - the default for every role
memberStatus, lists, settings and mod listings, logs, the live map, and the player-side economy commands
operatorThe above, plus /console, /command and scheduled commands
moderatorThe above, plus lifecycle, backups, settings writes, mods, Windrose Plus, the chat bridge, economy administration and events
adminThe above, plus /account, /billing, /tickets, and managing bot permissions

A preset is a starting point, not a ceiling: /permissions grant and /permissions revoke change one ability at a time, which is how you say "may restart the server, may not change its settings".

A member holding several roles gets the union of what those roles grant - a role never takes away what another gave, and Discord's role ordering makes no difference.

@everyone is held by every current and future member, so the bot refuses to give it anything destructive or account-facing, and a preset applied to it is filtered down to the safe part.

Check your work with /permissions list, /permissions role role:@YourRole, and /config view for your channels and the default server.

Step 5 - Point commands at the right server

Most server commands take an optional server-id (/buy, /kits show and /kits claim require one). When it is left out, the bot resolves the server in this order:

1. The server bound to the channel the command was run in.

2. The Discord server's default server.

3. Neither - the bot says so and names all three ways to fix it.

Run /servers to see your server ids, then set whichever fits:

/config default-server server-id:00000044
/config channel-server channel:#minecraft server-id:00000044

Channel bindings are the better answer once you run more than one server: #minecraft and #valheim each act on their own server, and nobody has to remember an id. To unbind a channel, run /config channel-server for it with no server-id.

Optional - channels the bot can use

CommandSets up
/config log-channelAn audit log of every command run through the bot, and who ran it
/config alert-channelAutomatic alerts when a server starts, stops or crashes, and a config event's restart warnings (the same words players get in game; the key needs config_events:read for these)
/config command-channelRestricts /command to one channel. Only `/command` - other commands, including /console, are unaffected
/config live-consoleMirrors a server's console into a channel
/config live-logsMirrors a server's log file into a channel
/chat-linkTwo-way chat between a Discord channel and in-game chat

Live mirrors and the alert channel should point at channels your admins can read and your members cannot. Credentials and IP addresses are redacted from mirrored output, but console text is still console text.

A few numbers worth knowing when you set these up. Alerts are checked every 30 seconds, and only fire on real transitions - a server going from stopped to running, or crashing. Console and log mirrors update every 10 seconds, in batches of up to 40 lines. The chat bridge polls every 5 seconds and posts up to 10 messages per cycle, telling you in the channel if a busy period meant some were skipped.

One thing to know about alerts after a restart: the bot records each server's current state without announcing it when it starts up. That stops a burst of alerts every time the bot restarts - but it also means a change that happened while the bot was offline is never announced.

Check it works

Run these in order. Each one tests something different:

CommandConfirms
/config viewThe bot is set up here: the default server, the channels and who linked it
/permissions listYour roles are set: what each one can do
/serversThe key can reach your servers - tests servers:read
/statusServer resolution works without a server-id
/consoleTests console:read and the console.read ability
/helpShows the caller what they can do - useful to hand to members
/permissions keyShows which abilities your API key can and cannot back

If something is refused, the message tells you which gate stopped it. A message naming an ability - "You need Restart a server (server.restart)" - is a Discord role problem, fixed with /permissions grant. A message naming a scope is a key problem, and no Discord role can fix it: create a new key in the panel with that scope added and re-run /setup.

Common problems

SymptomCause and fix
Commands do not appear in DiscordRegistration takes a minute or two. Fully restart your Discord client. Check the bot has Use Application Commands in that channel
Every command says no permissionNo role has been granted anything yet. Run /permissions preset or /permissions grant
One ability is refused while the rest of that role worksRead the refusal. If it names a scope, the API key is the ceiling and no role grant will help - see /permissions key
"No server specified"No channel binding and no default server. Run /servers, then /config default-server
One command fails with a scope error, the rest workThe key is missing that command's scope. Check the table in Step 1, create a new key on the same account, re-run /setup - your role grants are kept when the new key is for the account that is already linked
The bot was working and now rejects the keyThe key expired or was revoked. Create a new one and re-run /setup
Chat bridge sends game chat to Discord but not backAlmost always the key lacking economy:write. Check the scope before anything else
/chat-link is refused, or the bridge stops with "cannot read chat"The key needs player_metrics:chat and must be created by the account owner or an administrator (the bot preset leaves it out). See Discord Chat Bridge
Alerts stoppedConfirm the alert channel still exists and the bot can post in it
All my role grants vanishedA /setup re-link with a key from a different GameGrid account clears them, and so does one where the bot could not tell which account the key belongs to; the reply says "were cleared". A key from the same account keeps them. Re-apply with /permissions preset or /permissions grant

Next: Discord Bot Commands Reference for every command, and Discord Bot Permissions & Security for how the two permission gates interact.