All Projects → nikeee → TeamSpeak3QueryApi

nikeee / TeamSpeak3QueryApi

Licence: GPL-3.0 license
.NET wrapper for the TeamSpeak 3 Query API

Programming Languages

C#
18002 projects
shell
77523 projects

Projects that are alternatives of or similar to TeamSpeak3QueryApi

Eventflow
Async/await first CQRS+ES and DDD framework for .NET
Stars: ✭ 1,932 (+3350%)
Mutual labels:  nuget, async-await
Zipstorer
A Pure C# Class to Store Files in Zip
Stars: ✭ 139 (+148.21%)
Mutual labels:  nuget, async-await
async-permissions
Easy handling for Android-M permission based on async/await
Stars: ✭ 25 (-55.36%)
Mutual labels:  async-await
mathcore
Advanced .NET math library (.NET Standard).
Stars: ✭ 24 (-57.14%)
Mutual labels:  nuget
Krypton-Toolkit-Suite-Extended-NET-5.470
An extension to the Krypton Toolkit suite of controls for .NET framework 4.7
Stars: ✭ 51 (-8.93%)
Mutual labels:  nuget
ts3exporter
Teamspeak 3 exporter for prometheus
Stars: ✭ 25 (-55.36%)
Mutual labels:  teamspeak
lgsl
LGSL v6.2.0 for PHP 5.4-8.2.0dev (Live Game Server List): online status for Discord, FiveM, Rust, CS, SA:MP, GMOD, Minecraft, Source Query, etc.
Stars: ✭ 101 (+80.36%)
Mutual labels:  teamspeak
teamspeak-dark
A dark theme for TeamSpeak 3 which looks surprisingly similar to another popular voice communication software.
Stars: ✭ 50 (-10.71%)
Mutual labels:  teamspeak
coreclr-module
CoreClr (.NET Core Common Language Runtime) community made module https://fabianterhorst.github.io/coreclr-module/index.html
Stars: ✭ 65 (+16.07%)
Mutual labels:  nuget
junit.testlogger
JUnit test logger for vstest platform
Stars: ✭ 61 (+8.93%)
Mutual labels:  nuget
typescript-async
Creating Asynchronous Code with TypeScript
Stars: ✭ 44 (-21.43%)
Mutual labels:  async-await
bUnit
bUnit is a testing library for Blazor components that make tests look, feel, and runs like regular unit tests. bUnit makes it easy to render and control a component under test’s life-cycle, pass parameter and inject services into it, trigger event handlers, and verify the rendered markup from the component using a built-in semantic HTML comparer.
Stars: ✭ 857 (+1430.36%)
Mutual labels:  nuget
Community.VisualStudio.Toolkit
A community toolkit for writing Visual Studio extensions
Stars: ✭ 23 (-58.93%)
Mutual labels:  nuget
JustAnotherVoiceChat-Server
Server for the JustAnotherVoiceChat TeamSpeak 3 plugin
Stars: ✭ 17 (-69.64%)
Mutual labels:  teamspeak
vscode-npm-gui
vscode nuget package manager gui https://marketplace.visualstudio.com/items?itemName=aliasadidev.nugetpackagemanagergui
Stars: ✭ 36 (-35.71%)
Mutual labels:  nuget
MinimalNugetServer
A minimal but cross-platform implementation of a NuGet server, running on .NET Core
Stars: ✭ 46 (-17.86%)
Mutual labels:  nuget
yavdb
Yet Another Vulnerability Database
Stars: ✭ 14 (-75%)
Mutual labels:  nuget
sphinxcontrib-trio
Make Sphinx better at documenting Python functions and methods
Stars: ✭ 26 (-53.57%)
Mutual labels:  async-await
c4sharp
C4Sharp (C4S) is a .net library for building C4 Model diagrams.
Stars: ✭ 159 (+183.93%)
Mutual labels:  nuget
craft
The universal Sentry release CLI 🚀
Stars: ✭ 117 (+108.93%)
Mutual labels:  nuget

C# TeamSpeak3Query API Travis Build Status NuGet Downloads

An API wrapper for the TeamSpeak 3 Query API written in C#. Still work in progress.

Key features of this library:

  • Built entirely with the .NET TAP pattern for perfect async/await usage opportunities
  • Robust library architecture
  • Query responses are fully mapped to .NET objects, including the naming style
  • Usable via Middleware/Rich Client

Contents

  1. Documentation
  2. Compatibility
  3. NuGet
  4. Examples
  5. Connect and Login
  6. Notifications
  7. Requesting Client Information
  8. Exceptions
  9. Middleware
  10. Node.js

Documentation

The TeamSpeak 3 Query API is documented here. This library has an online documentation which was created using sharpDox. You can find the documentation on the GitHub Page of this repository.

Compatibility

This library requires .NET Standard 1.3. You can look at this table 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!

NuGet

Install-Package TeamSpeak3QueryApi
# or
dotnet add package TeamSpeak3QueryApi

Examples

Using the rich client, you can connect to a TeamSpeak Query server like this:

Connect and Login

var 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.
await rc.Connect(); // connect to the server
await rc.Login(user, password); // login to do some stuff that requires permission
await rc.UseServer(1); // Use the server with id '1'
var me = await rc.WhoAmI(); // Get information about yourself!

Notifications

You 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.

// assuming connected
await rc.RegisterServerNotification(); // register notifications to receive server notifications

// register channel notifications to receive notifications for channel with id '30'
await rc.RegisterChannelNotification(30);

//Subscribe a callback to a notification:
rc.Subscribe<ClientEnterView>(data => {
    foreach(var c in data)
    {
        Trace.WriteLine("Client " + c.NickName + " joined.");
    }
});

Requesting Client Information

Getting all clients and moving them to a specific channel is as simple as:

var currentClients = await rc.GetClients();
await rc.MoveClient(currentClients, 30); // Where 30 is the channel id

...and kick someone whose name is "Foobar".

var fooBar = currentClients.SingleOrDefault(c => c.NickName == "Foobar"); // Using linq to find our dude
if(fooBar != null) // Make sure we pass a valid reference
    await rc.KickClient(fooBar, 30);

Exceptions

There are three exceptions:

  • QueryProtocolException

    Only occurs when the server sends an invalid response, meaning the server violates the protocol specifications.

  • QueryException

    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.

  • FileTransferException

    Occurs when there was an error uploading or downloading a file.

Note that exceptions are also thrown when a network problem occurs. Just like a normal TcpClient.

Middleware

If you want to work more loose-typed, you can do this. This is possible using the QueryClient.

var qc = new QueryClient(host, port);
await qc.Connect();

await qc.Send("login", new Parameter("client_login_name", userName), new Parameter("client_login_password", password));

await qc.Send("use", new Parameter("sid", "1"));

var me = await qc.Send("whoami");

await qc.Send("servernotifyregister", new Parameter("event", "server"));
await qc.Send("servernotifyregister", new Parameter("event", "channel"), new Parameter("id", channelId));

// and so on.

Note that you have to look up the commands in the TeamSpeak documentation.

Node.js

Suddenly node.

Actually, this library is a port of my TypeScript port of a JS library.

Note that these ports only contain the (in this library called) middleware.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].