Documentation
¶
Overview ¶
Package irccommand provides an event.Handler implementation scoped to IRC commands
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler implements a IRC command based event system (and is an implementation of event.MessageHandler)
func (*Handler) AddCallback ¶
func (h *Handler) AddCallback(command string, callback event.CallbackFunc) int
AddCallback adds a callback to the given command name. The returned ID can be used to remove the callback the special command name * will collect calls for any command. Similar to the raw handler
func (*Handler) RemoveCallback ¶
RemoveCallback remove a callback from the Handler instance
type SimpleHandler ¶
type SimpleHandler struct {
*Handler
}
SimpleHandler is a wrapper around Handler that works with the raw ircmsg.Message directly.
func (*SimpleHandler) AddCallback ¶
AddCallback adds a callback to the SimpleHandler instance
func (*SimpleHandler) OnMessage ¶
func (h *SimpleHandler) OnMessage(msg *event.Message) error
OnMessage calls Handler.OnMessage
func (*SimpleHandler) RemoveCallback ¶
func (h *SimpleHandler) RemoveCallback(id int)
RemoveCallback calls Handler.RemoveCallback