Documentation ¶
Index ¶
- Variables
- func AckContinue(*discordgo.Interaction) (discordgo.InteractionResponse, bool, error)
- func AckSourceContinue(*discordgo.Interaction) (discordgo.InteractionResponse, bool, error)
- func Ping(interaction *discordgo.Interaction) (discordgo.InteractionResponse, bool, error)
- func Timer(interaction *discordgo.Interaction) error
- type Command
- type ContinuationSig
- type HandlerSig
Constants ¶
This section is empty.
Variables ¶
View Source
var Commands = map[string]Command{ "ping": { Command: discordgo.ApplicationCommand{ Name: "ping", Description: "Pong!", }, Handler: Ping, }, "timer": { Command: discordgo.ApplicationCommand{ Name: "timer", Description: "Sets a timer. Tick tock, tick tock...", Options: []*discordgo.ApplicationCommandOption{ { Type: discordgo.ApplicationCommandOptionInteger, Name: "Seconds", Description: "How many seconds to set the timer for", Required: true, }, }, }, Handler: AckSourceContinue, Continuation: Timer, }, }
Functions ¶
func AckContinue ¶
func AckContinue(*discordgo.Interaction) (discordgo.InteractionResponse, bool, error)
Use these to immediately continue to the task lambda
func AckSourceContinue ¶
func AckSourceContinue(*discordgo.Interaction) (discordgo.InteractionResponse, bool, error)
func Ping ¶
func Ping(interaction *discordgo.Interaction) (discordgo.InteractionResponse, bool, error)
func Timer ¶
func Timer(interaction *discordgo.Interaction) error
Note, this is certainly not a good way to implement a timer it's just a simple example for how continuation works
Types ¶
type Command ¶
type Command struct { Command discordgo.ApplicationCommand Handler HandlerSig Continuation ContinuationSig }
type ContinuationSig ¶
type ContinuationSig = func(*discordgo.Interaction) error
type HandlerSig ¶
type HandlerSig = func(*discordgo.Interaction) (discordgo.InteractionResponse, bool, error)
Click to show internal directories.
Click to hide internal directories.