Пример #1
0
// 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
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
// Unboxer for bot handlers.
func NewHandler(f BotHandler) event.Handler {
	return event.NewHandler(func(ev ...interface{}) {
		f(ev[0].(*Sp0rkle), ev[1].(*base.Line))
	})
}