mirror of
https://github.com/cwinfo/matterbridge.git
synced 2024-11-13 00:10:26 +00:00
Add support for discord attachments. Fixes #59
This commit is contained in:
parent
e7107cf782
commit
d3a34af073
@ -106,6 +106,11 @@ func (b *bdiscord) messageCreate(s *discordgo.Session, m *discordgo.MessageCreat
|
|||||||
if m.Author.Username == b.Nick {
|
if m.Author.Username == b.Nick {
|
||||||
return
|
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())
|
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),
|
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()}
|
Origin: b.origin, Protocol: b.protocol, FullOrigin: b.FullOrigin()}
|
||||||
|
Loading…
Reference in New Issue
Block a user