Documentation ¶
Index ¶
- Constants
- type AutocompleteCallbackData
- type Interaction
- func (interaction *Interaction) CreateResponse(response InteractionResponse) error
- func (interaction *Interaction) DeferResponse(isEphemeral bool) error
- func (interaction *Interaction) DeleteResponse() error
- func (interaction *Interaction) EditResponse(data ResponseEditData) error
- func (interaction *Interaction) GetResponse() (*discord.Message, error)
- func (interaction *Interaction) IsPing() bool
- func (interaction *Interaction) UnmarshalJSON(d []byte) error
- type InteractionCallbackData
- type InteractionCallbackType
- type InteractionData
- type InteractionResponse
- type InteractionType
- type MessageCallbackData
- type ModalCallback
- type ResponseEditData
- type WebhookMessageResponse
Constants ¶
View Source
const ( PongInteractionCallbackType InteractionCallbackType = iota + 1 ChannelMessageWithSourceInteractionCallbackType = iota + 3 DeferredChannelMessageWithSourceInteractionCallbackType DeferredUpdateMessageInteractionCallbackType UpdateMessageInteractionCallbackType ApplicationCommandAutocompleteResultInteractionCallbackType ModalInteractionCallbackType )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AutocompleteCallbackData ¶
type AutocompleteCallbackData struct {
Choices []commands.AutoCompleteChoice `json:"choices"`
}
type Interaction ¶
type Interaction struct { Id discord.Snowflake `json:"id"` ApplicationId discord.Snowflake `json:"application_id"` Type InteractionType `json:"type"` DataInternal *json.RawMessage `json:"data,omitempty"` Data InteractionData `json:"-"` GuildId *discord.Snowflake `json:"guild_id,omitempty"` ChannelId *discord.Snowflake `json:"channel_id,omitempty"` Member *discord.Member `json:"member,omitempty"` User *discord.User `json:"user,omitempty"` Token string `json:"token"` Version int `json:"version"` }
func Parse ¶
func Parse(data string) (interaction *Interaction, err error)
func (*Interaction) CreateResponse ¶ added in v0.1.4
func (interaction *Interaction) CreateResponse(response InteractionResponse) error
func (*Interaction) DeferResponse ¶ added in v0.1.6
func (interaction *Interaction) DeferResponse(isEphemeral bool) error
func (*Interaction) DeleteResponse ¶ added in v0.1.4
func (interaction *Interaction) DeleteResponse() error
func (*Interaction) EditResponse ¶ added in v0.1.4
func (interaction *Interaction) EditResponse(data ResponseEditData) error
func (*Interaction) GetResponse ¶ added in v0.1.4
func (interaction *Interaction) GetResponse() (*discord.Message, error)
func (*Interaction) IsPing ¶
func (interaction *Interaction) IsPing() bool
func (*Interaction) UnmarshalJSON ¶ added in v0.1.8
func (interaction *Interaction) UnmarshalJSON(d []byte) error
type InteractionCallbackData ¶
type InteractionCallbackData interface { }
type InteractionCallbackType ¶
type InteractionCallbackType uint8
type InteractionData ¶
type InteractionData interface { }
type InteractionResponse ¶
type InteractionResponse struct { Type InteractionCallbackType `json:"type"` Data InteractionCallbackData `json:"data,omitempty"` }
func CreateDeferEditResponse ¶ added in v0.1.1
func CreateDeferEditResponse() InteractionResponse
func CreateDeferMessageResponse ¶ added in v0.1.1
func CreateDeferMessageResponse() InteractionResponse
func CreatePongResponse ¶ added in v0.1.1
func CreatePongResponse() InteractionResponse
func (InteractionResponse) ToAPIGatewayResponse ¶ added in v0.1.1
func (ir InteractionResponse) ToAPIGatewayResponse() events.APIGatewayProxyResponse
type InteractionType ¶
type InteractionType uint8
const ( PingInteractionType InteractionType = iota + 1 ApplicationCommandInteractionType MessageComponentInteractionType ApplicationCommandAutocompleteInteractionType ModalSubmitInteractionType )
type MessageCallbackData ¶
type MessageCallbackData struct { TTS *bool `json:"tts,omitempty"` Content *string `json:"content,omitempty"` Embeds []discord.Embed `json:"embeds,omitempty"` AllowedMentions *discord.AllowedMentions `json:"allowed_mentions,omitempty"` Flags *int `json:"flags,omitempty"` Components []components.MessageComponent `json:"components,omitempty"` Attachments []discord.Attachment `json:"attachments,omitempty"` }
type ModalCallback ¶
type ModalCallback struct { CustomId string `json:"custom_id"` Title string `json:"title"` Components []components.MessageComponent `json:"components"` }
type ResponseEditData ¶ added in v0.1.4
type ResponseEditData struct { Content *string `json:"content,omitempty"` Embeds []discord.Embed `json:"embeds,omitempty"` AllowedMentions *discord.AllowedMentions `json:"allowed_mentions,omitempty"` Components []components.MessageComponent `json:"components,omitempty"` }
type WebhookMessageResponse ¶ added in v0.1.4
type WebhookMessageResponse struct { }
Click to show internal directories.
Click to hide internal directories.