Documentation
¶
Overview ¶
Package commands implements a command executor for Discordgo.
Index ¶
Constants ¶
View Source
const DiscordMessageMaxLength = 2000
DiscordMessageMaxLength is the maximum length a discord message may have.
Variables ¶
This section is empty.
Functions ¶
func HasCommandPrefix ¶
HasCommandPrefix determines whether or not a message has the given command prefix.
Types ¶
type Command ¶
Command is a command to be executed.
func CommandFunc ¶
CommandFunc defines a new command.
func NewCommand ¶
NewCommand defines a new command.
type Context ¶
type Context struct { Message *discordgo.Message Content string Args []string Session *discordgo.Session Ctx context.Context //nolint:containedctx // not long lived. }
Context is the context that a command is running in.
func (*Context) Reference ¶
func (ctx *Context) Reference() *discordgo.MessageReference
Reference reports a reference to the message.
type Executor ¶
type Executor struct {
// contains filtered or unexported fields
}
Executor runs commands.
func NewCommandExecutor ¶
NewCommandExecutor builds a new command executor.
Click to show internal directories.
Click to hide internal directories.