feat: refactor client into reusable ts3client library
This commit is contained in:
54
pkg/ts3client/types.go
Normal file
54
pkg/ts3client/types.go
Normal file
@@ -0,0 +1,54 @@
|
||||
package ts3client
|
||||
|
||||
// Channel represents a TeamSpeak channel
|
||||
type Channel struct {
|
||||
ID uint64
|
||||
ParentID uint64
|
||||
Name string
|
||||
Order uint64
|
||||
}
|
||||
|
||||
// Client represents a connected client
|
||||
type ClientInfo struct {
|
||||
ID uint16
|
||||
Nickname string
|
||||
ChannelID uint64
|
||||
}
|
||||
|
||||
// ServerInfo contains server information
|
||||
type ServerInfo struct {
|
||||
Name string
|
||||
WelcomeMessage string
|
||||
Platform string
|
||||
Version string
|
||||
MaxClients int
|
||||
ClientsOnline int
|
||||
ChannelsOnline int
|
||||
}
|
||||
|
||||
// SelfInfo contains our own client information
|
||||
type SelfInfo struct {
|
||||
ClientID uint16
|
||||
Nickname string
|
||||
ChannelID uint64
|
||||
}
|
||||
|
||||
// Config contains client configuration options
|
||||
type Config struct {
|
||||
Nickname string
|
||||
SecurityLevel int // Default: 8
|
||||
Version string // Default: "3.6.2 [Build: 1690976575]"
|
||||
Platform string // Default: "Windows"
|
||||
HWID string // Default: generated
|
||||
}
|
||||
|
||||
// DefaultConfig returns a Config with sensible defaults
|
||||
func DefaultConfig() Config {
|
||||
return Config{
|
||||
Nickname: "GoTS3Bot",
|
||||
SecurityLevel: 8,
|
||||
Version: "3.6.2 [Build: 1690976575]",
|
||||
Platform: "Windows",
|
||||
HWID: "1234567890",
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user