Black Branch/Docs
All sections

Discord

This page is for a streamer who already has a Discord server. After it, you will know what the Discord bridge does, how to set it up in four steps, what it does not carry, and what needs your own hand on Discord's side.

What the bridge does

A bridge is a program that sits between two chat systems and copies messages both ways. Black Branch comes with one for Discord, Out Of Your Element (OOYE), an open-source Discord bridge for Matrix. It runs on your own server beside your homeserver, and it is off on a new install.

Once it is on and a Discord channel is linked to one of your community rooms:

The bridge never decides who is who on your site. Roles, bans and who can join a room stay with your site; see Who can link what.

What you need

Setting it up

Everything happens on one page, Admin Panel → Site → Discord (under Community). At its top, Discord bridge: off, on or waiting says where the bridge stands, with the Doctor's own sentence under it. The import waits until Discord lets the bot in, and linking waits until the bridge is on.

1. The bot

The page shows the two steps on Discord's side, with a Copy button for the words to paste:

  1. A Discord application for this server only. In the Discord Developer Portal, press New Application. Put Powered by OOYE somewhere in its description: the bridge's author asks for it.
  2. Its intents and its bot token. On the application's Bot page, under Privileged Gateway Intents, switch on Presence Intent, Server Members Intent and Message Content Intent, and save. Then press Reset Token, copy the token, paste it into the page and press Save the token.

The server writes the token into the bridge's own settings file. The site keeps no copy, and the page never shows it again. To change it, paste a new one the same way: only the bridge restarts.

Then switch the bridge on, on the server:

sudo blackbranch discord on

It refuses until a token is saved. It builds the bridge (a minute or two the first time, more on a slow server) and starts it; sudo blackbranch discord off switches it off again. The page's top line turns on once Discord and your homeserver have let the bridge in.

Press Check again. The page now says Discord lets the bot in, with the bot's name and the Discord servers it is in. A warning shows while Server Members or Message Content is still off. Then open Discord's add-the-bot page (a link the bridge builds, with the permissions it needs), pick your Discord server, press Authorize, and press Check again: your server shows among the bot's servers.

2. Import the Discord server

Pick your server from the list (or paste its ID) and press Read the server. Nothing on Discord changes. The page shows what your community would become:

Press Confirm the import. The categories and channels are made in one go, and your server builds the rooms on its next run (see What your server keeps for you). Reading the server again later shows only what changed: new channels ticked, changes on either side marked Differs and left unticked. Nothing is ever made twice.

You can skip the import and link rooms you made yourself.

Paste your Discord server's ID and press Link the server. This can take up to a minute the first time, while your server seats the bridge's bot in the community's space. Once linked, the community's name and picture follow the Discord server's, as the bridge sets them; unlink and they are the panel's again.

Unlink the server asks first: it unlinks every room, and the bot leaves the Discord server.

Every room in your community is listed. Beside each, paste a Discord channel ID and press Link (a room the import made has its own channel filled in already). A room says Linked, Waiting for the bridge (with Try again), Not made yet or Only rooms everyone can see and post in. Unlink undoes one link. Check again reads again what the bridge holds.

The Doctor has two rows for the bridge, Discord bridge and Discord bot sees the server; see Health and the Doctor. When something is red, sudo blackbranch logs ooye says what Discord or your homeserver answered.

What it does not carry

These are also listed at the bottom of the Discord page.

What needs your hand on Discord's side

Known gaps, such as the bridge's database not yet being in the backups, are on Known gaps.

Next: 7TV emotes

← Connect your platforms