Beispiel #1
0
func OnDisconnect(event string, serv *bot.Server, msg *bot.Message) {
	server, pass := serv.Name(), servers[serv.Name()]
	log.Printf("Server %q disconnected.", server)
	time.Sleep(*delay)
	for {
		log.Printf("Recnnecting to %q...", server)
		if err := serv.Bot().ConnectPass(server, pass); err != nil {
			log.Printf("connect: %s", err)
			time.Sleep(*rdelay)
			continue
		}
		break
	}
}
Beispiel #2
0
func delServer(event string, serv *bot.Server, msg *bot.Message) {
	servers.Lock()
	defer servers.Unlock()

	delete(servers.m, serv.Name())
}
Beispiel #3
0
func addServer(event string, serv *bot.Server, msg *bot.Message) {
	servers.Lock()
	defer servers.Unlock()

	servers.m[serv.Name()] = serv
}