commands

package
v0.0.0-...-0d805c2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExecutableCommand

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

	// Execute executes the command.
	Execute(ctx context.Context, args []string, guild *bot.AttachedGuild) (*FeedbackAction, error)

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

ExecutableCommand is an interface that makes a bot command executable.

type FeedbackAction

type FeedbackAction struct {
	Message *discordgo.MessageSend
}

FeedbackAction is a union type that contains a form of feedback to send to the user, such as a text message, or a reaction emoji. An empty FeedbackAction value can be used if no feedback is needed.

func Execute

func Execute(guildID, name string, args []string) (*FeedbackAction, error)

Execute is the high-level command execution function.

type Metadata

type Metadata struct {
	Name        string
	Description string
	Aliases     []string
}

Metadata contains the name, description and aliases of a command.

Jump to

Keyboard shortcuts

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