Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Definition ¶
type Definition struct {
Name string
Description string
Args string
Aliases []string
Section commands.HelpSection
RequiresPortal bool
RequiresLogin bool
Handler func(*commands.Event)
}
Definition describes a chat command in a tool-like schema.
func (Definition) FullHandler ¶
func (d Definition) FullHandler() *commands.FullHandler
FullHandler returns the maunium command handler for this definition.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry collects command handlers for registration.
func (*Registry) All ¶
func (r *Registry) All() []*commands.FullHandler
All returns all handlers sorted by name.
func (*Registry) Get ¶
func (r *Registry) Get(name string) *commands.FullHandler
Get retrieves a handler by name or alias.
func (*Registry) Register ¶
func (r *Registry) Register(def Definition) *commands.FullHandler
Register adds a command definition to the registry and returns its handler.
func (*Registry) RegisterHandler ¶
func (r *Registry) RegisterHandler(handler *commands.FullHandler)
RegisterHandler adds an already-constructed handler to the registry.
Click to show internal directories.
Click to hide internal directories.