Add full list of Discord config options

Qais Patankar 2020-03-06 18:45:32 +00:00
parent c59399886f
commit 08cddcb766

@ -1,14 +1,133 @@
**Basic example**
```toml
[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}> "
```
**Full list**
```toml
[discord]
[discord.game]
# Token (REQUIRED) is the token to connect with Discord API
# You can get your token by following the instructions on
# https://github.com/reactiflux/discord-irc/wiki/Creating-a-discord-bot-&-getting-a-token
# 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="Yourtokenhere"
# Server is the ID or name of the guild to connect to, selected from the guilds the bot has been invited to
Server="yourservername"
## RELOADABLE SETTINGS
## Settings below can be reloaded by editing the file
# ShowEmbeds shows the title, description and URL of embedded messages (sent by other bots)
ShowEmbeds=false
# UseUserName shows the username instead of the server nickname
UseUserName=false
# UseDiscriminator appends the `#xxxx` discriminator when used with UseUserName
UseDiscriminator=false
# WebhookURL, if specified, will send messages in the style of puppets.
# This only works if you have one discord channel, if you have multiple discord channels you'll have to specify it in the gateway config
# Example: "https://discordapp.com/api/webhooks/1234/abcd_xyzw"
WebhookURL=""
# EditDisable allows you to disable sending of edits to other bridges
EditDisable=false
# EditSuffix specifies the message to be appended to every edited message
# Example: " (edited)"
EditSuffix=""
# IgnoreNicks allows you to mute outgoing messages from certain users.
# Messages from these users will not be transmitted to other bridges.
# Regular expressions are also supported.
# Example: "ircspammer1 ircspammer2"
IgnoreNicks=""
# IgnoreMessages allows you to mute outgoing messages of a certain format.
# Messages matching this regular expression will not be transmitted sent to other bridges
# See https://regex-golang.appspot.com/assets/html/index.html for more regex info
#
# Example that ignores messages starting with ~~ or messages containing badword:
# IgnoreMessages="^~~ badword"
IgnoreMessages=""
# ReplaceMessages replaces substrings of messages in outgoing messages.
# Regular expressions are supported.
#
# Example that replaces 'cat' => 'dog' and 'sleep' => 'awake':
# ReplaceMessages=[ ["cat","dog"], ["sleep","awake"] ]
# Example that replaces all digits with the letter 'X', so 'hello123' becomes 'helloXXX':
# ReplaceMessages=[ ["[0-9]","X"] ]
ReplaceMessages=[]
# ReplaceNicks replaces substrings of usernames in outgoing messages.
# See the ReplaceMessages setting for examples.
# Example: [ ["user--","user"] ]
ReplaceNicks=[]
# ExtractNicks allows for interoperability with other bridge software by rewriting messages and extracting usernames.
#
# Recommended reading:
# - https://github.com/42wim/matterbridge/issues/466
# - https://github.com/42wim/matterbridge/issues/713
#
# This example translates the following message
# "Relaybot: <relayeduser> something interesting"
# into this message
# "relayeduser: something interesting"
# like so:
# ExtractNicks=[ [ "Relaybot", "<(.*?)>\\s+" ] ]
#
# This example translates the following message
# "otherbot: (relayeduser) something else"
# into this message
# "relayeduser: something else"
# like so:
# ExtractNicks=[ [ "otherbot","\\((.*?)\\)\\s+" ] ]
#
# This example combines both of the above examples into one:
# ExtractNicks=[ [ "Relaybot", "<(.*?)>\\s+" ],[ "otherbot","\\((.*?)\\)\\s+" ]
#
ExtractNicks=[]
# Label can be used as an extra identifier for use in the RemoteNickFormat setting.
Label=""
# RemoteNickFormat specifies how remote users appear on this bridge.
# See the [general] config section for default options
RemoteNickFormat="[{PROTOCOL}] <{NICK}> "
# ShowJoinPart will emit messages that show joins/parts from other bridges
# Supported from the following bridges: irc, mattermost, slack, discord
ShowJoinPart=false
# StripNick will strip non-alphanumeric characters from nicknames.
# Recommended reading: https://github.com/42wim/matterbridge/issues/285
StripNick=false
# ShowTopicChange will emit messages that show topic/purpose updates from other bridges
# Supported from the following bridges: slack
ShowTopicChange=false
# SyncTopic will sync topic/purpose updates from other bridges
# Supported from the following bridges: slack
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.