interactions

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2023 License: GPL-3.0 Imports: 4 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"`
}

func Parse

func Parse(data string) (interaction *Interaction, err error)

func (*Interaction) IsPing

func (interaction *Interaction) IsPing() bool

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"`
}

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"`
}

Jump to

Keyboard shortcuts

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