mirror of
https://github.com/42wim/matterbridge.git
synced 2024-11-21 18:22:00 -08:00
Add file comment to webhook messages (discord). Fixes #358
This commit is contained in:
parent
492722af8b
commit
46e2683995
@ -188,8 +188,14 @@ func (b *Bdiscord) Send(msg config.Message) (string, error) {
|
|||||||
b.Log.Debugf("Broadcasting using Webhook")
|
b.Log.Debugf("Broadcasting using Webhook")
|
||||||
for _, f := range msg.Extra["file"] {
|
for _, f := range msg.Extra["file"] {
|
||||||
fi := f.(config.FileInfo)
|
fi := f.(config.FileInfo)
|
||||||
|
if fi.Comment != "" {
|
||||||
|
msg.Text += fi.Comment + ": "
|
||||||
|
}
|
||||||
if fi.URL != "" {
|
if fi.URL != "" {
|
||||||
msg.Text += " " + fi.URL
|
msg.Text = fi.URL
|
||||||
|
if fi.Comment != "" {
|
||||||
|
msg.Text = fi.Comment + ": " + fi.URL
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// skip empty messages
|
// skip empty messages
|
||||||
|
Loading…
Reference in New Issue
Block a user