Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Command ¶
type Command struct { //Name the name of the command commands should not have spaces Name string //CaseInsensitive will to lower the incomming message before checking if it matches CaseInsensitive bool //Handler The handler function which is called on a message matching the regex Handler CommandHandler Description string Example string }
Command Represents a Command to the discord bot.
type CommandHandler ¶
CommandHandler A callback function which is triggered when a command is ran Error should only return data your fine with the user seeing
type CommandSet ¶
type CommandSet struct { Prefix string ErrorHandler ErrorHandler // contains filtered or unexported fields }
CommandSet Use this to regsiter commands and get the handler to pass to discordgo. This should be created with CreateCommandSet.
func CreateCommandSet ¶
func CreateCommandSet(prefix string, errorHandler ErrorHandler) (*CommandSet, error)
CreateCommandSet Creates a command set
func (*CommandSet) AddCommand ¶
func (cs *CommandSet) AddCommand(com Command) error
AddCommand Use this to add a command to a command set
func (*CommandSet) Handler ¶
func (cs *CommandSet) Handler(s *discordgo.Session, m *discordgo.MessageCreate)
Handler Regsiter this with discordgo.AddHandler will be called every time a new message is sent on a guild.
type ErrorHandler ¶ added in v1.1.4
type ErrorHandler func(*discordgo.Session, *discordgo.MessageCreate, error)
ErrorHandler called if a command handler returns an error
Click to show internal directories.
Click to hide internal directories.