Skip to content

Section Discord (basic)

Victor edited this page Nov 1, 2019 · 21 revisions
[discord.mydiscord]
# You can get your token by following the instructions on
# https://github.com/42wim/matterbridge/wiki/Discord-bot-setup
# If you want roles/groups mentions to be shown with names instead of ID, 
# you'll need to give your bot the "Manage Roles" permission.
Token="YOUR_TOKEN_HERE"
Server="name or uid of guild" # picked from guilds the bot is connected to
RemoteNickFormat="[{PROTOCOL}] <{NICK}> "

Username/avatar spoofing

Creating a message via a user's API token (the basic configuration above) only lets Matterbridge post with the user/avatar that generated the token. But executing a webhook can set any old username and avatar URL.

Discord webhooks are per-channel. We can implement webhook creation and/or editing but this isn't done yet (see #674). Until then, you'll need to create a webhook for each channel that you want to synchronize:

  1. On Discord, go to Server Settings, then Webhooks
  2. Specify the name and channel, and copy the resulting webhook URL
  3. Paste in your gateway as WebhookURL="https://discordapp.com/api/webhooks/529689699999999999/Da-H4RRY_P0-kjdsknkfgfjghf

The resulting gateway configuration should look like this (for now, you'll need a gateway for each channel that works this way):

[[gateway]]
name="testing"
enable=true
[[gateway.inout]]
account="slack.myworkspace"
channel="testing"
[[gateway.inout]]
account="discord.myserver"
channel="testing"
[gateway.inout.options]
WebhookURL="https://discordapp.com/api/webhooks/thing1/thing2"

User token

To use a user token instead of a bot, refer to the settings page

Clone this wiki locally