diff --git a/message.go b/message.go index 86e6701..a833863 100644 --- a/message.go +++ b/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 @ mentions with the // username of the mention. func (m *Message) ContentWithMentionsReplaced() string { diff --git a/structs.go b/structs.go index 7763c6a..4ca28d9 100644 --- a/structs.go +++ b/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"`