Bridge Between Discord and with DiscordSRV
What is DiscordSRV
DiscordSRV is a plugin that allows players to interact between your Minecraft server and Discord through a Discord bot hosted on your Minecraft server. It has features such as:
- An interactive chat between a Discord channel and the Minecraft server’s chat.
- Forward your Minecraft console to a Discord channel.
- Send alerts based on specific events.
- Require linked accounts or specific roles to play.
Preparing the Discord Bot:
Creating the Bot:
-
Log in to the Discord Developer Portal.
-
Click on “New Application” and give the bot a name.
-
Make sure to agree to the Developer Terms of Service and Developer Policy before clicking “Create”.
-
Navigate to the “Installation” tab in the left menu.
-
Under “Installation Contexts” uncheck the “User Install” option.
-
Set the “Install Link” to “None”.
-
Click on “Save Changes” at the bottom of the page.
-
On the left, navigate to the “Bot” tab.
-
Under “Authorization Flow” toggle the “Public Bot” option to off.
-
Under the “Privileged Gateway Intents” section, enable “Server Members Intent” and “Message Content Intent”.
Adding to Your Server:
-
Navigate back to the “General Information” tab and click on “Copy” under “Application ID”.
-
Copy the link below and paste it into your browser, make sure to replace
<application_id>
with the ID you copied.https://discord.com/oauth2/authorize?scope=bot+applications.commands&client_id=<application_id>
-
From the dropdown menu, choose your Discord server and click on “Authorise”.
-
Give your bot the relevant permissions as explain in the DiscordSRV guide.
Obtaining the Bot Token
-
Navigate back to the “Bot” tab and below “Token” click on “Reset Token”.
-
Save the token as we will be needing it later on.
Installation and Configuration:
Prerequisites:
- Ensure your server is running with Spigot or any of its forks (Paper, Purpur, etc).
Installation:
We already have a guide on how to install DiscordSRV as well as any other plugin in our Adding Plugins guide.
Configuring the Plugin:
-
Navigate to the File Manager by hovering over “Manage” and clicking on “File Manager”.
-
Locate and open the Plugins folder.
-
Find and open the DiscordSRV folder, this is where all its configuration files are stored.
-
Open “config.yml”. This is the main configuration file.
-
Look for the property below and replace
BOTTOKEN
with your bot’s token.BotToken: "BOTTOKEN"
-
Get the ID of the channel you want to connect to the Minecraft chat. A detailed guide by Discord on getting IDs can be found here.
-
Find and replace
000000000000000000
in the setting below with the channel ID you just copied.Channels: {"global": "000000000000000000"}
-
Generate a Discord server invite link without an expiry period if it is a public server.
-
Update the setting below to the new server invite. If your server is private leave it as is or change it to
""
.DiscordInviteLink: "https://discord.gg/changethisintheconfig.yml"
-
Click on “Save File” to save your changes.
-
(Re)start your server to apply the changes.
Additional Configuration:
Console Channel:
In many cases, you may want to give your admins access to the server console through Discord without needing a Falix account. That is where the console channel feature comes in. It sends all messages from the console to the specified channel, and any commands sent within the channel will be forwarded and run in the actual console.
-
In Discord, copy the ID of the channel you want to use as a console.
-
Navigate and open the main DiscordSRV configuration file.
-
Locate the setting below and set
000000000000000000
the console channel ID.DiscordConsoleChannelId: "000000000000000000"
-
Click on “Save File” to save your changes.
-
(Re)start the server.
Link Discord To Join:
To safeguard against random and untrusted players joining your server it is advised to enable account linking. This is when a player joins the Minecraft server and is asked to send a code to the Discord bot. Upon sending the code your Discord account will be linked to the Minecraft account and you will gain permission to join the Minecraft server.
-
Once again navigate to the DiscordSRV configuration Folder.
-
Click to open
linking.yml
. -
Set
Enabled:
totrue
. -
Click on “Save File” to save your changes.
-
(Re)start the server.
Subscriber Role:
You may want to further secure the Minecraft server by allowing only Discord users with a specified role to join:
-
In Discord, copy the ID of the subscriber role.
-
In the DiscordSRV configuration folder, open
linking.yml
once more. -
Set
Require subscriber role to join:
totrue
.\ -
Change the configuration below and set
00000000000000000
to the role ID you copied.Subscriber roles: ["00000000000000000"]
To add multiple roles add
, "00000000000000000"
after"00000000000000000"
. If you want to require all the listed roles enableRequire all of the listed roles:
. -
Click on “Save File” to save your changes.
-
(Re)start the server.