fix: synchronize microphone mute state

This commit is contained in:
illusia committed 2026-09-18 17:06:30 +08:00
1 parent fae21ec086
commit bcf212738b
6 files changed
+35 -8

No files matched your search

+9
View File
@@ -240,6 +240,10 @@ export class TSClient extends EventEmitter {
if (info.id === this.clientId && info.targetChannelID !== 0n) this.preferredChannelId = info.targetChannelID;
this.emit("clientMoved", info);
});
client.on("clientUpdated", (event) => {
this.emit("clientUpdated", event.info);
});
}
sendVoice(data: Buffer, codec: number = 4): void {
@@ -271,6 +275,11 @@ export class TSClient extends EventEmitter {
await this.client.execCommand(`clientupdate client_away=${away ? 1 : 0} client_away_message=${escaped}`);
}
async setInputMuted(muted: boolean): Promise<void> {
if (!this.client || !this.connected) throw new Error("TeamSpeak session is not ready");
await this.client.execCommand(`clientupdate client_input_muted=${muted ? 1 : 0}`);
}
async switchChannel(channelId: bigint, password?: string): Promise<void> {
if (!this.client || !this.connected) return;
await tsClientMove(this.client, this.clientId, channelId, password);