Documentation
¶
Index ¶
- Variables
- type ActionRow
- type Button
- type ButtonStyle
- type ChannelSelect
- type Component
- func BuildActionRow(components ...Component) Component
- func BuildButton(data Button) Component
- func BuildChannelSelect(data ChannelSelect) Component
- func BuildContainer(data Container) Component
- func BuildFile(data File) Component
- func BuildInputText(data InputText) Component
- func BuildLabel(data Label) Component
- func BuildMediaGallery(data MediaGallery) Component
- func BuildMentionableSelect(data MentionableSelect) Component
- func BuildRoleSelect(data RoleSelect) Component
- func BuildSection(data Section) Component
- func BuildSelectMenu(data SelectMenu) Component
- func BuildSeparator(data Separator) Component
- func BuildTextDisplay(data TextDisplay) Component
- func BuildThumbnail(data Thumbnail) Component
- func BuildUserSelect(data UserSelect) Component
- type ComponentData
- type ComponentType
- type Container
- type File
- type InputText
- type Label
- type MediaGallery
- type MediaGalleryItem
- type MentionableSelect
- type RoleSelect
- type Section
- type SelectMenu
- type SelectOption
- type Separator
- type TextDisplay
- type TextStyleTypes
- type Thumbnail
- type UnfurledMediaItem
- type UserSelect
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,omitempty"`
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 ChannelSelect ¶
type ChannelSelect 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"`
Required *bool `json:"required,omitempty"`
}
func (ChannelSelect) MarshalJSON ¶
func (i ChannelSelect) MarshalJSON() ([]byte, error)
func (ChannelSelect) Type ¶
func (i ChannelSelect) Type() ComponentType
type Component ¶
type Component struct {
Type ComponentType `json:"type"`
ComponentData
}
func BuildActionRow ¶
func BuildButton ¶
func BuildChannelSelect ¶
func BuildChannelSelect(data ChannelSelect) Component
func BuildContainer ¶
func BuildInputText ¶
func BuildLabel ¶
func BuildMediaGallery ¶
func BuildMediaGallery(data MediaGallery) Component
func BuildMentionableSelect ¶
func BuildMentionableSelect(data MentionableSelect) Component
func BuildRoleSelect ¶
func BuildRoleSelect(data RoleSelect) Component
func BuildSection ¶
func BuildSelectMenu ¶
func BuildSelectMenu(data SelectMenu) Component
func BuildSeparator ¶
func BuildTextDisplay ¶
func BuildTextDisplay(data TextDisplay) Component
func BuildThumbnail ¶
func BuildUserSelect ¶
func BuildUserSelect(data UserSelect) 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 ComponentUserSelect ComponentRoleSelect ComponentMentionableSelect ComponentChannelSelect ComponentSection ComponentTextDisplay ComponentThumbnail ComponentMediaGallery ComponentFile ComponentSeparator ComponentContainer ComponentType = iota + 3 ComponentLabel )
type Container ¶
type Container struct {
Components []Component `json:"components"`
AccentColor *int `json:"accent_color,omitempty"`
Spoiler *bool `json:"spoiler,omitempty"`
}
func (Container) MarshalJSON ¶
func (Container) Type ¶
func (i Container) Type() ComponentType
type File ¶
type File struct {
File UnfurledMediaItem `json:"file"`
Spoiler *bool `json:"spoiler,omitempty"`
}
func (File) MarshalJSON ¶
func (File) Type ¶
func (i File) Type() ComponentType
type InputText ¶
type InputText struct {
Style TextStyleTypes `json:"style"`
CustomId string `json:"custom_id"`
Label *string `json:"label,omitempty"`
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 Label ¶
type Label struct {
Label string `json:"label"`
Description *string `json:"description,omitempty"`
Component Component `json:"component"` // This can only be string select or text input
}
func (Label) MarshalJSON ¶
func (Label) Type ¶
func (i Label) Type() ComponentType
type MediaGallery ¶
type MediaGallery struct {
Items []MediaGalleryItem `json:"items"`
}
func (MediaGallery) MarshalJSON ¶
func (i MediaGallery) MarshalJSON() ([]byte, error)
func (MediaGallery) Type ¶
func (i MediaGallery) Type() ComponentType
type MediaGalleryItem ¶
type MediaGalleryItem struct {
Media UnfurledMediaItem `json:"media,omitempty"`
Description *string `json:"description,omitempty"`
Spoiler *bool `json:"spoiler,omitempty"`
}
type MentionableSelect ¶
type MentionableSelect 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"`
Required *bool `json:"required,omitempty"`
}
func (MentionableSelect) MarshalJSON ¶
func (i MentionableSelect) MarshalJSON() ([]byte, error)
func (MentionableSelect) Type ¶
func (i MentionableSelect) Type() ComponentType
type RoleSelect ¶
type RoleSelect 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"`
Required *bool `json:"required,omitempty"`
}
func (RoleSelect) MarshalJSON ¶
func (i RoleSelect) MarshalJSON() ([]byte, error)
func (RoleSelect) Type ¶
func (i RoleSelect) Type() ComponentType
type Section ¶
type Section struct {
Components []Component `json:"components"`
Accessory Component `json:"accessory,omitempty"`
}
func (Section) MarshalJSON ¶
func (Section) Type ¶
func (i Section) 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"`
Required *bool `json:"required,omitempty"`
}
func (SelectMenu) MarshalJSON ¶
func (s SelectMenu) MarshalJSON() ([]byte, error)
func (SelectMenu) Type ¶
func (s SelectMenu) Type() ComponentType
type SelectOption ¶
type Separator ¶
type Separator struct {
Divider *bool `json:"divider,omitempty"`
Spacing *int `json:"spacing,omitempty"`
}
func (Separator) MarshalJSON ¶
func (Separator) Type ¶
func (i Separator) Type() ComponentType
type TextDisplay ¶
type TextDisplay struct {
Content string `json:"content"`
}
func (TextDisplay) MarshalJSON ¶
func (i TextDisplay) MarshalJSON() ([]byte, error)
func (TextDisplay) Type ¶
func (i TextDisplay) Type() ComponentType
type TextStyleTypes ¶
type TextStyleTypes uint8
const ( TextStyleShort TextStyleTypes = iota + 1 TextStyleParagraph )
type Thumbnail ¶
type Thumbnail struct {
Media UnfurledMediaItem `json:"media,omitempty"`
Description *string `json:"description,omitempty"`
Spoiler *bool `json:"spoiler,omitempty"`
}
func (Thumbnail) MarshalJSON ¶
func (Thumbnail) Type ¶
func (i Thumbnail) Type() ComponentType
type UnfurledMediaItem ¶
type UserSelect ¶
type UserSelect struct {
CustomId string `json:"custom_id"`
Placeholder string `json:"placeholder,omitempty"`
MinValues *int `json:"min_values,omitempty"`
MaxValues *int `json:"max_values,omitempty"`
Disabled bool `json:"disabled"`
Required *bool `json:"required,omitempty"`
}
func (UserSelect) MarshalJSON ¶
func (i UserSelect) MarshalJSON() ([]byte, error)
func (UserSelect) Type ¶
func (i UserSelect) Type() ComponentType
Source Files
¶
- component.go
- component_channel_select.go
- component_container.go
- component_file.go
- component_label.go
- component_media_gallery.go
- component_mentionable_select.go
- component_role_select.go
- component_section.go
- component_separator.go
- component_text_display.go
- component_thumbnail.go
- component_user_select.go
- componentactionrow.go
- componentbutton.go
- inputtext.go
- selectmenu.go
Click to show internal directories.
Click to hide internal directories.