示例#1
0
文件: handlers.go 项目: higgz/goirc
// Wrap f in an anonymous unboxing function
func NewHandler(f IRCHandler) event.Handler {
	return event.NewHandler(func(ev ...interface{}) {
		f(ev[0].(*Conn), ev[1].(*Line))
	})
}
示例#2
0
文件: bot.go 项目: harperreed/horace
func NewHandler(f BotCommandHandler) event.Handler {
	return event.NewHandler(func(ev ...interface{}) {
		f(ev[0].(*irc.Conn), ev[1].(*irc.Line), ev[2].([]string))
	})
}
示例#3
0
文件: handlers.go 项目: b33f/sp0rkle
// Unboxer for bot handlers.
func NewHandler(f BotHandler) event.Handler {
	return event.NewHandler(func(ev ...interface{}) {
		f(ev[0].(*Sp0rkle), ev[1].(*base.Line))
	})
}