Documentation
¶
Index ¶
- Constants
- Variables
- func PlayAction(ctx *Context, conn *Conn) (string, error)
- func QueueAction(ctx *Context, conn *Conn) (string, error)
- func QueuedAction(ctx *Context, conn *Conn) (string, error)
- func RecentAction(ctx *Context, conn *Conn) (string, error)
- func SkipAction(ctx *Context, conn *Conn) (string, error)
- func StopAction(ctx *Context, conn *Conn) (string, error)
- func SuggestAction(ctx *Context, conn *Conn) (string, error)
- func SuggestionsAction(ctx *Context, conn *Conn) (string, error)
- type Command
- type Conn
- type Context
- type Option
- type OptionType
Constants ¶
View Source
const ( OptionTypeString = iota << 1 OptionTypeNumber OptionTypeBoolean )
Variables ¶
View Source
var (
ErrNotInVoiceChannel = fmt.Errorf("user is not in a voice channel")
)
Functions ¶
Types ¶
type Command ¶
type Command struct { Name string Description string Options []Option // Action is the function to invoke whenever the command is invoked. // The action returns the response as a string, or an error if an unexpected // failure occurs. Action func(*Context, *Conn) (string, error) // EnabledFunc returns true if the command is enabled. // A nil EnabledFunc implicitly enables the command. EnabledFunc func(*state.State, *bot.Bot) bool }
Command exposes functionality as a Discord command.
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
Conn is a Discord bot connection.
type Context ¶
Context holds the context of a command invocation.
type Option ¶
type Option struct { Name string Description string // Type defaults to string. Type OptionType Required bool // EnabledFunc returns true if the option is enabled. // A nil EnabledFunc implicitly enables the option. EnableFunc func(*state.State, *bot.Bot) bool }
Option defines an option to a command.
type OptionType ¶
type OptionType int
Click to show internal directories.
Click to hide internal directories.