Contact
Source: Structures/
Represents a Contact on WhatsApp
Properties
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
block() → Promise containing boolean
Blocks this contact from WhatsApp
- Returns
-
Promise containing boolean
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
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
getCommonGroups() → Promise containing Array of WAWebJS.ChatId
Gets the Contact's common groups with you. Returns empty array if you don't have any common group.
- Returns
-
Promise containing Array of WAWebJS.ChatId
getCountryCode() → Promise containing string
Returns the contact's countrycode, ([email protected]) => (1)
- Returns
-
Promise containing string
getFormattedNumber() → Promise containing string
Returns the contact's formatted phone number, ([email protected]) => (+1 (234) 5678-901)
- Returns
-
Promise containing string
getProfilePicUrl() → Promise containing string
Returns the contact's profile picture URL, if privacy settings allow it
- Returns
-
Promise containing string
unblock() → Promise containing boolean
Unblocks this contact from WhatsApp
- Returns
-
Promise containing boolean