From 9e3bd7398cd153637f084cf4b5e6f01e567b491c Mon Sep 17 00:00:00 2001 From: Qais Patankar Date: Wed, 18 Mar 2020 22:12:48 +0000 Subject: Fix #1027: warning when handling inbound webhooks (discord) (#1044) --- bridge/discord/handlers.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bridge/discord/handlers.go b/bridge/discord/handlers.go index 2527c0db..2313390e 100644 --- a/bridge/discord/handlers.go +++ b/bridge/discord/handlers.go @@ -90,12 +90,12 @@ func (b *Bdiscord) messageCreate(s *discordgo.Session, m *discordgo.MessageCreat // set channel name rmsg.Channel = b.getChannelName(m.ChannelID) - // set username - if !b.GetBool("UseUserName") { + fromWebhook := m.WebhookID != "" + if !fromWebhook && !b.GetBool("UseUserName") { rmsg.Username = b.getNick(m.Author, m.GuildID) } else { rmsg.Username = m.Author.Username - if b.GetBool("UseDiscriminator") { + if !fromWebhook && b.GetBool("UseDiscriminator") { rmsg.Username += "#" + m.Author.Discriminator } } -- cgit v1.2.3