{"id":21548680,"url":"https://github.com/nikeee/teamspeak3queryapi","last_synced_at":"2025-04-09T20:00:20.884Z","repository":{"id":17404055,"uuid":"20176723","full_name":"nikeee/TeamSpeak3QueryApi","owner":"nikeee","description":".NET wrapper for the TeamSpeak 3 Query API","archived":false,"fork":false,"pushed_at":"2025-03-24T14:45:23.000Z","size":1646,"stargazers_count":60,"open_issues_count":20,"forks_count":17,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-04-02T19:07:44.801Z","etag":null,"topics":["async-await","c-sharp","hacktoberfest","nuget","teamspeak"],"latest_commit_sha":null,"homepage":"https://nikeee.github.io/TeamSpeak3QueryAPI","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nikeee.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null},"funding":{"github":"nikeee"}},"created_at":"2014-05-26T06:49:07.000Z","updated_at":"2025-03-24T14:45:18.000Z","dependencies_parsed_at":"2024-03-25T03:40:45.572Z","dependency_job_id":null,"html_url":"https://github.com/nikeee/TeamSpeak3QueryApi","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikeee%2FTeamSpeak3QueryApi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikeee%2FTeamSpeak3QueryApi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikeee%2FTeamSpeak3QueryApi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikeee%2FTeamSpeak3QueryApi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nikeee","download_url":"https://codeload.github.com/nikeee/TeamSpeak3QueryApi/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248103877,"owners_count":21048245,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["async-await","c-sharp","hacktoberfest","nuget","teamspeak"],"created_at":"2024-11-24T06:19:23.026Z","updated_at":"2025-04-09T20:00:20.727Z","avatar_url":"https://github.com/nikeee.png","language":"C#","funding_links":["https://github.com/sponsors/nikeee"],"categories":[],"sub_categories":[],"readme":"# C# TeamSpeak3Query API [![Travis Build Status](https://travis-ci.org/nikeee/TeamSpeak3QueryAPI.svg?branch=master)](https://travis-ci.org/nikeee/TeamSpeak3QueryAPI) ![NuGet Downloads](https://img.shields.io/nuget/dt/TeamSpeak3QueryApi.svg)\n\nAn API wrapper for the TeamSpeak 3 Query API written in C#. Still work in progress.\n\nKey features of this library:\n- Built entirely with the .NET TAP pattern for perfect async/await usage opportunities\n- Robust library architecture\n- Query responses are fully mapped to .NET objects, including the naming style\n- Usable via Middleware/Rich Client\n\n## Contents\n1. [Documentation](#documentation)\n2. [Compatibility](#compatibility)\n  1. [NuGet](#nuget)\n3. [Examples](#examples)\n  1. [Connect and Login](#connect-and-login)\n  2. [Notifications](#notifications)\n  3. [Requesting Client Information](#requesting-client-information)\n  4. [Exceptions](#exceptions)\n4. [Middleware](#middleware)\n5. [Node.js](#nodejs)\n\n## Documentation\n\nThe TeamSpeak 3 Query API is documented [here](http://media.teamspeak.com/ts3_literature/TeamSpeak%203%20Server%20Query%20Manual.pdf).\nThis library has an online documentation which was created using [sharpDox](http://sharpdox.de). You can find the documentation on the [GitHub Page of this repository](https://nikeee.github.io/TeamSpeak3QueryAPI).\n\n## Compatibility\nThis library requires .NET Standard `1.3`. You can look at [this table](https://docs.microsoft.com/en-us/dotnet/standard/net-standard#net-implementation-support) to see whether your platform is supported. If you find something that is missing (espacially in the `TeamSpeakClient` class), just submit a PR or an issue!\n\n### NuGet\n```Shell\nInstall-Package TeamSpeak3QueryApi\n# or\ndotnet add package TeamSpeak3QueryApi\n```\n\n## Examples\nUsing the rich client, you can connect to a TeamSpeak Query server like this:\n### Connect and Login\n\n```C#\nvar rc = new TeamSpeakClient(host, port); // Create rich client instance, optionally use the internal 'keep-alive' logic to keep the client from disconnecting by passing true here.\nawait rc.Connect(); // connect to the server\nawait rc.Login(user, password); // login to do some stuff that requires permission\nawait rc.UseServer(1); // Use the server with id '1'\nvar me = await rc.WhoAmI(); // Get information about yourself!\n```\n\n### Notifications\nYou can receive notifications. The notification data is fully typed, so you can access the response via properties and not - like other wrappers - using a dictionary.\n\n```C#\n// assuming connected\nawait rc.RegisterServerNotification(); // register notifications to receive server notifications\n\n// register channel notifications to receive notifications for channel with id '30'\nawait rc.RegisterChannelNotification(30);\n\n//Subscribe a callback to a notification:\nrc.Subscribe\u003cClientEnterView\u003e(data =\u003e {\n    foreach(var c in data)\n    {\n        Trace.WriteLine(\"Client \" + c.NickName + \" joined.\");\n    }\n});\n```\n\n### Requesting Client Information\nGetting all clients and moving them to a specific channel is as simple as:\n\n```C#\nvar currentClients = await rc.GetClients();\nawait rc.MoveClient(currentClients, 30); // Where 30 is the channel id\n```\n...and kick someone whose name is \"Foobar\".\n\n```C#\nvar fooBar = currentClients.SingleOrDefault(c =\u003e c.NickName == \"Foobar\"); // Using linq to find our dude\nif(fooBar != null) // Make sure we pass a valid reference\n    await rc.KickClient(fooBar, 30);\n```\n\n### Exceptions\nThere are three exceptions:\n- QueryProtocolException\n\n    Only occurs when the server sends an invalid response, meaning the server violates the protocol specifications.\n- QueryException\n\n    Occurs every time the server responds with an error code that is not `0`. It holds the error information, for example the error code, error message and - if applicatable - the missing permission id for the operation.\n- FileTransferException\n\n    Occurs when there was an error uploading or downloading a file.\n\nNote that exceptions are also thrown when a network problem occurs. Just like a normal TcpClient.\n\n## Middleware\nIf you want to work more loose-typed, you can do this. This is possible using the `QueryClient`.\n\n```C#\nvar qc = new QueryClient(host, port);\nawait qc.Connect();\n\nawait qc.Send(\"login\", new Parameter(\"client_login_name\", userName), new Parameter(\"client_login_password\", password));\n\nawait qc.Send(\"use\", new Parameter(\"sid\", \"1\"));\n\nvar me = await qc.Send(\"whoami\");\n\nawait qc.Send(\"servernotifyregister\", new Parameter(\"event\", \"server\"));\nawait qc.Send(\"servernotifyregister\", new Parameter(\"event\", \"channel\"), new Parameter(\"id\", channelId));\n\n// and so on.\n```\nNote that you have to look up the commands in the TeamSpeak documentation.\n\n## Node.js\nSuddenly node.\n\nActually, this library is a port of my TypeScript port of a JS library.\n\n- [The TypeScript port](https://github.com/nikeee/node-ts)\n- [The original js library](https://github.com/gwTumm/node-teamspeak)\n\nNote that these ports only contain the (in this library called) middleware.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnikeee%2Fteamspeak3queryapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnikeee%2Fteamspeak3queryapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnikeee%2Fteamspeak3queryapi/lists"}