Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrHandlerInvalidFirstParameterType = errors.New(
"incorrect first parameter type for handler - first parameter must be of type *discordgo.Session",
)
View Source
var ErrHandlerInvalidParameterCount = errors.New(
"invalid number of handler arguments",
)
View Source
var ErrHandlerInvalidSecondParameterType = errors.New(
"incorrect second parameter type for handler - second parameter must be of type *discordgo.InteractionCreate",
)
View Source
var ErrHandlerInvalidThirdParameterType = errors.New(
"incorrect third parameter type for handler - third parameter must be of type struct",
)
View Source
var ErrHandlerNotFunction = errors.New(
"provided command handler is not a function",
)
View Source
var ErrInvalidArgumentType = errors.New(
"struct field type is not a supported option type",
)
View Source
var ErrMessageHandlerInvalidThirdParameterType = errors.New(
"incorrect third parameter type for handler - third parameter must be of type *discordgo.Message",
)
View Source
var ErrUnknownCommand = errors.New("unknown command")
View Source
var ErrUnsupportedDefaultArgType = errors.New(
"attempted to use default value for option type which does not currently support default values",
)
View Source
var ErrUnsupportedInteractionType = errors.New("unsupported interaction type")
Functions ¶
This section is empty.
Types ¶
type Command ¶
type Command struct { Name string Description string Handler any GuildID string Type CommandType }
func (*Command) ToDiscordCommand ¶
func (c *Command) ToDiscordCommand() (*discordgo.ApplicationCommand, error)
type Switchboard ¶
type Switchboard struct {
// contains filtered or unexported fields
}
func (*Switchboard) AddCommand ¶
func (s *Switchboard) AddCommand(command *Command) error
func (*Switchboard) HandleInteractionCreate ¶
func (s *Switchboard) HandleInteractionCreate(session *discordgo.Session, interaction *discordgo.InteractionCreate)
func (*Switchboard) SyncCommands ¶
func (s *Switchboard) SyncCommands(session *discordgo.Session, appId string) error
Click to show internal directories.
Click to hide internal directories.