From 36a800c3f57ed1880ed6530db0542c979f6c69e7 Mon Sep 17 00:00:00 2001 From: Wim Date: Mon, 13 Nov 2017 00:20:31 +0100 Subject: Add support for comments from slack file uploads (slack) --- bridge/discord/discord.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'bridge/discord') diff --git a/bridge/discord/discord.go b/bridge/discord/discord.go index 12e0d827..183b1193 100644 --- a/bridge/discord/discord.go +++ b/bridge/discord/discord.go @@ -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 } } -- cgit v1.2.3