From 1b837b3dc7579351a6018b52b58613c446ce08a5 Mon Sep 17 00:00:00 2001 From: Wim Date: Sat, 24 Jun 2017 23:17:57 +0200 Subject: Add ShowEmbeds option (discord). #202 --- bridge/discord/discord.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'bridge/discord') diff --git a/bridge/discord/discord.go b/bridge/discord/discord.go index 3d244962..8c7d9711 100644 --- a/bridge/discord/discord.go +++ b/bridge/discord/discord.go @@ -141,7 +141,15 @@ func (b *bdiscord) messageCreate(s *discordgo.Session, m *discordgo.MessageCreat } m.Message.Content = b.stripCustomoji(m.Message.Content) m.Message.Content = b.replaceChannelMentions(m.Message.Content) - b.Remote <- config.Message{Username: username, Text: m.ContentWithMentionsReplaced(), Channel: channelName, + + text := m.ContentWithMentionsReplaced() + if b.Config.ShowEmbeds && m.Message.Embeds != nil { + for _, embed := range m.Message.Embeds { + text = text + "embed: " + embed.Title + " - " + embed.Description + " - " + embed.URL + "\n" + } + } + + b.Remote <- config.Message{Username: username, Text: text, Channel: channelName, Account: b.Account, Avatar: "https://cdn.discordapp.com/avatars/" + m.Author.ID + "/" + m.Author.Avatar + ".jpg", UserID: m.Author.ID} } -- cgit v1.2.3