hellabot.go
func (bot *Bot) handleIncomingMessages() {
	scan := bufio.NewScanner(bot.con)
	for scan.Scan() {
		// Disconnect if we have seen absolutely nothing for 300 seconds
		bot.con.SetDeadline(time.Now().Add(bot.PingTimeout))
		msg := ParseMessage(scan.Text())
		bot.Debug("Incoming", "raw", scan.Text(), "msg.To", msg.To, "msg.From", msg.From, "msg.Params", msg.Params, "msg.Trailing", msg.Trailing)
		go func() {
			for _, h := range bot.handlers {
				if h.Handle(bot, msg) {
					break
				}
			}
		}()
		bot.Incoming <- msg
	}
	close(bot.Incoming)
}
func (bot *Bot) handleIncomingMessages() {
	scan := bufio.NewScanner(bot.con)
	for scan.Scan() {
		// Disconnect if we have seen absolutely nothing for 300 seconds
		bot.con.SetDeadline(time.Now().Add(bot.PingTimeout))
		msg := ParseMessage(scan.Text())
		bot.Debug("Incoming", "raw", scan.Text(), "msg.To", msg.To, "msg.From", msg.From, "msg.Params", msg.Params, "msg.Trailing", msg.Trailing)
		go func() {
			for _, h := range bot.handlers {
				if h.Handle(bot, msg) {
					break
				}
			}
		}()
		bot.Incoming <- msg
	}
	close(bot.Incoming)
}
func ( bot * Bot ) handleIncomingMessages ( ) { scan := bufio . NewScanner ( bot . con ) for scan . Scan ( ) { // Disconnect if we have seen absolutely nothing for 300 seconds bot . con . SetDeadline ( time . Now ( ) . Add ( bot . PingTimeout ) ) msg := ParseMessage ( scan . Text ( ) ) bot . Debug ( " " , " " , scan . Text ( ) , " " , msg . To , " " , msg . From , " " , msg . Params , " " , msg . Trailing ) go func ( ) { for _ , h := range bot . handlers { if h . Handle ( bot , msg ) { break } } } ( ) bot . Incoming <- msg } close ( bot . Incoming ) }
// Incoming message gathering routine
Incoming message gathering routine