interactions

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: May 8, 2023 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

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"`
	Message        *discord.Message     `json:"message,omitempty"`
	AppPermissions *discord.Permissions `json:"permissions,omitempty"`
	Locale         string               `json:"locale"`
	GuildLocale    string               `json:"guild_locale"`
}

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"`
	Components      []components.MessageComponent `json:"components"`
}

type WebhookMessageResponse added in v0.1.4

type WebhookMessageResponse struct {
}

Jump to

Keyboard shortcuts

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