Documentation ¶
Index ¶
- type ActionRow
- type Button
- type ButtonStyle
- type ComponentType
- type ErrComponentMissingProperty
- type ErrComponentMustHaveCustomId
- type ErrComponentMustHaveStyle
- type ErrInvalidPropertyLength
- type ErrLinkButtonCannotHaveCustomId
- type ErrLinkButtonMustHaveUrl
- type ErrNestedActionRow
- type ErrNonLinkButtonCannotHaveUrl
- type ErrNonStringSelectMenuCannotHaveOptions
- type ErrSelectOptionMustHaveLabel
- type ErrSelectOptionMustHaveValue
- type ErrStringSelectMenuMustHaveOptions
- type ErrTooManyComponents
- type MessageComponent
- type MessageComponentData
- type MessageComponentWrapper
- type ModalSubmitData
- type SelectMenu
- type SelectOption
- type TextInput
- type TextInputStyle
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActionRow ¶
type ActionRow struct { RowType ComponentType `json:"type"` Components []MessageComponent `json:"components"` }
func (ActionRow) MarshalJSON ¶ added in v0.1.12
func (ActionRow) Type ¶
func (a ActionRow) Type() ComponentType
func (ActionRow) UnmarshalJSON ¶ added in v0.1.19
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"` ButtonType ComponentType `json:"type"` }
func (Button) MarshalJSON ¶ added in v0.1.18
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 ErrComponentMissingProperty ¶ added in v0.2.6
type ErrComponentMissingProperty struct { Component MessageComponent PropertyName string }
func (ErrComponentMissingProperty) Error ¶ added in v0.2.6
func (e ErrComponentMissingProperty) Error() string
type ErrComponentMustHaveCustomId ¶ added in v0.2.6
type ErrComponentMustHaveCustomId struct {
Component MessageComponent
}
func (ErrComponentMustHaveCustomId) Error ¶ added in v0.2.6
func (e ErrComponentMustHaveCustomId) Error() string
type ErrComponentMustHaveStyle ¶ added in v0.2.6
type ErrComponentMustHaveStyle struct {
Component MessageComponent
}
func (ErrComponentMustHaveStyle) Error ¶ added in v0.2.6
func (e ErrComponentMustHaveStyle) Error() string
type ErrInvalidPropertyLength ¶ added in v0.2.6
type ErrInvalidPropertyLength struct { Component interface{} PropertyName string MaxLength int MinLength int PropertyLength int PropertyValue interface{} }
func (ErrInvalidPropertyLength) Error ¶ added in v0.2.6
func (e ErrInvalidPropertyLength) Error() string
type ErrLinkButtonCannotHaveCustomId ¶ added in v0.2.6
type ErrLinkButtonCannotHaveCustomId struct {
Component Button
}
func (ErrLinkButtonCannotHaveCustomId) Error ¶ added in v0.2.6
func (e ErrLinkButtonCannotHaveCustomId) Error() string
type ErrLinkButtonMustHaveUrl ¶ added in v0.2.6
type ErrLinkButtonMustHaveUrl struct {
Component Button
}
func (ErrLinkButtonMustHaveUrl) Error ¶ added in v0.2.6
func (e ErrLinkButtonMustHaveUrl) Error() string
type ErrNestedActionRow ¶ added in v0.2.6
type ErrNestedActionRow struct {
Components []MessageComponent
}
func (ErrNestedActionRow) Error ¶ added in v0.2.6
func (e ErrNestedActionRow) Error() string
type ErrNonLinkButtonCannotHaveUrl ¶ added in v0.2.6
type ErrNonLinkButtonCannotHaveUrl struct {
Component Button
}
func (ErrNonLinkButtonCannotHaveUrl) Error ¶ added in v0.2.6
func (e ErrNonLinkButtonCannotHaveUrl) Error() string
type ErrNonStringSelectMenuCannotHaveOptions ¶ added in v0.2.6
type ErrNonStringSelectMenuCannotHaveOptions struct {
Component SelectMenu
}
func (ErrNonStringSelectMenuCannotHaveOptions) Error ¶ added in v0.2.6
func (e ErrNonStringSelectMenuCannotHaveOptions) Error() string
type ErrSelectOptionMustHaveLabel ¶ added in v0.2.6
type ErrSelectOptionMustHaveLabel struct {
Option SelectOption
}
func (ErrSelectOptionMustHaveLabel) Error ¶ added in v0.2.6
func (e ErrSelectOptionMustHaveLabel) Error() string
type ErrSelectOptionMustHaveValue ¶ added in v0.2.6
type ErrSelectOptionMustHaveValue struct {
Option SelectOption
}
func (ErrSelectOptionMustHaveValue) Error ¶ added in v0.2.6
func (e ErrSelectOptionMustHaveValue) Error() string
type ErrStringSelectMenuMustHaveOptions ¶ added in v0.2.6
type ErrStringSelectMenuMustHaveOptions struct {
Component SelectMenu
}
func (ErrStringSelectMenuMustHaveOptions) Error ¶ added in v0.2.6
func (e ErrStringSelectMenuMustHaveOptions) Error() string
type ErrTooManyComponents ¶ added in v0.2.6
type ErrTooManyComponents struct {
Components []MessageComponent
}
func (ErrTooManyComponents) Error ¶ added in v0.2.6
func (e ErrTooManyComponents) Error() string
type MessageComponent ¶
type MessageComponent interface { Type() ComponentType Verify() error }
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"` }
func (ModalSubmitData) UnmarshalJSON ¶ added in v0.1.19
func (m ModalSubmitData) UnmarshalJSON(data []byte) error
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
func (SelectMenu) Verify ¶ added in v0.2.6
func (selectMenu SelectMenu) Verify() error
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"` }
func (SelectOption) Verify ¶ added in v0.2.6
func (selectOption SelectOption) Verify() error
type TextInput ¶ added in v0.1.19
type TextInput struct { TextInputType ComponentType `json:"type"` CustomId string `json:"custom_id"` Style TextInputStyle `json:"style"` Label string `json:"label"` MinLength int `json:"min_length"` MaxLength int `json:"max_length"` Required bool `json:"required"` Value string `json:"value"` Placeholder string `json:"placeholder"` }
func (TextInput) MarshalJSON ¶ added in v0.1.19
func (TextInput) Type ¶ added in v0.1.19
func (t TextInput) Type() ComponentType
type TextInputStyle ¶ added in v0.1.19
type TextInputStyle uint8
const ( ShortTextInputStyle TextInputStyle = iota + 1 LongTextInputStyle )
Click to show internal directories.
Click to hide internal directories.