1
0
mirror of https://github.com/Adam-Ant/TeamspeakBot-Go synced 2024-11-05 05:36:23 +00:00
TeamspeakBot-Go/helpers.go

99 lines
2.0 KiB
Go
Raw Permalink Normal View History

2017-12-01 23:15:59 +00:00
package main
import "github.com/darfk/ts3"
func ClientGetDbIdFromUid(uid string) ts3.Command {
return ts3.Command{
Command: "´clientgetdbidfromuid",
Params: map[string][]string{
"cluid": []string{uid},
},
}
}
func ClientGetIds(uid string) ts3.Command {
return ts3.Command{
Command: "´clientgetids",
Params: map[string][]string{
"cluid": []string{uid},
},
}
}
func ClientGetNameFromUid(uid string) ts3.Command {
return ts3.Command{
Command: "´clientgetnamefromuid",
Params: map[string][]string{
"cluid": []string{uid},
},
}
}
func ClientGetNameFromDbId(dbid string) ts3.Command {
return ts3.Command{
Command: "´clientgetnamefromdbid",
Params: map[string][]string{
"cldbid": []string{dbid},
},
}
}
func ClientInfo(clid string) ts3.Command {
return ts3.Command{
Command: "clientinfo",
Params: map[string][]string{
2017-12-03 21:53:30 +00:00
"clid": []string{clid},
2017-12-01 23:15:59 +00:00
},
}
}
func ServerGroupDelClient(sgid string, cldbid string) ts3.Command {
return ts3.Command{
Command: "servergroupdelclient",
Params: map[string][]string{
"sgid": []string{sgid},
"cldbid": []string{cldbid},
},
}
}
2017-12-03 21:53:30 +00:00
func ServerGroupAddClient(sgid string, cldbid string) ts3.Command {
return ts3.Command{
Command: "servergroupaddclient",
Params: map[string][]string{
"sgid": []string{sgid},
"cldbid": []string{cldbid},
},
2017-12-01 23:15:59 +00:00
}
2017-12-03 21:53:30 +00:00
}
func SendMessageChannel(isError bool, message string) ts3.Command {
//if isError {
// message = "'[B][COLOR=#ff0000]" + message + "[/COLOR][/B]"
//}
2017-12-01 23:15:59 +00:00
return ts3.Command{
Command: "sendtextmessage",
Params: map[string][]string{
"targetmode": []string{"2"},
"target": []string{"1"},
2017-12-03 21:53:30 +00:00
"msg": []string{"Cockwomble"},
2017-12-01 23:15:59 +00:00
},
}
}
func SendMessageUser(isError bool, message string, clid string) ts3.Command {
2017-12-03 21:53:30 +00:00
//if isError {
// message = "'[B][COLOR=#ff0000]" + message + "[/COLOR][/B]"
//}
2017-12-01 23:15:59 +00:00
return ts3.Command{
Command: "sendtextmessage",
Params: map[string][]string{
"targetmode": []string{"1"},
"target": []string{clid},
"msg": []string{message},
},
}
}