summaryrefslogtreecommitdiffstats
path: root/bridge/discord
diff options
context:
space:
mode:
authorWim <wim@42.be>2016-10-26 00:09:22 +0200
committerWim <wim@42.be>2016-10-26 00:09:22 +0200
commitd3a34af07307a1b2360c2b32b6ffd726e075bcb5 (patch)
tree90d7c33b9309b29ce3b8cc0307c7b3ba340b9a5a /bridge/discord
parente7107cf782d64b63fe5d1fc1440754cbfee5c55e (diff)
downloadmatterbridge-msglm-d3a34af07307a1b2360c2b32b6ffd726e075bcb5.tar.gz
matterbridge-msglm-d3a34af07307a1b2360c2b32b6ffd726e075bcb5.tar.bz2
matterbridge-msglm-d3a34af07307a1b2360c2b32b6ffd726e075bcb5.zip
Add support for discord attachments. Fixes #59
Diffstat (limited to 'bridge/discord')
-rw-r--r--bridge/discord/discord.go5
1 files changed, 5 insertions, 0 deletions
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()}