Documentation ¶
Index ¶
- Variables
- func DefaultErrorHandler(err error, s *discordgo.Session, i *discordgo.InteractionCreate) error
- func GetUser(i *discordgo.InteractionCreate) *discordgo.User
- func Responded(s *discordgo.Session, i *discordgo.InteractionCreate) bool
- type Command
- type Commander
- func (m *Commander) AddCommand(c *Command)
- func (m *Commander) Handler(s *discordgo.Session, i *discordgo.InteractionCreate)
- func (m *Commander) Install(s *discordgo.Session, guild string) error
- func (m *Commander) OnError(h ErrorHandler)
- func (m *Commander) Uninstall(s *discordgo.Session, guild string) error
- type ErrorHandler
Constants ¶
This section is empty.
Variables ¶
View Source
var InteractionResponseEphemeral uint64 = 1 << 6
Functions ¶
func DefaultErrorHandler ¶
DefaultErrorHandler is the default command error handler
Types ¶
type Command ¶
type Command struct { Name string Description string Options []*discordgo.ApplicationCommandOption Run func(s *discordgo.Session, i *discordgo.InteractionCreate) error }
Command represents a Discord slash command
type Commander ¶
type Commander struct {
// contains filtered or unexported fields
}
Commander represents Discord slash commands
func (*Commander) AddCommand ¶
AddCommand adds a new slash command
func (*Commander) Handler ¶
func (m *Commander) Handler(s *discordgo.Session, i *discordgo.InteractionCreate)
Handler handles interaction create events from Discord
func (*Commander) Install ¶
Install creates the commands in given guild. If guild is empty, it will install the commands globally.
func (*Commander) OnError ¶
func (m *Commander) OnError(h ErrorHandler)
OnError sets the error handler when an error is returned from a command
type ErrorHandler ¶
ErrorHandler represents an error handler function
Click to show internal directories.
Click to hide internal directories.