commands

package
v0.0.0-...-07e1512 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2020 License: BSD-2-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// CommandsMetadata is a map containing metadata of every taalabc command.
	CommandsMetadata map[string]*bot.CommandMeta
)

Functions

This section is empty.

Types

type ExecutableCommand

type ExecutableCommand interface {
	// Metadata returns command metadata: name, description, etc.
	Metadata() *bot.CommandMeta

	// Execute executes the command, and returns a result action.
	Execute(ctx context.Context, args []string, guild *bot.AttachedGuild) (*bot.CommandExecutionResult, error)

	// Help gives users an explanatory notice on how to use the command.
	Help(invokedAs string, guild *bot.AttachedGuild) *bot.CommandExecutionResult
}

ExecutableCommand is an interface that makes a bot command executable.

func NewArticlesCommand

func NewArticlesCommand() ExecutableCommand

NewArticlesCommand creates and returns a new instance of the articles command.

func NewHelpCommand

func NewHelpCommand(commands map[string]ExecutableCommand) ExecutableCommand

NewHelpCommand creates and returns a new instance of the help command.

Jump to

Keyboard shortcuts

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