comment all
This commit is contained in:
@@ -2,16 +2,19 @@ package main
|
||||
|
||||
import "encoding/json"
|
||||
|
||||
// UnmarshalWebhook UnmarshalWebhook
|
||||
func UnmarshalWebhook(data []byte) (Webhook, error) {
|
||||
var r Webhook
|
||||
err := json.Unmarshal(data, &r)
|
||||
return r, err
|
||||
}
|
||||
|
||||
// Marshal Marshal
|
||||
func (r *Webhook) Marshal() ([]byte, error) {
|
||||
return json.Marshal(r)
|
||||
}
|
||||
|
||||
// Webhook Webhook
|
||||
type Webhook struct {
|
||||
Username string `json:"username,omitempty"`
|
||||
AvatarURL string `json:"avatar_url,omitempty"`
|
||||
@@ -20,6 +23,7 @@ type Webhook struct {
|
||||
Embeds []*Embed `json:"embeds,omitempty"`
|
||||
}
|
||||
|
||||
// Embed Embed
|
||||
type Embed struct {
|
||||
Author Author `json:"author,omitempty"`
|
||||
Title string `json:"title,omitempty"`
|
||||
@@ -32,23 +36,27 @@ type Embed struct {
|
||||
Footer Footer `json:"footer,omitempty"`
|
||||
}
|
||||
|
||||
// Author Author
|
||||
type Author struct {
|
||||
Name string `json:"name"`
|
||||
URL string `json:"url"`
|
||||
IconURL string `json:"icon_url"`
|
||||
}
|
||||
|
||||
// Field Field
|
||||
type Field struct {
|
||||
Name string `json:"name"`
|
||||
Value string `json:"value"`
|
||||
Inline *bool `json:"inline,omitempty"`
|
||||
}
|
||||
|
||||
// Footer Footer
|
||||
type Footer struct {
|
||||
Text string `json:"text"`
|
||||
IconURL string `json:"icon_url"`
|
||||
}
|
||||
|
||||
// Image Image
|
||||
type Image struct {
|
||||
URL string `json:"url"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user