matrix-org / matrix-appservice-discord

A bridge between Matrix and Discord.
Apache License 2.0
785 stars 148 forks source link
bridge discord matrix riot

Matrix Discord Bridge

A bridge between Matrix and Discord. Currently the bridge is in Beta and quite usable for everyday bridging, with one or two bugs cropping up.

Screenshot of Element and Discord working together

Helping out

Build Status Docker Automated build #discord:half-shot.uk

PRs

PRs are graciously accepted, so please come talk to us in #discord-bridge:matrix.org about any neat ideas you might have. If you are going to make a change, please merge it with the develop branch :).

Issues

You can also file bug reports/ feature requests on Github Issues which also helps a ton. Please remember to include logs. Please also be aware that this is an unoffical project worked on in our spare time.

Setting up

The bridge has been tested against the Synapse homeserver, although any homeserver that implements the AS API should work with this bridge.

The bridge supports any version of Node.js between v18.X - v20.X. View the releases for more details.

The bridge uses Yarn for dependency management and package scripts. For the time being, only Yarn Classic / v1 is supported. To install it, follow these instructions.

If you already have Yarn 2+ installed, you may configure just this project to use Yarn Classic by running yarn set version classic in the directory where you cloned this repository.

Set up the bridge

Docker

Following the instructions above, generate a registration file. The file may also be hand-crafted if you're familiar with the layout. You'll need this file to use the Docker image.

# Create the volume where we'll keep the bridge's files
mkdir -p /matrix-appservice-discord

# Create the configuration file. Use the sample configuration file as a template.
# Be sure to set the database paths to something like this:
#  database:
#    filename: "/data/discord.db"
#    userStorePath: "/data/user-store.db"
#    roomStorePath: "/data/room-store.db"
nano /matrix-appservice-discord/config.yaml

# Copy the registration file to the volume
cp discord-registration.yaml /matrix-appservice-discord/discord-registration.yaml

# Optional: Build the container yourself (requires a git clone, and to be in the root of the project)
docker build -t halfshot/matrix-appservice-discord .

# Run the container
docker run -v /matrix-appservice-discord:/data -p 9005:9005 halfshot/matrix-appservice-discord

Metrics

The bridge supports reporting metrics via Prometheus. You can configure metrics support in the config file. The metrics will be reported under the URL provided in the registration file, on the /metrics endpoint.

3PID Protocol Support

This bridge support searching for rooms within networks via the 3pid system used in clients like Element. Any new servers/guilds you bridge should show up in the network list on Element and other clients.

Setting up Discord

Running the Bridge

Howto

End User Documentation

Bridging a Room

You must get an authorization link from bridge owner. You must be a server admin or get help from server admin on Discord side.

Unbridging a Room

Features and Roadmap

In a vague order of what is coming up next

Contact

My Matrix ID: @Half-Shot:half-shot.uk