Documentation
¶
Index ¶
- type Command
- type CommandHandler
- type Flag
- type Manager
- func (m *Manager) Autocomplete(partial string) []string
- func (m *Manager) Execute(ctx context.Context, input string) (string, error)
- func (m *Manager) Get(name string) *Command
- func (m *Manager) HelpText(category string) string
- func (m *Manager) List() []*Command
- func (m *Manager) ListByCategory(category string) []*Command
- func (m *Manager) ParseCommand(input string) (*ParsedCommand, error)
- func (m *Manager) Register(cmd *Command)
- func (m *Manager) Unregister(name string)
- type ParsedCommand
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Command ¶
type Command struct {
Name string `json:"name"`
Description string `json:"description"`
Usage string `json:"usage"`
Aliases []string `json:"aliases"`
Handler CommandHandler `json:"-"`
Flags []Flag `json:"flags"`
Category string `json:"category"` // conversation, system, tools, info
}
Command represents a slash command
type CommandHandler ¶
type CommandHandler func(ctx context.Context, args []string, flags map[string]interface{}) (string, error)
CommandHandler is the function signature for command handlers
type Flag ¶
type Flag struct {
Name string `json:"name"`
Short string `json:"short"`
Description string `json:"description"`
Type string `json:"type"` // string, int, bool
Default interface{} `json:"default"`
Required bool `json:"required"`
}
Flag represents a command flag
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager handles slash commands
func (*Manager) Autocomplete ¶
Autocomplete returns completion suggestions
func (*Manager) ListByCategory ¶
ListByCategory returns commands filtered by category
func (*Manager) ParseCommand ¶
func (m *Manager) ParseCommand(input string) (*ParsedCommand, error)
ParseCommand parses a command string
Click to show internal directories.
Click to hide internal directories.