Documentation
¶
Index ¶
- type AutocompleteContext
- type AutocompleteHandler
- type Check
- type Command
- type CommandContext
- type CommandHandler
- type Component
- type ComponentContext
- type ComponentHandler
- type Handler
- func (h *Handler) AddCommands(commands ...Command)
- func (h *Handler) AddComponents(components ...Component)
- func (h *Handler) AddModals(modals ...Modal)
- func (h *Handler) InitI18n(fallbackLocale language.Tag)
- func (h *Handler) OnEvent(event bot.Event)
- func (h *Handler) SyncCommands(client bot.Client, guildIDs ...snowflake.ID)
- type I18n
- type Modal
- type ModalContext
- type ModalHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AutocompleteContext ¶ added in v0.2.0
type AutocompleteContext struct {
*events.AutocompleteInteractionCreate
Printer *message.Printer
}
type AutocompleteHandler ¶
type AutocompleteHandler func(ctx *AutocompleteContext) error
type Command ¶
type Command struct {
Create discord.ApplicationCommandCreate
Check Check[*CommandContext]
AutocompleteCheck Check[*AutocompleteContext]
CommandHandlers map[string]CommandHandler
AutocompleteHandlers map[string]AutocompleteHandler
}
type CommandContext ¶ added in v0.2.0
type CommandContext struct {
*events.ApplicationCommandInteractionCreate
Printer *message.Printer
}
type CommandHandler ¶
type CommandHandler func(ctx *CommandContext) error
type Component ¶
type Component struct {
Name string
Check Check[*ComponentContext]
Handler ComponentHandler
}
type ComponentContext ¶ added in v0.2.0
type ComponentContext struct {
*events.ComponentInteractionCreate
Printer *message.Printer
Args []string
}
type ComponentHandler ¶
type ComponentHandler func(ctx *ComponentContext) error
type Handler ¶
type Handler struct {
Logger log.Logger
I18n *I18n
NewCtxFunc func() context.Context
Commands map[string]Command
Components map[string]Component
Modals map[string]Modal
}
func (*Handler) AddCommands ¶
func (*Handler) AddComponents ¶
type I18n ¶ added in v0.2.0
func (*I18n) AddLanguage ¶ added in v0.2.0
func (*I18n) LoadFromEmbedFS ¶ added in v0.2.0
type Modal ¶
type Modal struct {
Name string
Check Check[*ModalContext]
Handler ModalHandler
}
type ModalContext ¶ added in v0.2.0
type ModalContext struct {
*events.ModalSubmitInteractionCreate
Printer *message.Printer
Args []string
}
type ModalHandler ¶
type ModalHandler func(ctx *ModalContext) error
Source Files
¶
Click to show internal directories.
Click to hide internal directories.
