Merge branch 'develop' of https://github.com/bwmarrin/Discordgo into develop

This commit is contained in:
Bruce Marriner 2016-04-30 17:52:32 -05:00
commit 20240f3915

View file

@ -21,6 +21,7 @@ type Message struct {
Content string `json:"content"`
Timestamp string `json:"timestamp"`
EditedTimestamp string `json:"edited_timestamp"`
MentionRoles []string `json:"mention_roles"`
Tts bool `json:"tts"`
MentionEveryone bool `json:"mention_everyone"`
Author *User `json:"author"`
@ -77,6 +78,8 @@ func (m *Message) ContentWithMentionsReplaced() string {
for _, user := range m.Mentions {
content = strings.Replace(content, fmt.Sprintf("<@%s>", user.ID),
fmt.Sprintf("@%s", user.Username), -1)
content = strings.Replace(content, fmt.Sprintf("<@!%s>", user.ID),
fmt.Sprintf("@%s", user.Username), -1)
}
return content
}