clientInfos.clientTalkRequest wrong type
TimMatten opened this issue · comments
TimMatten commented
Describe the bug
The property "CLIENT_TALK_REQUEST" of the client is of type boolean but should be of type string.
To Reproduce
Code:
this.teamspeak.getClientById(key).then(async (tsClient) => {
const clientInfos = await tsClient.getInfo();
console.log(clientInfos.clientTalkRequest); // return true or false
});
Expected behavior
Should return a result of type string (timestamp of requesttime)
Versions used
- lib version: 3.5.0
Additional context
Possible workaround until fix, using webquery.
export async function hasClientRequestedTalkpower(clid: string, httpService: HttpService) {
const url = `http://${process.env.TS_IP}:${process.env.TS_PORT_QUERY_WEB_API}/byport/${process.env.TS_PORT}/clientinfo`;
const response = await firstValueFrom(
httpService.post(
url,
{ clid: clid },
{
headers: {
'x-api-key': process.env.TS_QUERY_WEB_API_KEY,
},
},
),
);
return response.data.body[0]['client_talk_request'] != '0';
}