Documentation
¶
Overview ¶
Package command defines application commands and handlers for the bot.
Index ¶
Constants ¶
const Ephemeral = 1 << 6
Ephemeral flag used for event messages that should only be shown to the user.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Definition ¶
type Definition struct { Name string Description string Handler Handler SubCommands []*Definition Options []*discordgo.ApplicationCommandOption }
Definition of a command providing all the details required to register and handle it.
func (Definition) Translate ¶
func (c Definition) Translate() *discordgo.ApplicationCommand
Translate the Definition to the internal discordgo format.
type Dispatcher ¶
Dispatcher contains the set of handlers which it will Dispatch interactions to.
func (Dispatcher) Dispatch ¶
func (d Dispatcher) Dispatch(event Event)
Dispatch an interaction, either to a top level command, or a bottom level sub command.
func (Dispatcher) Register ¶
func (d Dispatcher) Register(definition *Definition)
Register a command definition with the dispatcher.
type Event ¶
type Event struct { Session *discordgo.Session Interaction *discordgo.InteractionCreate // contains filtered or unexported fields }
Event from Discord.
func (*Event) Commands ¶
Commands issued to get to this event. There will always be at least 1 command in the returned list.
func (Event) Respond ¶
func (e Event) Respond(response *discordgo.InteractionResponse)
Respond to an event.