embedbuilder

package
v0.0.0-...-553821e Latest Latest
Warning

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

Go to latest
Published: May 25, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package embedbuilder provides a builder pattern to create discordgo message embeds.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EmbedBuilder

type EmbedBuilder struct {
	// contains filtered or unexported fields
}

EmbedBuilder provides a builder pattern to create a discordgo message embed.

func New

func New() *EmbedBuilder

New returns a fresh EmbedBuilder.

func (*EmbedBuilder) AddField

func (b *EmbedBuilder) AddField(name, value string, inline ...bool) *EmbedBuilder

AddField adds a field to the embed.

func (*EmbedBuilder) AddInlineField

func (b *EmbedBuilder) AddInlineField(name, value string) *EmbedBuilder

AddInlineField adds an inline field to the embed.

func (*EmbedBuilder) AsType

func (b *EmbedBuilder) AsType(typ discordgo.EmbedType) *EmbedBuilder

AsType sets the type to the embed.

func (*EmbedBuilder) Build

func (b *EmbedBuilder) Build() *discordgo.MessageEmbed

Build returns the result embed.

func (*EmbedBuilder) WithAuthor

func (b *EmbedBuilder) WithAuthor(name, url, iconUrl, proxyIconUrl string) *EmbedBuilder

WithAuthor sets an author to the embed.

func (*EmbedBuilder) WithColor

func (b *EmbedBuilder) WithColor(color int) *EmbedBuilder

WithColor sets a color to the embed.

func (*EmbedBuilder) WithDescription

func (b *EmbedBuilder) WithDescription(description string) *EmbedBuilder

WithDescription adds a description to the embed.

func (*EmbedBuilder) WithFooter

func (b *EmbedBuilder) WithFooter(text, iconUrl, proxyIconUrl string) *EmbedBuilder

WithFooter sets a footer to the embed.

func (*EmbedBuilder) WithImage

func (b *EmbedBuilder) WithImage(url, proxyUrl string, width, height int) *EmbedBuilder

WithImage sets an image to the embed.

func (*EmbedBuilder) WithProvider

func (b *EmbedBuilder) WithProvider(name, url string) *EmbedBuilder

WithProvider sets a provider to the embed.

func (*EmbedBuilder) WithThumbnail

func (b *EmbedBuilder) WithThumbnail(url, proxyUrl string, width, height int) *EmbedBuilder

WithThumbnail sets a thumbnail to the embed.

func (*EmbedBuilder) WithTimestamp

func (b *EmbedBuilder) WithTimestamp(timestamp time.Time) *EmbedBuilder

WithTimestamp sets a timestamp to the embed.

func (*EmbedBuilder) WithTitle

func (b *EmbedBuilder) WithTitle(title string) *EmbedBuilder

WithTitle sets a title to the embed.

func (*EmbedBuilder) WithURL

func (b *EmbedBuilder) WithURL(url string) *EmbedBuilder

WithURL sets the URL to the embed.

func (*EmbedBuilder) WithVideo

func (b *EmbedBuilder) WithVideo(url string, width, height int) *EmbedBuilder

WithVideo sets a video to the embed.

Jump to

Keyboard shortcuts

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