Discord
Connect your Discord server to link accounts, sync roles from ranks, bridge the chat, post staff logs and offer slash commands.
The Discord module connects your Minecraft server or network to your Discord server through your own bot. Players link their accounts, get Discord roles from their ranks, and chat between the game and Discord. Your staff gets logs of punishments, jails, reports and tickets in the channels you choose.
This module requires the complete edition. See editions.
Features
- Account linking. A player types
/discord linkin game and gets a code. They send it on Discord with the/linkslash command, or in a private message to the bot. Each Minecraft account links to one Discord account and the other way round. - Link reward. Give money and run console commands the first time a player links. The reward is given only once per Minecraft account and once per Discord account, through the mailbox.
- Roles from ranks. Linked players get the Discord roles that match their ranks. Roles are updated when they join and when their rank changes.
- Discord nicknames. Optionally rename linked members with their Minecraft name or their in game nickname.
- Chat bridge. One Discord channel and the game chat mirror each other. Joins, leaves, deaths, advancements and server start and stop can be posted too. Vanished players are never announced.
- Staff logs. Punishments, jails, reports and tickets are posted in their own channels. Staff with a linked account can claim or close a report with buttons right from Discord.
- Status message. One message in a channel of your choice shows players online, TPS and uptime of each server, updated every minute.
- Slash commands on Discord:
/link <code>: links the Discord account to a Minecraft account./online: lists the players online on each server./player <name>: shows the profile of a player./leaderboard <board>: shows the top 10 of a leaderboard. Only available when the leaderboards module has boards.
- One bot for the whole network. A single server runs the bot. The other servers send it their events, so the chat bridge and the logs cover every server.
Setting it up
1. Create the bot
You do this once, it takes about five minutes. The Connection panel of the Discord page in the web editor shows the same steps.
- Open the Discord developer portal and create a new application. Give it the name you want your bot to have.
- Go to the Bot page of the application, click Reset Token and copy the token.
- On the same Bot page, under Privileged Gateway Intents, enable Message Content Intent and save. The bot needs it to read the chat bridge channel and the codes sent in private messages. The other privileged intents are not needed.
- In the web editor, open Discord, paste the token in Bot token and save.
- Click Invite the bot and add it to your Discord server. The invite link appears once the token is saved and already asks for the permissions the bot needs: View Channels, Send Messages, Embed Links, Read Message History, Manage Roles and Manage Nicknames.
Keep your token secret. Once saved, it is never shown again in the web editor. If it leaks, reset it on the Bot page of the portal and paste the new one.
The Connection panel shows the state of the bot: Bot online when everything works. If it shows Intent missing, enable Message Content Intent and save the token again. If it shows Bot not invited, use the invite button. If it shows Library missing, the bot server could not download what it needs to talk to Discord: check its internet access and restart it.
2. Choose the bot server and the Discord server
| Setting | What it does |
|---|---|
| Bot server | On a network, only this server runs the bot. The other servers send it their events. A single server always runs the bot itself. |
| Discord server | If the bot is in several Discord servers, choose the one to use. By default, the first one. |
| Bot activity | Text shown under the bot name, for example {online} players. Empty: none. |
Channels and roles appear in the lists below once the bot is online in your Discord server. A warning shows next to any channel where the bot cannot write.
3. Chat bridge
| Setting | What it does | Default |
|---|---|---|
| Chat channel | This channel and the game chat mirror each other. | None |
| Game chat to Discord | Sends game messages to the channel. | On |
| Discord to game chat | Shows channel messages in game. | On |
| Linked members only | Only members with a linked account can talk in game from Discord. | Off |
| Joins and leaves | Posts when players join and leave. | On |
| Deaths | Posts death messages. | On |
| Advancements | Posts advancements. | On |
| Server start and stop | Posts when a server starts or stops. | On |
| Maximum message length | Longer messages are cut, in both directions. | 256 |
Mentions and formatting written in game are never applied on Discord. Muted players can never talk in game from Discord.
Message formats lets you change how each bridged message looks: Discord messages in game (with Minecraft colors), and game messages, joins, leaves, deaths, advancements, server start and server stop on Discord (with **bold** and *italic*). Each language has its own texts.
4. Staff logs
Each log goes to its own channel. Leave a channel empty and that log is not posted.
| Setting | What it posts |
|---|---|
| Sanctions channel | Bans, mutes, kicks and warnings, given and lifted. |
| Jail channel | Players sent to jail and released. |
| Reports channel | New, claimed and closed reports. |
| Tickets channel | New, closed and rated tickets. |
| Ticket replies | Also posts every reply written in a ticket. Off by default. |
| Report buttons | Staff with a linked account can claim or close a report from Discord. On by default. |
| Player head image | Address of the head shown in the logs. {uuid} and {name} are replaced. Empty: none. |
Report buttons only work for linked members who have the inglis.reports.notify permission in game.
5. Status
Pick a Status channel and the bot keeps one message there, updated every minute, with the players online, TPS and uptime of each server.
6. Roles
Only linked players get roles.
| Setting | What it does | Default |
|---|---|---|
| Give roles from ranks | Linked players get the Discord roles of their ranks. | On |
| Ranks used | All ranks (inherited ones too) or Highest rank only. | All ranks |
| Remove other roles | A role from the table is removed when the player no longer has its rank. | On |
| Discord nickname | Unchanged, Minecraft name or Nickname. | Unchanged |
| Roles by rank | Table that pairs each rank with a Discord role. Use Add a role to add a line. | Empty |
Discord only lets the bot give roles that are below its own role. Roles that are too high are marked "above the bot" in the list. Move the bot role higher in your Discord server settings. The same applies to nicknames.
7. Account linking
| Setting | What it does | Default |
|---|---|---|
| Code lifetime (minutes) | Time a player has to send the code given by /discord link. |
10 |
| Link by private message | Players can also send their code to the bot in a private message. | On |
| Reward money | Given once per account on the first link. 0: none. | 0 |
| Reward currency | Currency id. Empty: the main currency. | Main currency |
| Reward commands | Console commands run once on the first link. {player} is the player name. |
Empty |
The Linked accounts page lists every linked player with their Discord account and link date. You can search it and unlink a player. Unlinking removes the synced roles, and the first link reward is not given again.
Commands
| Command | What it does | Permission |
|---|---|---|
/discord |
Shows whether your account is linked, and to which Discord account. | inglis.discord.discord (everyone) |
/discord link |
Gives you a code to link your account on Discord. | inglis.discord.discord |
/discord unlink |
Unlinks your account. | inglis.discord.discord |
The alias, permission, cooldown, price, worlds and rank rules of /discord can be changed in the web editor, see commands.
Tips
- After too many wrong codes, a Discord account has to wait a quarter of an hour before trying again. This blocks code guessing.
- If slash commands do not show up on Discord, invite the bot again with the button in the web editor.
- On a network, pick as bot server one that is always running, such as your lobby.