Merge pull request #5 from ayntgl/embeds
feat: implement sendable embeds
This commit is contained in:
commit
a1ea1288bf
28
other.go
28
other.go
@ -7,14 +7,27 @@ import (
|
|||||||
|
|
||||||
// Similar to message, but created for send message function.
|
// Similar to message, but created for send message function.
|
||||||
type SendMessage struct {
|
type SendMessage struct {
|
||||||
Content string `json:"content,omitempty"`
|
Content string `json:"content"`
|
||||||
Attachments []string `json:"attachments,omitempty"`
|
|
||||||
Nonce string `json:"nonce,omitempty"`
|
Nonce string `json:"nonce,omitempty"`
|
||||||
|
Attachments []string `json:"attachments,omitempty"`
|
||||||
|
Replies []Replies `json:"replies,omitempty"`
|
||||||
|
Embeds []SendableEmbed `json:"embeds,omitempty"`
|
||||||
DeleteAfter uint `json:"-"`
|
DeleteAfter uint `json:"-"`
|
||||||
Replies []struct {
|
}
|
||||||
Id string `json:"id,omitempty"`
|
|
||||||
|
type SendableEmbed struct {
|
||||||
|
Type string `json:"type"`
|
||||||
|
IconUrl string `json:"icon_url,omitempty"`
|
||||||
|
Url string `json:"url,omitempty"`
|
||||||
|
Title string `json:"title,omitempty"`
|
||||||
|
Description string `json:"description,omitempty"`
|
||||||
|
Media string `json:"media,omitempty"`
|
||||||
|
Colour string `json:"colour,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type Replies struct {
|
||||||
|
Id string `json:"id"`
|
||||||
Mention bool `json:"mention"`
|
Mention bool `json:"mention"`
|
||||||
} `json:"replies,omitempty"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set content.
|
// Set content.
|
||||||
@ -43,10 +56,7 @@ func (sms *SendMessage) AddAttachment(attachment string) *SendMessage {
|
|||||||
|
|
||||||
// Add a new reply.
|
// Add a new reply.
|
||||||
func (sms *SendMessage) AddReply(id string, mention bool) *SendMessage {
|
func (sms *SendMessage) AddReply(id string, mention bool) *SendMessage {
|
||||||
sms.Replies = append(sms.Replies, struct {
|
sms.Replies = append(sms.Replies, Replies{
|
||||||
Id string "json:\"id,omitempty\""
|
|
||||||
Mention bool "json:\"mention\""
|
|
||||||
}{
|
|
||||||
Id: id,
|
Id: id,
|
||||||
Mention: mention,
|
Mention: mention,
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user