new Contact()

Extends
Base

Properties

id  ContactId

ID that represents the contact

isBlocked  boolean

Indicates if you have blocked this contact

isBusiness  boolean

Indicates if the contact is a business contact

isEnterprise  boolean

Indicates if the contact is an enterprise contact

isGroup  boolean

Indicates if the contact is a group contact

isMe  boolean

Indicates if the contact is the current user's contact

isMyContact  boolean

Indicates if the number is saved in the current phone's contacts

isUser  boolean

Indicates if the contact is a user contact

isWAContact  boolean

Indicates if the number is registered on WhatsApp

name  nullable string

The contact's name, as saved by the current user

number  string

Contact's phone number

pushname  string

The name that the contact has configured to be shown publically

shortName  nullable string

A shortened version of name

Methods

async

block() → Promise containing boolean

Blocks this contact from WhatsApp

Returns

Promise containing boolean 

async

getAbout() → Promise containing nullable string

Gets the Contact's current "about" info. Returns null if you don't have permission to read their status.

Returns

Promise containing nullable string 

async

getChat() → Promise containing Chat

Returns the Chat that corresponds to this Contact. Will return null when getting chat for currently logged in user.

Returns

Promise containing Chat 

async

getProfilePicUrl() → Promise containing string

Returns the contact's profile picture URL, if privacy settings allow it

Returns

Promise containing string 

async

unblock() → Promise containing boolean

Unblocks this contact from WhatsApp

Returns

Promise containing boolean