Discord relay bot - ClassiCube/MCGalaxy GitHub Wiki
Introduction
MCGalaxy includes a built-in Discord relay bot which allows you to:
- Send in-game chat to Discord
- Send Discord chat to in-game
- Run in-game commands from Discord
This guide will explain how to setup and configure the Discord relay bot
Note: You should enable Developer Mode in User Settings -> App Settings - you'll need this later
Setting up a bot account
- Create a bot account in Developer Portal
- Invite the bot account to the guild/server
- Copy the bot account's token
See here for a more detailed guide
Note: Do not share the bot token with anyone else
Read permissions
Discord prevents bots from reading the contents of messages sent from Discord unless the Message Content Intent
permission has been enabled in their bot account settings
To enable the Message Content Intent
permission in bot account settings:
- Go to the Developer Portal
- Click on the bot in the My Applications list
- Click
SETTINGS -> Bot
in left pane - Ensure that
MESSAGE CONTENT INTENT
is enabled - Save Changes
GUI
Go to Settings -> IRC, then tick Enable Discord integration
and paste the bot token into Bot token
CLI
Open properties/discordbot.properties in a text editor, then set enabled
to true and paste the bot token for token
General channels
You can specify one or more Discord channels to treat as general channels
- Anyone can type
.who
to see a list of online players - All general in-game chat will be sent to these channels
- Any messages sent to these channels will appear in-game
Right click the channel, then click Copy ID
GUI
Paste the channel ID into Channel ID
(Use a comma to separate channel IDs)
CLI
Open properties/discordbot.properties in a text editor, then paste the channel ID into channel-ids
Operator channels
You can specify one or more Discord channels to treat as operator channels
- Anyone can type
.who
to see a list of online players - All staff-only chat (e.g. /opchat) will be sent to these channels
- Any messages sent to these channels will be appear in-game as /opchat messages
Right click the channel, then click Copy ID
GUI
Paste the channel ID into OpChannel ID
(Use a comma to separate channel IDs)
CLI
Open properties/discordbot.properties in a text editor, then paste the channel ID into op-channel-ids
Controller users
You can allow certain users to execute in-game commands from Discord
To add a controller user:
- Right click the user on Discord and then click
Copy ID
- In-game type
/DiscordControllers add [user id]
Controller users can execute in-game commands from Discord by either
- Typing
.x [command] [arguments]
on a General or Operator channel
- DMing the bot account
[command] [arguments]
This page is still a draft - remaining work
Adjusting messages
replacements.txt stuff
Advanced stuff
Extra options available by editing properties/discordbot.properties in a text editor