Versions in this module Expand all Collapse all v0 v0.1.1 Mar 15, 2026 v0.1.0 Mar 13, 2026 Changes in this version + var ErrButtonFailed = errors.New("button failed") + var ErrCommandFailed = errors.New("command failed") + var ErrHookAborted = errors.New("hook aborted") + var ErrModalFailed = errors.New("modal failed") + var ErrNotACommand = errors.New("not an application command interaction") + var ErrSessionNotReady = errors.New("session not ready") + var ErrUnknownButton = errors.New("unknown button") + var ErrUnknownCommand = errors.New("unknown command") + var ErrUnknownModal = errors.New("unknown modal") + func DefaultErrorHandler(s *discordgo.Session, i *discordgo.InteractionCreate, err error) + func DefaultRecoverHandler(s *discordgo.Session, i *discordgo.InteractionCreate, recovered any, ...) + func Defer(s *discordgo.Session, i *discordgo.InteractionCreate, ephemeral bool) error + func RespondEmptyAutocomplete(s *discordgo.Session, i *discordgo.InteractionCreate) error + func RespondEphemeral(s *discordgo.Session, i *discordgo.InteractionCreate, message string) error + func RespondOrEdit(s *discordgo.Session, i *discordgo.InteractionCreate, ...) error + type Button interface + CustomID func() string + Handle func(ctx context.Context, s *discordgo.Session, i *discordgo.InteractionCreate) error + Hooks func() []Hook + type Command interface + Autocomplete func(ctx context.Context, s *discordgo.Session, i *discordgo.InteractionCreate) error + Definition func() *discordgo.ApplicationCommand + Handle func(ctx context.Context, s *discordgo.Session, i *discordgo.InteractionCreate) error + Hooks func() []Hook + Scope func() Scope + type EmptyButton struct + func (*EmptyButton) Hooks() []Hook + type EmptyCommand struct + func (*EmptyCommand) Autocomplete(_ context.Context, s *discordgo.Session, i *discordgo.InteractionCreate) error + func (*EmptyCommand) Hooks() []Hook + func (*EmptyCommand) Scope() Scope + type EmptyHook struct + func (*EmptyHook) Execute(_ context.Context, _ *discordgo.Session, _ *discordgo.InteractionCreate) error + type EmptyModal struct + func (*EmptyModal) Hooks() []Hook + type ErrorHandler func(s *discordgo.Session, i *discordgo.InteractionCreate, err error) + type Hook interface + Execute func(ctx context.Context, s *discordgo.Session, i *discordgo.InteractionCreate) error + type IDMatcher func(registered, incoming string) bool + type Modal interface + CustomID func() string + Handle func(ctx context.Context, s *discordgo.Session, i *discordgo.InteractionCreate) error + Hooks func() []Hook + type RecoverHandler func(s *discordgo.Session, i *discordgo.InteractionCreate, recovered any, ...) + type Router struct + IDMatcher IDMatcher + OnError ErrorHandler + OnRecover RecoverHandler + func NewRouter(session *discordgo.Session) *Router + func (r *Router) AddButton(btn Button) + func (r *Router) AddCommand(cmd Command) + func (r *Router) AddEventHandler(h any) + func (r *Router) AddModal(m Modal) + func (r *Router) ClearButtons() + func (r *Router) ClearCommands() + func (r *Router) ClearModals() + func (r *Router) Init() + func (r *Router) RegisterCommands(guildID string) error + type Scope int + const ScopeGlobal + const ScopeGuild