Skip to content

Configuring a Discord bot

Dominik Korsa edited this page Jun 29, 2023 · 15 revisions

This page will help you create a Discord bot and configure Discord Integration to use it.

Please enable the server with this plugin at least once before following the rest of this tutorial, so the config.yml and messages.yml are created. You can also configure the plugin when it's enabled and the server is on, just remember to run /di reload.

Note: Do not use tabs in config.yml or messages.yml and use spaces instead. Otherwise the config won't load

Creating the bot

  1. Go to https://discord.com/developers/applications
  2. Click New application, choose a fitting name and click Create

Create an application dialog

  1. Open the Bot tab, then set the icon and name of the bot. Members of your server will be able to see them

Build-A-Bot

  1. Enable Server members intent and Message content intent below:

Configuring intents

  1. Copy the bot token from this page and paste it in the config.yml file as the discord-token field, like so:
# (...)
discord-token: PASTE.YOUR.TOKEN.HERE
# (...)

Inviting the bot to your server

  1. Open the OAuth2/URL Genrator tab
  2. Pick bot and applications.commands in scopes

Scopes selection

  1. In the Bot Permissions box, select Administrator. You can also manually select all the scopes the bot should have, but this might prevent the bot from working

Bot Permissions box

  1. Copy the authorization URL

Authorization URL

  1. Open the URL in your browser. Pick a server to add the bot to and click Continue

Connect with Discord
(pretend this is in English)

  1. Confirm the scopes and click Authorize

  2. Open Server Setting/Roles

  3. Move the bot role to the top

Managing roles

Configuring synced channels

  1. Right click on the channel you want to sync
  2. Click Copy Link (you can also click Copy ID, if you have Developer Mode enabled)
  3. Paste the ID or link in the chat.channels list
# (...)
chat:
  channels:
    - PASTE_YOUR_CHANNEL_ID_OR_LINK_HERE
# (...)
  1. Repeat for every channel you want to sync

Configuring Webhooks

You need to create webhooks in order for the Minecraft chat messages to be shown on Discord

  1. Click Edit channel on the channel you want to receive Minecraft messages on
  2. Click on the Integrations tab and click View Webhooks

View Webhooks

  1. Click New Webhook
  2. Pick the channel
  3. Pick a name and icon

Capitan Hook

  1. Click Copy Webhook URL
  2. Paste the webook in the chat.webhooks list
# (...)
chat:
  channels:
    - 814059044134322189
  webhooks:
    - https://discord.com/api/webhooks/839784039262191627/IYYJo-lXjiyNopEYUwuBAFThIsiSfaKeUTLCgsechCy-31bpkItTeNSSab7iEsA7xDD
# (...)
  1. Repeat for every channel you want to add
  2. If your server is set to offline mode (cracked), set chat.avatar.offline-mode to true

Finally you can type /di reload. You should see this message: Discord Integration connected