diff options
author | Wim <wim@42.be> | 2018-02-14 23:05:50 +0100 |
---|---|---|
committer | Wim <wim@42.be> | 2018-02-14 23:05:50 +0100 |
commit | bae9484df202312cb9606d16c621f22e3ceedd6b (patch) | |
tree | 94606fb4042128f5a3f0695225d0262991097dc4 /bridge | |
parent | 6f78485878e2208a3ab73e13cff5825db57f812d (diff) | |
download | matterbridge-msglm-bae9484df202312cb9606d16c621f22e3ceedd6b.tar.gz matterbridge-msglm-bae9484df202312cb9606d16c621f22e3ceedd6b.tar.bz2 matterbridge-msglm-bae9484df202312cb9606d16c621f22e3ceedd6b.zip |
Use discordgo ContentWithMoreMentionsReplace (discord)
Diffstat (limited to 'bridge')
-rw-r--r-- | bridge/discord/discord.go | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/bridge/discord/discord.go b/bridge/discord/discord.go index 1f7e50c8..79acf139 100644 --- a/bridge/discord/discord.go +++ b/bridge/discord/discord.go @@ -202,6 +202,7 @@ func (b *bdiscord) messageUpdate(s *discordgo.Session, m *discordgo.MessageUpdat } func (b *bdiscord) messageCreate(s *discordgo.Session, m *discordgo.MessageCreate) { + var err error // not relay our own messages if m.Author.Username == b.Nick { return @@ -220,12 +221,19 @@ func (b *bdiscord) messageCreate(s *discordgo.Session, m *discordgo.MessageCreat var text string if m.Content != "" { flog.Debugf("Receiving message %#v", m.Message) - if len(m.MentionRoles) > 0 { - m.Message.Content = b.replaceRoleMentions(m.Message.Content) - } + /* + if len(m.MentionRoles) > 0 { + m.Message.Content = b.replaceRoleMentions(m.Message.Content) + } + */ m.Message.Content = b.stripCustomoji(m.Message.Content) m.Message.Content = b.replaceChannelMentions(m.Message.Content) - text = m.ContentWithMentionsReplaced() + text, err = m.ContentWithMoreMentionsReplaced(b.c) + if err != nil { + flog.Errorf("ContentWithMoreMentionsReplaced failed: %s", err) + text = m.ContentWithMentionsReplaced() + } + // text = m.ContentWithMentionsReplaced() } rmsg := config.Message{Account: b.Account, Avatar: "https://cdn.discordapp.com/avatars/" + m.Author.ID + "/" + m.Author.Avatar + ".jpg", |