From a8a867e4f96afbb6f199e2b90a5fc285503e41da Mon Sep 17 00:00:00 2001 From: bretello Date: Fri, 23 Oct 2020 22:08:36 +0200 Subject: [PATCH] add clean exit, select channel on startup --- broadcast/main.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/broadcast/main.go b/broadcast/main.go index 3fcceae..d39540b 100644 --- a/broadcast/main.go +++ b/broadcast/main.go @@ -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 + } } }