fix(VoiceState): Ensure suppress & streaming have proper fallback values (#6377)

This commit is contained in:
Jiralite
2022-01-07 22:40:58 +00:00
committed by GitHub
parent 6085b4f727
commit a0d5f13dd9
2 changed files with 6 additions and 4 deletions

View File

@@ -88,7 +88,7 @@ class VoiceState extends Base {
if ('self_video' in data) {
/**
* Whether this member is streaming using "Screen Share"
* @type {boolean}
* @type {?boolean}
*/
this.streaming = data.self_stream ?? false;
} else {
@@ -108,9 +108,11 @@ class VoiceState extends Base {
if ('suppress' in data) {
/**
* Whether this member is suppressed from speaking. This property is specific to stage channels only.
* @type {boolean}
* @type {?boolean}
*/
this.suppress = data.suppress;
} else {
this.suppress ??= null;
}
if ('request_to_speak_timestamp' in data) {

View File

@@ -2506,9 +2506,9 @@ export class VoiceState extends Base {
public serverDeaf: boolean | null;
public serverMute: boolean | null;
public sessionId: string | null;
public streaming: boolean;
public streaming: boolean | null;
public selfVideo: boolean | null;
public suppress: boolean;
public suppress: boolean | null;
public requestToSpeakTimestamp: number | null;
public setDeaf(deaf?: boolean, reason?: string): Promise<GuildMember>;