The PrivilegeKeyCommands class provides static factory methods to construct Command objects for managing TeamSpeak 3 privilege keys. These commands can be used to add, delete, list, or use privilege keys via the API.
Available Commands
privilegeKeyAdd
Creates a command to add a new privilege key.
- Parameters:
type (PrivilegeKeyType): The type of privilege key. Must not be null.groupId (int): The ID of the group associated with the token.channelId (int): The ID of the channel associated with the token.description (String, optional): A description for the key. If null, the parameter is omitted.
- Command Structure:
privilegekeyadd with parameters tokentype, tokenid1, tokenid2, and optionally tokendescription.
privilegeKeyDelete
Creates a command to delete a specific privilege key.
- Parameters:
token (String): The privilege key token. Must be a non-empty string.
- Command Structure:
privilegekeydelete with parameter token.
privilegeKeyList
Creates a command to list all existing privilege keys.
- Command Structure:
privilegekeylist (no parameters).
privilegeKeyUse
Creates a command to use a specific privilege key.
- Parameters:
token (String): The privilege key token. Must be a non-empty string.
- Command Structure:
privilegekeyuse with parameter token.
// Example: Adding a privilege key
Command addCmd = PrivilegeKeyCommands.privilegeKeyAdd(PrivilegeKeyType.GROUP, 6, 1, "Admin Token");
// Example: Deleting a privilege key
Command deleteCmd = PrivilegeKeyCommands.privilegeKeyDelete("ABC123XYZ");
// Example: Listing privilege keys
Command listCmd = PrivilegeKeyCommands.privilegeKeyList();
// Example: Using a privilege key
Command useCmd = PrivilegeKeyCommands.privilegeKeyUse("ABC123XYZ");