mirror of
https://github.com/42wim/matterbridge.git
synced 2025-06-22 14:47:28 +02:00
Improve docs
parent
ddf60fa38e
commit
9598118d37
@ -1,3 +1,5 @@
|
||||
## Specification
|
||||
|
||||
**Basic example**
|
||||
```toml
|
||||
[discord.mydiscord]
|
||||
@ -147,40 +149,80 @@ SyncTopic=false
|
||||
|
||||
## Username/avatar spoofing
|
||||
|
||||
[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.
|
||||
[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 username and avatar URL.
|
||||
|
||||
If you grant the bot the "Manage Webhooks" permission, it will automatically load and create webhooks in every bridged channel. You can even grant that permission on specific channels, if you don't want to give it global permission.
|
||||
|
||||
1. Server Settings -> Roles
|
||||
2. Select your app's role
|
||||
3. Grant "Manage Webhooks"
|
||||
|
||||
Then, just provide `AutoWebhooks=true` for the Discord account settings, as shown below:
|
||||
|
||||
```toml
|
||||
[discord]
|
||||
[discord.mydiscord]
|
||||
Token="some-secret-token"
|
||||
Server="Wumpus Technologies Inc."
|
||||
AutoWebhooks=true
|
||||
```
|
||||
|
||||
|
||||
<details><summary>If you would like to create webhooks yourself, instead of letting the bot manage them, follow these instructions.</summary>
|
||||
|
||||
1. On Discord, go to Server Settings, then Integrations, then Webhooks -> "Create Webhook"
|
||||
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`
|
||||
|
||||
If your Discord bot has a role that **does not** have permissions to modify webhooks, you will need a webhook per channel:
|
||||
Specify a webhook per channel:
|
||||
|
||||
```toml
|
||||
[[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"
|
||||
|
||||
# Specify options for this gateway link
|
||||
[gateway.inout.options]
|
||||
WebhookURL="https://discordapp.com/api/webhooks/thing1/thing2"
|
||||
```
|
||||
|
||||
If your Discord bot has a role that **does** have permissions to modify webhooks, you can use one webhook (configured for any channel on the same Discord server) for all channels on that Server/Guild:
|
||||
</details>
|
||||
|
||||
|
||||
|
||||
## Guessing avatars when they are missing
|
||||
|
||||
> **This feature is only available when sending messages using webhooks.**
|
||||
|
||||
Avatars from source platforms will usually be shown in Discord messages. However, sometimes users can't (or don't) set their avatar on the source platform, (e.g for messages sent from IRC to Discord), so messages from those may use a default avatar.
|
||||
|
||||
The `UseLocalAvatar` specifies source bridges for which an avatar should be "guessed", so that all messages have avatars. This works by comparing the source message username to an existing Discord user on your server, and using the avatar of that Discord user.
|
||||
|
||||
Note that it won't try to "guess" avatars when:
|
||||
|
||||
- an avatar on the source platform is present, or
|
||||
- there are multiple Discord users with the same name.
|
||||
|
||||
As shown below, you can either provide the bridge platform name (`"irc"`) or the full account name (`"slack.myworkspace"`). This means that for messages coming from IRC, or messages from the Slack `myworkspace` account, avatar "guessing" is enabled.
|
||||
|
||||
```toml
|
||||
[discord]
|
||||
[discord.mydiscord]
|
||||
Token="YOUR_TOKEN_HERE"
|
||||
Server="name or uid of guild" # picked from guilds the bot is connected to
|
||||
WebhookURL="https://discordapp.com/api/webhooks/thing1/thing2"
|
||||
RemoteNickFormat="{NICK} via {PROTOCOL}"
|
||||
Token="some-secret-token"
|
||||
Server="Wumpus Technologies Inc."
|
||||
UseLocalAvatar=["irc", "slack.myworkspace"]
|
||||
```
|
||||
|
||||
|
||||
|
||||
## User token
|
||||
To use a user token instead of a bot, refer to the [settings page](https://github.com/42wim/matterbridge/wiki/Settings#token-)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user