discord

package
v0.0.14 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 23, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

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 is the author object

type Client

type Client struct {
	WebhookURL string
	Username   string
}

func (*Client) Post

func (c *Client) Post(webhook *Webhook) error

func (*Client) PostError

func (c *Client) PostError(webhook *Webhook) error

func (*Client) PostInfo added in v0.0.12

func (c *Client) PostInfo(webhook *Webhook) error

func (*Client) PostSuccess

func (c *Client) PostSuccess(webhook *Webhook) error

func (*Client) Write

func (c *Client) Write(p []byte) (n int, err error)

type Embed

type Embed 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"`
	Image       Image   `json:"image"`
	Footer      Footer  `json:"footer"`
	TimeStamp   string  `json:"timestamp"`
}

Embed is the embed object

type Field

type Field struct {
	Name   string `json:"name"`
	Value  string `json:"value"`
	Inline bool   `json:"inline,omitempty"`
}

Field is the field object inside an embed

type Footer struct {
	Text    string `json:"text"`
	IconURL string `json:"icon_url"`
}

Footer is the footer of the embed

type Image

type Image struct {
	URL string `json:"url"`
}

Image is an image possibly contained inside the embed

type Webhook

type Webhook struct {
	Username  string  `json:"username"`
	AvatarURL string  `json:"avatar_url"`
	Content   string  `json:"content"`
	Embeds    []Embed `json:"embeds"`
}

Webhook is the webhook object sent to discord

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL