Moved Message struct and related structs into message.go
This commit is contained in:
parent
7fc9331e04
commit
831fb29915
2 changed files with 23 additions and 23 deletions
23
message.go
23
message.go
|
@ -14,6 +14,29 @@ import (
|
||||||
"strings"
|
"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
|
// ContentWithMentionsReplaced will replace all @<id> mentions with the
|
||||||
// username of the mention.
|
// username of the mention.
|
||||||
func (m *Message) ContentWithMentionsReplaced() string {
|
func (m *Message) ContentWithMentionsReplaced() string {
|
||||||
|
|
23
structs.go
23
structs.go
|
@ -101,29 +101,6 @@ type Session struct {
|
||||||
listenChan chan 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.
|
// A VoiceRegion stores data for a specific voice region server.
|
||||||
type VoiceRegion struct {
|
type VoiceRegion struct {
|
||||||
ID string `json:"id"`
|
ID string `json:"id"`
|
||||||
|
|
Loading…
Reference in a new issue