Add support for fallback/text in attachments (slack)

This commit is contained in:
Wim 2017-07-16 18:08:26 +02:00
parent 835a1ac3a6
commit 778abea2d9
1 changed files with 9 additions and 0 deletions

View File

@ -262,6 +262,15 @@ func (b *Bslack) handleSlackClient(mchan chan *MMMessage) {
}
m.Channel = channel.Name
m.Text = ev.Text
if m.Text == "" {
for _, attach := range ev.Attachments {
if attach.Text != "" {
m.Text = attach.Text
} else {
m.Text = attach.Fallback
}
}
}
m.Raw = ev
m.Text = b.replaceMention(m.Text)
if ev.BotID != "" {