McDiscordChatBridge
This bungeecord plugin will offer you the opportunity to create a bidirectional ingame chat between minecraft and discord.
It's highly customizable, each discord channel can be configured to post messages on any MC server connected to bungeecord and each MC server can be configured to post its messages on individual discord channels.
Features:
- Customizable Bot status text
- Customizable mapping table on which MC server messages of discord channels should be posted ingame
- Separately customizable mapping table on which discord channels messages from ingame MC servers should be posted
- Discord command for player list output (also on private messages)
- MC command for muting players
- Customizable server prefixes to be shown in discord
- Customizable discord prefix to be shown ingame
- Customizable and disableable join, switch, leave messages
- Multilingual messages YAML files (comes with english & german by default)
- It uses bStats
Commands:
Ingame: /discbot <mute> [player]
Mute yourself or other players, so their messages won't be send to discord. The list of muted players will be saved to a CSV file, so it's persistent after stopping bungeecord.
Discord: !list
Prints a list of all online players and their server
Permissions:
Ingame:
"
mcdiscordchatbridge.mute": Permission to un- / mute yourself.
"
mcdiscordchatbridge.mute.others": Permission to un- / mute others.
Be aware, those permissions must be set up in bungeecord.
Discord:
None required.
Configuration:
The plugin comes with this default configuration, which
NEEDS to be adjusted by yourself.
Updating from v1.2? See here for a update description.
Code (YAML):
# The used messages_<LANG>.yml file
language
: en
# The secret authentification token of your bot
token
: 'AbCdEfGhIjKlMnOpQrStUvWxYz'
# Messages beginning with any of these chars will not be send to discord
mask-chars
:
[ '/', '!'
]
# Whether or not to send join, swich, leave messages to discord
announce-join
: true
# Mapping table where ingame messages should be posted in discord
servers:
'lobby':
channels
:
[ 12345678900, 12345678901
]
prefix
: '<:nether_star:1234567890> '
'survival':
channels
:
[ 12345678900, 12345678901
]
prefix
: '<:grass_block:1234567890> '
# Mapping table where discord messages should be posted ingame
channels:
'12345678900':
servers
:
[ 'lobby', 'survival'
]
prefix
: '&7
[&8Discord&7
]&r '
'12345678901':
servers
:
[ 'lobby', 'survival'
]
prefix
: '&7
[&8Discord&7
]&r '
Setting up the discord hook:
statustext:
token:
You should create your own discord bot. This is for free and can be done with only few easy steps. It only requires you having a discord account.
There already are many tutorials out there, feel free to use them.
However, right here i've summarized the steps for you.
- Go to the discord developer portal and log in there.
- Create a new "application" and open it or if you want to add the bot to a existing one, open that.
- Go to the "Bot" tab and create a new bot if you got none in your application yet.
- Copy the token and paste it into your config
- If you now just created a new bot, you need to let it join your discord server, where you want the action to take place.
Therefore go to the "OAuth2" tab on the same page and scroll down to the "OAuth2 URL Generator".
Check the box "bot", copy the link and paste it into your browsers adress bar.
It should be something like "https://discord.com/api/oauth2/authorize?client_id=<CLIENT_ID>&scope=bot".
Again no permissions needed (&permissions=0).
- On the following website you need to authenticate and then are able to add the bot to any server where you got administrative rights.
Select your desired server and click "Authenticate".
- You can set up several more things like its profile picture, etc...
As already said, no permissions needed for this bot.
servers:
List all MC servers by their bungeecord configuration name (only the ones you want their messages shown in discord).
For each server add 2 properties:
channels: A number array of all discord channel ids, where messages of each specific server should be posted. Simply use the channel right click copy ID feature of discord.
If you can't see this right-click menu entry, you probably need to enable developer mode within your advanced discord settings.
prefix: A prefix for this specific MC server in discord. This also can be an Emoji.
Be aware, if you want to post emoji in discord, it must be a specific syntax: <:name:id>. To find out the emoji ID, simply type the emoji in discord and add a backslash in front of it (\), then discord will show you this syntax.
channels:
List all discord channels by their ID (get the ID just like above) and also only those ones you want their messages from to be posted ingame.
Be aware to add an apostrophe here, since YAML keys must be string-type. This also needs 2 properties each:
servers: A string array of all bungeecord connected server names, where messages of this channel should be broadcasted in.
prefix: A prefix for this specific discord channel to be added in the MC chat.
Additional info:
- This plugin comes with the Javacord library, which is a officially trusted discord API implementation
That's also why this JAR is 8MB
- No other plugins are necessary, not on bungeecord neither on any connected MC server
- This plugin does not directly interact with any chat plugin, however chat plugins (e.g. for adding rank prefixes, etc.) can be used
- Compiled with Java 1.8
- Tested with bungeecord 1.16-R0.5 & spigot 1.16.5, also 1.17.1
- Of course the discord channel for sending messages to MC can be the same for receiving messages from MC, no separate sending / receiving channels necessary
Need additional features or got some interesting ideas?
Leave a reply and i might add this or other functions if requested.
Replys, ratings and suggestions welcome.
![[IMG]](/proxy/image?url=http%3A%2F%2Fprivateshare.ddns.net%2FbStats%2Fid12487.php)