4
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2025-06-26 16:39:24 +00:00

Add support for comments from slack file uploads (slack)

This commit is contained in:
Wim
2017-11-13 00:20:31 +01:00
parent 6d21f84187
commit 36a800c3f5
5 changed files with 36 additions and 22 deletions

View File

@ -151,11 +151,12 @@ func (b *bdiscord) Send(msg config.Message) (string, error) {
fi := f.(config.FileInfo)
files := []*discordgo.File{}
files = append(files, &discordgo.File{fi.Name, "", bytes.NewReader(*fi.Data)})
_, err = b.c.ChannelMessageSendComplex(channelID, &discordgo.MessageSend{Content: msg.Text, Files: files})
_, err = b.c.ChannelMessageSendComplex(channelID, &discordgo.MessageSend{Content: msg.Username + fi.Comment, Files: files})
if err != nil {
flog.Errorf("file upload failed: %#v", err)
}
}
return "", nil
}
}