Skip to content

Commit

Permalink
Added "AddServerGroup" to TeamSpeakClient. (#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
ceeno2k authored May 1, 2020
1 parent 763ddbe commit 5aac553
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 @@ -259,6 +259,39 @@ public async Task<IReadOnlyList<GetServerGroup>> GetServerGroups(int clientDatab

#endregion

#region AddServerGroup

#region One User

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

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

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

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

#endregion

#region Multiple Users

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

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

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

public Task AddServerGroup(int serverGroupId, IEnumerable<int> clientDatabaseIds)
{
return Client.Send("servergroupaddclient",
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 5aac553

Please sign in to comment.