mirror of
https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak.git
synced 2026-12-03 03:52:50 +08:00
fix: synchronize microphone mute state
This commit is contained in:
1 parent
fae21ec086
commit
bcf212738b
6 files changed
+35
-8
No files matched your search
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user