Documentation ¶
Overview ¶
Package jeff - A helper library for writing discord bots
Index ¶
Constants ¶
View Source
const VERSION = "0.0.2"
VERSION is jeff's version
Variables ¶
View Source
var ErrCmdArgsNotUnique = &InternalError{"The flags and subcommands must all be unique."}
ErrCmdArgsNotUnique is the error for when a flag and subcommand share the same name
View Source
var ErrCmdContainsIllegalChars = &InternalError{"The command, subcommand or flag contains illegal character."}
ErrCmdContainsIllegalChars is the error for commands, subcommands and flags that contain illegal characters
View Source
var ErrCmdExists = &InternalError{"A command with that name already exists for this session."}
ErrCmdExists is the error for preexisting commands
View Source
var ErrMessageSessionNil = &InternalError{"The session linked to the message is a nil pointer."}
ErrMessageSessionNil is the error when the session linked to a message is a nil pointer
Functions ¶
This section is empty.
Types ¶
type CommandHandler ¶
type CommandHandler func(s *Session, m *Message, c ParsedCommand)
CommandHandler - A function to handle a parsed command
type InternalError ¶
type InternalError struct {
ErrorString string
}
InternalError - A jeff internal error
func (*InternalError) Error ¶
func (err *InternalError) Error() string
type ParsedCommand ¶
type ParsedCommand struct { Cmd string Flags []string Subcmds []struct { Cmd string Arg string } Arg string }
ParsedCommand - A parsed command
type Session ¶
Session - Session object for a given connection, implements *discordgo.Session
func (*Session) NewCommand ¶
func (ses *Session) NewCommand(cmd string, flags []string, subcmds []string, handler CommandHandler) error
NewCommand - Define a new command
Click to show internal directories.
Click to hide internal directories.