diff --git a/bridge/discord/discord.go b/bridge/discord/discord.go index 9cc83ddc..2fcf0abc 100644 --- a/bridge/discord/discord.go +++ b/bridge/discord/discord.go @@ -304,7 +304,8 @@ func (b *Bdiscord) handleEventBotUser(msg *config.Message, channelID string) (st } m := discordgo.MessageSend{ - Content: msg.Username + msg.Text, + Content: msg.Username + msg.Text, + AllowedMentions: b.getAllowedMentions(), } if msg.ParentValid() { @@ -335,8 +336,9 @@ func (b *Bdiscord) handleUploadFile(msg *config.Message, channelID string) (stri Reader: bytes.NewReader(*fi.Data), } m := discordgo.MessageSend{ - Content: msg.Username + fi.Comment, - Files: []*discordgo.File{&file}, + Content: msg.Username + fi.Comment, + Files: []*discordgo.File{&file}, + AllowedMentions: b.getAllowedMentions(), } _, err = b.c.ChannelMessageSendComplex(channelID, &m) if err != nil { diff --git a/bridge/discord/webhook.go b/bridge/discord/webhook.go index 763800d2..9177db07 100644 --- a/bridge/discord/webhook.go +++ b/bridge/discord/webhook.go @@ -89,10 +89,11 @@ func (b *Bdiscord) webhookSend(msg *config.Message, channelID string) (*discordg _, e2 := b.transmitter.Send( channelID, &discordgo.WebhookParams{ - Username: msg.Username, - AvatarURL: msg.Avatar, - File: &file, - Content: content, + Username: msg.Username, + AvatarURL: msg.Avatar, + File: &file, + Content: content, + AllowedMentions: b.getAllowedMentions(), }, ) if e2 != nil { @@ -125,8 +126,9 @@ func (b *Bdiscord) handleEventWebhook(msg *config.Message, channelID string) (st if msg.ID != "" { b.Log.Debugf("Editing webhook message") err := b.transmitter.Edit(channelID, msg.ID, &discordgo.WebhookParams{ - Content: msg.Text, - Username: msg.Username, + Content: msg.Text, + Username: msg.Username, + AllowedMentions: b.getAllowedMentions(), }) if err == nil { return msg.ID, nil