summaryrefslogtreecommitdiffstats
path: root/bridge
diff options
context:
space:
mode:
Diffstat (limited to 'bridge')
-rw-r--r--bridge/config/config.go1
-rw-r--r--bridge/discord/discord.go7
2 files changed, 7 insertions, 1 deletions
diff --git a/bridge/config/config.go b/bridge/config/config.go
index c03a3ab5..a90cb9a9 100644
--- a/bridge/config/config.go
+++ b/bridge/config/config.go
@@ -77,6 +77,7 @@ type Protocol struct {
UseSASL bool // IRC
UseTLS bool // IRC
UseFirstName bool // telegram
+ UseUserName bool // discord
UseInsecureURL bool // telegram
WebhookBindAddress string // mattermost, slack
WebhookURL string // mattermost, slack
diff --git a/bridge/discord/discord.go b/bridge/discord/discord.go
index 926aa807..4b325653 100644
--- a/bridge/discord/discord.go
+++ b/bridge/discord/discord.go
@@ -181,7 +181,12 @@ func (b *bdiscord) messageCreate(s *discordgo.Session, m *discordgo.MessageCreat
if b.UseChannelID {
rmsg.Channel = "ID:" + m.ChannelID
}
- rmsg.Username = b.getNick(m.Author)
+
+ if !b.Config.UseUserName {
+ rmsg.Username = b.getNick(m.Author)
+ } else {
+ rmsg.Username = m.Author.Username
+ }
if b.Config.ShowEmbeds && m.Message.Embeds != nil {
for _, embed := range m.Message.Embeds {