Skip to content

Commit

Permalink
Added "RemoveServerGroup" to TeamSpeakClient. (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
ceeno2k authored May 1, 2020
1 parent 410f478 commit cac6e82
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions src/TeamSpeak3QueryApi/Specialized/TeamSpeakClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,39 @@ public Task AddServerGroup(int serverGroupId, IEnumerable<int> clientDatabaseIds

#endregion

#region RemoveServerGroup

#region One User

public Task RemoveServerGroup(int serverGroupId, int clientDatabaseId) => RemoveServerGroup(serverGroupId, new int[] { clientDatabaseId });

public Task RemoveServerGroup(int serverGroupId, GetClientInfo clientInfo) => RemoveServerGroup(serverGroupId, clientInfo.DatabaseId);

public Task RemoveServerGroup(GetServerGroup serverGroup, int clientDatabaseId) => RemoveServerGroup(serverGroup.Id, clientDatabaseId);

public Task RemoveServerGroup(GetServerGroup serverGroup, GetClientInfo clientInfo) => RemoveServerGroup(serverGroup.Id, clientInfo.DatabaseId);

#endregion

#region Multiple Users

public Task RemoveServerGroup(int serverGroupId, IEnumerable<GetClientInfo> clientInfo) => RemoveServerGroup(serverGroupId, clientInfo.Select(info => info.DatabaseId));

public Task RemoveServerGroup(GetServerGroup serverGroup, IEnumerable<int> clientDatabaseIds) => RemoveServerGroup(serverGroup.Id, clientDatabaseIds);

public Task RemoveServerGroup(GetServerGroup serverGroup, IEnumerable<GetClientInfo> clientInfo) => RemoveServerGroup(serverGroup.Id, clientInfo.Select(info => info.DatabaseId));

public Task RemoveServerGroup(int serverGroupId, IEnumerable<int> clientDatabaseIds)
{
return Client.Send("servergroupdelclient",
new Parameter("sgid", serverGroupId),
new Parameter("cldbid", clientDatabaseIds.Select(id => new ParameterValue(id)).ToArray()));
}

#endregion

#endregion

#endregion

#region Channel Methods
Expand Down

0 comments on commit cac6e82

Please sign in to comment.