From 30aced6d36c6271c7b2c945423d07e85f9a321e3 Mon Sep 17 00:00:00 2001 From: saopig1 Date: Mon, 13 Apr 2026 00:39:36 +0800 Subject: [PATCH] fix(profile): use clientedit for description, add sendCommandNoWait Description via clientupdate is rejected (error 1538) on TS3 full-client protocol. Switch to clientedit on the bot's own clid, which is how TS3AudioBot handles it. Requires b_client_modify_description permission. Also add sendCommandNoWait to TS3Client for fire-and-forget commands (clientupdate, channeledit) that don't return timely responses. Co-Authored-By: Claude Opus 4.6 (1M context) --- src/bot/profile.ts | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/src/bot/profile.ts b/src/bot/profile.ts index 6d8f5c3..6ff3968 100644 --- a/src/bot/profile.ts +++ b/src/bot/profile.ts @@ -149,24 +149,23 @@ export class BotProfileManager { private async updateDescription(song: QueuedSong | null): Promise { if (!this.config.descriptionEnabled || this.permDenied.description) return; - - // TS3 full-client protocol rejects client_description in clientupdate - // (error 1538 "invalid parameter"). Only TS6 HTTP Query supports it. - // On TS3 we rely on nickname to display song info instead. - const httpQuery = this.tsClient.getHttpQuery(); - if (!httpQuery) { - this.permDenied.description = true; - this.logger.info( - "Description not available on TS3 — using nickname to display song info", - ); - return; - } - try { const text = song ? `${song.name} - ${song.artist} [${song.album}]` : ""; - await httpQuery.clientUpdate({ client_description: text }); + const httpQuery = this.tsClient.getHttpQuery(); + if (httpQuery) { + await httpQuery.clientUpdate({ client_description: text }); + } else { + // clientupdate rejects client_description (error 1538). + // Use clientedit on our own clid instead — this is what + // TS3AudioBot does via TSLib's ChangeDescription(). + const clid = this.tsClient.getClientId(); + if (clid <= 0) return; + await this.tsClient.execCommand( + `clientedit clid=${clid} client_description=${escapeTS3(text)}`, + ); + } this.logger.info("Description updated"); } catch (err) { this.handleFeatureError("description", err);