Documentation
¶
Index ¶
- type Author
- type Embed
- func (e *Embed) AddField(Name, Value string, Inline bool) error
- func (e *Embed) SendToWebhook(Webhook string) error
- func (e *Embed) SetAuthor(Name, URL, IconURL string)
- func (e *Embed) SetAvatarURL(avatarURL string)
- func (e *Embed) SetColor(color string) error
- func (e *Embed) SetContent(content string)
- func (e *Embed) SetFooter(Text, IconURL string) error
- func (e *Embed) SetImage(URL string) error
- func (e *Embed) SetThumbnail(URL string) error
- func (e *Embed) SetUsername(Name string)
- type EmbedElement
- type Field
- type Footer
- type Image
- type Webhook
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Author ¶
type Author struct {
Name string `json:"name"`
URL string `json:"url"`
IconURL string `json:"icon_url"`
}
Author represents the author of the embed
type Embed ¶
type Embed struct {
Username string `json:"username"`
AvatarURL string `json:"avatar_url"`
Content string `json:"content"`
Embeds []EmbedElement `json:"embeds"`
}
Embed is a struct representing a Discord embed object
func (*Embed) AddField ¶
AddField adds a frield to the Embed. Returns an error if the embed was not initialized properly
func (*Embed) SendToWebhook ¶
SendToWebhook sents the Embed to a webhook. Returns error if embed was invalid or there was an error posting to the webhook.
func (*Embed) SetAvatarURL ¶
SetAvatarURL sets the Avatar URL of the Embed sender
func (*Embed) SetColor ¶
SetColor takes in a hex code and sets the color of the Embed. Returns an error if the hex is invalid
func (*Embed) SetContent ¶
SetContent gives the message a Content value
func (*Embed) SetFooter ¶
SetFooter sets the footer of the embed. Returns an error if the embed was not initialized properly
func (*Embed) SetImage ¶
SetImage sets the image of the embed Returns an error if the embed was not initialized properly
func (*Embed) SetThumbnail ¶
SetThumbnail sets the thumbnail of the embed. Returns an error if the embed was not initialized properly
func (*Embed) SetUsername ¶
SetUsername sets the username of the Embed sender
type EmbedElement ¶
type EmbedElement struct {
Author Author `json:"author"`
Title string `json:"title"`
URL string `json:"url"`
Description string `json:"description"`
Color int64 `json:"color"`
Fields []Field `json:"fields"`
Thumbnail Image `json:"thumbnail,omitempty"`
Image Image `json:"image,omitempty"`
}
EmbedElement is a struct representing an Embed element of the Embed struct