feat: refactor client into reusable ts3client library

This commit is contained in:
Jose Luis Montañes Ojados
2026-01-15 22:06:35 +01:00
parent 7878ad3d5b
commit 02318b1490
10 changed files with 1050 additions and 47 deletions

54
pkg/ts3client/types.go Normal file
View 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",
}
}