Multivit4min / TS3-NodeJS-Library

TeamSpeak 3 Server Query Library supports SSH and RAW Query

Home Page:https://multivit4min.github.io/TS3-NodeJS-Library/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

clientInfos.clientTalkRequest wrong type

TimMatten opened this issue · comments

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
});

Result via putty:
CLIENT_TALK_REQUEST

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';
}