Kaynağa Gözat

Moved Message struct and related structs into message.go

Bruce Marriner 9 yıl önce
ebeveyn
işleme
831fb29915
2 değiştirilmiş dosya ile 23 ekleme ve 23 silme
  1. 23 0
      message.go
  2. 0 23
      structs.go

+ 23 - 0
message.go

@@ -14,6 +14,29 @@ import (
 	"strings"
 )
 
+// A Message stores all data related to a specific Discord message.
+type Message struct {
+	ID              string       `json:"id"`
+	Author          User         `json:"author"`
+	Content         string       `json:"content"`
+	Attachments     []Attachment `json:"attachments"`
+	Tts             bool         `json:"tts"`
+	Embeds          []Embed      `json:"embeds"`
+	Timestamp       string       `json:"timestamp"`
+	MentionEveryone bool         `json:"mention_everyone"`
+	EditedTimestamp string       `json:"edited_timestamp"`
+	Mentions        []User       `json:"mentions"`
+	ChannelID       string       `json:"channel_id"`
+}
+
+// An Attachment stores data for message attachments.
+type Attachment struct { //TODO figure this out
+}
+
+// An Embed stores data for message embeds.
+type Embed struct { // TODO figure this out
+}
+
 // ContentWithMentionsReplaced will replace all @<id> mentions with the
 // username of the mention.
 func (m *Message) ContentWithMentionsReplaced() string {

+ 0 - 23
structs.go

@@ -101,29 +101,6 @@ type Session struct {
 	listenChan chan struct{}
 }
 
-// A Message stores all data related to a specific Discord message.
-type Message struct {
-	ID              string       `json:"id"`
-	Author          User         `json:"author"`
-	Content         string       `json:"content"`
-	Attachments     []Attachment `json:"attachments"`
-	Tts             bool         `json:"tts"`
-	Embeds          []Embed      `json:"embeds"`
-	Timestamp       string       `json:"timestamp"`
-	MentionEveryone bool         `json:"mention_everyone"`
-	EditedTimestamp string       `json:"edited_timestamp"`
-	Mentions        []User       `json:"mentions"`
-	ChannelID       string       `json:"channel_id"`
-}
-
-// An Attachment stores data for message attachments.
-type Attachment struct { //TODO figure this out
-}
-
-// An Embed stores data for message embeds.
-type Embed struct { // TODO figure this out
-}
-
 // A VoiceRegion stores data for a specific voice region server.
 type VoiceRegion struct {
 	ID       string `json:"id"`