5
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2024-12-01 22:51:36 +00:00

Remove unused code

This commit is contained in:
Wim 2018-02-15 00:07:25 +01:00
parent bae9484df2
commit a082b5a590

View File

@ -221,11 +221,6 @@ func (b *bdiscord) messageCreate(s *discordgo.Session, m *discordgo.MessageCreat
var text string var text string
if m.Content != "" { if m.Content != "" {
flog.Debugf("Receiving message %#v", m.Message) flog.Debugf("Receiving message %#v", m.Message)
/*
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.stripCustomoji(m.Message.Content)
m.Message.Content = b.replaceChannelMentions(m.Message.Content) m.Message.Content = b.replaceChannelMentions(m.Message.Content)
text, err = m.ContentWithMoreMentionsReplaced(b.c) text, err = m.ContentWithMoreMentionsReplaced(b.c)
@ -233,7 +228,6 @@ func (b *bdiscord) messageCreate(s *discordgo.Session, m *discordgo.MessageCreat
flog.Errorf("ContentWithMoreMentionsReplaced failed: %s", err) flog.Errorf("ContentWithMoreMentionsReplaced failed: %s", err)
text = m.ContentWithMentionsReplaced() 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", rmsg := config.Message{Account: b.Account, Avatar: "https://cdn.discordapp.com/avatars/" + m.Author.ID + "/" + m.Author.Avatar + ".jpg",
@ -330,18 +324,6 @@ func (b *bdiscord) getChannelName(id string) string {
return "" return ""
} }
func (b *bdiscord) replaceRoleMentions(text string) string {
roles, err := b.c.GuildRoles(b.guildID)
if err != nil {
flog.Debugf("%#v", string(err.(*discordgo.RESTError).ResponseBody))
return text
}
for _, role := range roles {
text = strings.Replace(text, "<@&"+role.ID+">", "@"+role.Name, -1)
}
return text
}
func (b *bdiscord) replaceChannelMentions(text string) string { func (b *bdiscord) replaceChannelMentions(text string) string {
var err error var err error
re := regexp.MustCompile("<#[0-9]+>") re := regexp.MustCompile("<#[0-9]+>")