3.1 KiB

Discord Bridge Setup Guide

This guide will help you set up the Discord bridge for your Dendrite Matrix server.

Prerequisites

Before starting, ensure that:

  • Dendrite is properly configured and running.
  • The discord database was created during the initial setup.
  • You have your domain name ready.

Setup Steps

  1. Navigate to the Discord configuration directory:
cd config/mautrix-discord
  1. Generate the initial configuration file:
docker run --rm -v `pwd`:/data:z dock.mau.dev/mautrix/discord
  1. Edit the generated config.yaml file. You may need administrative privileges (sudo) to edit this file.

Required Configuration Changes

Make the following modifications to your config.yaml:

Homeserver Settings

homeserver:
    address: http://monolith:8008  # Internal Docker network address
    domain: your.domain.com        # Replace with your actual domain

Appservice Settings

appservice:
    address: http://discord:29334  # Internal bridge address
    hostname: 0.0.0.0             # Listen on all interfaces

Bridge Settings

bridge:
    permissions:
        "*": relay
        "your.domain.com": user           # Replace with your domain
        "@yourusername:your.domain.com": admin  # Replace with your Matrix ID

Database Connection

Update the database URI to use the Discord-specific database:

# Original:
# postgres://dendrite:password@postgres/dendrite?sslmode=disable

# Modified (note 'discord' database name):
postgres://dendrite:password@postgres/discord?sslmode=disable
  1. Generate the registration file:
docker run --rm -v `pwd`:/data:z dock.mau.dev/mautrix/discord
  1. Configure Dendrite to use the Discord bridge by editing config/dendrite/dendrite.yaml:
app_service_api:
    config_files: 
        - "/etc/discord/registration.yaml"

Starting the Bridge

  1. Start the Discord bridge service:
docker compose up -d mautrix-discord
  1. Restart Dendrite to load the new bridge configuration:
docker compose restart monolith

Verifying the Setup

  1. Check if the bridge is running:
docker compose logs mautrix-discord
  1. Verify the bot is online in Discord

Using the Bridge

  1. Start a chat with @discordbot:your.domain.com in your Matrix client
  2. Use the OAuth URL you generated earlier to add the bot to your Discord server
  3. Use the following commands to start bridging:
    • !discord login - Link your Discord account
    • !discord bridge <channel> - Bridge a Discord channel
    • !discord list - List available servers and channels

Troubleshooting

Common issues and solutions:

  1. Bridge Not Connecting

    • Verify bot token is correct
    • Check if all required intents are enabled
    • Ensure bot has proper permissions in Discord
  2. Channel Bridging Issues

    • Verify bot has access to the channel
    • Check if the channel type is supported
    • Ensure proper permissions in both Discord and Matrix
  3. Message Delivery Problems

    • Check bridge logs for errors
    • Verify Discord connection status
    • Ensure proper permissions in both platforms