Documentation
¶
Overview ¶
Package handlers provides several pre-baked gobot.Handlers for convenience.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HelpHandler ¶
HelpHandler stores a short help message and a long help message and responds with them to !help and !help @[BotName], respectively.
func (*HelpHandler) HandleIncoming ¶
HandleIncoming checks incoming SendEvents for help commands and responds appropriately.
type PongHandler ¶
type PongHandler struct{}
PongHandler responds to a send-event starting with "!ping" and returns a send command containing "pong!".
func (*PongHandler) HandleIncoming ¶
HandleIncoming satisfies the Handler interface.
func (*PongHandler) Run ¶
func (ph *PongHandler) Run(r *gobot.Room)
Run is a no-op- the PongHandler does not need to run continuously, only in response to an incoming packet.
func (*PongHandler) Stop ¶
func (ph *PongHandler) Stop(r *gobot.Room)
Stop is also a no-op- there is nothing to stop.
type UptimeHandler ¶
type UptimeHandler struct {
// contains filtered or unexported fields
}
UptimeHandler records the time when the bot goes up and responds to commands with the duration the bot has been up.
func (*UptimeHandler) HandleIncoming ¶
HandleIncoming checks incoming commands for !uptime or !uptime @[BotName] and responds with the duration the bot has been up.