example code ts3.query.TS3QueryError: error id 516: invalid client type
Opened this issue · 3 comments
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?
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.
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.
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.