Documentation ¶
Index ¶
- Variables
- func GlobalCommandCreate(s *discordgo.Session, aID string, command Command) (err error)
- func GuildCommandCreate(s *discordgo.Session, aID string, gID string, command Command) (err error)
- type Command
- type CommandOption
- type CommandOptionChoice
- type CommandOptionType
- type Interaction
- type InteractionData
- type InteractionDataOption
- type InteractionResponse
- type InteractionResponseData
- type InteractionResponseType
- type InteractionType
Constants ¶
This section is empty.
Variables ¶
View Source
var ( EndpointApplicationNoOauth = func(aID string) string { return discordgo.EndpointAPI + "/applications/" + aID } EndpointApplicationCommands = func(aID string) string { return EndpointApplicationNoOauth(aID) + "/commands" } EndpointApplicationGuildCommands = func(aID string, gID string) string { return EndpointApplicationNoOauth(aID) + "/guilds/" + gID + "/commands" } EndpointInteractionResponse = func(iID string, iToken string) string { return discordgo.EndpointAPI + "/interactions/" + iID + "/" + iToken + "/callback" } )
Functions ¶
func GlobalCommandCreate ¶
Types ¶
type Command ¶
type Command struct { Name string `json:"name"` Description string `json:"description"` Options []CommandOption `json:"options,omitempty"` }
type CommandOption ¶
type CommandOption struct { Type CommandOptionType `json:"type"` Name string `json:"name"` Description string `json:"description"` Default bool `json:"default"` Required bool `json:"required"` Choices []CommandOptionChoice `json:"choices,omitempty"` Options []CommandOption `json:"options,omitempty"` }
type CommandOptionChoice ¶
type CommandOptionChoice struct { Name string `json:"name"` Value interface{} `json:"value"` }
type CommandOptionType ¶
type CommandOptionType int
const ( OptionTypeSubCommand CommandOptionType = iota + 1 OptionTypeSubCommandGroup OptionTypeString OptionTypeInteger OptionTypeBoolean OptionTypeUser OptionTypeChannel OptionTypeRole )
type Interaction ¶
type Interaction struct { ID string `json:"id"` Type InteractionType `json:"type"` Data InteractionData `json:"data"` GuildID string `json:"guild_id"` ChannelID string `json:"channel_id"` Member discordgo.Member `json:"member"` Token string `json:"token"` Version int `json:"version"` }
func InteractionFromRaw ¶
func InteractionFromRaw(raw json.RawMessage) (inter Interaction, err error)
func (*Interaction) Respond ¶
func (interaction *Interaction) Respond(s *discordgo.Session, resp InteractionResponse) (err error)
type InteractionData ¶
type InteractionData struct { ID string `json:"id"` Name string `json:"name"` Options []InteractionDataOption `json:"options"` }
type InteractionDataOption ¶
type InteractionDataOption struct { Name string `json:"name"` Value interface{} `json:"value"` Options []InteractionDataOption `json:"options"` }
type InteractionResponse ¶
type InteractionResponse struct { Type InteractionResponseType `json:"type"` Data InteractionResponseData `json:"data,omitempty"` }
type InteractionResponseData ¶
type InteractionResponseData struct { TTS bool `json:"tts"` Content string `json:"content"` Embeds []discordgo.MessageEmbed `json:"embeds,omitempty"` AllowedMentions discordgo.AllowedMentionType `json:"allowed_mentions,omitempty"` }
type InteractionResponseType ¶
type InteractionResponseType int
const ( InteractionResponseTypePong InteractionResponseType = iota + 1 InteractionResponseTypeAcknowledge InteractionResponseTypeChannelMessage InteractionResponseTypeChannelMessageWithSource InteractionResponseTypeACKWithSource )
type InteractionType ¶
type InteractionType int
const ( InteractionTypePing InteractionType = iota + 1 InteractionTypeApplicationCommand )
Click to show internal directories.
Click to hide internal directories.