From b85bae31d98a599589504e303f3ca39a1e63a477 Mon Sep 17 00:00:00 2001 From: Wim Date: Sun, 2 Feb 2020 21:14:54 +0100 Subject: Show file comment in webhook if normal message is empty (discord). Fixes #962 (#995) --- bridge/discord/discord.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'bridge/discord/discord.go') diff --git a/bridge/discord/discord.go b/bridge/discord/discord.go index 7159b08e..d247b951 100644 --- a/bridge/discord/discord.go +++ b/bridge/discord/discord.go @@ -407,6 +407,10 @@ func (b *Bdiscord) webhookSend(msg *config.Message, webhookID, token string) (*d ContentType: "", Reader: bytes.NewReader(*fi.Data), } + content := "" + if msg.Text == "" { + content = fi.Comment + } _, e2 := b.c.WebhookExecute( webhookID, token, @@ -415,6 +419,7 @@ func (b *Bdiscord) webhookSend(msg *config.Message, webhookID, token string) (*d Username: msg.Username, AvatarURL: msg.Avatar, File: &file, + Content: content, }, ) if e2 != nil { -- cgit v1.2.3