From 84b6842db042ada08de5ae34e8cf30c3e92905cd Mon Sep 17 00:00:00 2001 From: March 7th <71698422+aiko-chan-ai@users.noreply.github.com> Date: Fri, 16 Sep 2022 19:06:42 +0700 Subject: [PATCH] fix(VoiceState): correct data --- src/structures/VoiceState.js | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/src/structures/VoiceState.js b/src/structures/VoiceState.js index f952946..c3a546e 100644 --- a/src/structures/VoiceState.js +++ b/src/structures/VoiceState.js @@ -63,6 +63,16 @@ class VoiceState extends Base { this.selfMute ??= null; } + if ('self_stream' in data) { + /** + * Whether this member is streaming using "Go Live" + * @type {?boolean} + */ + this.streaming = data.self_stream; + } else { + this.streaming ??= null; + } + if ('self_video' in data) { /** * Whether this member's camera is enabled @@ -83,18 +93,6 @@ class VoiceState extends Base { this.sessionId ??= null; } - // The self_stream is property is omitted if false, check for another property - // here to avoid incorrectly clearing this when partial data is specified - if ('self_video' in data) { - /** - * Whether this member is streaming using "Screen Share" - * @type {boolean} - */ - this.streaming = data.self_stream ?? false; - } else { - this.streaming ??= null; - } - if ('channel_id' in data) { /** * The {@link VoiceChannel} or {@link StageChannel} id the member is in