Documentation ¶
Index ¶
- Variables
- func GetColor(red, green, blue string) int
- func SendWebhookMessage(name string, username, msg string) errordeprecated
- func SendWebhookMessageObj(name string, msg Message) error
- func SetupWebhooks(hooks map[string]string)
- type Author
- type Embed
- func (e *Embed) AddField(f *Field) *Embed
- func (e *Embed) SetAuthor(a *Author) *Embed
- func (e *Embed) SetColor(color int) *Embed
- func (e *Embed) SetDescription(desc string) *Embed
- func (e *Embed) SetFooter(f *Footer) *Embed
- func (e *Embed) SetImage(i *Image) *Embed
- func (e *Embed) SetThumbnail(t *Thumbnail) *Embed
- func (e *Embed) SetTitle(title string) *Embed
- func (e *Embed) SetURL(url string) *Embed
- type Field
- type Footer
- type Image
- type Message
- type Thumbnail
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DefaultUsername = "Web API" DefaultAvatarURL = "https://avatars.githubusercontent.com/u/115051386?s=200&v=4" )
View Source
var ( ErrWebhookNotConfigured = errors.New("webhook not configured") ErrUsedDefaultWebhook = errors.New("webhook not configured, used default webhook") )
Functions ¶
func SendWebhookMessage
deprecated
func SendWebhookMessageObj ¶
func SetupWebhooks ¶
Types ¶
type Embed ¶
type Embed struct { Title *string `json:"title,omitempty"` URL *string `json:"URL,omitempty"` Description *string `json:"description,omitempty"` Color *int `json:"color,omitempty"` Author *Author `json:"author,omitempty"` Fields []*Field `json:"fields,omitempty"` Thumbnail *Thumbnail `json:"thumbnail,omitempty"` Image *Image `json:"image,omitempty"` }
func (*Embed) SetDescription ¶
func (*Embed) SetThumbnail ¶
type Field ¶
type Message ¶
type Message struct { Username *string `json:"username,omitempty"` AvatarURL *string `json:"avatar_URL,omitempty"` Content *string `json:"content,omitempty"` Embeds []*Embed `json:"embeds,omitempty"` }
func NewMessage ¶
func NewMessage() *Message
func (*Message) SetAvatarURL ¶
func (*Message) SetContent ¶
func (*Message) SetUsername ¶
Click to show internal directories.
Click to hide internal directories.