This is a Sponge plugin to integrate Minecraft server with a Discord channel.
[GETTING STARTED.md](GETTING STARTED.md)
gradlew
build/libs/DiscordBridge-{version}-all.jar
./discord login
: login to Discord and bind the Discord account to the Minecraft account for automatic login in the future. The email and password will not be stored; instead, the access token of the user will be stored in the config folder on the server./discord otp
: One-time password for Discord login (thanks Prototik)./discord logout
: logout of Discord and unbind the Discord account from the Minecraft account. /discord broadcast
: as this plugin cannot capture server's /say
at the moment, this command is to send a message to all online players and Discord. This command requires having the default account set up./discord status
: show current connection status./discord reload
: reload configurations./discord reconnect
: reconnect Discord connection.A short summary is below:
Command | Shorthand | Permission |
---|---|---|
/discord login |
/d l |
discordbridge.login |
/discord otp |
/d otp |
discordbridge.login |
/discord logout |
/d lo |
discordbridge.login |
/discord broadcast <message> |
/d b <message> |
discordbridge.broadcast |
/discord status |
/d s |
discordbridge.status |
/discord reload |
/d reload |
discordbridge.reload |
/discord reconnect |
/d reconnect |
discordbridge.reconnect |
Some ideas for future commands
Command | Note |
---|---|
/discord config |
Show current configuration |
/discord status |
Show current Discord account |
Configuration is stored in config.json
file.
botToken
: App Bot User's tokenbotDiscordGame
: sets the current game activity of the bot in Discord (thanks, Vankka)tokenStore
: JSON
(default) or NONE
(user authentication will be disabled) or InMemory
(mainly for testing). This is used for player authentication.minecraftBroadcastTemplate
: template for messages in Minecraft from /discord broadcast
commandprefixBlacklist
: a list of prefix string (e.g. ["!"]
) that will be ignored by the plugin (thanks, Vankka)ignoreBots
: ignore all messages from any Discord Bots (thanks, Vankka)channels
: a list of channel configurationsdiscordId
: the ID of the Discord channel (usually a 18-digit number)discord
: templates in DiscordjoinedTemplate
: (optional) template for a message in Discord when a player joins the serverleftTemplate
: (optional) template for a message in Discord when a player leaves the serveranonymousChatTemplate
: (optional) template for messages from Minecraft to Discord for unauthenticated userauthenticatedChatTemplate
: (optional) template for messages from Minecraft to Discord for authenticated userbroadcastTemplate
: (optional) template for messages in Discord from /discord broadcast
commanddeathTemplate
: (optional) template for a message in Discord when a player dies (thanks, Mohron)minecraft
: templates in MinecraftchatTemplate
: (optional) template for messages from Discord to Minecraft. For supporting placeholders in the template, check the section Chat placeholder attachment
: (thanks, Mohron)
template
: template for Discord attachments linked in Minecraft hoverTemplate
: template for the message shown when you hover over an attachment linkallowLink
: adds a clickable link in game for attachments sent via discordemoji
: (thanks, Mohron)
template
: template for custom emoji viewed in Minecraft - accepts %n
hoverTemplate
: template for the message shown when you hover over an emojiallowLink
: adds a clickable link in game to view the emoji imagemention
: (thanks, Mohron)
userTemplate
: template for @user mentions - accepts %s
/%u
roleTemplate
: template for @role mentions - accepts %s
everyoneTemplate
: template for @here & @everyone mentions - accepts %s
channelTemplate
: template for @here & @everyone mentions - accepts %s
roles
: minecraft
configurations that are for a specific Discord roleYou can find some example configurations in examples
folders.
%s
- the message sent via discord%a
- the nickname of the message author or username if nickname is unavailable%u
- the username of the author. This is used if you want to disallow Discord nickname.%r
- the name of the highest Discord role held by the message author. Color of the role will also be translated into Minecraft color automatically.%g
- the current game of the message author%n
- the name of of custom emojiNOTE: The below permissions are applicable only to unathenticated users. Authenticated users chat under their own Discord accounts, so you can restrict using Text permission of Discord roles.
Permission | Use |
---|---|
discordbridge.mention.name discordbridge.mention.name.<name> |
Allows @username /@nickname mentions to be sent from Minecraft |
discordbridge.mention.role discordbridge.mention.role.<role> |
Allows @role mentions - the role must have "Allow anyone to @mention" set |
discordbridge.mention.channel discordbridge.mention.channel.<channel> |
Allows #channel mention |
discordbridge.mention.here |
Allows the @here mention1 |
discordbridge.mention.everyone |
Allows the @everyone mention1 |
1 The bot must have permission to "Mention Everyone" in order to use
@here
&@everyone
.
User Settings
in Discord, then open Appearance
section and tick Developer Mode
Copy ID
2.4.0
[ ] New config to allow executing Minecraft command from Discord
Future
[ ] MySQL token store
[ ] Group-based prefix
[ ] Handle custom Sponge channels (e.g. MCClan and staff chat of Nucleus)
[ ] A command to check Bot connection status
[ ] New config to route Minecraft server log to Discord