diff --git a/packages/core/src/highlevel/types/peers/chat.ts b/packages/core/src/highlevel/types/peers/chat.ts index 09b29afb..a3badd2f 100644 --- a/packages/core/src/highlevel/types/peers/chat.ts +++ b/packages/core/src/highlevel/types/peers/chat.ts @@ -291,13 +291,14 @@ export class Chat { /** * Title, for supergroups, channels and groups + * (`null` for private chats) */ get title(): string | null { return this.peer._ !== 'user' ? this.peer.title ?? null : null } /** - * Username, for private chats, bots, supergroups and channels if available + * Username, for private chats, bots, supergroups and channels (if available) */ get username(): string | null { if (!('username' in this.peer)) return null @@ -320,6 +321,7 @@ export class Chat { /** * First name of the other party in a private chat, * for private chats and bots + * (`null` for supergroups and channels) */ get firstName(): string | null { return this.peer._ === 'user' ? this.peer.firstName ?? null : null @@ -327,6 +329,7 @@ export class Chat { /** * Last name of the other party in a private chat, for private chats + * (`null` for supergroups and channels) */ get lastName(): string | null { return this.peer._ === 'user' ? this.peer.lastName ?? null : null diff --git a/packages/core/src/highlevel/types/peers/full-chat.ts b/packages/core/src/highlevel/types/peers/full-chat.ts index 87d0cdcc..a84a6485 100644 --- a/packages/core/src/highlevel/types/peers/full-chat.ts +++ b/packages/core/src/highlevel/types/peers/full-chat.ts @@ -138,8 +138,8 @@ export class FullChat extends Chat { * Bio of the other party in a private chat, or description of a * group, supergroup or channel. */ - get bio(): string | null { - return this.fullPeer?.about ?? null + get bio(): string { + return this.fullPeer.about ?? '' } /**