Documentation
¶
Index ¶
Constants ¶
View Source
const (
CMD_TYPE_STR = 3
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Command ¶
type Command struct {
Name string `json:"name"`
Description string `json:"description"`
Options []CommandOption `json:"options"`
}
Sent to the discord API as a created command.
func NewCommand ¶
func NewCommand(name, desc string, options ...CommandOption) Command
type CommandData ¶
type CommandData struct {
ID string
Name string
Options []CommandDataOption
}
Data received as part of an interaction.
type CommandDataOption ¶
type CommandDataOption struct {
Name, Value string
}
Options for the received data.
type CommandOption ¶
type CommandOption struct {
Type int `json:"type"`
Name string `json:"name"`
Description string `json:"description"`
Required bool `json:"required"`
}
Options for a command.
type Interaction ¶
type Interaction struct {
ID string
Type int64
Token string
Data CommandData
}
Represents a Discord interaction request.
func (Interaction) IsPing ¶
func (i Interaction) IsPing() bool
Whether or not the interaction is a ping request.
type InteractionResponse ¶
type InteractionResponse struct {
Type int `json:"type"`
Data InteractionResponseData `json:"data"`
}
Represents the response to a Discord interaction request.
func NewAckResponse ¶
func NewAckResponse() InteractionResponse
func NewAckWithSrcResponse ¶
func NewAckWithSrcResponse(i Interaction) InteractionResponse
func NewMsgResponse ¶
func NewMsgResponse(content string) InteractionResponse
func NewMsgWithSrcResponse ¶
func NewMsgWithSrcResponse(i Interaction) InteractionResponse
func NewPongResponse ¶
func NewPongResponse() InteractionResponse
type InteractionResponseData ¶
Click to show internal directories.
Click to hide internal directories.