Documentation ¶
Overview ¶
Package embedbuilder provides a builder pattern to create discordgo message embeds.
Index ¶
- type EmbedBuilder
- func (b *EmbedBuilder) AddField(name, value string, inline ...bool) *EmbedBuilder
- func (b *EmbedBuilder) AddInlineField(name, value string) *EmbedBuilder
- func (b *EmbedBuilder) AsType(typ discordgo.EmbedType) *EmbedBuilder
- func (b *EmbedBuilder) Build() *discordgo.MessageEmbed
- func (b *EmbedBuilder) WithAuthor(name, url, iconUrl, proxyIconUrl string) *EmbedBuilder
- func (b *EmbedBuilder) WithColor(color int) *EmbedBuilder
- func (b *EmbedBuilder) WithDescription(description string) *EmbedBuilder
- func (b *EmbedBuilder) WithFooter(text, iconUrl, proxyIconUrl string) *EmbedBuilder
- func (b *EmbedBuilder) WithImage(url, proxyUrl string, width, height int) *EmbedBuilder
- func (b *EmbedBuilder) WithProvider(name, url string) *EmbedBuilder
- func (b *EmbedBuilder) WithThumbnail(url, proxyUrl string, width, height int) *EmbedBuilder
- func (b *EmbedBuilder) WithTimestamp(timestamp time.Time) *EmbedBuilder
- func (b *EmbedBuilder) WithTitle(title string) *EmbedBuilder
- func (b *EmbedBuilder) WithURL(url string) *EmbedBuilder
- func (b *EmbedBuilder) WithVideo(url string, width, height int) *EmbedBuilder
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 (*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.