Documentation ¶
Overview ¶
Package router ...
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrMissingClient . ErrMissingClient = errors.New("router: missing client") // ErrInvalidPrefix . ErrInvalidPrefix = errors.New("router: invalid prefix") // ErrMissingRegistrar . ErrMissingRegistrar = errors.New("router: missing registrar") // ErrInterfaceIsNotAPointer represents an Interface Is Not A Pointer error. ErrInterfaceIsNotAPointer = errors.New("router: interface is not a pointer") // ErrCommandIsNil represents a Command Is Nil error. ErrCommandIsNil = errors.New("router: command is nil") // ErrMethodHasNoErrorReturn . ErrMethodHasNoErrorReturn = errors.New("router: method has no error return") // ErrMethodHasNoArguments . ErrMethodHasNoArguments = errors.New("router: method has no arguments") // ErrMissingMessageCreateArgument . ErrMissingMessageCreateArgument = errors.New("router: missing *disgord.MessageCreate as the first method argument") )
Functions ¶
This section is empty.
Types ¶
type ErrCommandExecution ¶
type ErrCommandExecution struct { Command *Command // contains filtered or unexported fields }
ErrCommandExecution represents an unexpected error during a Command Execution.
func (*ErrCommandExecution) Error ¶
func (err *ErrCommandExecution) Error() string
type ErrInvalidUsage ¶
ErrInvalidUsage represents an Invalid Usage error.
func (*ErrInvalidUsage) Error ¶
func (err *ErrInvalidUsage) Error() string
type ErrMissingArguments ¶
ErrMissingArguments represents a Missing Arguments error.
func (*ErrMissingArguments) Error ¶
func (err *ErrMissingArguments) Error() string
type ErrUnknownCommand ¶
type ErrUnknownCommand struct {
Command string
}
ErrUnknownCommand represents an Unknown Command error.
func (*ErrUnknownCommand) Error ¶
func (err *ErrUnknownCommand) Error() string
type Formatter ¶
Formatter represents an argument that can be formatted for use in a usage string.
type ManualParseable ¶
ManualParseable represents a manually parseable argument.
type Parseable ¶
Parseable represents a parseable argument.
type Registrar ¶
Registrar represents a Command Registrar.
type Router ¶
type Router struct { *disgord.Client Prefix string Commands []*Command // contains filtered or unexported fields }
Router .
func NewRouter ¶
NewRouter .
func (*Router) GetCommandByName ¶
GetCommandByName attempts to get a *Command by matching it's name.
func (*Router) Handle ¶
func (r *Router) Handle(e *disgord.MessageCreate) error
Handle handles an incoming *disgord.MessageCreate event.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.