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

example code ts3.query.TS3QueryError: error id 516: invalid client type #96

Open
0verthink opened this issue Aug 1, 2020 · 3 comments

Comments

@0verthink
Copy link

0verthink commented Aug 1, 2020

I hope someone sees this.

Im trying to run the "say hello to all clients" example code. for some reason when I try to run the code, I get the following error:

ts3.query.TS3QueryError: error id 516: invalid client type

Thats the Code im using:

import ts3

with ts3.query.TS3ServerConnection("telnet://serveradmin:Z0YxRb7u@localhost:10011") as ts3conn:
        ts3conn.exec_("use", sid=1)

        for client in ts3conn.exec_("clientlist"):
                msg = "Hi {}".format(client["client_nickname"])
                ts3conn.exec_("clientpoke", clid=client["clid"], msg=msg)

I only replaced the login credentials. Is there something im missing?

@whookie
Copy link

whookie commented Aug 3, 2020

Without testing it, the following seems to be the issue:
You are looping through all clients.
This means that you will also loop over server query clients, including "yourself".

My guess is your bot is trying to poke itself or another server query.

@0verthink
Copy link
Author

Without testing it, the following seems to be the issue:

You are looping through all clients.

This means that you will also loop over server query clients, including "yourself".

My guess is your bot is trying to poke itself or another server query.

Thanks. Yea that would make sense. Do you know how I can ignore server querys? I read trough the documentation but couldn't find anything.

@whookie
Copy link

whookie commented Aug 3, 2020

Queries have the client_type 1, so try a condition like:
client["client_type"] == "0"
This evaluates to True when a client is a normal user and not a server query.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants