commandregistry

package
v0.0.0-...-5239448 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 15, 2026 License: MIT Imports: 4 Imported by: 0

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 NewRegistry

func NewRegistry() *Registry

NewRegistry creates an empty registry.

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) Names

func (r *Registry) Names() []string

Names returns all registered handler names.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL