diff options
author | Declan Hoare <declanhoare@exemail.com.au> | 2019-02-23 00:28:27 +1100 |
---|---|---|
committer | Wim <wim@42.be> | 2019-02-22 14:28:27 +0100 |
commit | a7dd033c3b11fd4e0f186cfb00c1a68ea4eab217 (patch) | |
tree | ee482cc3e6584d9fe8610a96e1e74d56bc0024b1 | |
parent | 95e78ffa05ea42b476ae04fe9d7a9cc17d5fdc2f (diff) | |
download | matterbridge-msglm-a7dd033c3b11fd4e0f186cfb00c1a68ea4eab217.tar.gz matterbridge-msglm-a7dd033c3b11fd4e0f186cfb00c1a68ea4eab217.tar.bz2 matterbridge-msglm-a7dd033c3b11fd4e0f186cfb00c1a68ea4eab217.zip |
Allow sending discriminator with Discord username (#726)
-rw-r--r-- | bridge/config/config.go | 1 | ||||
-rw-r--r-- | bridge/discord/handlers.go | 3 | ||||
-rw-r--r-- | matterbridge.toml.sample | 6 |
3 files changed, 9 insertions, 1 deletions
diff --git a/bridge/config/config.go b/bridge/config/config.go index f473ab04..7ab6aef4 100644 --- a/bridge/config/config.go +++ b/bridge/config/config.go @@ -136,6 +136,7 @@ type Protocol struct { UseAPI bool // mattermost, slack UseSASL bool // IRC UseTLS bool // IRC + UseDiscriminator bool // discord UseFirstName bool // telegram UseUserName bool // discord UseInsecureURL bool // telegram diff --git a/bridge/discord/handlers.go b/bridge/discord/handlers.go index 85bac2ec..85a36e1d 100644 --- a/bridge/discord/handlers.go +++ b/bridge/discord/handlers.go @@ -71,6 +71,9 @@ func (b *Bdiscord) messageCreate(s *discordgo.Session, m *discordgo.MessageCreat rmsg.Username = b.getNick(m.Author) } else { rmsg.Username = m.Author.Username + if b.GetBool("UseDiscriminator") { + rmsg.Username += "#" + m.Author.Discriminator + } } // if we have embedded content add it to text diff --git a/matterbridge.toml.sample b/matterbridge.toml.sample index 55f3ab7f..33aebea9 100644 --- a/matterbridge.toml.sample +++ b/matterbridge.toml.sample @@ -710,10 +710,14 @@ Server="yourservername" #OPTIONAL (default false) ShowEmbeds=false -#Shows the username (minus the discriminator) instead of the server nickname +#Shows the username instead of the server nickname #OPTIONAL (default false) UseUserName=false +#Show #xxxx discriminator with UseUserName +#OPTIONAL (default false) +UseDiscriminator=false + #Specify WebhookURL. If given, will relay messages using the Webhook, which gives a better look to messages. #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 #OPTIONAL (default empty) |