Skip to content

Commit

Permalink
fix(VoiceState): Ensure suppress & streaming have proper fallback…
Browse files Browse the repository at this point in the history
… values (#6377)
  • Loading branch information
Jiralite committed Jan 7, 2022
1 parent 6085b4f commit a0d5f13
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions packages/discord.js/src/structures/VoiceState.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions packages/discord.js/typings/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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>;
Expand Down

0 comments on commit a0d5f13

Please sign in to comment.