embed

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2021 License: MIT Imports: 1 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Now

func Now() *time.Time

Now just wraps time.Now and returns a pointer that works with Embed.Timestamp

Types

type AllowedMentions

type AllowedMentions struct {
	Parse []Parse  `json:"parse"`
	Roles []string `json:"roles,omitempty"`
	Users []string `json:"users,omitempty"`
}

AllowedMentions is the allowed mentions to parse in a Webhook

type Author

type Author struct {
	Name         string `json:"name,omitempty"`
	URL          string `json:"url,omitempty"`
	IconURL      string `json:"icon_url,omitempty"`
	ProxyIconURL string `json:"proxy_icon_url,omitempty"`
}

Author is the author of an embed

type Embed

type Embed struct {
	Title       string     `json:"title,omitempty"`
	Type        Type       `json:"type,omitempty"`
	Description string     `json:"description,omitempty"`
	URL         string     `json:"url,omitempty"`
	Timestamp   *time.Time `json:"timestamp,omitempty"`
	Color       int        `json:"color,omitempty"`
	Footer      *Footer    `json:"footer,omitempty"`
	Image       *Image     `json:"image,omitempty"`
	Thumbnail   *Thumbnail `json:"thumbnail,omitempty"`
	Video       *Video     `json:"video,omitempty"`
	Provider    *Provider  `json:"provider,omitempty"`
	Author      *Author    `json:"author,omitempty"`
	Fields      []*Field   `json:"fields,omitempty"`
}

An Embed is sent in a message or webhook

type Field

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

Field is a field in an embed

type Footer struct {
	Text         string `json:"text,omitempty"`
	IconURL      string `json:"icon_url,omitempty"`
	ProxyIconURL string `json:"proxy_icon_url,omitempty"`
}

Footer is the footer of an embed

type Image

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 is the image of an embed

type Parse

type Parse string

Parse is the parse types of AllowedMentions

const (
	Roles    Parse = "roles"
	Users    Parse = "users"
	Everyone Parse = "everyone"
)

type Provider

type Provider struct {
	Name string `json:"name,omitempty"`
	URL  string `json:"url,omitempty"`
}

Provider is the provider of an embed

type Thumbnail

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 is the thumbnail of an embed

type Type

type Type string

Type is the type of embed

const (
	TypeRich    Type = "rich"
	TypeImage   Type = "image"
	TypeVideo   Type = "video"
	TypeGifv    Type = "gifv"
	TypeArticle Type = "article"
	TypeLink    Type = "link"
)

Embed Type

type Video

type Video struct {
	URL    string `json:"url,omitempty"`
	Height int    `json:"height,omitempty"`
	Width  int    `json:"width,omitempty"`
}

Video is the video in an embed

Jump to

Keyboard shortcuts

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