Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type ActionRow ¶
type ActionRow struct {
Components []Component
}
func (ActionRow) MarshalJSON ¶
func (ActionRow) Type ¶
func (a ActionRow) Type() ComponentType
type Button ¶
type Button struct { Label string `json:"label"` CustomId string `json:"custom_id"` Style ButtonStyle `json:"style"` Emoji *emoji.Emoji `json:"emoji,omitempty"` SkuId *uint64 `json:"sku_id,omitempty"` Url *string `json:"url,omitempty"` Disabled bool `json:"disabled"` }
func (Button) MarshalJSON ¶
func (Button) Type ¶
func (b Button) Type() ComponentType
type ButtonStyle ¶
type ButtonStyle uint8
const ( ButtonStylePrimary ButtonStyle = iota + 1 ButtonStyleSecondary ButtonStyleSuccess ButtonStyleDanger ButtonStyleLink ButtonStylePremium )
type Component ¶
type Component struct { Type ComponentType `json:"type"` ComponentData }
func BuildActionRow ¶
func BuildButton ¶
func BuildInputText ¶
func BuildSelectMenu ¶
func BuildSelectMenu(data SelectMenu) Component
func (Component) MarshalJSON ¶
func (*Component) UnmarshalJSON ¶
type ComponentData ¶
type ComponentData interface {
Type() ComponentType
}
type ComponentType ¶
type ComponentType uint8
const ( ComponentActionRow ComponentType = iota + 1 ComponentButton ComponentSelectMenu ComponentInputText )
type InputText ¶
type InputText struct { Style TextStyleTypes `json:"style"` CustomId string `json:"custom_id"` Label string `json:"label"` Placeholder *string `json:"placeholder,omitempty"` MinLength *uint32 `json:"min_length,omitempty"` MaxLength *uint32 `json:"max_length,omitempty"` Required *bool `json:"required,omitempty"` Value *string `json:"value,omitempty"` }
func (InputText) MarshalJSON ¶
func (InputText) Type ¶
func (i InputText) Type() ComponentType
type SelectMenu ¶
type SelectMenu struct { CustomId string `json:"custom_id"` Options []SelectOption `json:"options"` Placeholder string `json:"placeholder,omitempty"` MinValues *int `json:"min_values,omitempty"` MaxValues *int `json:"max_values,omitempty"` Disabled bool `json:"disabled"` }
func (SelectMenu) MarshalJSON ¶
func (s SelectMenu) MarshalJSON() ([]byte, error)
func (SelectMenu) Type ¶
func (s SelectMenu) Type() ComponentType
type SelectOption ¶
type TextStyleTypes ¶
type TextStyleTypes uint8
const ( TextStyleShort TextStyleTypes = iota + 1 TextStyleParagraph )
Click to show internal directories.
Click to hide internal directories.