Documentation ¶
Index ¶
- type Command
- func (command *Command) AppendArgument(argument *arguments.Argument)
- func (command *Command) Execute(sender Sender, commandArgs []string)
- func (command *Command) ExemptFromPermissionCheck(value bool)
- func (command *Command) GetAliases() []string
- func (command *Command) GetArguments() []*arguments.Argument
- func (command *Command) GetDescription() string
- func (command *Command) GetName() string
- func (command *Command) GetPermission() string
- func (command *Command) GetUsage() string
- func (command *Command) IsPermissionChecked() bool
- func (command *Command) SetArguments(arguments []*arguments.Argument)
- func (command *Command) SetDescription(description string)
- func (command *Command) SetPermission(permission string)
- type Manager
- func (holder *Manager) AliasExists(aliasName string) bool
- func (holder *Manager) DeregisterCommand(commandName string) bool
- func (holder *Manager) GetCommand(commandName string) (*Command, error)
- func (holder *Manager) GetCommandByAlias(aliasName string) (*Command, error)
- func (holder *Manager) GetCommandByName(commandName string) (*Command, error)
- func (holder *Manager) IsCommandRegistered(commandName string) bool
- func (holder *Manager) RegisterCommand(command *Command)
- type Sender
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Command ¶
type Command struct {
// contains filtered or unexported fields
}
func NewCommand ¶
func NewCommand(name string, description string, permission string, aliases []string, function interface{}) *Command
NewCommand returns a new command with the given command function. The permission used in the command should be registered in order to get correct output.
func (*Command) AppendArgument ¶
AppendArgument adds one argument to the command.
func (*Command) ExemptFromPermissionCheck ¶
ExemptFromPermissionCheck sets the command exempted from permission checking, allowing anybody to use it.
func (*Command) GetAliases ¶
GetAliases returns the aliases of this command.
func (*Command) GetArguments ¶
GetArguments returns a slice with all arguments.
func (*Command) GetDescription ¶
GetDescription returns the command description.
func (*Command) GetPermission ¶
GetPermission returns the command permission string.
func (*Command) GetUsage ¶
GetUsage returns the usage of this command. The usage will get parsed if it had not yet been.
func (*Command) IsPermissionChecked ¶
IsPermissionChecked checks if the user of this command is checked for the adequate permission.
func (*Command) SetArguments ¶
SetArguments sets the command arguments.
func (*Command) SetDescription ¶
SetDescription sets the description of the command.
func (*Command) SetPermission ¶
SetPermission sets the permission of the command.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func (*Manager) AliasExists ¶
AliasExists checks if the given alias exists or not.
func (*Manager) DeregisterCommand ¶
DeregisterCommand deregisters a command from the command holder. Also deregisters all command aliases.
func (*Manager) GetCommand ¶
GetCommand returns a command regardless whether it's an alias or the command name, or an error if none was found.
func (*Manager) GetCommandByAlias ¶
GetCommandByAlias returns a command by alias, and an error if none was found.
func (*Manager) GetCommandByName ¶
GetCommandByName returns a command by name, and an error if none was found.
func (*Manager) IsCommandRegistered ¶
IsCommandRegistered checks if the command has been registered. Also checks for aliases.
func (*Manager) RegisterCommand ¶
RegisterCommand registers a command in the command holder with the including aliases.