-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathquery.go
45 lines (39 loc) · 778 Bytes
/
query.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package ts3
import (
"strconv"
)
func Login(user, pass string) (c Command) {
return Command{
Command: "login",
Params: map[string][]string{
"client_login_name": []string{user},
"client_login_password": []string{pass}},
}
}
func Select(index int) Command {
return Command{
Command: "use",
Params: map[string][]string{
"sid": []string{strconv.Itoa(index)}},
}
}
func SelectByPort(index int) Command {
return Command{
Command: "use",
Params: map[string][]string{
"port": []string{strconv.Itoa(index)}},
}
}
func Version() (c Command) {
return Command{
Command: "version",
}
}
func Nickname(name string) Command {
return Command{
Command: "clientupdate",
Params: map[string][]string{
"client_nickname": []string{name},
},
}
}