hellabot.go
func (bot *Bot) Run() {
	bot.Debug("Starting bot goroutines")

	// Attempt reconnection
	var hijack bool
	if bot.HijackSession {
		if bot.SSL {
			bot.Crit("Can't Hijack a SSL connection")
			return
		}
		hijack = bot.hijackSession()
		bot.Debug("Hijack", "Did we?", hijack)
	}

	if !hijack {
		err := bot.connect(bot.Host)
		if err != nil {
			bot.Crit("bot.Connect error", "err", err.Error())
			return
		}
		bot.Info("Connected successfully!")
	}

	go bot.handleIncomingMessages()
	go bot.handleOutgoingMessages()

	go bot.StartUnixListener()

	// Only register on an initial connection
	if !bot.reconnecting {
		if bot.SASL {
			bot.SASLAuthenticate(bot.Nick, bot.Password)
		} else {
			bot.StandardRegistration()
		}
	}
	for m := range bot.Incoming {
		if m == nil {
			log.Info("Disconnected")
			return
		}
	}
}
func (bot *Bot) Run() {
	bot.Debug("Starting bot goroutines")

	// Attempt reconnection
	var hijack bool
	if bot.HijackSession {
		if bot.SSL {
			bot.Crit("Can't Hijack a SSL connection")
			return
		}
		hijack = bot.hijackSession()
		bot.Debug("Hijack", "Did we?", hijack)
	}

	if !hijack {
		err := bot.connect(bot.Host)
		if err != nil {
			bot.Crit("bot.Connect error", "err", err.Error())
			return
		}
		bot.Info("Connected successfully!")
	}

	go bot.handleIncomingMessages()
	go bot.handleOutgoingMessages()

	go bot.StartUnixListener()

	// Only register on an initial connection
	if !bot.reconnecting {
		if bot.SASL {
			bot.SASLAuthenticate(bot.Nick, bot.Password)
		} else {
			bot.StandardRegistration()
		}
	}
	for m := range bot.Incoming {
		if m == nil {
			log.Info("Disconnected")
			return
		}
	}
}
func ( bot * Bot ) Run ( ) { bot . Debug ( " " ) // Attempt reconnection var hijack bool if bot . HijackSession { if bot . SSL { bot . Crit ( " " ) return } hijack = bot . hijackSession ( ) bot . Debug ( " " , " " , hijack ) } if ! hijack { err := bot . connect ( bot . Host ) if err != nil { bot . Crit ( " " , " " , err . Error ( ) ) return } bot . Info ( " " ) } go bot . handleIncomingMessages ( ) go bot . handleOutgoingMessages ( ) go bot . StartUnixListener ( ) // Only register on an initial connection if ! bot . reconnecting { if bot . SASL { bot . SASLAuthenticate ( bot . Nick , bot . Password ) } else { bot . StandardRegistration ( ) } } for m := range bot . Incoming { if m == nil { log . Info ( " " ) return } } }
// Run starts the bot and connects to the server. Blocks until we disconnect from the server.
Run starts the bot and connects to the server . Blocks until we disconnect from the server .