-
Notifications
You must be signed in to change notification settings - Fork 107
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
channel.getTotalClients() showing wrong numbers #405
Comments
I'm not sure what the purpose of the TOTAL_CLIENTS flag in the teamspeak api is, but it wouldn't surprise me if it has some obscure function aside from conveying the number of clients in a channel. For this java wrapper api, the Channel objects aren't updated all the time, nor are client objects, as they are merely local java representations of the channel or client at a particular instant. You'll want to make sure that you have the most up-to-date info by calling TS3Api#getChannels() or #getChannelByName, or whatever method you choose, then perhaps that method will return a useful value. I'm more partial to using TS3Api#getClients(), then filtering by channel instead, since I will use other client info, but I don't know what your intent is for that information. |
it was intended, if someone has a music bot in the channel, that this, if all other users leave the channel, he was moved back to his home. Have solved it so: public static void moveTeamBots() {
for (Client clients : Main.api.getClients()) {
if (clients.isInServerGroup(GroupIdService.teammusic) && (clients.getChannelId() != ChannelIdService.musikAfkChannel_ID)) {
String tmp = "alone";
for (Client clients2 : Main.api.getClients()) {
if (!clients2.isInServerGroup(GroupIdService.teammusic)) {
if (clients.getChannelId() == clients2.getChannelId()) {
tmp = "not";
}
}
}
if (tmp.equalsIgnoreCase("alone")) Main.api.moveClient(clients.getId(),
ChannelIdService.musikAfkChannel_ID);
}
}
} i know, funny way to solve my problem xD |
My bot gives me -1 as client value, but we are 4 clients in the channel.
I use the latest API version.
The text was updated successfully, but these errors were encountered: