From c6c58c4d1131daa024b4ac4126a12574a766a4e1 Mon Sep 17 00:00:00 2001 From: MichaelOultram Date: Wed, 12 Aug 2015 20:31:12 +0100 Subject: [PATCH] Trying to work out why dummy won't connect --- main.go | 2 +- test.go | 22 +++++++++++++--------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/main.go b/main.go index a26aad8..ba758c4 100644 --- a/main.go +++ b/main.go @@ -249,7 +249,7 @@ func main() { if testcode { Verbose("Testing is enabled") - Test(password, address, port) + Test(password, address, port, accesstokens) } web = NewWebServer(9563) diff --git a/test.go b/test.go index f1a8284..39201e7 100644 --- a/test.go +++ b/test.go @@ -7,18 +7,20 @@ import ( ) type TestSettings struct { - password string - ip string - port string + password string + ip string + port string + accesstokens []string } var test TestSettings -func Test(password, ip, port string) { +func Test(password, ip, port, accesstokens string) { test = TestSettings{ - password: password, - ip: ip, - port: port, + password: password, + ip: ip, + port: port, + accesstokens: strings.Split(accesstokens, " "), } test.testYoutubeSong() } @@ -27,13 +29,15 @@ func (t TestSettings) createClient(uname string) *gumble.Client { return gumble.NewClient(&gumble.Config{ Username: uname, Password: t.password, - Address: t.ip + ":" + t.port}) + Address: t.ip + ":" + t.port, + Tokens: t.accesstokens, + }) } func (t TestSettings) testYoutubeSong() { dummyClient := t.createClient("dummy") dummyClient.Connect() - time.Sleep(time.Second * 5) // Give dummy time to connect + time.Sleep(time.Second * 5) // Give dummy time to connect dummyUser := dj.client.Users.Find("dummy") // May be nil // Don't judge, I used the (autogenerated) Top Tracks for United Kingdom playlist