embed

package
v0.0.0-...-e4f0057 Latest Latest
Warning

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

Go to latest
Published: May 9, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

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

Constants for message embed character limits

Variables

This section is empty.

Functions

func DeferResponse

func DeferResponse(s *discordgo.Session, i *discordgo.Interaction) chan struct{}

func ModifyInteraction

func ModifyInteraction(s *discordgo.Session, embed *discordgo.MessageEmbed, i *discordgo.Interaction)

Modify an already sent interaction

func ModifyInteractionAndDelete

func ModifyInteractionAndDelete(s *discordgo.Session, embed *discordgo.MessageEmbed, i *discordgo.Interaction, wait time.Duration)

ModifyInteractionAndDelete modifies an already sent interaction and deletes it after the specified wait time

func SendAndDeleteEmbedInteraction

func SendAndDeleteEmbedInteraction(s *discordgo.Session, embed *discordgo.MessageEmbed, i *discordgo.Interaction, wait time.Duration, isDeferred chan struct{})

SendAndDeleteEmbedInteraction sends and deletes after three second an embed in a given channel

func SendEmbed

func SendEmbed(s *discordgo.Session, embed *discordgo.MessageEmbed, txtChannel string) *discordgo.Message

SendEmbed sends an embed in a given text channel

func SendEmbedInteraction

func SendEmbedInteraction(s *discordgo.Session, embed *discordgo.MessageEmbed, i *discordgo.Interaction, c chan<- struct{}, isDeferred chan struct{})

SendEmbedInteraction sends an embed as response to an interaction

Types

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