discord

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2019 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TitleLimit      = 256
	DescLimit       = 2048
	FieldLimit      = 25
	FieldNameLimit  = 256
	FieldValueLimit = 1024
	FooterLimit     = 2048
	AuthorNameLimit = 256
	TotalCharLimit  = 6000
)

definitions of embed element limits https://discordapp.com/developers/docs/resources/channel#embed-limits

Variables

This section is empty.

Functions

This section is empty.

Types

type Embed

type Embed struct {
	*discordgo.MessageEmbed
	// contains filtered or unexported fields
}

Struct that wraps functionality around a discordgo message embed

func NewEmbed

func NewEmbed() *Embed

Returns a pointer to an empty Embed

func (*Embed) AddField

func (e *Embed) AddField(name, value string, inline bool) *Embed

Add a field to the embed

func (*Embed) EmbedColor

func (e *Embed) EmbedColor(c int) *Embed

Set the color of the embed

func (*Embed) EmbedDescription

func (e *Embed) EmbedDescription(d string) *Embed

Set the embed description

func (*Embed) EmbedFooter

func (e *Embed) EmbedFooter(text, icon, proxy string) *Embed

Set the footer of the embed

func (*Embed) EmbedTimestamp

func (e *Embed) EmbedTimestamp(t time.Time) *Embed

Add a custom timestamp to the embed footer

func (*Embed) EmbedTitle

func (e *Embed) EmbedTitle(t string) *Embed

Set the embed title

func (*Embed) EmbedURL

func (e *Embed) EmbedURL(s string) *Embed

Add a URL for the embed

type Error

type Error struct {
	Name string
	Desc string
}

Custom error class for discord errors

func NewError

func NewError(name, desc string) Error

make a new discord error

func (Error) Embed

func (d Error) Embed() *discordgo.MessageEmbed

Return an embed message for the error

func (Error) Error

func (d Error) Error() string

Must implement the Error interface

Jump to

Keyboard shortcuts

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