Sfoglia il codice sorgente

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

Bruce Marriner 8 anni fa
parent
commit
20240f3915
1 ha cambiato i file con 3 aggiunte e 0 eliminazioni
  1. 3 0
      message.go

+ 3 - 0
message.go

@@ -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
 }