Closed tipakA closed 4 years ago
This is because the library might not have fetched the Client via the clientlist command. This happens most times when the query connects to get data like serverinfo and immediately disconnects again.
TeamSpeak Query will emit the clientconnect and clientdisconnect event very late where the query has actually already left again
But yeah i see what i did wrong there, i still emit the client as an object with only the clid
property set
will fix that and set the client property as undefined
I have released a new version on npm 3.0.9 which should fix this issue
Describe the bug I've been using this function for handling
clientdisconnect
event:and noticed that from time to time it errors with
Then i've put it in try/catch block to log whole
data
object with the error, and all i am getting in such case is{ clid: '1271' }
.According to typings,
data.client
should beTeamSpeakClient | undefined
, but it clearly is not any of those, as both null check and function fail.To Reproduce
As far as i'm aware, this only happens when a certain query client disconnects from my server, i don't really know what is so special about this one. Additionally, for unknown reasons, it does not happen every time.
Expected behavior Null check works properly, or typings cover data emitted under
data.client
, so you can write your function around itVersions used
3.12.1
12.13.1
3.9.7
3.0.8
Additional context I am aware that object logged in the catch is not full object emitted, yet it still contains something as
client
, that is notTeamSpeakClient