Versions in this module Expand all Collapse all v0 v0.9.0 May 24, 2020 Changes in this version + var Break = errors.New("break middleware chain, non-fatal") + var ErrNotEnoughArgs = errors.New("not enough arguments given") + var ErrTooManyArgs = errors.New("too many arguments given") + var HelpUnderline = true + var InvalidUsageString = func(err *ErrInvalidUsage) string + var ShellwordsEscaper = strings.NewReplacer("\\", "\\\\") + var UnknownCommandString = func(err *ErrUnknownCommand) string + func IndentLines(input string) string + func Start(token string, cmd interface{}, opts func(*Context) error) (wait func() error, err error) + func Wait() + type ArgsParser func(content string) ([]string, error) + func DefaultArgsParser() ArgsParser + type Argument struct + String string + func (a *Argument) Type() reflect.Type + type ArgumentParts []string + func (r *ArgumentParts) ParseContent(args []string) error + func (r ArgumentParts) After(n int) string + func (r ArgumentParts) Arg(n int) string + func (r ArgumentParts) Length() int + func (r ArgumentParts) String() string + func (r ArgumentParts) Usage() string + type CanHelp interface + Help func() string + type CanSetup interface + Setup func(*Subcommand) + type Context struct + AllowBot bool + Description string + EditableCommands bool + ErrorLogger func(error) + FormatError func(error) string + HasPrefix Prefixer + Name string + ParseArgs ArgsParser + ReplyError bool + SilentUnknown struct{ ... } + func New(s *state.State, cmd interface{}) (*Context, error) + func (ctx *Context) Call(event interface{}) error + func (ctx *Context) FindCommand(structname, methodname string) *MethodContext + func (ctx *Context) Help() string + func (ctx *Context) MustRegisterSubcommand(cmd interface{}) *Subcommand + func (ctx *Context) MustRegisterSubcommandCustom(cmd interface{}, name string) *Subcommand + func (ctx *Context) RegisterSubcommand(cmd interface{}) (*Subcommand, error) + func (ctx *Context) RegisterSubcommandCustom(cmd interface{}, name string) (*Subcommand, error) + func (ctx *Context) Start() func() + func (ctx *Context) Subcommands() []*Subcommand + type CustomParser interface + CustomParse func(arguments string) error + type ErrInvalidUsage struct + Args []string + Ctx *MethodContext + Index int + Prefix string + Wrap error + func (err *ErrInvalidUsage) Error() string + func (err *ErrInvalidUsage) Unwrap() error + type ErrUnknownCommand struct + Parts []string + Subcmd *Subcommand + func (err *ErrUnknownCommand) Error() string + type ManualParser interface + ParseContent func([]string) error + type MethodContext struct + Aliases []string + Arguments []Argument + Command string + Description string + Hidden bool + MethodName string + Variadic bool + func (cctx *MethodContext) SetName(name string) + func (cctx *MethodContext) Usage() []string + type MiddlewareContext struct + func ParseMiddleware(mw interface{}) *MiddlewareContext + type Parser interface + Parse func(string) error + type Prefixer func(*gateway.MessageCreateEvent) (prefix string, ok bool) + func NewPrefix(prefixes ...string) Prefixer + type RawArguments string + func (a *RawArguments) CustomParse(arguments string) error + type Subcommand struct + Command string + Commands []*MethodContext + Description string + Events []*MethodContext + Hidden bool + SanitizeMessage func(content string) string + StructName string + func NewSubcommand(cmd interface{}) (*Subcommand, error) + func (sub *Subcommand) AddAliases(commandName string, aliases ...string) + func (sub *Subcommand) AddMiddleware(methodName string, middleware interface{}) + func (sub *Subcommand) ChangeCommandInfo(methodName, cmd, desc string) + func (sub *Subcommand) FindCommand(methodName string) *MethodContext + func (sub *Subcommand) Help() string + func (sub *Subcommand) HelpGenerate() string + func (sub *Subcommand) Hide(methodName string) + func (sub *Subcommand) InitCommands(ctx *Context) error + func (sub *Subcommand) NeedsName() + func (sub *Subcommand) SetPlumb(methodName string) + type Usager interface + Usage func() string