Files
whatsapp-web.js/docs/Contact.html
2022-06-21 01:36:19 -04:00

308 lines
15 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!doctype html>
<html>
<head>
<meta name="generator" content="JSDoc 3.6.7">
<meta charset="utf-8">
<title>whatsapp-web.js 1.17.0 &raquo; Class: Contact</title>
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
<link href="css/baseline.css" rel="stylesheet">
</head>
<body onload="prettyPrint()">
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
<div id="jsdoc-navbar-container">
<div id="jsdoc-navbar-content">
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>17.<wbr>0</a>
</div>
</div>
</nav>
<div id="jsdoc-body-container">
<div id="jsdoc-content">
<div id="jsdoc-content-container">
<div id="jsdoc-main" role="main">
<header class="page-header">
<div class="symbol-detail-labels"><span class="label label-kind">class</span></div>
<h1><small></small><span class="symbol-name">Contact</span></h1>
<p class="source-link">Source: <a href="structures_Contact.js.html#source-line-17">structures/<wbr>Contact.<wbr>js:17</a></p>
<div class="symbol-classdesc">
<p>Represents a Contact on WhatsApp</p>
</div>
<dl class="dl-compact">
</dl>
</header>
<section id="summary">
<div class="summary-callout">
<h2 class="summary-callout-heading">Properties</h2>
<div class="summary-content">
<div class="summary-column">
<dl class="dl-summary-callout">
<dt><a href="Contact.html#id">id</a></dt>
<dd>
</dd>
<dt><a href="Contact.html#isBlocked">isBlocked</a></dt>
<dd>
</dd>
<dt><a href="Contact.html#isBusiness">isBusiness</a></dt>
<dd>
</dd>
<dt><a href="Contact.html#isEnterprise">isEnterprise</a></dt>
<dd>
</dd>
<dt><a href="Contact.html#isGroup">isGroup</a></dt>
<dd>
</dd>
</dl>
</div>
<div class="summary-column">
<dl class="dl-summary-callout">
<dt><a href="Contact.html#isMe">isMe</a></dt>
<dd>
</dd>
<dt><a href="Contact.html#isMyContact">isMyContact</a></dt>
<dd>
</dd>
<dt><a href="Contact.html#isUser">isUser</a></dt>
<dd>
</dd>
<dt><a href="Contact.html#isWAContact">isWAContact</a></dt>
<dd>
</dd>
<dt><a href="Contact.html#name">name</a></dt>
<dd>
</dd>
</dl>
</div>
<div class="summary-column">
<dl class="dl-summary-callout">
<dt><a href="Contact.html#number">number</a></dt>
<dd>
</dd>
<dt><a href="Contact.html#pushname">pushname</a></dt>
<dd>
</dd>
<dt><a href="Contact.html#shortName">shortName</a></dt>
<dd>
</dd>
</dl>
</div>
</div>
</div>
<div class="summary-callout">
<h2 class="summary-callout-heading">Methods</h2>
<div class="summary-content">
<div class="summary-column">
<dl class="dl-summary-callout">
<dt><a href="Contact.html#block">block()</a></dt>
<dd>
</dd>
<dt><a href="Contact.html#getAbout">getAbout()</a></dt>
<dd>
</dd>
<dt><a href="Contact.html#getChat">getChat()</a></dt>
<dd>
</dd>
</dl>
</div>
<div class="summary-column">
<dl class="dl-summary-callout">
<dt><a href="Contact.html#getCommonGroups">getCommonGroups()</a></dt>
<dd>
</dd>
<dt><a href="Contact.html#getCountryCode">getCountryCode()</a></dt>
<dd>
</dd>
<dt><a href="Contact.html#getFormattedNumber">getFormattedNumber()</a></dt>
<dd>
</dd>
</dl>
</div>
<div class="summary-column">
<dl class="dl-summary-callout">
<dt><a href="Contact.html#getProfilePicUrl">getProfilePicUrl()</a></dt>
<dd>
</dd>
<dt><a href="Contact.html#unblock">unblock()</a></dt>
<dd>
</dd>
</dl>
</div>
</div>
</div>
</section>
<section>
<h2 id="Contact">new&nbsp;<span class="symbol-name">Contact</span><span class="signature"><span class="signature-params">()</span></span></h2>
<dl class="dl-compact">
<dt>Extends</dt>
<dd><a href="Base.html">Base</a></dd>
</dl>
</section>
<section>
<h2>Properties</h2>
<section>
<h3 id="id"><span class="symbol-name">id</span><small class="property-type">
&nbsp;<a href="global.html#ContactId">ContactId</a></small></h3>
<p>ID that represents the contact</p>
<dl class="dl-compact">
</dl>
<h3 id="isBlocked"><span class="symbol-name">isBlocked</span><small class="property-type">
&nbsp;boolean</small></h3>
<p>Indicates if you have blocked this contact</p>
<dl class="dl-compact">
</dl>
<h3 id="isBusiness"><span class="symbol-name">isBusiness</span><small class="property-type">
&nbsp;boolean</small></h3>
<p>Indicates if the contact is a business contact</p>
<dl class="dl-compact">
</dl>
<h3 id="isEnterprise"><span class="symbol-name">isEnterprise</span><small class="property-type">
&nbsp;boolean</small></h3>
<p>Indicates if the contact is an enterprise contact</p>
<dl class="dl-compact">
</dl>
<h3 id="isGroup"><span class="symbol-name">isGroup</span><small class="property-type">
&nbsp;boolean</small></h3>
<p>Indicates if the contact is a group contact</p>
<dl class="dl-compact">
</dl>
<h3 id="isMe"><span class="symbol-name">isMe</span><small class="property-type">
&nbsp;boolean</small></h3>
<p>Indicates if the contact is the current user's contact</p>
<dl class="dl-compact">
</dl>
<h3 id="isMyContact"><span class="symbol-name">isMyContact</span><small class="property-type">
&nbsp;boolean</small></h3>
<p>Indicates if the number is saved in the current phone's contacts</p>
<dl class="dl-compact">
</dl>
<h3 id="isUser"><span class="symbol-name">isUser</span><small class="property-type">
&nbsp;boolean</small></h3>
<p>Indicates if the contact is a user contact</p>
<dl class="dl-compact">
</dl>
<h3 id="isWAContact"><span class="symbol-name">isWAContact</span><small class="property-type">
&nbsp;boolean</small></h3>
<p>Indicates if the number is registered on WhatsApp</p>
<dl class="dl-compact">
</dl>
<h3 id="name"><span class="symbol-name">name</span><small class="property-type">
&nbsp;nullable string</small></h3>
<p>The contact's name, as saved by the current user</p>
<dl class="dl-compact">
</dl>
<h3 id="number"><span class="symbol-name">number</span><small class="property-type">
&nbsp;string</small></h3>
<p>Contact's phone number</p>
<dl class="dl-compact">
</dl>
<h3 id="pushname"><span class="symbol-name">pushname</span><small class="property-type">
&nbsp;string</small></h3>
<p>The name that the contact has configured to be shown publically</p>
<dl class="dl-compact">
</dl>
<h3 id="shortName"><span class="symbol-name">shortName</span><small class="property-type">
&nbsp;nullable string</small></h3>
<p>A shortened version of name</p>
<dl class="dl-compact">
</dl>
</section>
<h2>Methods</h2>
<section>
<div class="symbol-detail-labels"><span class="label label-async">async</span></div>
<h3 id="block"><span class="symbol-name">block</span><span class="signature"><span class="signature-params">()</span>&nbsp;&rarr; <span class="signature-returns"> Promise containing boolean</span></span></h3>
<p>Blocks this contact from WhatsApp</p>
<dl class="dl-compact">
<dt>Returns</dt>
<dd>
<p><code>Promise containing boolean</code> </p>
</dd>
</dl>
<div class="symbol-detail-labels"><span class="label label-async">async</span></div>
<h3 id="getAbout"><span class="symbol-name">getAbout</span><span class="signature"><span class="signature-params">()</span>&nbsp;&rarr; <span class="signature-returns"> Promise containing nullable string</span></span></h3>
<p>Gets the Contact's current &quot;about&quot; info. Returns null if you don't have permission to read their status.</p>
<dl class="dl-compact">
<dt>Returns</dt>
<dd>
<p><code>Promise containing nullable string</code> </p>
</dd>
</dl>
<div class="symbol-detail-labels"><span class="label label-async">async</span></div>
<h3 id="getChat"><span class="symbol-name">getChat</span><span class="signature"><span class="signature-params">()</span>&nbsp;&rarr; <span class="signature-returns"> Promise containing <a href="Chat.html">Chat</a></span></span></h3>
<p>Returns the Chat that corresponds to this Contact.
Will return null when getting chat for currently logged in user.</p>
<dl class="dl-compact">
<dt>Returns</dt>
<dd>
<p><code>Promise containing <a href="Chat.html">Chat</a></code> </p>
</dd>
</dl>
<div class="symbol-detail-labels"><span class="label label-async">async</span></div>
<h3 id="getCommonGroups"><span class="symbol-name">getCommonGroups</span><span class="signature"><span class="signature-params">()</span>&nbsp;&rarr; <span class="signature-returns"> Promise containing Array of WAWebJS.ChatId</span></span></h3>
<p>Gets the Contact's common groups with you. Returns empty array if you don't have any common group.</p>
<dl class="dl-compact">
<dt>Returns</dt>
<dd>
<p><code>Promise containing Array of WAWebJS.ChatId</code> </p>
</dd>
</dl>
<div class="symbol-detail-labels"><span class="label label-async">async</span></div>
<h3 id="getCountryCode"><span class="symbol-name">getCountryCode</span><span class="signature"><span class="signature-params">()</span>&nbsp;&rarr; <span class="signature-returns"> Promise containing string</span></span></h3>
<p>Returns the contact's countrycode, (1541859685@c.us) =&gt; (1)</p>
<dl class="dl-compact">
<dt>Returns</dt>
<dd>
<p><code>Promise containing string</code> </p>
</dd>
</dl>
<div class="symbol-detail-labels"><span class="label label-async">async</span></div>
<h3 id="getFormattedNumber"><span class="symbol-name">getFormattedNumber</span><span class="signature"><span class="signature-params">()</span>&nbsp;&rarr; <span class="signature-returns"> Promise containing string</span></span></h3>
<p>Returns the contact's formatted phone number, (12345678901@c.us) =&gt; (+1 (234) 5678-901)</p>
<dl class="dl-compact">
<dt>Returns</dt>
<dd>
<p><code>Promise containing string</code> </p>
</dd>
</dl>
<div class="symbol-detail-labels"><span class="label label-async">async</span></div>
<h3 id="getProfilePicUrl"><span class="symbol-name">getProfilePicUrl</span><span class="signature"><span class="signature-params">()</span>&nbsp;&rarr; <span class="signature-returns"> Promise containing string</span></span></h3>
<p>Returns the contact's profile picture URL, if privacy settings allow it</p>
<dl class="dl-compact">
<dt>Returns</dt>
<dd>
<p><code>Promise containing string</code> </p>
</dd>
</dl>
<div class="symbol-detail-labels"><span class="label label-async">async</span></div>
<h3 id="unblock"><span class="symbol-name">unblock</span><span class="signature"><span class="signature-params">()</span>&nbsp;&rarr; <span class="signature-returns"> Promise containing boolean</span></span></h3>
<p>Unblocks this contact from WhatsApp</p>
<dl class="dl-compact">
<dt>Returns</dt>
<dd>
<p><code>Promise containing boolean</code> </p>
</dd>
</dl>
</section>
</section>
</div>
</div>
<nav id="jsdoc-toc-nav" role="navigation"></nav>
</div>
</div>
<footer id="jsdoc-footer" class="jsdoc-footer">
<div id="jsdoc-footer-container">
<p>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on June 21, 2022.
</p>
</div>
</footer>
<script src="scripts/jquery.min.js"></script>
<script src="scripts/tree.jquery.js"></script>
<script src="scripts/prettify.js"></script>
<script src="scripts/jsdoc-toc.js"></script>
<script src="scripts/linenumber.js"></script>
<script src="scripts/scrollanchor.js"></script>
</body>
</html>