add clean exit, select channel on startup

bretello/develop
bretello 2020-10-23 22:08:36 +02:00
parent 3df1d842f3
commit a8a867e4f9
1 changed files with 7 additions and 0 deletions

View File

@ -69,7 +69,14 @@ func main() {
fmt.Printf("\t%d - %s\n", idx, channel.Name)
}
channel := client.Channels.Find("Antro delle Bestemmie")
client.Self.Move(channel)
fmt.Println("Chosen Channel: ", channel.Name)
for {
time.Sleep(1 * time.Second)
if client.State() == gumble.StateDisconnected {
log.Println("Disconnected from server")
break
}
}
}