Documentation
¶
Index ¶
Constants ¶
View Source
const ( // This library automatically divide message into smaller messages if it // exceeds the number of embed and embed total character limits. MessageEmbedNumLimit = 10 MessageContentLimit = 2000 // Although not mentioned in documentation, in testings this limit seems // also enforced as the total character limit of multiple embeds in one // webhook message (excludes characters in "Content"). EmbedTotalLimit = 6000 EmbedTitleLimit = 256 EmbedDescriptionLimit = 4096 EmbedFieldNumLimit = 25 AuthorNameLimit = 256 FieldNameLimit = 256 FieldValueLimit = 1024 )
Limits Discord API enforces on webhook message.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Author ¶
type Author struct { Name string `json:"name,omitempty"` URL string `json:"url,omitempty"` // URL on the Author name field. IconURL string `json:"icon_url,omitempty"` ProxyIconURL string `json:"proxy_icon_url,omitempty"` }
Author represents author object in an embed object.
type Client ¶ added in v0.5.0
type Client struct {
// contains filtered or unexported fields
}
type Embed ¶
type Embed struct { Fields []Field `json:"fields,omitempty"` Author Author `json:"author,omitempty"` Video Video `json:"video,omitempty"` Thumbnail Thumbnail `json:"thumbnail,omitempty"` Image Image `json:"image,omitempty"` Title string `json:"title,omitempty"` Description string `json:"description,omitempty"` URL string `json:"url,omitempty"` Timestamp Timestamp `json:"timestamp,omitempty"` Color int `json:"color,omitempty"` }
Embed represents an embed object in message object.
type Field ¶
type Field struct { Name string `json:"name"` Value string `json:"value"` Inline bool `json:"inline,omitempty"` }
Field represents field object in an embed object.
type File ¶ added in v0.5.0
type File struct { // Name must include file extension (e.g. .jpg) Name string // Usually not required for common file types, check Discord docs if not working. // https://discord.com/developers/docs/reference#image-data/ ContentType string Reader io.Reader }
type HttpClient ¶ added in v0.4.1
HttpClient represent standard library http compatible clients.
type Image ¶ added in v0.2.0
type Image struct { URL string `json:"url,omitempty"` ProxyURL string `json:"proxy_url,omitempty"` Height int `json:"height,omitempty"` Width int `json:"width,omitempty"` }
Image represents the image object in an embed object.
type Message ¶
type Message struct { Embeds []Embed `json:"embeds,omitempty"` Files []*File `json:"-"` Content string `json:"content,omitempty"` Username string `json:"username,omitempty"` }
Message represents a webhook message.
type Thumbnail ¶ added in v0.2.0
type Thumbnail struct { URL string `json:"url,omitempty"` ProxyURL string `json:"proxy_url,omitempty"` Height int `json:"height,omitempty"` Width int `json:"width,omitempty"` }
Thumbnail represents the thumbnail object in an embed object.
Click to show internal directories.
Click to hide internal directories.