Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GetClients returns empty list in TextMessage notification #72

Open
Weeb6279 opened this issue Jul 3, 2021 · 0 comments
Open

GetClients returns empty list in TextMessage notification #72

Weeb6279 opened this issue Jul 3, 2021 · 0 comments
Labels

Comments

@Weeb6279
Copy link

Weeb6279 commented Jul 3, 2021

Hello,

I get an empty list whenever I try to retreive a list of all clients using TeamSpeakClient.Subscribe. This happens only inside a TeamSpeakClient.Subscribe Call. I need to manually query clientlist to get all online clients.

Package Version:

 <PackageReference Include="TeamSpeak3QueryApi" Version="1.13.0" />
var clients = rc.GetClients(); // Count = 2
rc.Subscribe<TextMessage>(async data =>
{
  foreach (var msg in data)
  {
      if (msg.InvokerId == me.ClientId) 
          continue;
      var onlineClients = await rc.GetClients(); // Count = 0
  }
}

Workaround:

var clients = rc.GetClients(); // Count = 2
rc.Subscribe<TextMessage>(async data =>
{
  foreach (var msg in data)
  {
      if (msg.InvokerId == me.ClientId) 
          continue;
      await rc.Client.Send("clientlist");
      var onlineClients = await rc.GetClients(); // Count = 2
  }
}
@nikeee nikeee added the bug label Jul 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants