Beispiel #1
0
func (qd *quoteDriver) RegisterHandlers(r event.EventRegistry) {
	r.AddHandler(bot.NewHandler(qd_privmsg), "bot_privmsg")
	//	r.AddHandler(bot.NewHandler(qd_action), "bot_action")
}
Beispiel #2
0
func (ud *urlDriver) RegisterHandlers(r event.EventRegistry) {
	r.AddHandler(bot.NewHandler(ud_privmsg), "bot_privmsg")
}
Beispiel #3
0
func (nd *netDriver) RegisterHandlers(r event.EventRegistry) {
	r.AddHandler(bot.NewHandler(nd_privmsg), "bot_privmsg")
}
Beispiel #4
0
func (sd *seenDriver) RegisterHandlers(r event.EventRegistry) {
	r.AddHandler(bot.NewHandler(sd_record_pm), "bot_privmsg", "bot_action")
	r.AddHandler(bot.NewHandler(sd_record_lines), "bot_privmsg", "bot_action")
	r.AddHandler(bot.NewHandler(sd_record_chan), "bot_join", "bot_part")
	r.AddHandler(bot.NewHandler(sd_record_nick), "bot_quit", "bot_nick")
	r.AddHandler(bot.NewHandler(sd_record_kick), "bot_kick")
	r.AddHandler(bot.NewHandler(sd_privmsg), "bot_privmsg")
	r.AddHandler(bot.NewHandler(sd_smoke), "bot_privmsg", "bot_action")
}
Beispiel #5
0
func (dd *decisionDriver) RegisterHandlers(r event.EventRegistry) {
	r.AddHandler(bot.NewHandler(dd_privmsg), "bot_privmsg")
}
Beispiel #6
0
// NOTE: Nothing but the bot should register for IRC events!
func (bot *Sp0rkle) RegisterHandlers(r event.EventRegistry) {
	// Generic shim to wrap an irc event into a bot event.
	forward_event := func(name string) event.Handler {
		return client.NewHandler(func(irc *client.Conn, line *client.Line) {
			getState(irc).Dispatch("bot_"+name, &base.Line{Line: *line.Copy()})
		})
	}

	r.AddHandler(client.NewHandler(bot_connected), "connected")
	r.AddHandler(client.NewHandler(bot_disconnected), "disconnected")
	r.AddHandler(client.NewHandler(bot_privmsg), "privmsg")
	r.AddHandler(forward_event("action"), "action")
	// These are mostly for the seen plugin.
	r.AddHandler(forward_event("join"), "join")
	r.AddHandler(forward_event("part"), "part")
	r.AddHandler(forward_event("kick"), "kick")
	r.AddHandler(forward_event("quit"), "quit")
	r.AddHandler(forward_event("nick"), "nick")

	// This is a special handler that triggers a rebuild and re-exec
	r.AddHandler(client.NewHandler(bot_rebuild), "notice")
	// This is a special handler that triggers a shutdown and disconnect
	r.AddHandler(client.NewHandler(bot_shutdown), "notice")
}
Beispiel #7
0
func (cd *calcDriver) RegisterHandlers(r event.EventRegistry) {
	r.AddHandler(bot.NewHandler(cd_privmsg), "bot_privmsg")
}
Beispiel #8
0
func (fd *factoidDriver) RegisterHandlers(r event.EventRegistry) {
	r.AddHandler(bot.NewHandler(fd_privmsg), "bot_privmsg")
	r.AddHandler(bot.NewHandler(fd_action), "bot_action")
}