mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
fix(VoiceState): Ensure suppress & streaming have proper fallback values (#6377)
This commit is contained in:
@@ -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) {
|
||||
|
||||
4
packages/discord.js/typings/index.d.ts
vendored
4
packages/discord.js/typings/index.d.ts
vendored
@@ -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>;
|
||||
|
||||
Reference in New Issue
Block a user