From d3a34af07307a1b2360c2b32b6ffd726e075bcb5 Mon Sep 17 00:00:00 2001 From: Wim Date: Wed, 26 Oct 2016 00:09:22 +0200 Subject: Add support for discord attachments. Fixes #59 --- bridge/discord/discord.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'bridge') diff --git a/bridge/discord/discord.go b/bridge/discord/discord.go index 613bbb8e..98968fde 100644 --- a/bridge/discord/discord.go +++ b/bridge/discord/discord.go @@ -106,6 +106,11 @@ func (b *bdiscord) messageCreate(s *discordgo.Session, m *discordgo.MessageCreat if m.Author.Username == b.Nick { return } + if len(m.Attachments) > 0 { + for _, attach := range m.Attachments { + m.Content = m.Content + "\n" + attach.URL + } + } flog.Debugf("Sending message from %s on %s to gateway", m.Author.Username, b.FullOrigin()) b.Remote <- config.Message{Username: m.Author.Username, Text: m.Content, Channel: b.getChannelName(m.ChannelID), Origin: b.origin, Protocol: b.protocol, FullOrigin: b.FullOrigin()} -- cgit v1.2.3