Giter Site home page Giter Site logo

nikeee / teamspeak3queryapi Goto Github PK

View Code? Open in Web Editor NEW
57.0 11.0 17.0 1.6 MB

.NET wrapper for the TeamSpeak 3 Query API

Home Page: https://nikeee.github.io/TeamSpeak3QueryAPI

License: GNU General Public License v3.0

C# 99.05% Shell 0.95%
c-sharp teamspeak async-await nuget hacktoberfest

teamspeak3queryapi's Introduction

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.

teamspeak3queryapi's People

Contributors

aleksanderpsuj avatar arefu avatar ceeno2k avatar dependabot[bot] avatar maximilianast avatar nikeee avatar splamy avatar substituter avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

teamspeak3queryapi's Issues

How to handle Channel Joined event?

I'm trying to subscribe to the Event where a user joins inside a channel. This is my approach:

ts3.Subscribe<ClientEnterView>(data =>
            {
                foreach (var c in data)
                {
                    Console.WriteLine(c.NickName);
                }
            });

When i connect to the server it show my Name, but when i switch channels it doesn't do anything.

Connection Lost

After sometime, I lose connection and all query clients disconnect. I get this in debug:

line: notifyclientleftview cfid=1 ctid=0 reasonid=3 reasonmsg=connection\slost clid=3

Note: after clients are disconnected, debug is spammed with many: line: with no message.

Sorry and thank you.

API whishlist

