Trying to work out why dummy won't connect
This commit is contained in:
parent
d9527a4093
commit
c6c58c4d11
2
main.go
2
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)
|
||||
|
|
22
test.go
22
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
|
||||
|
|
Reference in a new issue