embed

package
v0.0.0-...-e2d74ad Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Credit to Necroforger https://gist.github.com/Necroforger/8b0b70b1a69fa7828b8ad6387ebb3835 Modified to allow self hosted images.

Credit to Necroforger https://gist.github.com/Necroforger/8b0b70b1a69fa7828b8ad6387ebb3835

Index

Constants

View Source
const (
	EmbedLimitTitle       = 256
	EmbedLimitDescription = 2048
	EmbedLimitFieldValue  = 1024
	EmbedLimitFieldName   = 256
	EmbedLimitField       = 25
	EmbedLimitFooter      = 2048
	EmbedLimit            = 4000
)

Constants for message embed character limits

Variables

This section is empty.

Functions

func NewErrorEmbed

func NewErrorEmbed(errorTitle, errorMsg string, replacements ...interface{}) *discordgo.MessageEmbed

NewErrorEmbed creates a new error embed

func NewErrorEmbedAdvanced

func NewErrorEmbedAdvanced(errorTitle, errorMsg string, errorColor int) *discordgo.MessageEmbed

NewErrorEmbedAdvanced creates a new error embed with a custom color

func NewGenericEmbed

func NewGenericEmbed(embedTitle, embedMsg string, replacements ...interface{}) *discordgo.MessageEmbed

NewGenericEmbed creates a new generic embed

func NewGenericEmbedAdvanced

func NewGenericEmbedAdvanced(embedTitle, embedMsg string, embedColor int) *discordgo.MessageEmbed

NewGenericEmbedAdvanced creates a new generic embed with a custom color

func NewSuccessEmbed

func NewSuccessEmbed(title, msg string, replacements ...interface{}) *discordgo.MessageEmbed

NewSuccessEmebed create a new success embed.

Types

type ComplexEmbed

type ComplexEmbed struct {
	*discordgo.MessageSend
}

func NewComplexEmbed

func NewComplexEmbed() *ComplexEmbed

func (*ComplexEmbed) AddField

func (e *ComplexEmbed) AddField(name, value string) *ComplexEmbed

AddField [name] [value]

func (*ComplexEmbed) InlineAllFields

func (e *ComplexEmbed) InlineAllFields() *ComplexEmbed

InlineAllFields sets all fields in the embed to be inline

func (*ComplexEmbed) SetAuthor

func (e *ComplexEmbed) SetAuthor(args ...string) *ComplexEmbed

SetAuthor ...

func (*ComplexEmbed) SetColor

func (e *ComplexEmbed) SetColor(clr int) *ComplexEmbed

SetColor ...

func (*ComplexEmbed) SetDescription

func (e *ComplexEmbed) SetDescription(description string) *ComplexEmbed

SetDescription [desc]

func (*ComplexEmbed) SetFooter

func (e *ComplexEmbed) SetFooter(args ...string) *ComplexEmbed

SetFooter [Text] [iconURL]

func (*ComplexEmbed) SetImage

func (e *ComplexEmbed) SetImage(args ...string) *ComplexEmbed

SetImage ...

func (*ComplexEmbed) SetLocalImage

func (e *ComplexEmbed) SetLocalImage(buffer io.Reader, filename string) *ComplexEmbed

SetLocalImage ...

func (*ComplexEmbed) SetThumbnail

func (e *ComplexEmbed) SetThumbnail(args ...string) *ComplexEmbed

SetThumbnail ...

func (*ComplexEmbed) SetTitle

func (e *ComplexEmbed) SetTitle(name string) *ComplexEmbed

SetTitle ...

func (*ComplexEmbed) SetURL

func (e *ComplexEmbed) SetURL(URL string) *ComplexEmbed

SetURL ...

func (*ComplexEmbed) Truncate

func (e *ComplexEmbed) Truncate() *ComplexEmbed

Truncate truncates any embed value over the character limit.

func (*ComplexEmbed) TruncateDescription

func (e *ComplexEmbed) TruncateDescription() *ComplexEmbed

TruncateDescription ...

func (*ComplexEmbed) TruncateFields

func (e *ComplexEmbed) TruncateFields() *ComplexEmbed

TruncateFields truncates fields that are too long

func (*ComplexEmbed) TruncateFooter

func (e *ComplexEmbed) TruncateFooter() *ComplexEmbed

TruncateFooter ...

func (*ComplexEmbed) TruncateTitle

func (e *ComplexEmbed) TruncateTitle() *ComplexEmbed

TruncateTitle ...

type Embed

type Embed struct {
	*discordgo.MessageEmbed
}

Embed ...

func NewEmbed

func NewEmbed() *Embed

NewEmbed returns a new embed object

func (*Embed) AddField

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

AddField [name] [value]

func (*Embed) InlineAllFields

func (e *Embed) InlineAllFields() *Embed

InlineAllFields sets all fields in the embed to be inline

func (*Embed) SetAuthor

func (e *Embed) SetAuthor(args ...string) *Embed

SetAuthor ...

func (*Embed) SetColor

func (e *Embed) SetColor(clr int) *Embed

SetColor ...

func (*Embed) SetDescription

func (e *Embed) SetDescription(description string) *Embed

SetDescription [desc]

func (*Embed) SetFooter

func (e *Embed) SetFooter(args ...string) *Embed

SetFooter [Text] [iconURL]

func (*Embed) SetImage

func (e *Embed) SetImage(args ...string) *Embed

SetImage ...

func (*Embed) SetThumbnail

func (e *Embed) SetThumbnail(args ...string) *Embed

SetThumbnail ...

func (*Embed) SetTitle

func (e *Embed) SetTitle(name string) *Embed

SetTitle ...

func (*Embed) SetURL

func (e *Embed) SetURL(URL string) *Embed

SetURL ...

func (*Embed) Truncate

func (e *Embed) Truncate() *Embed

Truncate truncates any embed value over the character limit.

func (*Embed) TruncateDescription

func (e *Embed) TruncateDescription() *Embed

TruncateDescription ...

func (*Embed) TruncateFields

func (e *Embed) TruncateFields() *Embed

TruncateFields truncates fields that are too long

func (*Embed) TruncateFooter

func (e *Embed) TruncateFooter() *Embed

TruncateFooter ...

func (*Embed) TruncateTitle

func (e *Embed) TruncateTitle() *Embed

TruncateTitle ...

Jump to

Keyboard shortcuts

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