//GetServers retrieves list of available servers.
GetServers retrieves list of available servers.
// GetServers retrieves list of available servers .
func (bot *Hitbot) GetServers() {
	bot.servers = make([]server, 0, 5)
	buf := new(bytes.Buffer)
	if _, err := http.Get(buf, "http://api.hitbox.tv/chat/servers.json?redis=true"); err != nil {
		log.Fatalf("Could not get server list: %v", err)
	}
	if err := json.Unmarshal(buf.Bytes(), &bot.servers); err != nil {
		log.Fatalf("Could not parse JSON: %v", err)
	}
	if bot.verbose {
		log.Printf("Found %v servers", len(bot.servers))
	}
}
func ( bot * Hitbot ) GetServers ( ) { bot . servers = make ( [ ] server , 0 , 5 ) buf := new ( bytes . Buffer ) if _ , err := http . Get ( buf , " " ) ; err != nil { log . Fatalf ( " " , err ) } if err := json . Unmarshal ( buf . Bytes ( ) , & bot . servers ) ; err != nil { log . Fatalf ( " " , err ) } if bot . verbose { log . Printf ( " " , len ( bot . servers ) ) } }
GetServers retrieves list of available servers.
GetServers retrieves list of available servers .