components

package
v0.0.0-...-bfbcaf2 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewActionRow

func NewActionRow(components ...*SCDiscordComponent) (discordgo.MessageComponent, error)

Types

type SCDiscordActionRow

type SCDiscordActionRow struct {
	Type discordgo.ComponentType `json:"type"`
	// Components is a slice of MessageComponents
	Components []*SCDiscordComponent `json:"components"`
}

func (*SCDiscordActionRow) AsMessageComponent

func (ar *SCDiscordActionRow) AsMessageComponent() (discordgo.MessageComponent, error)

type SCDiscordComponent

type SCDiscordComponent struct {
	Type     discordgo.ComponentType `json:"type"`
	Style    discordgo.ButtonStyle   `json:"style"`
	Label    string                  `json:"label,omitempty"`
	Emoji    *discordgo.Emoji        `json:"emoji,omitempty"`
	CustomID string                  `json:"custom_id,omitempty"`
	URL      string                  `json:"url,omitempty"`
	Disabled *bool                   `json:"disabled,omitempty"`
}

func NewButton

func NewButton(label string, id string, emoji string) *SCDiscordComponent

Creates a new action button

func NewLinkButton

func NewLinkButton(label string, url string, emoji string) *SCDiscordComponent

Creates a new link button

Jump to

Keyboard shortcuts

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