Documentation
¶
Index ¶
- type Command
- type CommandClosure
- type EvHandler
- type HelpHandler
- type Registry
- func (r *Registry) AddAll(b *bot.Bot, c *bot.Configuration)
- func (r *Registry) Deregister(id string)
- func (r *Registry) Register(id string, handler TriggerFunc, help string, db *sql.DB, c *bot.Configuration) error
- func (r *Registry) RegisterCommand(command *Command) error
- func (r *Registry) RegisterCommands(commands []*Command) error
- type TriggerFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Command ¶
type Command struct {
// The command identifier - it will determine how
// the command is called
ID string
ArgumentsRegexp *regexp.Regexp
HelpMsg string
Action CommandClosure
Db *sql.DB
Configuration *bot.Configuration
// contains filtered or unexported fields
}
Command encapsulates an irc command
func (*Command) AllowChannel ¶
Allows triggering the command via public message in a channel
func (*Command) AllowPrivate ¶
Helper functions when initializing from ircbot.IrcBot.AddCommand Allows triggering the command via private message to the bot
type CommandClosure ¶
Commands section
type EvHandler ¶
type EvHandler struct {
Handler TriggerFunc
HelpMsg string
Config *bot.Configuration
Db *sql.DB
}
EvHandler is the basic structure for holding information about an irc trigger. For most interactive commands, where you want to define ACLs, input validation, etc. you should use Command instead.
type HelpHandler ¶
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry is a container for all event handlers.
func (*Registry) Deregister ¶
Deregister removes one handler from the system.
func (*Registry) Register ¶
func (r *Registry) Register(id string, handler TriggerFunc, help string, db *sql.DB, c *bot.Configuration) error
Register an handler. This is the basic interface you should use if you're not crating a proper command, but rather a trigger. For interactive commands, please use RegisterCommand below.
func (*Registry) RegisterCommand ¶
RegisterCommand allows to register a full-featured IRC command.