Merge branch 'develop' of https://github.com/bwmarrin/Discordgo into develop
This commit is contained in:
commit
20240f3915
1 changed files with 3 additions and 0 deletions
|
@ -21,6 +21,7 @@ type Message struct {
|
||||||
Content string `json:"content"`
|
Content string `json:"content"`
|
||||||
Timestamp string `json:"timestamp"`
|
Timestamp string `json:"timestamp"`
|
||||||
EditedTimestamp string `json:"edited_timestamp"`
|
EditedTimestamp string `json:"edited_timestamp"`
|
||||||
|
MentionRoles []string `json:"mention_roles"`
|
||||||
Tts bool `json:"tts"`
|
Tts bool `json:"tts"`
|
||||||
MentionEveryone bool `json:"mention_everyone"`
|
MentionEveryone bool `json:"mention_everyone"`
|
||||||
Author *User `json:"author"`
|
Author *User `json:"author"`
|
||||||
|
@ -77,6 +78,8 @@ func (m *Message) ContentWithMentionsReplaced() string {
|
||||||
for _, user := range m.Mentions {
|
for _, user := range m.Mentions {
|
||||||
content = strings.Replace(content, fmt.Sprintf("<@%s>", user.ID),
|
content = strings.Replace(content, fmt.Sprintf("<@%s>", user.ID),
|
||||||
fmt.Sprintf("@%s", user.Username), -1)
|
fmt.Sprintf("@%s", user.Username), -1)
|
||||||
|
content = strings.Replace(content, fmt.Sprintf("<@!%s>", user.ID),
|
||||||
|
fmt.Sprintf("@%s", user.Username), -1)
|
||||||
}
|
}
|
||||||
return content
|
return content
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue