summaryrefslogtreecommitdiffstats
path: root/bridge
diff options
context:
space:
mode:
authorWim <wim@42.be>2020-02-02 21:14:54 +0100
committerGitHub <noreply@github.com>2020-02-02 21:14:54 +0100
commitb85bae31d98a599589504e303f3ca39a1e63a477 (patch)
tree7507e446570473b2aa642dfcfb1770f568fd98dc /bridge
parent0898829313f8a3a87a13472c1fcb4e7a10a362da (diff)
downloadmatterbridge-msglm-b85bae31d98a599589504e303f3ca39a1e63a477.tar.gz
matterbridge-msglm-b85bae31d98a599589504e303f3ca39a1e63a477.tar.bz2
matterbridge-msglm-b85bae31d98a599589504e303f3ca39a1e63a477.zip
Show file comment in webhook if normal message is empty (discord). Fixes #962 (#995)
Diffstat (limited to 'bridge')
-rw-r--r--bridge/discord/discord.go5
1 files changed, 5 insertions, 0 deletions
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 {