components

package
v0.1.12 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionRowBuilder

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

func NewActionRow

func NewActionRow() *ActionRowBuilder

func (*ActionRowBuilder) Add

func (a *ActionRowBuilder) Add(components Component) *ActionRowBuilder

func (*ActionRowBuilder) SetCustomID

func (v *ActionRowBuilder) SetCustomID(id string) *baseBuilder

func (*ActionRowBuilder) SetDisabled

func (v *ActionRowBuilder) SetDisabled(disabled bool) *baseBuilder

func (*ActionRowBuilder) Size

func (a *ActionRowBuilder) Size() int

func (*ActionRowBuilder) ToComponent

func (a *ActionRowBuilder) ToComponent() (x Component)

func (*ActionRowBuilder) Type

func (v *ActionRowBuilder) Type() Type

type ActionRowItem

type ActionRowItem interface {
	ToComponent() Component
	Type() Type
}

type ButtonBuilder

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

func NewButton

func NewButton(style ButtonStyle) *ButtonBuilder

func (*ButtonBuilder) SetCustomID

func (v *ButtonBuilder) SetCustomID(id string) *ButtonBuilder

func (*ButtonBuilder) SetDisabled

func (v *ButtonBuilder) SetDisabled(disabled bool) *ButtonBuilder

func (*ButtonBuilder) SetEmoji

func (v *ButtonBuilder) SetEmoji(emoji PartialEmoji) *ButtonBuilder

func (*ButtonBuilder) SetLabel

func (v *ButtonBuilder) SetLabel(label string) *ButtonBuilder

func (*ButtonBuilder) SetUrl

func (v *ButtonBuilder) SetUrl(url string) *ButtonBuilder

func (*ButtonBuilder) ToComponent

func (v *ButtonBuilder) ToComponent() (x Component)

func (*ButtonBuilder) Type

func (v *ButtonBuilder) Type() Type

type ButtonStyle

type ButtonStyle uint8
const (
	ButtonStylePrimary ButtonStyle = iota + 1
	ButtonStyleSecondary
	ButtonStyleSuccess
	ButtonStyleDanger
	ButtonStyleLink
)

type Component

type Component struct {
	Emoji       *PartialEmoji      `json:"emoji,omitempty"`
	Value       string             `json:"value,omitempty"`
	CustomID    string             `json:"custom_id,omitempty"`
	Placeholder string             `json:"placeholder,omitempty"`
	Label       string             `json:"label,omitempty"`
	Url         string             `json:"url,omitempty"`
	Options     []SelectMenuOption `json:"options,omitempty"`
	Components  []Component        `json:"components,omitempty"`
	Style       ButtonStyle        `json:"style,omitempty"`
	Disabled    bool               `json:"disabled,omitempty"`
	MinValues   uint8              `json:"min_values,omitempty"`
	MaxValues   uint8              `json:"max_values,omitempty"`
	Type        Type               `json:"type"`
}

type List

type List [][]ActionRowItem

func (List) Build

func (rows List) Build() (components []Component)

type PartialEmoji

type PartialEmoji struct {
	Name     string       `json:"name"`
	ID       snowflake.ID `json:"id"`
	Animated bool         `json:"animated,omitempty"`
}

type SelectMenuBuilder

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

func NewSelectMenu

func NewSelectMenu() *SelectMenuBuilder

func (*SelectMenuBuilder) SetCustomID

func (v *SelectMenuBuilder) SetCustomID(id string) *SelectMenuBuilder

func (*SelectMenuBuilder) SetDisabled

func (v *SelectMenuBuilder) SetDisabled(disabled bool) *SelectMenuBuilder

func (*SelectMenuBuilder) SetMaxValues

func (v *SelectMenuBuilder) SetMaxValues(max uint8) *SelectMenuBuilder

func (*SelectMenuBuilder) SetMinValues

func (v *SelectMenuBuilder) SetMinValues(min uint8) *SelectMenuBuilder

func (*SelectMenuBuilder) SetOptions

func (v *SelectMenuBuilder) SetOptions(options SelectMenuOptions) *SelectMenuBuilder

func (*SelectMenuBuilder) SetPlaceholder

func (v *SelectMenuBuilder) SetPlaceholder(text string) *SelectMenuBuilder

func (*SelectMenuBuilder) ToComponent

func (v *SelectMenuBuilder) ToComponent() (x Component)

func (*SelectMenuBuilder) Type

func (v *SelectMenuBuilder) Type() Type

type SelectMenuOption

type SelectMenuOption struct {
	Emoji       *PartialEmoji `json:"emoji,omitempty"`
	Label       string        `json:"label"`
	Value       string        `json:"value"`
	Description string        `json:"description,omitempty"`
	Default     bool          `json:"default,omitempty"`
}

type SelectMenuOptions

type SelectMenuOptions = []SelectMenuOption

type Type

type Type uint8
const (
	TypeActionRow Type = iota + 1
	TypeButton
	TypeSelectMenu
)

Jump to

Keyboard shortcuts

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