Assume we can do breaking changes, what could we do?

  • How about every response of the rich client is also a readonly-dictionary that contains all the original values? Pros? Cons? (Rel.: #26)
    • Pros:
      • Prevents #25
      • Access to raw data, if needed
    • Cons:
      • The data is hold multiple times, slightly higher memory consumption
      • Some users might rely too heavily on them (or in the wrong cases)

Implementation couold look like this:

class Response : IReadOnlyDictionary<string, string>
{
    private readonly IReadOnlyDictionary<string, string> _rawFields; // init via setter mechanism during response processing
    // ...
    // Implement indexer with getter only, just returning _rawFields's entry
    // ...
}
  • How about generating the data classes in the Specialzed-Namespace? Pros? Cons?
    • Pros:
      • Maybe (tm) faster de-serialization as we could define a general setter method that calls hand-written converters based on an auto-generated switch-statement. No dynamic invocations needed.
      • Debugging is easier for single responses
      • We might share/maintain the declaration with https://github.com/ReSpeak/tsdeclarations
    • Cons:
      • Generating code before compilation can introduce (caching) errors
      • Generating code requires a generator... which has to run on all plattforms that can compile C#. Maybe use a sub-project? Or a Roslyn-API?
  • Can we somehow benefit from C# 7.x/8 features? Span<T>, Memory<T>, Ref-Returns/In-Parameters, Local-Refs? Pattern matching? Nullable-Ref-Types?

This list is open to everyone!

EditChannelInfo

I am not expert on c# and how create API, i am using the rich client and having trouble finding some stuff, like finding the EditChannelInfo. (How get it, there is no method?)

What i find kinda stressing, that you use so many class with same fields like Editchannelinfo and Channelinfo. For each command you have your own class like Foundchannel. Is it becasue out of perfomance? Or why i cant get just the Basic Channel class?

But so far its nice to have some c# API but for me 'who dont know whats perfomant' it way to complicated. I would probaly write down all to my own methods, to get some comfy code.

"Connect()" freezes the Program

when I try to connect to a server with this:

TSClient = new TeamSpeakClient("185.116.156.40");
try
{
    await TSClient.Connect();
}
catch (exception e)
{
    Console.WriteLine(e.Message);
    return ConnectionResult.UNKNOWN;
}

it gets stuck with the TSClient.Connect().
No exception gets thrown, it just gets stuck.
I used this API before, but did not get this problem.

Is there a way to find the error?

-Dj

Edit: If you need to try it, here is the project: https://github.com/MrDj200/TS3ChannelMonitor .

No responses come through after lots of activity

Hello nikeee,

I have been using your API wrapper for a while (and made a few additions to it), and its been working like a charm. I just noticed that you started updating it again and I got really excited!

One thing that I have come across is when multiple requests occur around the same time, it will just error out with a null response.

e.g. multiple WhoAmI() requests, or GetClientInfo() requests at once.
I have gotten around this by just sending every request through a queue, so its not a major issue.

Is this something you would be willing/able to fix? As it would make things a little faster and smoother.

addservergroup not there?

Hey,
i dont find a function to give server groups to people in the rich client, is it not included or am i blind?
I dont want to use the middleware.

Thank you

Set up CI-Deployment

Now where we have a NuGet, it would be nice to push new versions right from the CI.

Use ushort instead of short for port variable

Hallo,

i found a little mistake. It's not possible to use a query port above 32767 because of variable type short. Replacing it with a ushort solves the issue.

Thank you and greed work

Not getting any response

When the script arrives at the line "await qc.Send" it freezes and goes no further. If I remove await, the whole code processes, however, I do not receive any messages on the console. And it doesn't even enter the callback breakpoint. What am I doing wrong? By the way, the only thing I've been able to do so far, was connect and send a message on the channel.

static async Task test2()
        {
            var qc = new QueryClient("localhost", 25639);
            await qc.Connect();

            await qc.Send("clientnotifyregister", new Parameter("schandlerid", 0), new Parameter("event", "notifytextmessage"));
            await qc.Send("clientnotifyregister", new Parameter("schandlerid", 0), new Parameter("event", "notifyclientpoke"));

            qc.Subscribe("notifytextmessage", (data =>
            {
                foreach (var c in data.Payload)
                {
                    Trace.WriteLine("Client " + c.ToString() + " joined.");
                    Console.WriteLine("Client " + c.ToString() + " joined.");
                }
            }));

            qc.Subscribe("notifyclientpoke", (data =>
            {
                foreach (var c in data.Payload)
                {
                    Trace.WriteLine("Client " + c.ToString() + " joined.");
                    Console.WriteLine("Client " + c.ToString() + " joined.");
                }
            }));
        }

Error During Execution Query

Most of the methods works, but everytime i try a new method just to see it functioning, i got this error.
TeamSpeak3QueryApi.Net.QueryException: 'An error occurred during the query.'

Happened with KickClient, ClientPoke.
I haven't coded anything yet, just calling functions using your console app.

Whats is wrong here?

Feature Request: Automatic Keep-Alive

See #64 for the need of this.

Option 1:

Use System.Timers.Timer
Pros:

  • Simple to implement
  • Can be implemented external from the TeamSpeak client without breaking changes
    Cons:
  • We currently target Net Standard 1.3 - there might not be a Timer available, so we have to bump the Net Standard version.

Note:

Option 2:

Timeout in the response queue.
Pros:

  • KeepAlive will only be sent if there was no
    Cons:
  • Harder to implement
    Note:
  • Must be implemented in the QueryClient itself; if done correctly, would be transparent to the user

Option N

[your suggestion here (comment on this issue)]

General implementation notes:

  • Some library users are have already implemented their own Keep-Alive logic.
  • Design decision: Keep the query client / rich client dumb?

Out of curiosity, what separates this lib from TS3QueryLib?

This lib has been around for a while: https://github.com/Scordo/TS3QueryLib.Net

Not 100% maintained so some bugs exist, but I was just wondering if you ever saw this project, and decided to take step(s) in other directions compared to it.

I want to know because I've already established a code base using aforementioned library, and currently wondering if there would be better performance / maintaining / functionality with this library.

Thanks!

Get RequestedTalkPower of Client

Hello,
is there any way to get the parameters RequestedTalkPower and TalkPowerRequestMessage without the ClientEnterView Event ?
Its missing in GetClientDetailedInfo.

Application crashes

Hello,
im using the library for quite a while now, but now its not working anymore. i now commented everything except 1 query and the login out, so i can analyze the problem. but not even the first query works.
`
var rc = new TeamSpeakClient("185.230.160.62", 10011); // Create rich client instance
await rc.Connect(); // connect to the server
await rc.Login("serveradmin", "ddddddd"); // login to do some stuff that requires permission
await rc.UseServer(1); // Use the server with id '1'

        var currentClients = await rc.GetClients();

        foreach (var c in currentClients)
        {
                if (c.DatabaseId == 5)
                {
                    await rc.PokeClient(c.DatabaseId, "Der RCon Server wurde gestartet");
                }

`
Visual studio says it begins at the foreach loop.

the error is:
TeamSpeak3QueryApi.Net.QueryException
HResult=0x80131500
Nachricht = An error occurred during the query.
Quelle = mscorlib
Stapelüberwachung:
bei System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
bei System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
bei TeamSpeak3QueryApi.Net.QueryClient.d__27.MoveNext()
bei System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
bei TCPServer.Program.d__8.MoveNext()
bei System.Runtime.CompilerServices.AsyncMethodBuilderCore.<>c.b__6_1(Object state)
bei System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(Object state)
bei System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
bei System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
bei System.Threading.ThreadPoolWorkQueue.Dispatch()
bei System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()

One more thing to note: i had to enable "just my code" because before that it said "AsyncMethodBuilder.cs not found". i followed this tutorial for that: https://stackoverflow.com/questions/39167352/debugging-source-not-found-asyncextensions-cs-not-found

i have no clue whats going on cuz it worked before. i hope you can help.
Alex

wie funktioniert es?

Ich verstehe nicht wirklich wie diese API funktioniert...

ich hab es in vb.net so versucht:

Dim ts3server As New Net.Specialized.TeamSpeakClient("127.0.0.1", "10011")
ts3server.Login("serveradmin", "pw")
ts3server.UseServer(2)
ts3server.Client.Connect()
MsgBox(ts3server.Client.IsConnected)

Ich bekomme da immer false, die angaben stimmen aber :(

Send Plugin Command

I haven't found any references of SendPluginCommand in documentation, so the question:
is there any way to send command to plugin using this API?

Adding Dictionarry<sting, sting> to Respone

Hay Nikeee what do you think about adding a Dictionarry<sting, sting> (or IReadOnlyList<KeyValuePair<string, string>>) to the respone class for all respone-parameters that couln't be deserialized?

SSH Support

Telnet isnt very safty. Are you planing to add ssh support? Teamspeak will remove for sure telnet support in the future.

Fatal error: Unsubscripe with callback won't work

I would make a pr but I can´t refork this project again and I don´t know how can I refork the master branch into my fork. 👎 . So I create this issue and hope @nikeee can fix it with the next commit.

It´s currently not possible to clear a specific subscribe notification cause the callback method can´t be compared with the saved callback methods.

TeamspeakClient.cs:79

    public void Unsubscribe<T>(Action<IReadOnlyCollection<T>> callback)
        where T : Notification
    {
        var notification = GetNotificationType<T>();
        var cbt = _callbacks.SingleOrDefault(t => t.Item1 == notification && t.Item2 == callback as object);
        if (cbt != null)
            Client.Unsubscribe(notification.ToString(), cbt.Item3);
    }

t.Item2 == callback as object this part of the code will always return false. To fix this you need to use the method .equals. I will also fix this in my ssh branch.

Solution

    public void Unsubscribe<T>(Action<IReadOnlyCollection<T>> callback)
        where T : Notification
    {
        var notification = GetNotificationType<T>();
        var cbt = _callbacks.SingleOrDefault(t => t.Item1 == notification && t.Item2.Equals(callback));
        if (cbt != null)
            Client.Unsubscribe(notification.ToString(), cbt.Item3);
    }

Notifications not working correctly?

Hallo,

i'm having a weird problem with notifications, they never get fired. I see the servernotifyregister message in the debug window and they even got confirmed (error id=0 msg=ok) but if i switch channels or write a private message, no notify... message abiers in the debug window.

First i tried to set a breakpoint at but it never got fired.

Then i created 3 test projects.

  • TsQueryNotificationsTest-NET uses .Net Framework 4.6.1 with the TeamSpeak3QueryAPI libary
  • TsQueryNotificationsTest uses .Net Core 2 with the TeamSpeak3QueryAPI libary
  • TsQuerySimpleNotificationsTest uses .Net Core 2, only a TcpClient (nearly Copy&Pates from the libary)

The problem abiers only when the TeamSpeak3 QueryAPI library is used. With the simple version, i receive the notify messages.

I also checked the tcp communication with wireshark and in all 3 cases the notify messages got send from the teamspeak server.

Maybe someone can confirm that notification are working correctly and maybe can give me a tipp, what i'm doing wrong.

I'm using Visual Studio 15.5.3 with .Net Framework 4.7.1 and .Net Core SDK 2.1.4. I tested it on 3 different PC's, always with the same result.

Adding ssh as nuget package

Are there any plans to create a nuget package with this version? Currently isn't there any ssh teamspeak query package.

Get Clients with more parameters

Hey is it possible to get the Clientlist with more parameter like just 1 ?

var ClientList = await server.teamspeak.GetClients(GetClientOptions.Groups);

Here just with the Groups Parameter, but I want 2 ;)

Events occasionally do not fire (ClientLeftView,ClientEnterView,TextMessage)

Heya!

Instance = new TeamSpeakClient(Host, Port);
Instance.Connect().Wait();
Instance.Login(User, Pass);`
//Select Server & Set Nick
Instance.UseServer(ServerID);
Instance.Client.Send("clientupdate client_nickname=Bitch");

//We Want Server & Server Text Events
Instance.RegisterServerNotification();
Instance.RegisterTextServerNotification();

//Setup Callbacks For My Events
Instance.Subscribe<ClientEnterView>(ClientEnter);
Instance.Subscribe<ClientLeftView>(ClientLeft);

This is the code I have currently, at times I've noticed that either the client doesn't connect (and it doesn't throw any error back? Or events aren't registering correctly, am I doing something wrong or am I crazy?

My reproduction was, I compiled the program, launched my TeamSpeak and it saw I joined but wouldn't catch me sending messages, then relaunching it would catch all 3, but then compile again and it wouldn't do anything.

I have my IP in the Server_query_whitelist ip file, also as a side note, does anyone know how to get the 'serve id' that's the string ID?

Multiple Tasks?

I'm having a problem with not getting an answer from the TeamSpeakClient-methods when running them from different task/thread. How can I fix this?

Task.Run(async () => {
// Connect - True
// GetClients() - True
while(true);
});

Task.Run(async () => {
// Delay 5 seconds
// GetClients() - Hangs infinity!
});

RegisterChannelNotification Information.

Hi, i'm trying to intercept when a client enter in a room (115) with the example in Notifications, but when a client enter in the room the code not notify me.

Code:
Immagine

is the code right? Thanks for your attention.

GetClients() taking forever sometimes

Hello.

Sometimes when I use the GetClients (var clients= await TsClient.GetClients(GetClientOptions.Uid);) it wait forever, looks like it happens when I call the Getclients "too fast".

Any idea what could be happening? I'm testing it in a local server, so it's not a delay or something like that.

Thank you

get group clients

Is there a way to get group clients?
If not, how this can be added?

100% CPU usage

After 5minutes after connecting to my teamspeak server, my software uses 100% of CPU without calling any function or executing any loop.

Setting channel parent via channeledit does not work, consider removing it.

https://github.com/nikeee/TeamSpeak3QueryAPI/blob/2aaa56383231c362086e993986bad34ddc660607/src/TeamSpeak3QueryApi/Specialized/TeamSpeakClient.cs#L498

I was looking for a reference for the channeledit command since the ts3 query documentation is trash, but in the end I had to resign to try and error.
Your channeledit has an option to change the parent, but that does not work. channelmove is the only way this works.

channeledit cid=6 cpid=5
error id=1538 msg=invalid\sparameter
channeledit cid=6 channel_cpid=5
error id=1538 msg=invalid\sparameter
channeledit cid=6 channel_parent=5
error id=1538 msg=invalid\sparameter
channelmove cid=6 cpid=5
error id=0 msg=ok

Unless I'm missing anything or it is possible to use this in some weird teamspeak versions, consider removing the field and the data parameter field.

A few questions, before I migrate my current solution.

I've been using TSQueryLib for quite some time with my teamspeak bot, where I'm able to completely overwrite(over rule) the default permission system of teamspeak with a custom one.

  • Basically when ever a user performs an action such as changing channel, the bot checks the user against its own database and queries whether or not the user is allowed to change into that channel and so on.
  • The bot also includes a smart afk function, where it monitors the users activity and estimates when users are likely to be afk, depending on the data gathered in the past, and moves them if they are indeed afk after X amount of minutes.

TSQueryLib's main problem so far, has been the lack of await/tasks, making these actions quite performance heavy when dealing with 200+ users.
Discovering this api instead, might solve some of my issues, and so to make the test a bit easier, I was wondering if you could answer a few questions.

  1. Can you give me a short sample of how one would assign and remove a server group from a user ?
  2. Can you give me a short sample of how one would make a hook for when a user changes their channel ?
  3. Are their any thing I should be concerned about, when it comes to running this in a commercial environment ? The product it self wont be sold, but will be a part of a network that is commercially distributed among several hundred customers. And will over time, be integrated into the games we develop.

Best Regards,
Yilmas, Founder of Unknown Borders

Unable to move channel to the top of listing with `CreateChannel`, `EditChannel` or `Move Channel`

I've been trying to create a channel with a parent channel, but an issue I'm having is that channels are always moved to the top of the channel when they are A: edited or B: created. From what I can see, this is caused by the order being given the default value of zero when created. (See https://github.com/nikeee/TeamSpeak3QueryAPI/blob/master/src/TeamSpeak3QueryApi/Specialized/Notifications/ChannelCreated.cs#L32).

I've worked around this problem by using the QueryClient and sending my own channelcreate method. Could this behaviour be changed, or can we get some overloads which allows us to determine if we want it at the top of the channel or not.

This is the code I'm using to get the behaviour I expect.

await ts3.Client.Send("channelcreate", new TeamSpeak3QueryApi.Net.Parameter("channel_name", "Test Channel Name"), new TeamSpeak3QueryApi.Net.Parameter("cpid", mParentChannelId));

Private Text Event not firing

Hello there,

I can't get the PrivateTextNotification to work.
I ran the line

await TSClient.RegisterTextPrivateNotification();

and subbed to the TextMessage event:

TSClient.Subscribe<TextMessage>(data =>
{
	CommandStuff.CommandManager.ExecuteCommand(data);
});

But I still get the Error of Insufficient client Permission(yes, I am Admin, and I can text my old Java Bot)
The Permission I'm apparently missing is i_client_needed_private_textmessage_power.

Do you happen to know the reason for the fail?
Really hope to get some help over here :D

-Dj

TeamSpeak3QueryApi.pdb not loaded

I ve installed this API with NuGet, and tried to use the code example to connect to TS3Query plugin

TeamSpeakClient rc = new TeamSpeakClient("localhost", 25639);
await rc.Connect();
await rc.UseServer(1);
var me = await rc.WhoAmI();

After executing this code i get a screen saying that TeamSpeak3QueryApi is not loaded
image
Im a beginner so i dont know much about C# but from what i ve searched the .pdb files are used in debugging - am I supossed to apply some special debbuging settings? I ve tried few and none of them worked. I dont know if Im doing something wrong or this .pdb file really should be there?

rc.UseServer 'An error occured during the query'

An error occurred during the query.
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at TeamSpeak3QueryApi.Net.QueryClient.<Send>d__27.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
   at HydroBot.Hydrobot.<ConnectToTeamspeak>d__1.MoveNext()

If you want to re-produce, use the code below.

var rc = new TeamSpeakClient("167.114.60.251", 10011);
try
{
    await rc.Connect();
    await rc.UseServer(2);
    var client = await rc.WhoAmI();

}
catch (Exception e)
{
    Console.WriteLine(e.Message);
    Console.WriteLine(e.StackTrace);
}

Edit:
This has been tried with logging in previously, it's just excluded from this example for simplicity.

The error is thrown from rc.UseServer() and it's thrown by connecting to any server Id other than 1.

SendAsync with Parameters and Options don't work

It´s currently not possible to send a command over the query using a parameter and a opton. The method public async Task<QueryResponseDictionary[]> SendAsync(string cmd, params Parameter[] parameters) => await SendAsync(cmd, parameters, null); dosen´t allow to skip the params parameter to get into the method public async Task<QueryResponseDictionary[]> SendAsync(string cmd, Parameter[] parameters, string[] options).

Any ideas that dosen´t break the changes?

Example:

var res = await Client.SendAsync("servergroupclientlist", new Parameter("sgid", serverGroupDatabaseId), new string[] { "names" });

Multiple channel notifications problem

I'm working on simple bot and I want to listen for multiple channels notfications, in order to add users to ranks etc.. I'm trying to use subscription of ClientMoved but it's only get data for first registered channel id.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.