From f22d9a1586e879372ab4d3951a3cab7adbe3f18f Mon Sep 17 00:00:00 2001 From: Qais Patankar Date: Fri, 6 Mar 2020 18:50:26 +0000 Subject: [PATCH] Updated Section Discord (basic) (markdown) --- Section-Discord-(basic).md | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/Section-Discord-(basic).md b/Section-Discord-(basic).md index cd0a921..35afbb5 100644 --- a/Section-Discord-(basic).md +++ b/Section-Discord-(basic).md @@ -137,13 +137,11 @@ SyncTopic=false [Creating a message](https://discordapp.com/developers/docs/resources/channel#create-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](https://discordapp.com/developers/docs/resources/webhook#execute-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): +If matterbridge does not have permissions to modify webhooks, you will need a webhook per channel: ```toml [[gateway]] @@ -159,5 +157,22 @@ channel="testing" WebhookURL="https://discordapp.com/api/webhooks/thing1/thing2" ``` +If matterbridge **does** have permissions to modify webhooks, you can use one webhook for the gateway: + +```toml +[[gateway]] +name="testing" +enable=true +WebhookURL="https://discordapp.com/api/webhooks/thing1/thing2" + +[[gateway.inout]] +account="slack.myworkspace" +channel="testing" +[[gateway.inout]] +account="discord.myserver" +channel="testing" +``` + + ## User token To use a user token instead of a bot, refer to the [settings page](https://github.com/42wim/matterbridge/wiki/Settings#token-) \ No newline at end of file