fix(WidgetMember): Default to null and not undefined (#6399)

This commit is contained in:
Jiralite
2021-08-12 15:06:11 +01:00
committed by GitHub
parent 4a64662a7d
commit 44bbfa5c46
2 changed files with 16 additions and 16 deletions

View File

@@ -53,37 +53,37 @@ class WidgetMember extends Base {
* IIf the member is server deafened * IIf the member is server deafened
* @type {?boolean} * @type {?boolean}
*/ */
this.deaf = data.deaf; this.deaf = data.deaf ?? null;
/** /**
* If the member is server muted * If the member is server muted
* @type {?boolean} * @type {?boolean}
*/ */
this.mute = data.mute; this.mute = data.mute ?? null;
/** /**
* If the member is self deafened * If the member is self deafened
* @type {?boolean} * @type {?boolean}
*/ */
this.selfDeaf = data.self_deaf; this.selfDeaf = data.self_deaf ?? null;
/** /**
* If the member is self muted * If the member is self muted
* @type {?boolean} * @type {?boolean}
*/ */
this.selfMute = data.self_mute; this.selfMute = data.self_mute ?? null;
/** /**
* If the member is suppressed * If the member is suppressed
* @type {?boolean} * @type {?boolean}
*/ */
this.suppress = data.suppress; this.suppress = data.suppress ?? null;
/** /**
* The id of the voice channel the member is in, if any * The id of the voice channel the member is in, if any
* @type {?Snowflake} * @type {?Snowflake}
*/ */
this.channelId = data.channel_id; this.channelId = data.channel_id ?? null;
/** /**
* The avatar URL of the member. * The avatar URL of the member.
@@ -95,7 +95,7 @@ class WidgetMember extends Base {
* The activity of the member. * The activity of the member.
* @type {?WidgetActivity} * @type {?WidgetActivity}
*/ */
this.activity = data.activity; this.activity = data.activity ?? null;
} }
} }

18
typings/index.d.ts vendored
View File

@@ -130,7 +130,7 @@ import {
RawWelcomeChannelData, RawWelcomeChannelData,
RawWelcomeScreenData, RawWelcomeScreenData,
RawWidgetData, RawWidgetData,
RawWidgetMemberData RawWidgetMemberData,
} from './rawDataTypes'; } from './rawDataTypes';
//#region Classes //#region Classes
@@ -2109,16 +2109,16 @@ export class WidgetMember extends Base {
public id: string; public id: string;
public username: string; public username: string;
public discriminator: string; public discriminator: string;
public avatar?: string; public avatar: string | null;
public status: PresenceStatus; public status: PresenceStatus;
public deaf?: boolean; public deaf: boolean | null;
public mute?: boolean; public mute: boolean | null;
public selfDeaf?: boolean; public selfDeaf: boolean | null;
public selfMute?: boolean; public selfMute: boolean | null;
public suppress?: boolean; public suppress: boolean | null;
public channelId?: Snowflake; public channelId: Snowflake | null;
public avatarURL: string; public avatarURL: string;
public activity?: WidgetActivity; public activity: WidgetActivity | null;
} }
export class WelcomeChannel extends Base { export class WelcomeChannel extends Base {