Fix(voice): Voice UI would not react to actions.

Feat(voice): Allow accessing user profile from voice UI.

Fixes #89. Fixes #91.
This commit is contained in:
Paul
2021-10-20 22:39:26 +01:00
parent d75af2fa45
commit 04ced5a0d2
4 changed files with 87 additions and 56 deletions

View File

@@ -154,20 +154,25 @@ class VoiceStateReference {
async startDeafen() {
if (!this.client) return console.log("No client object"); // ! TODO: let the user know
if (this.client.isDeaf) return;
this.client.isDeaf = true;
this.client?.consumers.forEach((consumer) => {
consumer.audio?.pause();
});
this.syncState();
}
async stopDeafen() {
if (!this.client) return console.log("No client object"); // ! TODO: let the user know
if (!this.client.isDeaf) return;
this.client.isDeaf = false;
this.client?.consumers.forEach((consumer) => {
consumer.audio?.resume();
});
this.syncState();
}
async startProducing(type: ProduceType) {
@@ -192,10 +197,14 @@ class VoiceStateReference {
);
}
}
this.syncState();
}
stopProducing(type: ProduceType) {
this.client?.stopProduce(type);
async stopProducing(type: ProduceType) {
await this.client?.stopProduce(type);
this.syncState();
}
}