Show file comment in webhook if normal message is empty (discord). Fixes #962

This commit is contained in:
Wim
2020-02-02 21:08:17 +01:00
parent 585d1556c1
commit d1d6bf855c

View File

@@ -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 {