Fix member nick type
This commit is contained in:
parent
be3a793fa1
commit
2a38fc1e00
2 changed files with 4 additions and 4 deletions
|
@ -18,7 +18,7 @@ export interface MemberData {
|
||||||
export class Member extends SnowflakeBase {
|
export class Member extends SnowflakeBase {
|
||||||
id: string
|
id: string
|
||||||
user: User
|
user: User
|
||||||
nick?: string
|
nick: string | null
|
||||||
roles: MemberRolesManager
|
roles: MemberRolesManager
|
||||||
joinedAt: string
|
joinedAt: string
|
||||||
premiumSince?: string
|
premiumSince?: string
|
||||||
|
@ -49,7 +49,7 @@ export class Member extends SnowflakeBase {
|
||||||
}
|
}
|
||||||
|
|
||||||
get displayName(): string {
|
get displayName(): string {
|
||||||
return this.nick !== undefined ? this.nick : this.user.username
|
return this.nick !== null ? this.nick : this.user.username
|
||||||
}
|
}
|
||||||
|
|
||||||
toString(): string {
|
toString(): string {
|
||||||
|
@ -95,7 +95,7 @@ export class Member extends SnowflakeBase {
|
||||||
)
|
)
|
||||||
if (res.ok === true) {
|
if (res.ok === true) {
|
||||||
if (data.nick !== undefined)
|
if (data.nick !== undefined)
|
||||||
this.nick = data.nick === null ? undefined : data.nick
|
this.nick = data.nick === null ? null : data.nick
|
||||||
if (data.deaf !== undefined) this.deaf = data.deaf
|
if (data.deaf !== undefined) this.deaf = data.deaf
|
||||||
if (data.mute !== undefined) this.mute = data.mute
|
if (data.mute !== undefined) this.mute = data.mute
|
||||||
}
|
}
|
||||||
|
|
|
@ -67,7 +67,7 @@ export interface GuildPayload {
|
||||||
|
|
||||||
export interface MemberPayload {
|
export interface MemberPayload {
|
||||||
user: UserPayload
|
user: UserPayload
|
||||||
nick?: string
|
nick: string | null
|
||||||
roles: string[]
|
roles: string[]
|
||||||
joined_at: string
|
joined_at: string
|
||||||
premium_since?: string
|
premium_since?: string
|
||||||
|
|
Loading…
Reference in a new issue