Skip to content

Commit

Permalink
fix(WidgetMember): Default to null and not undefined (#6399)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jiralite committed Aug 12, 2021
1 parent 4a64662 commit 44bbfa5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
14 changes: 7 additions & 7 deletions src/structures/WidgetMember.js
Expand Up @@ -53,37 +53,37 @@ class WidgetMember extends Base {
* IIf the member is server deafened
* @type {?boolean}
*/
this.deaf = data.deaf;
this.deaf = data.deaf ?? null;

/**
* If the member is server muted
* @type {?boolean}
*/
this.mute = data.mute;
this.mute = data.mute ?? null;

/**
* If the member is self deafened
* @type {?boolean}
*/
this.selfDeaf = data.self_deaf;
this.selfDeaf = data.self_deaf ?? null;

/**
* If the member is self muted
* @type {?boolean}
*/
this.selfMute = data.self_mute;
this.selfMute = data.self_mute ?? null;

/**
* If the member is suppressed
* @type {?boolean}
*/
this.suppress = data.suppress;
this.suppress = data.suppress ?? null;

/**
* The id of the voice channel the member is in, if any
* @type {?Snowflake}
*/
this.channelId = data.channel_id;
this.channelId = data.channel_id ?? null;

/**
* The avatar URL of the member.
Expand All @@ -95,7 +95,7 @@ class WidgetMember extends Base {
* The activity of the member.
* @type {?WidgetActivity}
*/
this.activity = data.activity;
this.activity = data.activity ?? null;
}
}

Expand Down
18 changes: 9 additions & 9 deletions typings/index.d.ts
Expand Up @@ -130,7 +130,7 @@ import {
RawWelcomeChannelData,
RawWelcomeScreenData,
RawWidgetData,
RawWidgetMemberData
RawWidgetMemberData,
} from './rawDataTypes';

//#region Classes
Expand Down Expand Up @@ -2109,16 +2109,16 @@ export class WidgetMember extends Base {
public id: string;
public username: string;
public discriminator: string;
public avatar?: string;
public avatar: string | null;
public status: PresenceStatus;
public deaf?: boolean;
public mute?: boolean;
public selfDeaf?: boolean;
public selfMute?: boolean;
public suppress?: boolean;
public channelId?: Snowflake;
public deaf: boolean | null;
public mute: boolean | null;
public selfDeaf: boolean | null;
public selfMute: boolean | null;
public suppress: boolean | null;
public channelId: Snowflake | null;
public avatarURL: string;
public activity?: WidgetActivity;
public activity: WidgetActivity | null;
}

export class WelcomeChannel extends Base {
Expand Down

0 comments on commit 44bbfa5

Please sign in to comment.