components

package
v0.1.11 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2023 License: GPL-3.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 ActionRow

type ActionRow struct {
	Components []MessageComponent `json:"components"`
}

func (ActionRow) Type

func (a ActionRow) Type() ComponentType

type Button

type Button struct {
	Style    ButtonStyle    `json:"style"`
	Label    *string        `json:"label,omitempty"`
	Emoji    *discord.Emoji `json:"emoji,omitempty"`
	CustomId *string        `json:"custom_id,omitempty"`
	Url      *string        `json:"url,omitempty"`
	Disabled *bool          `json:"disabled,omitempty"`
}

func (Button) Type

func (button Button) Type() ComponentType

type ButtonStyle

type ButtonStyle uint8
const (
	PrimaryButtonStyle ButtonStyle = iota + 1
	SecondaryButtonStyle
	SuccessButtonStyle
	DangerButtonStyle
	LinkButtonStyle
)

type ComponentType

type ComponentType uint8
const (
	ActionRowType ComponentType = iota + 1
	ButtonType
	StringSelectType
	TextInputType
	UserSelectType
	RoleSelectType
	MentionableSelectType
	ChannelSelectType
)

type MessageComponent

type MessageComponent interface {
	Type() ComponentType
}

MessageComponent can be made of any variables, so it's a map until we parse it into a specific component.

type MessageComponentData

type MessageComponentData struct {
	CustomId string                `json:"custom_id"`
	Type     ComponentType         `json:"component_type"`
	Values   []string              `json:"values"`
	Resolved *discord.ResolvedData `json:"resolved,omitempty"`
}

type MessageComponentWrapper

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

func (*MessageComponentWrapper) MarshalJSON

func (m *MessageComponentWrapper) MarshalJSON() ([]byte, error)

func (*MessageComponentWrapper) UnmarshalJSON

func (m *MessageComponentWrapper) UnmarshalJSON(data []byte) error

type ModalSubmitData

type ModalSubmitData struct {
	CustomId   string             `json:"custom_id"`
	Components []MessageComponent `json:"components"`
}

type SelectMenu

type SelectMenu struct {
	MenuType     ComponentType          `json:"type"`
	CustomId     string                 `json:"custom_id"`
	Options      *[]SelectOption        `json:"options,omitempty"`
	ChannelTypes *[]discord.ChannelType `json:"channel_types,omitempty"`
	Placeholder  *string                `json:"placeholder,omitempty"`
	MinValues    *uint8                 `json:"min_values,omitempty"`
	MaxValues    *uint8                 `json:"max_values,omitempty"`
	Disabled     *bool                  `json:"disabled,omitempty"`
}

func (SelectMenu) Type

func (selectMenu SelectMenu) Type() ComponentType

type SelectOption

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

Jump to

Keyboard shortcuts

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