diff options
author | Wim <wim@42.be> | 2017-11-03 20:13:58 +0100 |
---|---|---|
committer | Wim <wim@42.be> | 2017-11-03 20:13:58 +0100 |
commit | 0530503ef28b2cbf71bb8a9d6867e2cafe9c2a7c (patch) | |
tree | 481b0c3e8341b4619cd2a8e7b7205f34b88d5617 | |
parent | d1e8ff814b616d38ad778f8b85e38caf53c33552 (diff) | |
download | matterbridge-msglm-0530503ef28b2cbf71bb8a9d6867e2cafe9c2a7c.tar.gz matterbridge-msglm-0530503ef28b2cbf71bb8a9d6867e2cafe9c2a7c.tar.bz2 matterbridge-msglm-0530503ef28b2cbf71bb8a9d6867e2cafe9c2a7c.zip |
Make megacheck happy again
-rw-r--r-- | bridge/discord/discord.go | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/bridge/discord/discord.go b/bridge/discord/discord.go index c82844a4..fdc20c18 100644 --- a/bridge/discord/discord.go +++ b/bridge/discord/discord.go @@ -146,17 +146,15 @@ func (b *bdiscord) Send(msg config.Message) (string, error) { if msg.Extra != nil { // check if we have files to upload (from slack, telegram or mattermost) if len(msg.Extra["file"]) > 0 { + var err error + var res *discordgo.Message for _, f := range msg.Extra["file"] { fi := f.(config.FileInfo) files := []*discordgo.File{} files = append(files, &discordgo.File{fi.Name, "", bytes.NewReader(*fi.Data)}) - res, err := b.c.ChannelMessageSendComplex(channelID, &discordgo.MessageSend{Content: msg.Text, Files: files}) - if err != nil { - flog.Debugf("ERROR channelMessageSendComplex: %#v", err) - return "", err - } - return res.ID, err + res, err = b.c.ChannelMessageSendComplex(channelID, &discordgo.MessageSend{Content: msg.Text, Files: files}) } + return res.ID, err } } res, err := b.c.ChannelMessageSend(channelID, msg.Username+msg.Text) |