Multivit4min / TS3-NodeJS-Library

TeamSpeak 3 Server Query Library supports SSH and RAW Query
https://multivit4min.github.io/TS3-NodeJS-Library/
MIT License
149 stars 20 forks source link

ClientEdit - ResponseError: invalid parameter #177

Closed JDittmerCOM closed 2 years ago

JDittmerCOM commented 2 years ago

Hi, when I try to change the client nickname, I keep getting the following error message.

node:internal/process/promises:246
          triggerUncaughtException(err, true /* fromPromise */);
          ^

ResponseError: invalid parameter
    at new Command (/home/Justin/MissionVBots/ts3Bot/node_modules/ts3-nodejs-library/lib/transport/Command.js:15:22)
    at /home/Justin/MissionVBots/ts3Bot/node_modules/ts3-nodejs-library/lib/transport/TeamSpeakQuery.js:79:25
    at new Promise (<anonymous>)
    at TeamSpeakQuery.handleCommand (/home/Justin/MissionVBots/ts3Bot/node_modules/ts3-nodejs-library/lib/transport/TeamSpeakQuery.js:78:16)
    at TeamSpeakQuery.execute (/home/Justin/MissionVBots/ts3Bot/node_modules/ts3-nodejs-library/lib/transport/TeamSpeakQuery.js:66:21)
    at TeamSpeak.execute (/home/Justin/MissionVBots/ts3Bot/node_modules/ts3-nodejs-library/lib/TeamSpeak.js:391:31)
    at TeamSpeak.clientEdit (/home/Justin/MissionVBots/ts3Bot/node_modules/ts3-nodejs-library/lib/TeamSpeak.js:1619:21)
    at /home/Justin/MissionVBots/ts3Bot/index.js:257:13
    at processTicksAndRejections (node:internal/process/task_queues:96:5) {
  id: '1538',
  msg: 'invalid parameter',
  extraMsg: undefined,
  failedPermid: undefined
}

However, I have no idea what could be the reason, since all the parameters are actually there, aren't they?

app.put('/client/editname', (req, res) => {
    var identifier = req.body.identifier;
    var name = req.body.name;

    teamspeak.clientGetIds(identifier).then(clientInfo => {
        teamspeak.clientEdit(clientInfo[0].clid, {'client_nickname': name});
        res.json();
    }).catch(error => res.json({ error: "Identifier falsch oder Client nicht Online" }))
});
chikovanreuden commented 2 years ago

You are not suppose to change the Client's Nickname. Please check the Interfaces for Teamspeak.clientEdit(): https://github.com/Multivit4min/TS3-NodeJS-Library/blob/02c8fccd1b41c1434f25ceee6ac20cac79f79974/src/types/PropertyTypes.ts#L28

JDittmerCOM commented 2 years ago

So I can really only use the two properties? I was of the opinion that I read that I could also change the nickname. But well, ok, then I know. Thanks.

clientDescription?: string
clientIsTalker?: boolean