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

pull/996/head
Wim 4 years ago committed by GitHub
parent 0898829313
commit b85bae31d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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

Loading…
Cancel
Save