mirror of
https://github.com/cheveguerra/whatsapp-web.js.git
synced 2026-04-18 03:29:14 +00:00
Compare commits
44 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
995abbf4a6 | ||
|
|
8599a6d918 | ||
|
|
5e9deff8a9 | ||
|
|
539849732c | ||
|
|
4fe7fa93b9 | ||
|
|
2820d3e72a | ||
|
|
cde5719bb6 | ||
|
|
8bdecadba4 | ||
|
|
b41414cfbf | ||
|
|
c61f447a93 | ||
|
|
49aacec4a7 | ||
|
|
d7a3e1a9a3 | ||
|
|
e14b49c5df | ||
|
|
f34902dfdd | ||
|
|
6e76fece91 | ||
|
|
98458f760e | ||
|
|
48b9ae1e81 | ||
|
|
588dc93c17 | ||
|
|
16fe865a9c | ||
|
|
b07b38bbe8 | ||
|
|
d35f101fac | ||
|
|
72441beb37 | ||
|
|
794c9e16fc | ||
|
|
05f57d2f39 | ||
|
|
130da046f5 | ||
|
|
bb40218c66 | ||
|
|
ad3834e575 | ||
|
|
e6ef5929fc | ||
|
|
bb4ad11bfa | ||
|
|
1ebaf56617 | ||
|
|
60ee2ca522 | ||
|
|
132424ea08 | ||
|
|
5c9e76e23f | ||
|
|
37932d9a69 | ||
|
|
3c500a6474 | ||
|
|
1c60c83e80 | ||
|
|
69d7b3e50b | ||
|
|
0b1f06a932 | ||
|
|
1840826e2b | ||
|
|
6ade08e814 | ||
|
|
9891d85b35 | ||
|
|
67784bc797 | ||
|
|
e385563883 | ||
|
|
d5a26add20 |
@@ -1,4 +1,4 @@
|
|||||||
[](https://www.npmjs.com/package/whatsapp-web.js) [](https://depfu.com/github/pedroslopez/whatsapp-web.js?project_id=9765) 
|
[](https://www.npmjs.com/package/whatsapp-web.js) [](https://depfu.com/github/pedroslopez/whatsapp-web.js?project_id=9765) 
|
||||||
|
|
||||||
# whatsapp-web.js
|
# whatsapp-web.js
|
||||||
A WhatsApp API client that connects through the WhatsApp Web browser app
|
A WhatsApp API client that connects through the WhatsApp Web browser app
|
||||||
@@ -46,7 +46,7 @@ Take a look at [example.js](https://github.com/pedroslopez/whatsapp-web.js/blob/
|
|||||||
| Send messages | ✅ |
|
| Send messages | ✅ |
|
||||||
| Receive messages | ✅ |
|
| Receive messages | ✅ |
|
||||||
| Send media (images/audio/documents) | ✅ |
|
| Send media (images/audio/documents) | ✅ |
|
||||||
| Send media (video) | _pending_ |
|
| Send media (video) | ✅ (requires google chrome) |
|
||||||
| Send stickers | _pending_ |
|
| Send stickers | _pending_ |
|
||||||
| Receive media (images/audio/video/documents) | ✅ |
|
| Receive media (images/audio/video/documents) | ✅ |
|
||||||
| Send contact cards | _pending_ |
|
| Send contact cards | _pending_ |
|
||||||
|
|||||||
BIN
docs/._Contact.html
Normal file
BIN
docs/._Contact.html
Normal file
Binary file not shown.
@@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta name="generator" content="JSDoc 3.6.3">
|
<meta name="generator" content="JSDoc 3.6.3">
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>whatsapp-web.js 1.0.2 » Class: Base</title>
|
<title>whatsapp-web.js 1.2.4 » Class: Base</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/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/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 rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
||||||
<div id="jsdoc-navbar-container">
|
<div id="jsdoc-navbar-container">
|
||||||
<div id="jsdoc-navbar-content">
|
<div id="jsdoc-navbar-content">
|
||||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>0.<wbr>2</a>
|
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>2.<wbr>4</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
@@ -50,7 +50,7 @@
|
|||||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||||
<div id="jsdoc-footer-container">
|
<div id="jsdoc-footer-container">
|
||||||
<p>
|
<p>
|
||||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.3 on February 10, 2020.
|
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.3 on March 14, 2020.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta name="generator" content="JSDoc 3.6.3">
|
<meta name="generator" content="JSDoc 3.6.3">
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>whatsapp-web.js 1.0.2 » Class: BusinessContact</title>
|
<title>whatsapp-web.js 1.2.4 » Class: BusinessContact</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/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/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 rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
||||||
<div id="jsdoc-navbar-container">
|
<div id="jsdoc-navbar-container">
|
||||||
<div id="jsdoc-navbar-content">
|
<div id="jsdoc-navbar-content">
|
||||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>0.<wbr>2</a>
|
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>2.<wbr>4</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
@@ -227,7 +227,7 @@
|
|||||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||||
<div id="jsdoc-footer-container">
|
<div id="jsdoc-footer-container">
|
||||||
<p>
|
<p>
|
||||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.3 on February 10, 2020.
|
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.3 on March 14, 2020.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
180
docs/Chat.html
180
docs/Chat.html
@@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta name="generator" content="JSDoc 3.6.3">
|
<meta name="generator" content="JSDoc 3.6.3">
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>whatsapp-web.js 1.0.2 » Class: Chat</title>
|
<title>whatsapp-web.js 1.2.4 » Class: Chat</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/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/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 rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
||||||
<div id="jsdoc-navbar-container">
|
<div id="jsdoc-navbar-container">
|
||||||
<div id="jsdoc-navbar-content">
|
<div id="jsdoc-navbar-content">
|
||||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>0.<wbr>2</a>
|
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>2.<wbr>4</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
@@ -26,7 +26,7 @@
|
|||||||
<header class="page-header">
|
<header class="page-header">
|
||||||
<div class="symbol-detail-labels"><span class="label label-kind">class</span></div>
|
<div class="symbol-detail-labels"><span class="label label-kind">class</span></div>
|
||||||
<h1><small></small><span class="symbol-name">Chat</span></h1>
|
<h1><small></small><span class="symbol-name">Chat</span></h1>
|
||||||
<p class="source-link">Source: <a href="structures_Chat.js.html#source-line-10">structures/<wbr>Chat.<wbr>js:10</a></p>
|
<p class="source-link">Source: <a href="structures_Chat.js.html#source-line-11">structures/<wbr>Chat.<wbr>js:11</a></p>
|
||||||
<div class="symbol-classdesc">
|
<div class="symbol-classdesc">
|
||||||
<p>Represents a Chat on WhatsApp</p>
|
<p>Represents a Chat on WhatsApp</p>
|
||||||
</div>
|
</div>
|
||||||
@@ -39,6 +39,9 @@
|
|||||||
<div class="summary-content">
|
<div class="summary-content">
|
||||||
<div class="summary-column">
|
<div class="summary-column">
|
||||||
<dl class="dl-summary-callout">
|
<dl class="dl-summary-callout">
|
||||||
|
<dt><a href="Chat.html#archived">archived</a></dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
<dt><a href="Chat.html#id">id</a></dt>
|
<dt><a href="Chat.html#id">id</a></dt>
|
||||||
<dd>
|
<dd>
|
||||||
</dd>
|
</dd>
|
||||||
@@ -55,13 +58,13 @@
|
|||||||
<dt><a href="Chat.html#name">name</a></dt>
|
<dt><a href="Chat.html#name">name</a></dt>
|
||||||
<dd>
|
<dd>
|
||||||
</dd>
|
</dd>
|
||||||
|
<dt><a href="Chat.html#timestamp">timestamp</a></dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
</div>
|
</div>
|
||||||
<div class="summary-column">
|
<div class="summary-column">
|
||||||
<dl class="dl-summary-callout">
|
<dl class="dl-summary-callout">
|
||||||
<dt><a href="Chat.html#timestamp">timestamp</a></dt>
|
|
||||||
<dd>
|
|
||||||
</dd>
|
|
||||||
<dt><a href="Chat.html#unreadCount">unreadCount</a></dt>
|
<dt><a href="Chat.html#unreadCount">unreadCount</a></dt>
|
||||||
<dd>
|
<dd>
|
||||||
</dd>
|
</dd>
|
||||||
@@ -70,18 +73,49 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="summary-callout">
|
<div class="summary-callout">
|
||||||
<h2 class="summary-callout-heading">Method</h2>
|
<h2 class="summary-callout-heading">Methods</h2>
|
||||||
<div class="summary-content">
|
<div class="summary-content">
|
||||||
<div class="summary-column">
|
<div class="summary-column">
|
||||||
<dl class="dl-summary-callout">
|
<dl class="dl-summary-callout">
|
||||||
<dt><a href="Chat.html#sendMessage">sendMessage(content, options)</a></dt>
|
<dt><a href="Chat.html#archive">archive()</a></dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
<dt><a href="Chat.html#clearMessages">clearMessages()</a></dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
<dt><a href="Chat.html#clearState">clearState()</a></dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
<dt><a href="Chat.html#delete">delete()</a></dt>
|
||||||
<dd>
|
<dd>
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
</div>
|
</div>
|
||||||
<div class="summary-column">
|
<div class="summary-column">
|
||||||
|
<dl class="dl-summary-callout">
|
||||||
|
<dt><a href="Chat.html#fetchMessages">fetchMessages(searchOptions)</a></dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
<dt><a href="Chat.html#sendMessage">sendMessage(content, options)</a></dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
<dt><a href="Chat.html#sendSeen">sendSeen()</a></dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
<dt><a href="Chat.html#sendStateRecording">sendStateRecording()</a></dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
</div>
|
</div>
|
||||||
<div class="summary-column">
|
<div class="summary-column">
|
||||||
|
<dl class="dl-summary-callout">
|
||||||
|
<dt><a href="Chat.html#sendStateTyping">sendStateTyping()</a></dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
<dt><a href="Chat.html#unarchive">unarchive()</a></dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -96,6 +130,11 @@
|
|||||||
<section>
|
<section>
|
||||||
<h2>Properties</h2>
|
<h2>Properties</h2>
|
||||||
<section>
|
<section>
|
||||||
|
<h3 id="archived"><span class="symbol-name">archived</span><small class="property-type">
|
||||||
|
boolean</small></h3>
|
||||||
|
<p>Indicates if the Chat is archived</p>
|
||||||
|
<dl class="dl-compact">
|
||||||
|
</dl>
|
||||||
<h3 id="id"><span class="symbol-name">id</span><small class="property-type">
|
<h3 id="id"><span class="symbol-name">id</span><small class="property-type">
|
||||||
object</small></h3>
|
object</small></h3>
|
||||||
<p>ID that represents the chat</p>
|
<p>ID that represents the chat</p>
|
||||||
@@ -127,8 +166,104 @@
|
|||||||
<dl class="dl-compact">
|
<dl class="dl-compact">
|
||||||
</dl>
|
</dl>
|
||||||
</section>
|
</section>
|
||||||
<h2>Method</h2>
|
<h2>Methods</h2>
|
||||||
<section>
|
<section>
|
||||||
|
<div class="symbol-detail-labels"><span class="label label-async">async</span></div>
|
||||||
|
<h3 id="archive"><span class="symbol-name">archive</span><span class="signature"><span class="signature-params">()</span></span></h3>
|
||||||
|
<p>Archives this chat</p>
|
||||||
|
<dl class="dl-compact">
|
||||||
|
</dl>
|
||||||
|
<div class="symbol-detail-labels"><span class="label label-async">async</span></div>
|
||||||
|
<h3 id="clearMessages"><span class="symbol-name">clearMessages</span><span class="signature"><span class="signature-params">()</span> → <span class="signature-returns"> Promise containing Boolean</span></span></h3>
|
||||||
|
<p>Clears all messages from the chat</p>
|
||||||
|
<dl class="dl-compact">
|
||||||
|
<dt>Returns</dt>
|
||||||
|
<dd>
|
||||||
|
<p><code>Promise containing Boolean</code> <p>result</p>
|
||||||
|
</p>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
<div class="symbol-detail-labels"><span class="label label-async">async</span></div>
|
||||||
|
<h3 id="clearState"><span class="symbol-name">clearState</span><span class="signature"><span class="signature-params">()</span></span></h3>
|
||||||
|
<p>Stops typing or recording in chat immediately.</p>
|
||||||
|
<dl class="dl-compact">
|
||||||
|
</dl>
|
||||||
|
<div class="symbol-detail-labels"><span class="label label-async">async</span></div>
|
||||||
|
<h3 id="delete"><span class="symbol-name">delete</span><span class="signature"><span class="signature-params">()</span> → <span class="signature-returns"> Promise containing Boolean</span></span></h3>
|
||||||
|
<p>Deletes the chat</p>
|
||||||
|
<dl class="dl-compact">
|
||||||
|
<dt>Returns</dt>
|
||||||
|
<dd>
|
||||||
|
<p><code>Promise containing Boolean</code> <p>result</p>
|
||||||
|
</p>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
<div class="symbol-detail-labels"><span class="label label-async">async</span></div>
|
||||||
|
<h3 id="fetchMessages"><span class="symbol-name">fetchMessages</span><span class="signature"><span class="signature-params">(searchOptions)</span> → <span class="signature-returns"> Promise containing Array of <a href="Message.html">Message</a></span></span></h3>
|
||||||
|
<p>Loads chat messages, sorted from earliest to latest.</p>
|
||||||
|
<section>
|
||||||
|
<h4>Parameters</h4>
|
||||||
|
<table class="jsdoc-details-table">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Name</th>
|
||||||
|
<th>Type</th>
|
||||||
|
<th>Optional</th>
|
||||||
|
<th>Description</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<p>searchOptions</p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p>Object</p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p> </p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p>Options for searching messages. Right now only limit is supported.</p>
|
||||||
|
<p>Values in <code>searchOptions</code> have the following properties:</p>
|
||||||
|
<table class="jsdoc-details-table">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Name</th>
|
||||||
|
<th>Type</th>
|
||||||
|
<th>Optional</th>
|
||||||
|
<th>Description</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<p>limit</p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p>Number</p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p>Yes</p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p>The amount of messages to return. Note that the actual number of returned messages may be smaller if there aren't enough messages in the conversation. Set this to Infinity to load all messages.</p>
|
||||||
|
<p>Defaults to <code>50</code>.</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</section>
|
||||||
|
<dl class="dl-compact">
|
||||||
|
<dt>Returns</dt>
|
||||||
|
<dd>
|
||||||
|
<p><code>Promise containing Array of <a href="Message.html">Message</a></code> </p>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
<div class="symbol-detail-labels"><span class="label label-async">async</span></div>
|
<div class="symbol-detail-labels"><span class="label label-async">async</span></div>
|
||||||
<h3 id="sendMessage"><span class="symbol-name">sendMessage</span><span class="signature"><span class="signature-params">(content, options)</span> → <span class="signature-returns"> Promise containing <a href="Message.html">Message</a></span></span></h3>
|
<h3 id="sendMessage"><span class="symbol-name">sendMessage</span><span class="signature"><span class="signature-params">(content, options)</span> → <span class="signature-returns"> Promise containing <a href="Message.html">Message</a></span></span></h3>
|
||||||
<p>Send a message to this chat</p>
|
<p>Send a message to this chat</p>
|
||||||
@@ -180,6 +315,31 @@
|
|||||||
</p>
|
</p>
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
|
<div class="symbol-detail-labels"><span class="label label-async">async</span></div>
|
||||||
|
<h3 id="sendSeen"><span class="symbol-name">sendSeen</span><span class="signature"><span class="signature-params">()</span> → <span class="signature-returns"> Promise containing Boolean</span></span></h3>
|
||||||
|
<p>Set the message as seen</p>
|
||||||
|
<dl class="dl-compact">
|
||||||
|
<dt>Returns</dt>
|
||||||
|
<dd>
|
||||||
|
<p><code>Promise containing Boolean</code> <p>result</p>
|
||||||
|
</p>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
<div class="symbol-detail-labels"><span class="label label-async">async</span></div>
|
||||||
|
<h3 id="sendStateRecording"><span class="symbol-name">sendStateRecording</span><span class="signature"><span class="signature-params">()</span></span></h3>
|
||||||
|
<p>Simulate recording audio in chat. This will last for 25 seconds.</p>
|
||||||
|
<dl class="dl-compact">
|
||||||
|
</dl>
|
||||||
|
<div class="symbol-detail-labels"><span class="label label-async">async</span></div>
|
||||||
|
<h3 id="sendStateTyping"><span class="symbol-name">sendStateTyping</span><span class="signature"><span class="signature-params">()</span></span></h3>
|
||||||
|
<p>Simulate typing in chat. This will last for 25 seconds.</p>
|
||||||
|
<dl class="dl-compact">
|
||||||
|
</dl>
|
||||||
|
<div class="symbol-detail-labels"><span class="label label-async">async</span></div>
|
||||||
|
<h3 id="unarchive"><span class="symbol-name">unarchive</span><span class="signature"><span class="signature-params">()</span></span></h3>
|
||||||
|
<p>un-archives this chat</p>
|
||||||
|
<dl class="dl-compact">
|
||||||
|
</dl>
|
||||||
</section>
|
</section>
|
||||||
</section>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
@@ -190,7 +350,7 @@
|
|||||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||||
<div id="jsdoc-footer-container">
|
<div id="jsdoc-footer-container">
|
||||||
<p>
|
<p>
|
||||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.3 on February 10, 2020.
|
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.3 on March 14, 2020.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
273
docs/Client.html
273
docs/Client.html
@@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta name="generator" content="JSDoc 3.6.3">
|
<meta name="generator" content="JSDoc 3.6.3">
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>whatsapp-web.js 1.0.2 » Class: Client</title>
|
<title>whatsapp-web.js 1.2.4 » Class: Client</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/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/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 rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
||||||
<div id="jsdoc-navbar-container">
|
<div id="jsdoc-navbar-container">
|
||||||
<div id="jsdoc-navbar-content">
|
<div id="jsdoc-navbar-content">
|
||||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>0.<wbr>2</a>
|
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>2.<wbr>4</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
@@ -42,38 +42,53 @@
|
|||||||
<dt><a href="Client.html#acceptInvite">acceptInvite(inviteCode)</a></dt>
|
<dt><a href="Client.html#acceptInvite">acceptInvite(inviteCode)</a></dt>
|
||||||
<dd>
|
<dd>
|
||||||
</dd>
|
</dd>
|
||||||
|
<dt><a href="Client.html#archiveChat">archiveChat()</a></dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
<dt><a href="Client.html#destroy">destroy()</a></dt>
|
<dt><a href="Client.html#destroy">destroy()</a></dt>
|
||||||
<dd>
|
<dd>
|
||||||
</dd>
|
</dd>
|
||||||
<dt><a href="Client.html#getChatById">getChatById(chatId)</a></dt>
|
<dt><a href="Client.html#getChatById">getChatById(chatId)</a></dt>
|
||||||
<dd>
|
<dd>
|
||||||
</dd>
|
</dd>
|
||||||
|
<dt><a href="Client.html#getChats">getChats()</a></dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
</div>
|
</div>
|
||||||
<div class="summary-column">
|
<div class="summary-column">
|
||||||
<dl class="dl-summary-callout">
|
<dl class="dl-summary-callout">
|
||||||
<dt><a href="Client.html#getChats">getChats()</a></dt>
|
|
||||||
<dd>
|
|
||||||
</dd>
|
|
||||||
<dt><a href="Client.html#getContactById">getContactById(contactId)</a></dt>
|
<dt><a href="Client.html#getContactById">getContactById(contactId)</a></dt>
|
||||||
<dd>
|
<dd>
|
||||||
</dd>
|
</dd>
|
||||||
<dt><a href="Client.html#getContacts">getContacts()</a></dt>
|
<dt><a href="Client.html#getContacts">getContacts()</a></dt>
|
||||||
<dd>
|
<dd>
|
||||||
</dd>
|
</dd>
|
||||||
|
<dt><a href="Client.html#getState">getState()</a></dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
<dt><a href="Client.html#initialize">initialize()</a></dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
<dt><a href="Client.html#resetState">resetState()</a></dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
</div>
|
</div>
|
||||||
<div class="summary-column">
|
<div class="summary-column">
|
||||||
<dl class="dl-summary-callout">
|
<dl class="dl-summary-callout">
|
||||||
<dt><a href="Client.html#initialize">initialize()</a></dt>
|
|
||||||
<dd>
|
|
||||||
</dd>
|
|
||||||
<dt><a href="Client.html#sendMessage">sendMessage(chatId, content, options)</a></dt>
|
<dt><a href="Client.html#sendMessage">sendMessage(chatId, content, options)</a></dt>
|
||||||
<dd>
|
<dd>
|
||||||
</dd>
|
</dd>
|
||||||
|
<dt><a href="Client.html#sendSeen">sendSeen(chatId)</a></dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
<dt><a href="Client.html#setStatus">setStatus(status)</a></dt>
|
<dt><a href="Client.html#setStatus">setStatus(status)</a></dt>
|
||||||
<dd>
|
<dd>
|
||||||
</dd>
|
</dd>
|
||||||
|
<dt><a href="Client.html#unarchiveChat">unarchiveChat()</a></dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -95,26 +110,38 @@
|
|||||||
<dt><a href="Client.html#event:disconnected">disconnected</a></dt>
|
<dt><a href="Client.html#event:disconnected">disconnected</a></dt>
|
||||||
<dd>
|
<dd>
|
||||||
</dd>
|
</dd>
|
||||||
|
<dt><a href="Client.html#event:group_join">group_join</a></dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
</div>
|
</div>
|
||||||
<div class="summary-column">
|
<div class="summary-column">
|
||||||
<dl class="dl-summary-callout">
|
<dl class="dl-summary-callout">
|
||||||
|
<dt><a href="Client.html#event:group_leave">group_leave</a></dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
<dt><a href="Client.html#event:group_update">group_update</a></dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
<dt><a href="Client.html#event:message">message</a></dt>
|
<dt><a href="Client.html#event:message">message</a></dt>
|
||||||
<dd>
|
<dd>
|
||||||
</dd>
|
</dd>
|
||||||
|
<dt><a href="Client.html#event:message_ack">message_ack</a></dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
<dt><a href="Client.html#event:message_create">message_create</a></dt>
|
<dt><a href="Client.html#event:message_create">message_create</a></dt>
|
||||||
<dd>
|
<dd>
|
||||||
</dd>
|
</dd>
|
||||||
|
</dl>
|
||||||
|
</div>
|
||||||
|
<div class="summary-column">
|
||||||
|
<dl class="dl-summary-callout">
|
||||||
<dt><a href="Client.html#event:message_revoke_everyone">message_revoke_everyone</a></dt>
|
<dt><a href="Client.html#event:message_revoke_everyone">message_revoke_everyone</a></dt>
|
||||||
<dd>
|
<dd>
|
||||||
</dd>
|
</dd>
|
||||||
<dt><a href="Client.html#event:message_revoke_me">message_revoke_me</a></dt>
|
<dt><a href="Client.html#event:message_revoke_me">message_revoke_me</a></dt>
|
||||||
<dd>
|
<dd>
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
|
||||||
</div>
|
|
||||||
<div class="summary-column">
|
|
||||||
<dl class="dl-summary-callout">
|
|
||||||
<dt><a href="Client.html#event:qr">qr</a></dt>
|
<dt><a href="Client.html#event:qr">qr</a></dt>
|
||||||
<dd>
|
<dd>
|
||||||
</dd>
|
</dd>
|
||||||
@@ -137,9 +164,13 @@
|
|||||||
<dd><a href="Client.html#event:auth_failure">Client#event:auth_failure</a></dd>
|
<dd><a href="Client.html#event:auth_failure">Client#event:auth_failure</a></dd>
|
||||||
<dd><a href="Client.html#event:ready">Client#event:ready</a></dd>
|
<dd><a href="Client.html#event:ready">Client#event:ready</a></dd>
|
||||||
<dd><a href="Client.html#event:message">Client#event:message</a></dd>
|
<dd><a href="Client.html#event:message">Client#event:message</a></dd>
|
||||||
|
<dd><a href="Client.html#event:message_ack">Client#event:message_ack</a></dd>
|
||||||
<dd><a href="Client.html#event:message_create">Client#event:message_create</a></dd>
|
<dd><a href="Client.html#event:message_create">Client#event:message_create</a></dd>
|
||||||
<dd><a href="Client.html#event:message_revoke_me">Client#event:message_revoke_me</a></dd>
|
<dd><a href="Client.html#event:message_revoke_me">Client#event:message_revoke_me</a></dd>
|
||||||
<dd><a href="Client.html#event:message_revoke_everyone">Client#event:message_revoke_everyone</a></dd>
|
<dd><a href="Client.html#event:message_revoke_everyone">Client#event:message_revoke_everyone</a></dd>
|
||||||
|
<dd><a href="Client.html#event:group_join">Client#event:group_join</a></dd>
|
||||||
|
<dd><a href="Client.html#event:group_leave">Client#event:group_leave</a></dd>
|
||||||
|
<dd><a href="Client.html#event:group_update">Client#event:group_update</a></dd>
|
||||||
<dd><a href="Client.html#event:disconnected">Client#event:disconnected</a></dd>
|
<dd><a href="Client.html#event:disconnected">Client#event:disconnected</a></dd>
|
||||||
<dd><a href="Client.html#event:change_state">Client#event:change_state</a></dd>
|
<dd><a href="Client.html#event:change_state">Client#event:change_state</a></dd>
|
||||||
</dl>
|
</dl>
|
||||||
@@ -182,6 +213,15 @@
|
|||||||
<dl class="dl-compact">
|
<dl class="dl-compact">
|
||||||
</dl>
|
</dl>
|
||||||
<div class="symbol-detail-labels"><span class="label label-async">async</span></div>
|
<div class="symbol-detail-labels"><span class="label label-async">async</span></div>
|
||||||
|
<h3 id="archiveChat"><span class="symbol-name">archiveChat</span><span class="signature"><span class="signature-params">()</span> → <span class="signature-returns"> boolean</span></span></h3>
|
||||||
|
<p>Enables and returns the archive state of the Chat</p>
|
||||||
|
<dl class="dl-compact">
|
||||||
|
<dt>Returns</dt>
|
||||||
|
<dd>
|
||||||
|
<p><code>boolean</code> </p>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
<div class="symbol-detail-labels"><span class="label label-async">async</span></div>
|
||||||
<h3 id="destroy"><span class="symbol-name">destroy</span><span class="signature"><span class="signature-params">()</span></span></h3>
|
<h3 id="destroy"><span class="symbol-name">destroy</span><span class="signature"><span class="signature-params">()</span></span></h3>
|
||||||
<p>Closes the client</p>
|
<p>Closes the client</p>
|
||||||
<dl class="dl-compact">
|
<dl class="dl-compact">
|
||||||
@@ -279,11 +319,25 @@
|
|||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
<div class="symbol-detail-labels"><span class="label label-async">async</span></div>
|
<div class="symbol-detail-labels"><span class="label label-async">async</span></div>
|
||||||
|
<h3 id="getState"><span class="symbol-name">getState</span><span class="signature"><span class="signature-params">()</span> → <span class="signature-returns"> <a href="global.html#WAState">WAState</a></span></span></h3>
|
||||||
|
<p>Gets the current connection state for the client</p>
|
||||||
|
<dl class="dl-compact">
|
||||||
|
<dt>Returns</dt>
|
||||||
|
<dd>
|
||||||
|
<p><code><a href="global.html#WAState">WAState</a></code> </p>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
<div class="symbol-detail-labels"><span class="label label-async">async</span></div>
|
||||||
<h3 id="initialize"><span class="symbol-name">initialize</span><span class="signature"><span class="signature-params">()</span></span></h3>
|
<h3 id="initialize"><span class="symbol-name">initialize</span><span class="signature"><span class="signature-params">()</span></span></h3>
|
||||||
<p>Sets up events and requirements, kicks off authentication request</p>
|
<p>Sets up events and requirements, kicks off authentication request</p>
|
||||||
<dl class="dl-compact">
|
<dl class="dl-compact">
|
||||||
</dl>
|
</dl>
|
||||||
<div class="symbol-detail-labels"><span class="label label-async">async</span></div>
|
<div class="symbol-detail-labels"><span class="label label-async">async</span></div>
|
||||||
|
<h3 id="resetState"><span class="symbol-name">resetState</span><span class="signature"><span class="signature-params">()</span></span></h3>
|
||||||
|
<p>Force reset of connection state for the client</p>
|
||||||
|
<dl class="dl-compact">
|
||||||
|
</dl>
|
||||||
|
<div class="symbol-detail-labels"><span class="label label-async">async</span></div>
|
||||||
<h3 id="sendMessage"><span class="symbol-name">sendMessage</span><span class="signature"><span class="signature-params">(chatId, content, options)</span> → <span class="signature-returns"> Promise containing <a href="Message.html">Message</a></span></span></h3>
|
<h3 id="sendMessage"><span class="symbol-name">sendMessage</span><span class="signature"><span class="signature-params">(chatId, content, options)</span> → <span class="signature-returns"> Promise containing <a href="Message.html">Message</a></span></span></h3>
|
||||||
<p>Send a message to a specific chatId</p>
|
<p>Send a message to a specific chatId</p>
|
||||||
<section>
|
<section>
|
||||||
@@ -348,6 +402,44 @@
|
|||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
<div class="symbol-detail-labels"><span class="label label-async">async</span></div>
|
<div class="symbol-detail-labels"><span class="label label-async">async</span></div>
|
||||||
|
<h3 id="sendSeen"><span class="symbol-name">sendSeen</span><span class="signature"><span class="signature-params">(chatId)</span> → <span class="signature-returns"> Promise containing boolean</span></span></h3>
|
||||||
|
<p>Mark as seen for the Chat</p>
|
||||||
|
<section>
|
||||||
|
<h4>Parameter</h4>
|
||||||
|
<table class="jsdoc-details-table">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Name</th>
|
||||||
|
<th>Type</th>
|
||||||
|
<th>Optional</th>
|
||||||
|
<th>Description</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<p>chatId</p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p>string</p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p> </p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</section>
|
||||||
|
<dl class="dl-compact">
|
||||||
|
<dt>Returns</dt>
|
||||||
|
<dd>
|
||||||
|
<p><code>Promise containing boolean</code> <p>result</p>
|
||||||
|
</p>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
<div class="symbol-detail-labels"><span class="label label-async">async</span></div>
|
||||||
<h3 id="setStatus"><span class="symbol-name">setStatus</span><span class="signature"><span class="signature-params">(status)</span></span></h3>
|
<h3 id="setStatus"><span class="symbol-name">setStatus</span><span class="signature"><span class="signature-params">(status)</span></span></h3>
|
||||||
<p>Sets the current user's status message</p>
|
<p>Sets the current user's status message</p>
|
||||||
<section>
|
<section>
|
||||||
@@ -381,6 +473,15 @@
|
|||||||
</section>
|
</section>
|
||||||
<dl class="dl-compact">
|
<dl class="dl-compact">
|
||||||
</dl>
|
</dl>
|
||||||
|
<div class="symbol-detail-labels"><span class="label label-async">async</span></div>
|
||||||
|
<h3 id="unarchiveChat"><span class="symbol-name">unarchiveChat</span><span class="signature"><span class="signature-params">()</span> → <span class="signature-returns"> boolean</span></span></h3>
|
||||||
|
<p>Changes and returns the archive state of the Chat</p>
|
||||||
|
<dl class="dl-compact">
|
||||||
|
<dt>Returns</dt>
|
||||||
|
<dd>
|
||||||
|
<p><code>boolean</code> </p>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
</section>
|
</section>
|
||||||
<h2>Events</h2>
|
<h2>Events</h2>
|
||||||
<section>
|
<section>
|
||||||
@@ -515,6 +616,105 @@
|
|||||||
</section>
|
</section>
|
||||||
<dl class="dl-compact">
|
<dl class="dl-compact">
|
||||||
</dl>
|
</dl>
|
||||||
|
<h3 id="event:group_join"><span class="symbol-name">group_join</span></h3>
|
||||||
|
<p>Emitted when a user joins the chat via invite link or is added by an admin.</p>
|
||||||
|
<section>
|
||||||
|
<h4>Parameter</h4>
|
||||||
|
<table class="jsdoc-details-table">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Name</th>
|
||||||
|
<th>Type</th>
|
||||||
|
<th>Optional</th>
|
||||||
|
<th>Description</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<p>notification</p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p><a href="GroupNotification.html">GroupNotification</a></p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p> </p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p>GroupNotification with more information about the action</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</section>
|
||||||
|
<dl class="dl-compact">
|
||||||
|
</dl>
|
||||||
|
<h3 id="event:group_leave"><span class="symbol-name">group_leave</span></h3>
|
||||||
|
<p>Emitted when a user leaves the chat or is removed by an admin.</p>
|
||||||
|
<section>
|
||||||
|
<h4>Parameter</h4>
|
||||||
|
<table class="jsdoc-details-table">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Name</th>
|
||||||
|
<th>Type</th>
|
||||||
|
<th>Optional</th>
|
||||||
|
<th>Description</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<p>notification</p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p><a href="GroupNotification.html">GroupNotification</a></p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p> </p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p>GroupNotification with more information about the action</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</section>
|
||||||
|
<dl class="dl-compact">
|
||||||
|
</dl>
|
||||||
|
<h3 id="event:group_update"><span class="symbol-name">group_update</span></h3>
|
||||||
|
<p>Emitted when group settings are updated, such as subject, description or picture.</p>
|
||||||
|
<section>
|
||||||
|
<h4>Parameter</h4>
|
||||||
|
<table class="jsdoc-details-table">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Name</th>
|
||||||
|
<th>Type</th>
|
||||||
|
<th>Optional</th>
|
||||||
|
<th>Description</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<p>notification</p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p><a href="GroupNotification.html">GroupNotification</a></p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p> </p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p>GroupNotification with more information about the action</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</section>
|
||||||
|
<dl class="dl-compact">
|
||||||
|
</dl>
|
||||||
<h3 id="event:message"><span class="symbol-name">message</span></h3>
|
<h3 id="event:message"><span class="symbol-name">message</span></h3>
|
||||||
<p>Emitted when a new message is received.</p>
|
<p>Emitted when a new message is received.</p>
|
||||||
<section>
|
<section>
|
||||||
@@ -548,6 +748,53 @@
|
|||||||
</section>
|
</section>
|
||||||
<dl class="dl-compact">
|
<dl class="dl-compact">
|
||||||
</dl>
|
</dl>
|
||||||
|
<h3 id="event:message_ack"><span class="symbol-name">message_ack</span></h3>
|
||||||
|
<p>Emitted when an ack event occurrs on message type.</p>
|
||||||
|
<section>
|
||||||
|
<h4>Parameters</h4>
|
||||||
|
<table class="jsdoc-details-table">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Name</th>
|
||||||
|
<th>Type</th>
|
||||||
|
<th>Optional</th>
|
||||||
|
<th>Description</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<p>message</p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p><a href="Message.html">Message</a></p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p> </p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p>The message that was affected</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<p>ack</p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p><a href="global.html#MessageAck">MessageAck</a></p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p> </p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p>The new ACK value</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</section>
|
||||||
|
<dl class="dl-compact">
|
||||||
|
</dl>
|
||||||
<h3 id="event:message_create"><span class="symbol-name">message_create</span></h3>
|
<h3 id="event:message_create"><span class="symbol-name">message_create</span></h3>
|
||||||
<p>Emitted when a new message is created, which may include the current user's own messages.</p>
|
<p>Emitted when a new message is created, which may include the current user's own messages.</p>
|
||||||
<section>
|
<section>
|
||||||
@@ -710,7 +957,7 @@
|
|||||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||||
<div id="jsdoc-footer-container">
|
<div id="jsdoc-footer-container">
|
||||||
<p>
|
<p>
|
||||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.3 on February 10, 2020.
|
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.3 on March 14, 2020.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta name="generator" content="JSDoc 3.6.3">
|
<meta name="generator" content="JSDoc 3.6.3">
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>whatsapp-web.js 1.0.2 » Source: Client.js</title>
|
<title>whatsapp-web.js 1.2.4 » Source: Client.js</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/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/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 rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
||||||
<div id="jsdoc-navbar-container">
|
<div id="jsdoc-navbar-container">
|
||||||
<div id="jsdoc-navbar-content">
|
<div id="jsdoc-navbar-content">
|
||||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>0.<wbr>2</a>
|
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>2.<wbr>4</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
@@ -41,11 +41,7 @@ const { WhatsWebURL, UserAgent, DefaultOptions, Events, WAState } = require
|
|||||||
const { ExposeStore, LoadUtils } = require('./util/Injected');
|
const { ExposeStore, LoadUtils } = require('./util/Injected');
|
||||||
const ChatFactory = require('./factories/ChatFactory');
|
const ChatFactory = require('./factories/ChatFactory');
|
||||||
const ContactFactory = require('./factories/ContactFactory');
|
const ContactFactory = require('./factories/ContactFactory');
|
||||||
const ClientInfo = require('./structures/ClientInfo');
|
const { ClientInfo, Message, MessageMedia, Location, GroupNotification } = require('./structures');
|
||||||
const Message = require('./structures/Message');
|
|
||||||
const MessageMedia = require('./structures/MessageMedia');
|
|
||||||
const Location = require('./structures/Location');
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Starting point for interacting with the WhatsApp Web API
|
* Starting point for interacting with the WhatsApp Web API
|
||||||
* @extends {EventEmitter}
|
* @extends {EventEmitter}
|
||||||
@@ -54,9 +50,13 @@ const Location = require('./structures/Location');
|
|||||||
* @fires Client#auth_failure
|
* @fires Client#auth_failure
|
||||||
* @fires Client#ready
|
* @fires Client#ready
|
||||||
* @fires Client#message
|
* @fires Client#message
|
||||||
|
* @fires Client#message_ack
|
||||||
* @fires Client#message_create
|
* @fires Client#message_create
|
||||||
* @fires Client#message_revoke_me
|
* @fires Client#message_revoke_me
|
||||||
* @fires Client#message_revoke_everyone
|
* @fires Client#message_revoke_everyone
|
||||||
|
* @fires Client#group_join
|
||||||
|
* @fires Client#group_leave
|
||||||
|
* @fires Client#group_update
|
||||||
* @fires Client#disconnected
|
* @fires Client#disconnected
|
||||||
* @fires Client#change_state
|
* @fires Client#change_state
|
||||||
*/
|
*/
|
||||||
@@ -75,7 +75,7 @@ class Client extends EventEmitter {
|
|||||||
*/
|
*/
|
||||||
async initialize() {
|
async initialize() {
|
||||||
const browser = await puppeteer.launch(this.options.puppeteer);
|
const browser = await puppeteer.launch(this.options.puppeteer);
|
||||||
const page = await browser.newPage();
|
const page = (await browser.pages())[0];
|
||||||
page.setUserAgent(UserAgent);
|
page.setUserAgent(UserAgent);
|
||||||
|
|
||||||
if (this.options.session) {
|
if (this.options.session) {
|
||||||
@@ -114,21 +114,34 @@ class Client extends EventEmitter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// Wait for QR Code
|
const getQrCode = async () => {
|
||||||
const QR_CANVAS_SELECTOR = 'canvas';
|
// Check if retry button is present
|
||||||
await page.waitForSelector(QR_CANVAS_SELECTOR);
|
var QR_RETRY_SELECTOR = 'div[data-ref] > span > div';
|
||||||
const qrImgData = await page.$eval(QR_CANVAS_SELECTOR, canvas => [].slice.call(canvas.getContext('2d').getImageData(0,0,264,264).data));
|
var qrRetry = await page.$(QR_RETRY_SELECTOR);
|
||||||
const qr = jsQR(qrImgData, 264, 264).data;
|
if (qrRetry) {
|
||||||
|
await qrRetry.click();
|
||||||
/**
|
}
|
||||||
* Emitted when the QR code is received
|
|
||||||
* @event Client#qr
|
// Wait for QR Code
|
||||||
* @param {string} qr QR Code
|
|
||||||
*/
|
const QR_CANVAS_SELECTOR = 'canvas';
|
||||||
this.emit(Events.QR_RECEIVED, qr);
|
await page.waitForSelector(QR_CANVAS_SELECTOR);
|
||||||
|
const qrImgData = await page.$eval(QR_CANVAS_SELECTOR, canvas => [].slice.call(canvas.getContext('2d').getImageData(0, 0, 264, 264).data));
|
||||||
|
const qr = jsQR(qrImgData, 264, 264).data;
|
||||||
|
/**
|
||||||
|
* Emitted when the QR code is received
|
||||||
|
* @event Client#qr
|
||||||
|
* @param {string} qr QR Code
|
||||||
|
*/
|
||||||
|
this.emit(Events.QR_RECEIVED, qr);
|
||||||
|
};
|
||||||
|
getQrCode();
|
||||||
|
let retryInterval = setInterval(getQrCode, 20000); // check for qr code every 20 seconds
|
||||||
|
|
||||||
// Wait for code scan
|
// Wait for code scan
|
||||||
await page.waitForSelector(KEEP_PHONE_CONNECTED_IMG_SELECTOR, { timeout: 0 });
|
await page.waitForSelector(KEEP_PHONE_CONNECTED_IMG_SELECTOR, { timeout: 0 });
|
||||||
|
clearInterval(retryInterval);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
await page.evaluate(ExposeStore, moduleRaid.toString());
|
await page.evaluate(ExposeStore, moduleRaid.toString());
|
||||||
@@ -167,6 +180,33 @@ class Client extends EventEmitter {
|
|||||||
await page.exposeFunction('onAddMessageEvent', msg => {
|
await page.exposeFunction('onAddMessageEvent', msg => {
|
||||||
if (!msg.isNewMsg) return;
|
if (!msg.isNewMsg) return;
|
||||||
|
|
||||||
|
if (msg.type === 'gp2') {
|
||||||
|
const notification = new GroupNotification(this, msg);
|
||||||
|
if (msg.subtype === 'add' || msg.subtype === 'invite') {
|
||||||
|
/**
|
||||||
|
* Emitted when a user joins the chat via invite link or is added by an admin.
|
||||||
|
* @event Client#group_join
|
||||||
|
* @param {GroupNotification} notification GroupNotification with more information about the action
|
||||||
|
*/
|
||||||
|
this.emit(Events.GROUP_JOIN, notification);
|
||||||
|
} else if (msg.subtype === 'remove' || msg.subtype === 'leave') {
|
||||||
|
/**
|
||||||
|
* Emitted when a user leaves the chat or is removed by an admin.
|
||||||
|
* @event Client#group_leave
|
||||||
|
* @param {GroupNotification} notification GroupNotification with more information about the action
|
||||||
|
*/
|
||||||
|
this.emit(Events.GROUP_LEAVE, notification);
|
||||||
|
} else {
|
||||||
|
/**
|
||||||
|
* Emitted when group settings are updated, such as subject, description or picture.
|
||||||
|
* @event Client#group_update
|
||||||
|
* @param {GroupNotification} notification GroupNotification with more information about the action
|
||||||
|
*/
|
||||||
|
this.emit(Events.GROUP_UPDATE, notification);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const message = new Message(this, msg);
|
const message = new Message(this, msg);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -193,7 +233,7 @@ class Client extends EventEmitter {
|
|||||||
if (msg.type === 'revoked') {
|
if (msg.type === 'revoked') {
|
||||||
const message = new Message(this, msg);
|
const message = new Message(this, msg);
|
||||||
let revoked_msg;
|
let revoked_msg;
|
||||||
if(last_message &amp;&amp; msg.id.id === last_message.id.id) {
|
if (last_message &amp;&amp; msg.id.id === last_message.id.id) {
|
||||||
revoked_msg = new Message(this, last_message);
|
revoked_msg = new Message(this, last_message);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -206,11 +246,11 @@ class Client extends EventEmitter {
|
|||||||
*/
|
*/
|
||||||
this.emit(Events.MESSAGE_REVOKED_EVERYONE, message, revoked_msg);
|
this.emit(Events.MESSAGE_REVOKED_EVERYONE, message, revoked_msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
await page.exposeFunction('onChangeMessageEvent', (msg) => {
|
await page.exposeFunction('onChangeMessageEvent', (msg) => {
|
||||||
|
|
||||||
if (msg.type !== 'revoked') {
|
if (msg.type !== 'revoked') {
|
||||||
last_message = msg;
|
last_message = msg;
|
||||||
}
|
}
|
||||||
@@ -232,7 +272,21 @@ class Client extends EventEmitter {
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
await page.exposeFunction('onAppStateChangedEvent', (_AppState, state) => {
|
await page.exposeFunction('onMessageAckEvent', (msg, ack) => {
|
||||||
|
|
||||||
|
const message = new Message(this, msg);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Emitted when an ack event occurrs on message type.
|
||||||
|
* @event Client#message_ack
|
||||||
|
* @param {Message} message The message that was affected
|
||||||
|
* @param {MessageAck} ack The new ACK value
|
||||||
|
*/
|
||||||
|
this.emit(Events.MESSAGE_ACK, message, ack);
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
await page.exposeFunction('onAppStateChangedEvent', (state) => {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Emitted when the connection state changes
|
* Emitted when the connection state changes
|
||||||
@@ -254,11 +308,12 @@ class Client extends EventEmitter {
|
|||||||
});
|
});
|
||||||
|
|
||||||
await page.evaluate(() => {
|
await page.evaluate(() => {
|
||||||
window.Store.Msg.on('add', window.onAddMessageEvent);
|
window.Store.Msg.on('add', (msg) => { if(msg.isNewMsg) window.onAddMessageEvent(msg); });
|
||||||
window.Store.Msg.on('change', window.onChangeMessageEvent);
|
window.Store.Msg.on('change', (msg) => { window.onChangeMessageEvent(msg); });
|
||||||
window.Store.Msg.on('change:type', window.onChangeMessageTypeEvent);
|
window.Store.Msg.on('change:type', (msg) => { window.onChangeMessageTypeEvent(msg); });
|
||||||
window.Store.Msg.on('remove', window.onRemoveMessageEvent);
|
window.Store.Msg.on('change:ack', (msg, ack) => { window.onMessageAckEvent(msg, ack); });
|
||||||
window.Store.AppState.on('change:state', window.onAppStateChangedEvent);
|
window.Store.Msg.on('remove', (msg) => { if(msg.isNewMsg) window.onRemoveMessageEvent(msg); });
|
||||||
|
window.Store.AppState.on('change:state', (_AppState, state) => { window.onAppStateChangedEvent(state); });
|
||||||
});
|
});
|
||||||
|
|
||||||
this.pupBrowser = browser;
|
this.pupBrowser = browser;
|
||||||
@@ -277,7 +332,19 @@ class Client extends EventEmitter {
|
|||||||
async destroy() {
|
async destroy() {
|
||||||
await this.pupBrowser.close();
|
await this.pupBrowser.close();
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Mark as seen for the Chat
|
||||||
|
* @param {string} chatId
|
||||||
|
* @returns {Promise&lt;boolean>} result
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
async sendSeen(chatId) {
|
||||||
|
const result = await this.pupPage.evaluate(async (chatId) => {
|
||||||
|
return window.WWebJS.sendSeen(chatId);
|
||||||
|
|
||||||
|
}, chatId);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* Send a message to a specific chatId
|
* Send a message to a specific chatId
|
||||||
* @param {string} chatId
|
* @param {string} chatId
|
||||||
@@ -285,28 +352,55 @@ class Client extends EventEmitter {
|
|||||||
* @param {object} options
|
* @param {object} options
|
||||||
* @returns {Promise&lt;Message>} Message that was just sent
|
* @returns {Promise&lt;Message>} Message that was just sent
|
||||||
*/
|
*/
|
||||||
async sendMessage(chatId, content, options={}) {
|
async sendMessage(chatId, content, options = {}) {
|
||||||
let internalOptions = {
|
let internalOptions = {
|
||||||
caption: options.caption,
|
caption: options.caption,
|
||||||
quotedMessageId: options.quotedMessageId,
|
quotedMessageId: options.quotedMessageId,
|
||||||
mentionedJidList: Array.isArray(options.mentions) ? options.mentions.map(contact => contact.id._serialized) : []
|
mentionedJidList: Array.isArray(options.mentions) ? options.mentions.map(contact => contact.id._serialized) : []
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const sendSeen = typeof options.sendSeen === 'undefined' ? true : options.sendSeen;
|
||||||
|
|
||||||
if(content instanceof MessageMedia) {
|
if (content instanceof MessageMedia) {
|
||||||
internalOptions.attachment = content;
|
internalOptions.attachment = content;
|
||||||
content = '';
|
content = '';
|
||||||
} else if(options.media instanceof MessageMedia) {
|
} else if (options.media instanceof MessageMedia) {
|
||||||
internalOptions.attachment = options.media;
|
internalOptions.attachment = options.media;
|
||||||
internalOptions.caption = content;
|
internalOptions.caption = content;
|
||||||
} else if(content instanceof Location) {
|
} else if (content instanceof Location) {
|
||||||
internalOptions.location = content;
|
internalOptions.location = content;
|
||||||
content = '';
|
content = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
const newMessage = await this.pupPage.evaluate(async (chatId, message, options) => {
|
const newMessage = await this.pupPage.evaluate(async (chatId, message, options, sendSeen) => {
|
||||||
const msg = await window.WWebJS.sendMessage(window.Store.Chat.get(chatId), message, options);
|
let chat = window.Store.Chat.get(chatId);
|
||||||
|
let msg;
|
||||||
|
if (!chat) { // The chat is not available in the previously chatted list
|
||||||
|
|
||||||
|
let newChatId = await window.WWebJS.getNumberId(chatId);
|
||||||
|
if (newChatId) {
|
||||||
|
//get the topmost chat object and assign the new chatId to it .
|
||||||
|
//This is just a workaround.May cause problem if there are no chats at all. Need to dig in and emulate how whatsapp web does
|
||||||
|
let chat = window.Store.Chat.models[0];
|
||||||
|
if (!chat)
|
||||||
|
throw 'Chat List empty! Need at least one open conversation with any of your contact';
|
||||||
|
|
||||||
|
let originalChatObjId = chat.id;
|
||||||
|
chat.id = newChatId;
|
||||||
|
|
||||||
|
msg = await window.WWebJS.sendMessage(chat, message, options);
|
||||||
|
chat.id = originalChatObjId; //replace the chat with its original id
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if(sendSeen) {
|
||||||
|
window.WWebJS.sendSeen(chatId);
|
||||||
|
}
|
||||||
|
|
||||||
|
msg = await window.WWebJS.sendMessage(chat, message, options, sendSeen);
|
||||||
|
}
|
||||||
return msg.serialize();
|
return msg.serialize();
|
||||||
}, chatId, content, internalOptions);
|
}, chatId, content, internalOptions, sendSeen);
|
||||||
|
|
||||||
return new Message(this, newMessage);
|
return new Message(this, newMessage);
|
||||||
}
|
}
|
||||||
@@ -383,6 +477,49 @@ class Client extends EventEmitter {
|
|||||||
}, status);
|
}, status);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the current connection state for the client
|
||||||
|
* @returns {WAState}
|
||||||
|
*/
|
||||||
|
async getState() {
|
||||||
|
return await this.pupPage.evaluate(() => {
|
||||||
|
return window.Store.AppState.state;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enables and returns the archive state of the Chat
|
||||||
|
* @returns {boolean}
|
||||||
|
*/
|
||||||
|
async archiveChat(chatId) {
|
||||||
|
return await this.pupPage.evaluate(async chatId => {
|
||||||
|
let chat = await window.Store.Chat.get(chatId);
|
||||||
|
await window.Store.Cmd.archiveChat(chat, true);
|
||||||
|
return chat.archive;
|
||||||
|
}, chatId);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Changes and returns the archive state of the Chat
|
||||||
|
* @returns {boolean}
|
||||||
|
*/
|
||||||
|
async unarchiveChat(chatId) {
|
||||||
|
return await this.pupPage.evaluate(async chatId => {
|
||||||
|
let chat = await window.Store.Chat.get(chatId);
|
||||||
|
await window.Store.Cmd.archiveChat(chat, false);
|
||||||
|
return chat.archive;
|
||||||
|
}, chatId);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Force reset of connection state for the client
|
||||||
|
*/
|
||||||
|
async resetState(){
|
||||||
|
await this.pupPage.evaluate(() => {
|
||||||
|
window.Store.AppState.phoneWatchdog.shiftTimer.forceRunNow();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = Client;
|
module.exports = Client;
|
||||||
@@ -396,7 +533,7 @@ module.exports = Client;
|
|||||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||||
<div id="jsdoc-footer-container">
|
<div id="jsdoc-footer-container">
|
||||||
<p>
|
<p>
|
||||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.3 on February 10, 2020.
|
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.3 on March 14, 2020.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta name="generator" content="JSDoc 3.6.3">
|
<meta name="generator" content="JSDoc 3.6.3">
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>whatsapp-web.js 1.0.2 » Class: ClientInfo</title>
|
<title>whatsapp-web.js 1.2.4 » Class: ClientInfo</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/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/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 rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
||||||
<div id="jsdoc-navbar-container">
|
<div id="jsdoc-navbar-container">
|
||||||
<div id="jsdoc-navbar-content">
|
<div id="jsdoc-navbar-content">
|
||||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>0.<wbr>2</a>
|
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>2.<wbr>4</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
@@ -187,7 +187,7 @@
|
|||||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||||
<div id="jsdoc-footer-container">
|
<div id="jsdoc-footer-container">
|
||||||
<p>
|
<p>
|
||||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.3 on February 10, 2020.
|
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.3 on March 14, 2020.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta name="generator" content="JSDoc 3.6.3">
|
<meta name="generator" content="JSDoc 3.6.3">
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>whatsapp-web.js 1.0.2 » Class: Contact</title>
|
<title>whatsapp-web.js 1.2.4 » 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/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/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 rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
||||||
<div id="jsdoc-navbar-container">
|
<div id="jsdoc-navbar-container">
|
||||||
<div id="jsdoc-navbar-content">
|
<div id="jsdoc-navbar-content">
|
||||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>0.<wbr>2</a>
|
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>2.<wbr>4</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
@@ -196,7 +196,7 @@
|
|||||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||||
<div id="jsdoc-footer-container">
|
<div id="jsdoc-footer-container">
|
||||||
<p>
|
<p>
|
||||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.3 on February 10, 2020.
|
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.3 on March 14, 2020.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta name="generator" content="JSDoc 3.6.3">
|
<meta name="generator" content="JSDoc 3.6.3">
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>whatsapp-web.js 1.0.2 » Class: GroupChat</title>
|
<title>whatsapp-web.js 1.2.4 » Class: GroupChat</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/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/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 rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
||||||
<div id="jsdoc-navbar-container">
|
<div id="jsdoc-navbar-container">
|
||||||
<div id="jsdoc-navbar-content">
|
<div id="jsdoc-navbar-content">
|
||||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>0.<wbr>2</a>
|
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>2.<wbr>4</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
@@ -39,6 +39,9 @@
|
|||||||
<div class="summary-content">
|
<div class="summary-content">
|
||||||
<div class="summary-column">
|
<div class="summary-column">
|
||||||
<dl class="dl-summary-callout">
|
<dl class="dl-summary-callout">
|
||||||
|
<dt><a href="GroupChat.html#archived">archived</a></dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
<dt><a href="GroupChat.html#createdAt">createdAt</a></dt>
|
<dt><a href="GroupChat.html#createdAt">createdAt</a></dt>
|
||||||
<dd>
|
<dd>
|
||||||
</dd>
|
</dd>
|
||||||
@@ -48,13 +51,13 @@
|
|||||||
<dt><a href="GroupChat.html#id">id</a></dt>
|
<dt><a href="GroupChat.html#id">id</a></dt>
|
||||||
<dd>
|
<dd>
|
||||||
</dd>
|
</dd>
|
||||||
<dt><a href="GroupChat.html#isGroup">isGroup</a></dt>
|
|
||||||
<dd>
|
|
||||||
</dd>
|
|
||||||
</dl>
|
</dl>
|
||||||
</div>
|
</div>
|
||||||
<div class="summary-column">
|
<div class="summary-column">
|
||||||
<dl class="dl-summary-callout">
|
<dl class="dl-summary-callout">
|
||||||
|
<dt><a href="GroupChat.html#isGroup">isGroup</a></dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
<dt><a href="GroupChat.html#isReadOnly">isReadOnly</a></dt>
|
<dt><a href="GroupChat.html#isReadOnly">isReadOnly</a></dt>
|
||||||
<dd>
|
<dd>
|
||||||
</dd>
|
</dd>
|
||||||
@@ -64,13 +67,13 @@
|
|||||||
<dt><a href="GroupChat.html#owner">owner</a></dt>
|
<dt><a href="GroupChat.html#owner">owner</a></dt>
|
||||||
<dd>
|
<dd>
|
||||||
</dd>
|
</dd>
|
||||||
<dt><a href="GroupChat.html#participants">participants</a></dt>
|
|
||||||
<dd>
|
|
||||||
</dd>
|
|
||||||
</dl>
|
</dl>
|
||||||
</div>
|
</div>
|
||||||
<div class="summary-column">
|
<div class="summary-column">
|
||||||
<dl class="dl-summary-callout">
|
<dl class="dl-summary-callout">
|
||||||
|
<dt><a href="GroupChat.html#participants">participants</a></dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
<dt><a href="GroupChat.html#timestamp">timestamp</a></dt>
|
<dt><a href="GroupChat.html#timestamp">timestamp</a></dt>
|
||||||
<dd>
|
<dd>
|
||||||
</dd>
|
</dd>
|
||||||
@@ -95,13 +98,28 @@
|
|||||||
<dt><a href="GroupChat.html#addParticipants">addParticipants(participantIds)</a></dt>
|
<dt><a href="GroupChat.html#addParticipants">addParticipants(participantIds)</a></dt>
|
||||||
<dd>
|
<dd>
|
||||||
</dd>
|
</dd>
|
||||||
<dt><a href="GroupChat.html#demoteParticipants">demoteParticipants(participantIds)</a></dt>
|
<dt><a href="GroupChat.html#archive">archive()</a></dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
<dt><a href="GroupChat.html#clearMessages">clearMessages()</a></dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
<dt><a href="GroupChat.html#clearState">clearState()</a></dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
<dt><a href="GroupChat.html#delete">delete()</a></dt>
|
||||||
<dd>
|
<dd>
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
</div>
|
</div>
|
||||||
<div class="summary-column">
|
<div class="summary-column">
|
||||||
<dl class="dl-summary-callout">
|
<dl class="dl-summary-callout">
|
||||||
|
<dt><a href="GroupChat.html#demoteParticipants">demoteParticipants(participantIds)</a></dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
<dt><a href="GroupChat.html#fetchMessages">fetchMessages(searchOptions)</a></dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
<dt><a href="GroupChat.html#getInviteCode">getInviteCode()</a></dt>
|
<dt><a href="GroupChat.html#getInviteCode">getInviteCode()</a></dt>
|
||||||
<dd>
|
<dd>
|
||||||
</dd>
|
</dd>
|
||||||
@@ -114,14 +132,23 @@
|
|||||||
<dt><a href="GroupChat.html#removeParticipants">removeParticipants(participantIds)</a></dt>
|
<dt><a href="GroupChat.html#removeParticipants">removeParticipants(participantIds)</a></dt>
|
||||||
<dd>
|
<dd>
|
||||||
</dd>
|
</dd>
|
||||||
|
<dt><a href="GroupChat.html#revokeInvite">revokeInvite()</a></dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
</div>
|
</div>
|
||||||
<div class="summary-column">
|
<div class="summary-column">
|
||||||
<dl class="dl-summary-callout">
|
<dl class="dl-summary-callout">
|
||||||
<dt><a href="GroupChat.html#revokeInvite">revokeInvite()</a></dt>
|
<dt><a href="GroupChat.html#sendMessage">sendMessage(content, options)</a></dt>
|
||||||
<dd>
|
<dd>
|
||||||
</dd>
|
</dd>
|
||||||
<dt><a href="GroupChat.html#sendMessage">sendMessage(content, options)</a></dt>
|
<dt><a href="GroupChat.html#sendSeen">sendSeen()</a></dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
<dt><a href="GroupChat.html#sendStateRecording">sendStateRecording()</a></dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
<dt><a href="GroupChat.html#sendStateTyping">sendStateTyping()</a></dt>
|
||||||
<dd>
|
<dd>
|
||||||
</dd>
|
</dd>
|
||||||
<dt><a href="GroupChat.html#setDescription">setDescription(description)</a></dt>
|
<dt><a href="GroupChat.html#setDescription">setDescription(description)</a></dt>
|
||||||
@@ -130,6 +157,9 @@
|
|||||||
<dt><a href="GroupChat.html#setSubject">setSubject(subject)</a></dt>
|
<dt><a href="GroupChat.html#setSubject">setSubject(subject)</a></dt>
|
||||||
<dd>
|
<dd>
|
||||||
</dd>
|
</dd>
|
||||||
|
<dt><a href="GroupChat.html#unarchive">unarchive()</a></dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -145,6 +175,13 @@
|
|||||||
<section>
|
<section>
|
||||||
<h2>Properties</h2>
|
<h2>Properties</h2>
|
||||||
<section>
|
<section>
|
||||||
|
<h3 id="archived"><span class="symbol-name">archived</span><small class="property-type">
|
||||||
|
unknown</small></h3>
|
||||||
|
<p>Indicates if the Chat is archived</p>
|
||||||
|
<dl class="dl-compact">
|
||||||
|
<dt>Inherited from</dt>
|
||||||
|
<dd><a href="Chat.html#archived">Chat#archived</a></dd>
|
||||||
|
</dl>
|
||||||
<h3 id="createdAt"><span class="symbol-name">createdAt</span><small class="property-type">
|
<h3 id="createdAt"><span class="symbol-name">createdAt</span><small class="property-type">
|
||||||
date</small></h3>
|
date</small></h3>
|
||||||
<p>Gets the date at which the group was created</p>
|
<p>Gets the date at which the group was created</p>
|
||||||
@@ -314,6 +351,42 @@
|
|||||||
<dl class="dl-compact">
|
<dl class="dl-compact">
|
||||||
</dl>
|
</dl>
|
||||||
<div class="symbol-detail-labels"><span class="label label-async">async</span></div>
|
<div class="symbol-detail-labels"><span class="label label-async">async</span></div>
|
||||||
|
<h3 id="archive"><span class="symbol-name">archive</span><span class="signature"><span class="signature-params">()</span></span></h3>
|
||||||
|
<p>Archives this chat</p>
|
||||||
|
<dl class="dl-compact">
|
||||||
|
<dt>Inherited from</dt>
|
||||||
|
<dd><a href="Chat.html#archive">Chat#archive</a></dd>
|
||||||
|
</dl>
|
||||||
|
<div class="symbol-detail-labels"><span class="label label-async">async</span></div>
|
||||||
|
<h3 id="clearMessages"><span class="symbol-name">clearMessages</span><span class="signature"><span class="signature-params">()</span> → <span class="signature-returns"> Promise containing Boolean</span></span></h3>
|
||||||
|
<p>Clears all messages from the chat</p>
|
||||||
|
<dl class="dl-compact">
|
||||||
|
<dt>Inherited from</dt>
|
||||||
|
<dd><a href="Chat.html#clearMessages">Chat#clearMessages</a></dd>
|
||||||
|
<dt>Returns</dt>
|
||||||
|
<dd>
|
||||||
|
<p>result</p>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
<div class="symbol-detail-labels"><span class="label label-async">async</span></div>
|
||||||
|
<h3 id="clearState"><span class="symbol-name">clearState</span><span class="signature"><span class="signature-params">()</span></span></h3>
|
||||||
|
<p>Stops typing or recording in chat immediately.</p>
|
||||||
|
<dl class="dl-compact">
|
||||||
|
<dt>Inherited from</dt>
|
||||||
|
<dd><a href="Chat.html#clearState">Chat#clearState</a></dd>
|
||||||
|
</dl>
|
||||||
|
<div class="symbol-detail-labels"><span class="label label-async">async</span></div>
|
||||||
|
<h3 id="delete"><span class="symbol-name">delete</span><span class="signature"><span class="signature-params">()</span> → <span class="signature-returns"> Promise containing Boolean</span></span></h3>
|
||||||
|
<p>Deletes the chat</p>
|
||||||
|
<dl class="dl-compact">
|
||||||
|
<dt>Inherited from</dt>
|
||||||
|
<dd><a href="Chat.html#delete">Chat#delete</a></dd>
|
||||||
|
<dt>Returns</dt>
|
||||||
|
<dd>
|
||||||
|
<p>result</p>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
<div class="symbol-detail-labels"><span class="label label-async">async</span></div>
|
||||||
<h3 id="demoteParticipants"><span class="symbol-name">demoteParticipants</span><span class="signature"><span class="signature-params">(participantIds)</span></span></h3>
|
<h3 id="demoteParticipants"><span class="symbol-name">demoteParticipants</span><span class="signature"><span class="signature-params">(participantIds)</span></span></h3>
|
||||||
<p>Demotes participants by IDs to regular users</p>
|
<p>Demotes participants by IDs to regular users</p>
|
||||||
<section>
|
<section>
|
||||||
@@ -347,6 +420,72 @@
|
|||||||
<dl class="dl-compact">
|
<dl class="dl-compact">
|
||||||
</dl>
|
</dl>
|
||||||
<div class="symbol-detail-labels"><span class="label label-async">async</span></div>
|
<div class="symbol-detail-labels"><span class="label label-async">async</span></div>
|
||||||
|
<h3 id="fetchMessages"><span class="symbol-name">fetchMessages</span><span class="signature"><span class="signature-params">(searchOptions)</span> → <span class="signature-returns"> Promise containing Array of <a href="Message.html">Message</a></span></span></h3>
|
||||||
|
<p>Loads chat messages, sorted from earliest to latest.</p>
|
||||||
|
<section>
|
||||||
|
<h4>Parameters</h4>
|
||||||
|
<table class="jsdoc-details-table">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Name</th>
|
||||||
|
<th>Type</th>
|
||||||
|
<th>Optional</th>
|
||||||
|
<th>Description</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<p>searchOptions</p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p> </p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p> </p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p>Options for searching messages. Right now only limit is supported.</p>
|
||||||
|
<p>Values in <code>searchOptions</code> have the following properties:</p>
|
||||||
|
<table class="jsdoc-details-table">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Name</th>
|
||||||
|
<th>Type</th>
|
||||||
|
<th>Optional</th>
|
||||||
|
<th>Description</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<p>limit</p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p> </p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p>Yes</p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p>The amount of messages to return. Note that the actual number of returned messages may be smaller if there aren't enough messages in the conversation. Set this to Infinity to load all messages.</p>
|
||||||
|
<p>Defaults to <code>50</code>.</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</section>
|
||||||
|
<dl class="dl-compact">
|
||||||
|
<dt>Inherited from</dt>
|
||||||
|
<dd><a href="Chat.html#fetchMessages">Chat#fetchMessages</a></dd>
|
||||||
|
<dt>Returns</dt>
|
||||||
|
<dd></dd>
|
||||||
|
</dl>
|
||||||
|
<div class="symbol-detail-labels"><span class="label label-async">async</span></div>
|
||||||
<h3 id="getInviteCode"><span class="symbol-name">getInviteCode</span><span class="signature"><span class="signature-params">()</span></span></h3>
|
<h3 id="getInviteCode"><span class="symbol-name">getInviteCode</span><span class="signature"><span class="signature-params">()</span></span></h3>
|
||||||
<p>Gets the invite code for a specific group</p>
|
<p>Gets the invite code for a specific group</p>
|
||||||
<dl class="dl-compact">
|
<dl class="dl-compact">
|
||||||
@@ -480,6 +619,31 @@
|
|||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
<div class="symbol-detail-labels"><span class="label label-async">async</span></div>
|
<div class="symbol-detail-labels"><span class="label label-async">async</span></div>
|
||||||
|
<h3 id="sendSeen"><span class="symbol-name">sendSeen</span><span class="signature"><span class="signature-params">()</span> → <span class="signature-returns"> Promise containing Boolean</span></span></h3>
|
||||||
|
<p>Set the message as seen</p>
|
||||||
|
<dl class="dl-compact">
|
||||||
|
<dt>Inherited from</dt>
|
||||||
|
<dd><a href="Chat.html#sendSeen">Chat#sendSeen</a></dd>
|
||||||
|
<dt>Returns</dt>
|
||||||
|
<dd>
|
||||||
|
<p>result</p>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
<div class="symbol-detail-labels"><span class="label label-async">async</span></div>
|
||||||
|
<h3 id="sendStateRecording"><span class="symbol-name">sendStateRecording</span><span class="signature"><span class="signature-params">()</span></span></h3>
|
||||||
|
<p>Simulate recording audio in chat. This will last for 25 seconds.</p>
|
||||||
|
<dl class="dl-compact">
|
||||||
|
<dt>Inherited from</dt>
|
||||||
|
<dd><a href="Chat.html#sendStateRecording">Chat#sendStateRecording</a></dd>
|
||||||
|
</dl>
|
||||||
|
<div class="symbol-detail-labels"><span class="label label-async">async</span></div>
|
||||||
|
<h3 id="sendStateTyping"><span class="symbol-name">sendStateTyping</span><span class="signature"><span class="signature-params">()</span></span></h3>
|
||||||
|
<p>Simulate typing in chat. This will last for 25 seconds.</p>
|
||||||
|
<dl class="dl-compact">
|
||||||
|
<dt>Inherited from</dt>
|
||||||
|
<dd><a href="Chat.html#sendStateTyping">Chat#sendStateTyping</a></dd>
|
||||||
|
</dl>
|
||||||
|
<div class="symbol-detail-labels"><span class="label label-async">async</span></div>
|
||||||
<h3 id="setDescription"><span class="symbol-name">setDescription</span><span class="signature"><span class="signature-params">(description)</span></span></h3>
|
<h3 id="setDescription"><span class="symbol-name">setDescription</span><span class="signature"><span class="signature-params">(description)</span></span></h3>
|
||||||
<p>Updates the group description</p>
|
<p>Updates the group description</p>
|
||||||
<section>
|
<section>
|
||||||
@@ -545,6 +709,13 @@
|
|||||||
</section>
|
</section>
|
||||||
<dl class="dl-compact">
|
<dl class="dl-compact">
|
||||||
</dl>
|
</dl>
|
||||||
|
<div class="symbol-detail-labels"><span class="label label-async">async</span></div>
|
||||||
|
<h3 id="unarchive"><span class="symbol-name">unarchive</span><span class="signature"><span class="signature-params">()</span></span></h3>
|
||||||
|
<p>un-archives this chat</p>
|
||||||
|
<dl class="dl-compact">
|
||||||
|
<dt>Inherited from</dt>
|
||||||
|
<dd><a href="Chat.html#unarchive">Chat#unarchive</a></dd>
|
||||||
|
</dl>
|
||||||
</section>
|
</section>
|
||||||
</section>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
@@ -555,7 +726,7 @@
|
|||||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||||
<div id="jsdoc-footer-container">
|
<div id="jsdoc-footer-container">
|
||||||
<p>
|
<p>
|
||||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.3 on February 10, 2020.
|
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.3 on March 14, 2020.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
248
docs/GroupNotification.html
Normal file
248
docs/GroupNotification.html
Normal file
@@ -0,0 +1,248 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html>
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta name="generator" content="JSDoc 3.6.3">
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>whatsapp-web.js 1.2.4 » Class: GroupNotification</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>2.<wbr>4</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">GroupNotification</span></h1>
|
||||||
|
<p class="source-link">Source: <a href="structures_GroupNotification.js.html#source-line-10">structures/<wbr>GroupNotification.<wbr>js:10</a></p>
|
||||||
|
<div class="symbol-classdesc">
|
||||||
|
<p>Represents a GroupNotification 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="GroupNotification.html#author">author</a></dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
<dt><a href="GroupNotification.html#body">body</a></dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
<dt><a href="GroupNotification.html#chatId">chatId</a></dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
</div>
|
||||||
|
<div class="summary-column">
|
||||||
|
<dl class="dl-summary-callout">
|
||||||
|
<dt><a href="GroupNotification.html#id">id</a></dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
<dt><a href="GroupNotification.html#recipientIds">recipientIds</a></dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
<dt><a href="GroupNotification.html#timestamp">timestamp</a></dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
</div>
|
||||||
|
<div class="summary-column">
|
||||||
|
<dl class="dl-summary-callout">
|
||||||
|
<dt><a href="GroupNotification.html#type">type</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="GroupNotification.html#getChat">getChat()</a></dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
<dt><a href="GroupNotification.html#getContact">getContact()</a></dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
</div>
|
||||||
|
<div class="summary-column">
|
||||||
|
<dl class="dl-summary-callout">
|
||||||
|
<dt><a href="GroupNotification.html#getRecipients">getRecipients()</a></dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
<dt><a href="GroupNotification.html#reply">reply(content, options)</a></dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
</div>
|
||||||
|
<div class="summary-column">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
<section>
|
||||||
|
<h2 id="GroupNotification">new <span class="symbol-name">GroupNotification</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="author"><span class="symbol-name">author</span><small class="property-type">
|
||||||
|
string</small></h3>
|
||||||
|
<p>ContactId for the user that produced the GroupNotification.</p>
|
||||||
|
<dl class="dl-compact">
|
||||||
|
</dl>
|
||||||
|
<h3 id="body"><span class="symbol-name">body</span><small class="property-type">
|
||||||
|
string</small></h3>
|
||||||
|
<p>Extra content</p>
|
||||||
|
<dl class="dl-compact">
|
||||||
|
</dl>
|
||||||
|
<h3 id="chatId"><span class="symbol-name">chatId</span><small class="property-type">
|
||||||
|
string</small></h3>
|
||||||
|
<p>ID for the Chat that this groupNotification was sent for.</p>
|
||||||
|
<dl class="dl-compact">
|
||||||
|
</dl>
|
||||||
|
<h3 id="id"><span class="symbol-name">id</span><small class="property-type">
|
||||||
|
object</small></h3>
|
||||||
|
<p>ID that represents the groupNotification</p>
|
||||||
|
<dl class="dl-compact">
|
||||||
|
</dl>
|
||||||
|
<h3 id="recipientIds"><span class="symbol-name">recipientIds</span><small class="property-type">
|
||||||
|
Array of string</small></h3>
|
||||||
|
<p>Contact IDs for the users that were affected by this GroupNotification.</p>
|
||||||
|
<dl class="dl-compact">
|
||||||
|
</dl>
|
||||||
|
<h3 id="timestamp"><span class="symbol-name">timestamp</span><small class="property-type">
|
||||||
|
number</small></h3>
|
||||||
|
<p>Unix timestamp for when the groupNotification was created</p>
|
||||||
|
<dl class="dl-compact">
|
||||||
|
</dl>
|
||||||
|
<h3 id="type"><span class="symbol-name">type</span><small class="property-type">
|
||||||
|
<a href="global.html#GroupNotificationTypes">GroupNotificationTypes</a></small></h3>
|
||||||
|
<p>GroupNotification type</p>
|
||||||
|
<dl class="dl-compact">
|
||||||
|
</dl>
|
||||||
|
</section>
|
||||||
|
<h2>Methods</h2>
|
||||||
|
<section>
|
||||||
|
<h3 id="getChat"><span class="symbol-name">getChat</span><span class="signature"><span class="signature-params">()</span> → <span class="signature-returns"> Promise containing <a href="Chat.html">Chat</a></span></span></h3>
|
||||||
|
<p>Returns the Chat this groupNotification was sent in</p>
|
||||||
|
<dl class="dl-compact">
|
||||||
|
<dt>Returns</dt>
|
||||||
|
<dd>
|
||||||
|
<p><code>Promise containing <a href="Chat.html">Chat</a></code> </p>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
<h3 id="getContact"><span class="symbol-name">getContact</span><span class="signature"><span class="signature-params">()</span> → <span class="signature-returns"> Promise containing <a href="Contact.html">Contact</a></span></span></h3>
|
||||||
|
<p>Returns the Contact this GroupNotification was produced by</p>
|
||||||
|
<dl class="dl-compact">
|
||||||
|
<dt>Returns</dt>
|
||||||
|
<dd>
|
||||||
|
<p><code>Promise containing <a href="Contact.html">Contact</a></code> </p>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
<div class="symbol-detail-labels"><span class="label label-async">async</span></div>
|
||||||
|
<h3 id="getRecipients"><span class="symbol-name">getRecipients</span><span class="signature"><span class="signature-params">()</span> → <span class="signature-returns"> Promise containing Array of <a href="Contact.html">Contact</a></span></span></h3>
|
||||||
|
<p>Returns the Contacts affected by this GroupNotification.</p>
|
||||||
|
<dl class="dl-compact">
|
||||||
|
<dt>Returns</dt>
|
||||||
|
<dd>
|
||||||
|
<p><code>Promise containing Array of <a href="Contact.html">Contact</a></code> </p>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
<div class="symbol-detail-labels"><span class="label label-async">async</span></div>
|
||||||
|
<h3 id="reply"><span class="symbol-name">reply</span><span class="signature"><span class="signature-params">(content, options)</span> → <span class="signature-returns"> Promise containing <a href="Message.html">Message</a></span></span></h3>
|
||||||
|
<p>Sends a message to the same chat this GroupNotification was produced in.</p>
|
||||||
|
<section>
|
||||||
|
<h4>Parameters</h4>
|
||||||
|
<table class="jsdoc-details-table">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Name</th>
|
||||||
|
<th>Type</th>
|
||||||
|
<th>Optional</th>
|
||||||
|
<th>Description</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<p>content</p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p>(string, <a href="MessageMedia.html">MessageMedia</a>, or <a href="Location.html">Location</a>)</p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p> </p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<p>options</p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p>object</p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p> </p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</section>
|
||||||
|
<dl class="dl-compact">
|
||||||
|
<dt>Returns</dt>
|
||||||
|
<dd>
|
||||||
|
<p><code>Promise containing <a href="Message.html">Message</a></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.3 on March 14, 2020.
|
||||||
|
</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>
|
||||||
@@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta name="generator" content="JSDoc 3.6.3">
|
<meta name="generator" content="JSDoc 3.6.3">
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>whatsapp-web.js 1.0.2 » Class: Location</title>
|
<title>whatsapp-web.js 1.2.4 » Class: Location</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/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/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 rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
||||||
<div id="jsdoc-navbar-container">
|
<div id="jsdoc-navbar-container">
|
||||||
<div id="jsdoc-navbar-content">
|
<div id="jsdoc-navbar-content">
|
||||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>0.<wbr>2</a>
|
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>2.<wbr>4</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
@@ -149,7 +149,7 @@
|
|||||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||||
<div id="jsdoc-footer-container">
|
<div id="jsdoc-footer-container">
|
||||||
<p>
|
<p>
|
||||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.3 on February 10, 2020.
|
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.3 on March 14, 2020.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta name="generator" content="JSDoc 3.6.3">
|
<meta name="generator" content="JSDoc 3.6.3">
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>whatsapp-web.js 1.0.2 » Class: Message</title>
|
<title>whatsapp-web.js 1.2.4 » Class: Message</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/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/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 rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
||||||
<div id="jsdoc-navbar-container">
|
<div id="jsdoc-navbar-container">
|
||||||
<div id="jsdoc-navbar-content">
|
<div id="jsdoc-navbar-content">
|
||||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>0.<wbr>2</a>
|
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>2.<wbr>4</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
@@ -98,6 +98,9 @@
|
|||||||
<div class="summary-content">
|
<div class="summary-content">
|
||||||
<div class="summary-column">
|
<div class="summary-column">
|
||||||
<dl class="dl-summary-callout">
|
<dl class="dl-summary-callout">
|
||||||
|
<dt><a href="Message.html#delete">delete(everyone)</a></dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
<dt><a href="Message.html#downloadMedia">downloadMedia()</a></dt>
|
<dt><a href="Message.html#downloadMedia">downloadMedia()</a></dt>
|
||||||
<dd>
|
<dd>
|
||||||
</dd>
|
</dd>
|
||||||
@@ -114,13 +117,13 @@
|
|||||||
<dt><a href="Message.html#getMentions">getMentions()</a></dt>
|
<dt><a href="Message.html#getMentions">getMentions()</a></dt>
|
||||||
<dd>
|
<dd>
|
||||||
</dd>
|
</dd>
|
||||||
|
<dt><a href="Message.html#getQuotedMessage">getQuotedMessage()</a></dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
</div>
|
</div>
|
||||||
<div class="summary-column">
|
<div class="summary-column">
|
||||||
<dl class="dl-summary-callout">
|
<dl class="dl-summary-callout">
|
||||||
<dt><a href="Message.html#getQuotedMessage">getQuotedMessage()</a></dt>
|
|
||||||
<dd>
|
|
||||||
</dd>
|
|
||||||
<dt><a href="Message.html#reply">reply(content, chatId, options)</a></dt>
|
<dt><a href="Message.html#reply">reply(content, chatId, options)</a></dt>
|
||||||
<dd>
|
<dd>
|
||||||
</dd>
|
</dd>
|
||||||
@@ -214,6 +217,41 @@
|
|||||||
</section>
|
</section>
|
||||||
<h2>Methods</h2>
|
<h2>Methods</h2>
|
||||||
<section>
|
<section>
|
||||||
|
<div class="symbol-detail-labels"><span class="label label-async">async</span></div>
|
||||||
|
<h3 id="delete"><span class="symbol-name">delete</span><span class="signature"><span class="signature-params">(everyone)</span></span></h3>
|
||||||
|
<p>Deletes a message from the chat</p>
|
||||||
|
<section>
|
||||||
|
<h4>Parameter</h4>
|
||||||
|
<table class="jsdoc-details-table">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Name</th>
|
||||||
|
<th>Type</th>
|
||||||
|
<th>Optional</th>
|
||||||
|
<th>Description</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<p>everyone</p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p>boolean</p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p> </p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p>If true and the message is sent by the current user, will delete it for everyone in the chat.</p>
|
||||||
|
<p>Value can be null.</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</section>
|
||||||
|
<dl class="dl-compact">
|
||||||
|
</dl>
|
||||||
<div class="symbol-detail-labels"><span class="label label-async">async</span></div>
|
<div class="symbol-detail-labels"><span class="label label-async">async</span></div>
|
||||||
<h3 id="downloadMedia"><span class="symbol-name">downloadMedia</span><span class="signature"><span class="signature-params">()</span> → <span class="signature-returns"> Promise containing <a href="MessageMedia.html">MessageMedia</a></span></span></h3>
|
<h3 id="downloadMedia"><span class="symbol-name">downloadMedia</span><span class="signature"><span class="signature-params">()</span> → <span class="signature-returns"> Promise containing <a href="MessageMedia.html">MessageMedia</a></span></span></h3>
|
||||||
<p>Downloads and returns the attatched message media</p>
|
<p>Downloads and returns the attatched message media</p>
|
||||||
@@ -333,7 +371,7 @@
|
|||||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||||
<div id="jsdoc-footer-container">
|
<div id="jsdoc-footer-container">
|
||||||
<p>
|
<p>
|
||||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.3 on February 10, 2020.
|
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.3 on March 14, 2020.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta name="generator" content="JSDoc 3.6.3">
|
<meta name="generator" content="JSDoc 3.6.3">
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>whatsapp-web.js 1.0.2 » Class: MessageMedia</title>
|
<title>whatsapp-web.js 1.2.4 » Class: MessageMedia</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/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/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 rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
||||||
<div id="jsdoc-navbar-container">
|
<div id="jsdoc-navbar-container">
|
||||||
<div id="jsdoc-navbar-content">
|
<div id="jsdoc-navbar-content">
|
||||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>0.<wbr>2</a>
|
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>2.<wbr>4</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
@@ -152,7 +152,7 @@
|
|||||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||||
<div id="jsdoc-footer-container">
|
<div id="jsdoc-footer-container">
|
||||||
<p>
|
<p>
|
||||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.3 on February 10, 2020.
|
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.3 on March 14, 2020.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta name="generator" content="JSDoc 3.6.3">
|
<meta name="generator" content="JSDoc 3.6.3">
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>whatsapp-web.js 1.0.2 » Class: PrivateChat</title>
|
<title>whatsapp-web.js 1.2.4 » Class: PrivateChat</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/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/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 rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
||||||
<div id="jsdoc-navbar-container">
|
<div id="jsdoc-navbar-container">
|
||||||
<div id="jsdoc-navbar-content">
|
<div id="jsdoc-navbar-content">
|
||||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>0.<wbr>2</a>
|
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>2.<wbr>4</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
@@ -39,6 +39,9 @@
|
|||||||
<div class="summary-content">
|
<div class="summary-content">
|
||||||
<div class="summary-column">
|
<div class="summary-column">
|
||||||
<dl class="dl-summary-callout">
|
<dl class="dl-summary-callout">
|
||||||
|
<dt><a href="PrivateChat.html#archived">archived</a></dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
<dt><a href="PrivateChat.html#id">id</a></dt>
|
<dt><a href="PrivateChat.html#id">id</a></dt>
|
||||||
<dd>
|
<dd>
|
||||||
</dd>
|
</dd>
|
||||||
@@ -55,13 +58,13 @@
|
|||||||
<dt><a href="PrivateChat.html#name">name</a></dt>
|
<dt><a href="PrivateChat.html#name">name</a></dt>
|
||||||
<dd>
|
<dd>
|
||||||
</dd>
|
</dd>
|
||||||
|
<dt><a href="PrivateChat.html#timestamp">timestamp</a></dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
</div>
|
</div>
|
||||||
<div class="summary-column">
|
<div class="summary-column">
|
||||||
<dl class="dl-summary-callout">
|
<dl class="dl-summary-callout">
|
||||||
<dt><a href="PrivateChat.html#timestamp">timestamp</a></dt>
|
|
||||||
<dd>
|
|
||||||
</dd>
|
|
||||||
<dt><a href="PrivateChat.html#unreadCount">unreadCount</a></dt>
|
<dt><a href="PrivateChat.html#unreadCount">unreadCount</a></dt>
|
||||||
<dd>
|
<dd>
|
||||||
</dd>
|
</dd>
|
||||||
@@ -70,18 +73,49 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="summary-callout">
|
<div class="summary-callout">
|
||||||
<h2 class="summary-callout-heading">Method</h2>
|
<h2 class="summary-callout-heading">Methods</h2>
|
||||||
<div class="summary-content">
|
<div class="summary-content">
|
||||||
<div class="summary-column">
|
<div class="summary-column">
|
||||||
<dl class="dl-summary-callout">
|
<dl class="dl-summary-callout">
|
||||||
<dt><a href="PrivateChat.html#sendMessage">sendMessage(content, options)</a></dt>
|
<dt><a href="PrivateChat.html#archive">archive()</a></dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
<dt><a href="PrivateChat.html#clearMessages">clearMessages()</a></dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
<dt><a href="PrivateChat.html#clearState">clearState()</a></dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
<dt><a href="PrivateChat.html#delete">delete()</a></dt>
|
||||||
<dd>
|
<dd>
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
</div>
|
</div>
|
||||||
<div class="summary-column">
|
<div class="summary-column">
|
||||||
|
<dl class="dl-summary-callout">
|
||||||
|
<dt><a href="PrivateChat.html#fetchMessages">fetchMessages(searchOptions)</a></dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
<dt><a href="PrivateChat.html#sendMessage">sendMessage(content, options)</a></dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
<dt><a href="PrivateChat.html#sendSeen">sendSeen()</a></dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
<dt><a href="PrivateChat.html#sendStateRecording">sendStateRecording()</a></dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
</div>
|
</div>
|
||||||
<div class="summary-column">
|
<div class="summary-column">
|
||||||
|
<dl class="dl-summary-callout">
|
||||||
|
<dt><a href="PrivateChat.html#sendStateTyping">sendStateTyping()</a></dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
<dt><a href="PrivateChat.html#unarchive">unarchive()</a></dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -96,6 +130,13 @@
|
|||||||
<section>
|
<section>
|
||||||
<h2>Properties</h2>
|
<h2>Properties</h2>
|
||||||
<section>
|
<section>
|
||||||
|
<h3 id="archived"><span class="symbol-name">archived</span><small class="property-type">
|
||||||
|
unknown</small></h3>
|
||||||
|
<p>Indicates if the Chat is archived</p>
|
||||||
|
<dl class="dl-compact">
|
||||||
|
<dt>Inherited from</dt>
|
||||||
|
<dd><a href="Chat.html#archived">Chat#archived</a></dd>
|
||||||
|
</dl>
|
||||||
<h3 id="id"><span class="symbol-name">id</span><small class="property-type">
|
<h3 id="id"><span class="symbol-name">id</span><small class="property-type">
|
||||||
unknown</small></h3>
|
unknown</small></h3>
|
||||||
<p>ID that represents the chat</p>
|
<p>ID that represents the chat</p>
|
||||||
@@ -139,8 +180,110 @@
|
|||||||
<dd><a href="Chat.html#unreadCount">Chat#unreadCount</a></dd>
|
<dd><a href="Chat.html#unreadCount">Chat#unreadCount</a></dd>
|
||||||
</dl>
|
</dl>
|
||||||
</section>
|
</section>
|
||||||
<h2>Method</h2>
|
<h2>Methods</h2>
|
||||||
<section>
|
<section>
|
||||||
|
<div class="symbol-detail-labels"><span class="label label-async">async</span></div>
|
||||||
|
<h3 id="archive"><span class="symbol-name">archive</span><span class="signature"><span class="signature-params">()</span></span></h3>
|
||||||
|
<p>Archives this chat</p>
|
||||||
|
<dl class="dl-compact">
|
||||||
|
<dt>Inherited from</dt>
|
||||||
|
<dd><a href="Chat.html#archive">Chat#archive</a></dd>
|
||||||
|
</dl>
|
||||||
|
<div class="symbol-detail-labels"><span class="label label-async">async</span></div>
|
||||||
|
<h3 id="clearMessages"><span class="symbol-name">clearMessages</span><span class="signature"><span class="signature-params">()</span> → <span class="signature-returns"> Promise containing Boolean</span></span></h3>
|
||||||
|
<p>Clears all messages from the chat</p>
|
||||||
|
<dl class="dl-compact">
|
||||||
|
<dt>Inherited from</dt>
|
||||||
|
<dd><a href="Chat.html#clearMessages">Chat#clearMessages</a></dd>
|
||||||
|
<dt>Returns</dt>
|
||||||
|
<dd>
|
||||||
|
<p>result</p>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
<div class="symbol-detail-labels"><span class="label label-async">async</span></div>
|
||||||
|
<h3 id="clearState"><span class="symbol-name">clearState</span><span class="signature"><span class="signature-params">()</span></span></h3>
|
||||||
|
<p>Stops typing or recording in chat immediately.</p>
|
||||||
|
<dl class="dl-compact">
|
||||||
|
<dt>Inherited from</dt>
|
||||||
|
<dd><a href="Chat.html#clearState">Chat#clearState</a></dd>
|
||||||
|
</dl>
|
||||||
|
<div class="symbol-detail-labels"><span class="label label-async">async</span></div>
|
||||||
|
<h3 id="delete"><span class="symbol-name">delete</span><span class="signature"><span class="signature-params">()</span> → <span class="signature-returns"> Promise containing Boolean</span></span></h3>
|
||||||
|
<p>Deletes the chat</p>
|
||||||
|
<dl class="dl-compact">
|
||||||
|
<dt>Inherited from</dt>
|
||||||
|
<dd><a href="Chat.html#delete">Chat#delete</a></dd>
|
||||||
|
<dt>Returns</dt>
|
||||||
|
<dd>
|
||||||
|
<p>result</p>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
<div class="symbol-detail-labels"><span class="label label-async">async</span></div>
|
||||||
|
<h3 id="fetchMessages"><span class="symbol-name">fetchMessages</span><span class="signature"><span class="signature-params">(searchOptions)</span> → <span class="signature-returns"> Promise containing Array of <a href="Message.html">Message</a></span></span></h3>
|
||||||
|
<p>Loads chat messages, sorted from earliest to latest.</p>
|
||||||
|
<section>
|
||||||
|
<h4>Parameters</h4>
|
||||||
|
<table class="jsdoc-details-table">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Name</th>
|
||||||
|
<th>Type</th>
|
||||||
|
<th>Optional</th>
|
||||||
|
<th>Description</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<p>searchOptions</p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p> </p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p> </p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p>Options for searching messages. Right now only limit is supported.</p>
|
||||||
|
<p>Values in <code>searchOptions</code> have the following properties:</p>
|
||||||
|
<table class="jsdoc-details-table">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Name</th>
|
||||||
|
<th>Type</th>
|
||||||
|
<th>Optional</th>
|
||||||
|
<th>Description</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<p>limit</p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p> </p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p>Yes</p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p>The amount of messages to return. Note that the actual number of returned messages may be smaller if there aren't enough messages in the conversation. Set this to Infinity to load all messages.</p>
|
||||||
|
<p>Defaults to <code>50</code>.</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</section>
|
||||||
|
<dl class="dl-compact">
|
||||||
|
<dt>Inherited from</dt>
|
||||||
|
<dd><a href="Chat.html#fetchMessages">Chat#fetchMessages</a></dd>
|
||||||
|
<dt>Returns</dt>
|
||||||
|
<dd></dd>
|
||||||
|
</dl>
|
||||||
<div class="symbol-detail-labels"><span class="label label-async">async</span></div>
|
<div class="symbol-detail-labels"><span class="label label-async">async</span></div>
|
||||||
<h3 id="sendMessage"><span class="symbol-name">sendMessage</span><span class="signature"><span class="signature-params">(content, options)</span> → <span class="signature-returns"> Promise containing <a href="Message.html">Message</a></span></span></h3>
|
<h3 id="sendMessage"><span class="symbol-name">sendMessage</span><span class="signature"><span class="signature-params">(content, options)</span> → <span class="signature-returns"> Promise containing <a href="Message.html">Message</a></span></span></h3>
|
||||||
<p>Send a message to this chat</p>
|
<p>Send a message to this chat</p>
|
||||||
@@ -193,6 +336,38 @@
|
|||||||
<p>Message that was just sent</p>
|
<p>Message that was just sent</p>
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
|
<div class="symbol-detail-labels"><span class="label label-async">async</span></div>
|
||||||
|
<h3 id="sendSeen"><span class="symbol-name">sendSeen</span><span class="signature"><span class="signature-params">()</span> → <span class="signature-returns"> Promise containing Boolean</span></span></h3>
|
||||||
|
<p>Set the message as seen</p>
|
||||||
|
<dl class="dl-compact">
|
||||||
|
<dt>Inherited from</dt>
|
||||||
|
<dd><a href="Chat.html#sendSeen">Chat#sendSeen</a></dd>
|
||||||
|
<dt>Returns</dt>
|
||||||
|
<dd>
|
||||||
|
<p>result</p>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
<div class="symbol-detail-labels"><span class="label label-async">async</span></div>
|
||||||
|
<h3 id="sendStateRecording"><span class="symbol-name">sendStateRecording</span><span class="signature"><span class="signature-params">()</span></span></h3>
|
||||||
|
<p>Simulate recording audio in chat. This will last for 25 seconds.</p>
|
||||||
|
<dl class="dl-compact">
|
||||||
|
<dt>Inherited from</dt>
|
||||||
|
<dd><a href="Chat.html#sendStateRecording">Chat#sendStateRecording</a></dd>
|
||||||
|
</dl>
|
||||||
|
<div class="symbol-detail-labels"><span class="label label-async">async</span></div>
|
||||||
|
<h3 id="sendStateTyping"><span class="symbol-name">sendStateTyping</span><span class="signature"><span class="signature-params">()</span></span></h3>
|
||||||
|
<p>Simulate typing in chat. This will last for 25 seconds.</p>
|
||||||
|
<dl class="dl-compact">
|
||||||
|
<dt>Inherited from</dt>
|
||||||
|
<dd><a href="Chat.html#sendStateTyping">Chat#sendStateTyping</a></dd>
|
||||||
|
</dl>
|
||||||
|
<div class="symbol-detail-labels"><span class="label label-async">async</span></div>
|
||||||
|
<h3 id="unarchive"><span class="symbol-name">unarchive</span><span class="signature"><span class="signature-params">()</span></span></h3>
|
||||||
|
<p>un-archives this chat</p>
|
||||||
|
<dl class="dl-compact">
|
||||||
|
<dt>Inherited from</dt>
|
||||||
|
<dd><a href="Chat.html#unarchive">Chat#unarchive</a></dd>
|
||||||
|
</dl>
|
||||||
</section>
|
</section>
|
||||||
</section>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
@@ -203,7 +378,7 @@
|
|||||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||||
<div id="jsdoc-footer-container">
|
<div id="jsdoc-footer-container">
|
||||||
<p>
|
<p>
|
||||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.3 on February 10, 2020.
|
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.3 on March 14, 2020.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta name="generator" content="JSDoc 3.6.3">
|
<meta name="generator" content="JSDoc 3.6.3">
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>whatsapp-web.js 1.0.2 » Class: PrivateContact</title>
|
<title>whatsapp-web.js 1.2.4 » Class: PrivateContact</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/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/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 rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
||||||
<div id="jsdoc-navbar-container">
|
<div id="jsdoc-navbar-container">
|
||||||
<div id="jsdoc-navbar-content">
|
<div id="jsdoc-navbar-content">
|
||||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>0.<wbr>2</a>
|
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>2.<wbr>4</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
@@ -220,7 +220,7 @@
|
|||||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||||
<div id="jsdoc-footer-container">
|
<div id="jsdoc-footer-container">
|
||||||
<p>
|
<p>
|
||||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.3 on February 10, 2020.
|
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.3 on March 14, 2020.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta name="generator" content="JSDoc 3.6.3">
|
<meta name="generator" content="JSDoc 3.6.3">
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>whatsapp-web.js 1.0.2 » Class: Util</title>
|
<title>whatsapp-web.js 1.2.4 » Class: Util</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/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/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 rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
||||||
<div id="jsdoc-navbar-container">
|
<div id="jsdoc-navbar-container">
|
||||||
<div id="jsdoc-navbar-content">
|
<div id="jsdoc-navbar-content">
|
||||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>0.<wbr>2</a>
|
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>2.<wbr>4</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
@@ -50,7 +50,7 @@
|
|||||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||||
<div id="jsdoc-footer-container">
|
<div id="jsdoc-footer-container">
|
||||||
<p>
|
<p>
|
||||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.3 on February 10, 2020.
|
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.3 on March 14, 2020.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
301
docs/global.html
301
docs/global.html
@@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta name="generator" content="JSDoc 3.6.3">
|
<meta name="generator" content="JSDoc 3.6.3">
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>whatsapp-web.js 1.0.2 » Globals</title>
|
<title>whatsapp-web.js 1.2.4 » Globals</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/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/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 rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
||||||
<div id="jsdoc-navbar-container">
|
<div id="jsdoc-navbar-container">
|
||||||
<div id="jsdoc-navbar-content">
|
<div id="jsdoc-navbar-content">
|
||||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>0.<wbr>2</a>
|
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>2.<wbr>4</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
@@ -36,10 +36,16 @@
|
|||||||
<dt><a href="global.html#Events">Events</a></dt>
|
<dt><a href="global.html#Events">Events</a></dt>
|
||||||
<dd>
|
<dd>
|
||||||
</dd>
|
</dd>
|
||||||
|
<dt><a href="global.html#GroupNotificationTypes">GroupNotificationTypes</a></dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
</div>
|
</div>
|
||||||
<div class="summary-column">
|
<div class="summary-column">
|
||||||
<dl class="dl-summary-callout">
|
<dl class="dl-summary-callout">
|
||||||
|
<dt><a href="global.html#MessageAck">MessageAck</a></dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
<dt><a href="global.html#MessageTypes">MessageTypes</a></dt>
|
<dt><a href="global.html#MessageTypes">MessageTypes</a></dt>
|
||||||
<dd>
|
<dd>
|
||||||
</dd>
|
</dd>
|
||||||
@@ -228,6 +234,58 @@
|
|||||||
<td>
|
<td>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<p>MESSAGE_ACK</p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p> </p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p> </p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<p>GROUP_JOIN</p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p> </p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p> </p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<p>GROUP_LEAVE</p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p> </p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p> </p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<p>GROUP_UPDATE</p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p> </p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p> </p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<p>QR_RECEIVED</p>
|
<p>QR_RECEIVED</p>
|
||||||
@@ -273,6 +331,243 @@
|
|||||||
<dl class="dl-compact">
|
<dl class="dl-compact">
|
||||||
</dl>
|
</dl>
|
||||||
<div class="symbol-detail-labels"><span class="label label-readonly">read-only</span></div>
|
<div class="symbol-detail-labels"><span class="label label-readonly">read-only</span></div>
|
||||||
|
<h3 id="GroupNotificationTypes"><span class="symbol-name">GroupNotificationTypes</span><small class="property-type">
|
||||||
|
string</small></h3>
|
||||||
|
<p>Group notification types</p>
|
||||||
|
<section>
|
||||||
|
<h4>Properties</h4>
|
||||||
|
<table class="jsdoc-details-table">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Name</th>
|
||||||
|
<th>Type</th>
|
||||||
|
<th>Optional</th>
|
||||||
|
<th>Description</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<p>ADD</p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p> </p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p> </p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<p>INVITE</p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p> </p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p> </p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<p>REMOVE</p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p> </p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p> </p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<p>LEAVE</p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p> </p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p> </p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<p>SUBJECT</p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p> </p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p> </p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<p>DESCRIPTION</p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p> </p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p> </p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<p>PICTURE</p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p> </p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p> </p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<p>ANNOUNCE</p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p> </p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p> </p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<p>RESTRICT</p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p> </p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p> </p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</section>
|
||||||
|
<dl class="dl-compact">
|
||||||
|
</dl>
|
||||||
|
<div class="symbol-detail-labels"><span class="label label-readonly">read-only</span></div>
|
||||||
|
<h3 id="MessageAck"><span class="symbol-name">MessageAck</span><small class="property-type">
|
||||||
|
number</small></h3>
|
||||||
|
<p>Message ACK</p>
|
||||||
|
<section>
|
||||||
|
<h4>Properties</h4>
|
||||||
|
<table class="jsdoc-details-table">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Name</th>
|
||||||
|
<th>Type</th>
|
||||||
|
<th>Optional</th>
|
||||||
|
<th>Description</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<p>ACK_ERROR</p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p> </p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p> </p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<p>ACK_PENDING</p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p> </p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p> </p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<p>ACK_SERVER</p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p> </p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p> </p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<p>ACK_DEVICE</p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p> </p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p> </p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<p>ACK_READ</p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p> </p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p> </p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<p>ACK_PLAYED</p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p> </p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p> </p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</section>
|
||||||
|
<dl class="dl-compact">
|
||||||
|
</dl>
|
||||||
|
<div class="symbol-detail-labels"><span class="label label-readonly">read-only</span></div>
|
||||||
<h3 id="MessageTypes"><span class="symbol-name">MessageTypes</span><small class="property-type">
|
<h3 id="MessageTypes"><span class="symbol-name">MessageTypes</span><small class="property-type">
|
||||||
string</small></h3>
|
string</small></h3>
|
||||||
<p>Message types</p>
|
<p>Message types</p>
|
||||||
@@ -696,7 +991,7 @@
|
|||||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||||
<div id="jsdoc-footer-container">
|
<div id="jsdoc-footer-container">
|
||||||
<p>
|
<p>
|
||||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.3 on February 10, 2020.
|
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.3 on March 14, 2020.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
474
docs/index.html
474
docs/index.html
@@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta name="generator" content="JSDoc 3.6.3">
|
<meta name="generator" content="JSDoc 3.6.3">
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>whatsapp-web.js 1.0.2 » Home</title>
|
<title>whatsapp-web.js 1.2.4 » Home</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/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/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 rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
||||||
<div id="jsdoc-navbar-container">
|
<div id="jsdoc-navbar-container">
|
||||||
<div id="jsdoc-navbar-content">
|
<div id="jsdoc-navbar-content">
|
||||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>0.<wbr>2</a>
|
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>2.<wbr>4</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
@@ -27,11 +27,11 @@
|
|||||||
<div id="jsdoc-main" role="main">
|
<div id="jsdoc-main" role="main">
|
||||||
<header class="page-header">
|
<header class="page-header">
|
||||||
<h1>
|
<h1>
|
||||||
whatsapp-web.js 1.0.2
|
whatsapp-web.js 1.2.4
|
||||||
</h1>
|
</h1>
|
||||||
</header>
|
</header>
|
||||||
<article>
|
<article>
|
||||||
<p><a href="https://www.npmjs.com/package/whatsapp-web.js"><img src="https://img.shields.io/npm/v/whatsapp-web.js.svg" alt="npm"></a> <a href="https://depfu.com/github/pedroslopez/whatsapp-web.js?project_id=9765"><img src="https://badges.depfu.com/badges/4a65a0de96ece65fdf39e294e0c8dcba/overview.svg" alt="Depfu"></a> <img src="https://img.shields.io/badge/WhatsApp_Web-0.4.612-brightgreen.svg" alt="WhatsApp_Web 0.4.612"></p>
|
<p><a href="https://www.npmjs.com/package/whatsapp-web.js"><img src="https://img.shields.io/npm/v/whatsapp-web.js.svg" alt="npm"></a> <a href="https://depfu.com/github/pedroslopez/whatsapp-web.js?project_id=9765"><img src="https://badges.depfu.com/badges/4a65a0de96ece65fdf39e294e0c8dcba/overview.svg" alt="Depfu"></a> <img src="https://img.shields.io/badge/WhatsApp_Web-0.4.1296-brightgreen.svg" alt="WhatsApp_Web 0.4.1296"></p>
|
||||||
<h1>whatsapp-web.js</h1>
|
<h1>whatsapp-web.js</h1>
|
||||||
<p>A WhatsApp API client that connects through the WhatsApp Web browser app</p>
|
<p>A WhatsApp API client that connects through the WhatsApp Web browser app</p>
|
||||||
<p>It uses Puppeteer to run a real instance of Whatsapp Web to avoid getting blocked.</p>
|
<p>It uses Puppeteer to run a real instance of Whatsapp Web to avoid getting blocked.</p>
|
||||||
@@ -84,7 +84,7 @@ client.initialize();
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Send media (video)</td>
|
<td>Send media (video)</td>
|
||||||
<td><em>pending</em></td>
|
<td>✅ (requires google chrome)</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Send stickers</td>
|
<td>Send stickers</td>
|
||||||
@@ -291,6 +291,40 @@ client.initialize();
|
|||||||
</dt>
|
</dt>
|
||||||
<dd>
|
<dd>
|
||||||
</dd>
|
</dd>
|
||||||
|
<dt class="symbol-index-name">
|
||||||
|
<a href="Chat.html#archive" class="!symbol-index-name">Chat#<wbr>archive()</a>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
<dt class="symbol-index-name">
|
||||||
|
<a href="Chat.html#archived" class="!symbol-index-name">Chat#<wbr>archived</a>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
<dt class="symbol-index-name">
|
||||||
|
<a href="Chat.html#clearMessages" class="!symbol-index-name">Chat#<wbr>clearMessages()</a>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
<dt class="symbol-index-name">
|
||||||
|
<a href="Chat.html#clearState" class="!symbol-index-name">Chat#<wbr>clearState()</a>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
<dt class="symbol-index-name">
|
||||||
|
<a href="Chat.html#delete" class="!symbol-index-name">Chat#<wbr>delete()</a>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
</div>
|
||||||
|
<div class="symbol-index-column">
|
||||||
|
<dl class="symbol-index-list">
|
||||||
|
<dt class="symbol-index-name">
|
||||||
|
<a href="Chat.html#fetchMessages" class="!symbol-index-name">Chat#<wbr>fetchMessages(searchOptions)</a>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
<dt class="symbol-index-name">
|
<dt class="symbol-index-name">
|
||||||
<a href="Chat.html#id" class="!symbol-index-name">Chat#<wbr>id</a>
|
<a href="Chat.html#id" class="!symbol-index-name">Chat#<wbr>id</a>
|
||||||
</dt>
|
</dt>
|
||||||
@@ -301,10 +335,6 @@ client.initialize();
|
|||||||
</dt>
|
</dt>
|
||||||
<dd>
|
<dd>
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
|
||||||
</div>
|
|
||||||
<div class="symbol-index-column">
|
|
||||||
<dl class="symbol-index-list">
|
|
||||||
<dt class="symbol-index-name">
|
<dt class="symbol-index-name">
|
||||||
<a href="Chat.html#isReadOnly" class="!symbol-index-name">Chat#<wbr>isReadOnly</a>
|
<a href="Chat.html#isReadOnly" class="!symbol-index-name">Chat#<wbr>isReadOnly</a>
|
||||||
</dt>
|
</dt>
|
||||||
@@ -324,11 +354,31 @@ client.initialize();
|
|||||||
</div>
|
</div>
|
||||||
<div class="symbol-index-column">
|
<div class="symbol-index-column">
|
||||||
<dl class="symbol-index-list">
|
<dl class="symbol-index-list">
|
||||||
|
<dt class="symbol-index-name">
|
||||||
|
<a href="Chat.html#sendSeen" class="!symbol-index-name">Chat#<wbr>sendSeen()</a>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
<dt class="symbol-index-name">
|
||||||
|
<a href="Chat.html#sendStateRecording" class="!symbol-index-name">Chat#<wbr>sendStateRecording()</a>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
<dt class="symbol-index-name">
|
||||||
|
<a href="Chat.html#sendStateTyping" class="!symbol-index-name">Chat#<wbr>sendStateTyping()</a>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
<dt class="symbol-index-name">
|
<dt class="symbol-index-name">
|
||||||
<a href="Chat.html#timestamp" class="!symbol-index-name">Chat#<wbr>timestamp</a>
|
<a href="Chat.html#timestamp" class="!symbol-index-name">Chat#<wbr>timestamp</a>
|
||||||
</dt>
|
</dt>
|
||||||
<dd>
|
<dd>
|
||||||
</dd>
|
</dd>
|
||||||
|
<dt class="symbol-index-name">
|
||||||
|
<a href="Chat.html#unarchive" class="!symbol-index-name">Chat#<wbr>unarchive()</a>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
<dt class="symbol-index-name">
|
<dt class="symbol-index-name">
|
||||||
<a href="Chat.html#unreadCount" class="!symbol-index-name">Chat#<wbr>unreadCount</a>
|
<a href="Chat.html#unreadCount" class="!symbol-index-name">Chat#<wbr>unreadCount</a>
|
||||||
</dt>
|
</dt>
|
||||||
@@ -389,6 +439,11 @@ client.initialize();
|
|||||||
</dt>
|
</dt>
|
||||||
<dd>
|
<dd>
|
||||||
</dd>
|
</dd>
|
||||||
|
<dt class="symbol-index-name">
|
||||||
|
<a href="Client.html#archiveChat" class="!symbol-index-name">Client#<wbr>archiveChat()</a>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
<dt class="symbol-index-name">
|
<dt class="symbol-index-name">
|
||||||
<a href="Client.html#destroy" class="!symbol-index-name">Client#<wbr>destroy()</a>
|
<a href="Client.html#destroy" class="!symbol-index-name">Client#<wbr>destroy()</a>
|
||||||
</dt>
|
</dt>
|
||||||
@@ -414,15 +469,35 @@ client.initialize();
|
|||||||
</dt>
|
</dt>
|
||||||
<dd>
|
<dd>
|
||||||
</dd>
|
</dd>
|
||||||
|
<dt class="symbol-index-name">
|
||||||
|
<a href="Client.html#event:group_join" class="!symbol-index-name">Client#<wbr>event:group_join</a>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
<dt class="symbol-index-name">
|
||||||
|
<a href="Client.html#event:group_leave" class="!symbol-index-name">Client#<wbr>event:group_leave</a>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
</div>
|
</div>
|
||||||
<div class="symbol-index-column">
|
<div class="symbol-index-column">
|
||||||
<dl class="symbol-index-list">
|
<dl class="symbol-index-list">
|
||||||
|
<dt class="symbol-index-name">
|
||||||
|
<a href="Client.html#event:group_update" class="!symbol-index-name">Client#<wbr>event:group_update</a>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
<dt class="symbol-index-name">
|
<dt class="symbol-index-name">
|
||||||
<a href="Client.html#event:message" class="!symbol-index-name">Client#<wbr>event:message</a>
|
<a href="Client.html#event:message" class="!symbol-index-name">Client#<wbr>event:message</a>
|
||||||
</dt>
|
</dt>
|
||||||
<dd>
|
<dd>
|
||||||
</dd>
|
</dd>
|
||||||
|
<dt class="symbol-index-name">
|
||||||
|
<a href="Client.html#event:message_ack" class="!symbol-index-name">Client#<wbr>event:message_ack</a>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
<dt class="symbol-index-name">
|
<dt class="symbol-index-name">
|
||||||
<a href="Client.html#event:message_create" class="!symbol-index-name">Client#<wbr>event:message_create</a>
|
<a href="Client.html#event:message_create" class="!symbol-index-name">Client#<wbr>event:message_create</a>
|
||||||
</dt>
|
</dt>
|
||||||
@@ -453,15 +528,15 @@ client.initialize();
|
|||||||
</dt>
|
</dt>
|
||||||
<dd>
|
<dd>
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
|
||||||
</div>
|
|
||||||
<div class="symbol-index-column">
|
|
||||||
<dl class="symbol-index-list">
|
|
||||||
<dt class="symbol-index-name">
|
<dt class="symbol-index-name">
|
||||||
<a href="Client.html#getChats" class="!symbol-index-name">Client#<wbr>getChats()</a>
|
<a href="Client.html#getChats" class="!symbol-index-name">Client#<wbr>getChats()</a>
|
||||||
</dt>
|
</dt>
|
||||||
<dd>
|
<dd>
|
||||||
</dd>
|
</dd>
|
||||||
|
</dl>
|
||||||
|
</div>
|
||||||
|
<div class="symbol-index-column">
|
||||||
|
<dl class="symbol-index-list">
|
||||||
<dt class="symbol-index-name">
|
<dt class="symbol-index-name">
|
||||||
<a href="Client.html#getContactById" class="!symbol-index-name">Client#<wbr>getContactById(contactId)</a>
|
<a href="Client.html#getContactById" class="!symbol-index-name">Client#<wbr>getContactById(contactId)</a>
|
||||||
</dt>
|
</dt>
|
||||||
@@ -472,21 +547,41 @@ client.initialize();
|
|||||||
</dt>
|
</dt>
|
||||||
<dd>
|
<dd>
|
||||||
</dd>
|
</dd>
|
||||||
|
<dt class="symbol-index-name">
|
||||||
|
<a href="Client.html#getState" class="!symbol-index-name">Client#<wbr>getState()</a>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
<dt class="symbol-index-name">
|
<dt class="symbol-index-name">
|
||||||
<a href="Client.html#initialize" class="!symbol-index-name">Client#<wbr>initialize()</a>
|
<a href="Client.html#initialize" class="!symbol-index-name">Client#<wbr>initialize()</a>
|
||||||
</dt>
|
</dt>
|
||||||
<dd>
|
<dd>
|
||||||
</dd>
|
</dd>
|
||||||
|
<dt class="symbol-index-name">
|
||||||
|
<a href="Client.html#resetState" class="!symbol-index-name">Client#<wbr>resetState()</a>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
<dt class="symbol-index-name">
|
<dt class="symbol-index-name">
|
||||||
<a href="Client.html#sendMessage" class="!symbol-index-name">Client#<wbr>sendMessage(chatId, content, options)</a>
|
<a href="Client.html#sendMessage" class="!symbol-index-name">Client#<wbr>sendMessage(chatId, content, options)</a>
|
||||||
</dt>
|
</dt>
|
||||||
<dd>
|
<dd>
|
||||||
</dd>
|
</dd>
|
||||||
|
<dt class="symbol-index-name">
|
||||||
|
<a href="Client.html#sendSeen" class="!symbol-index-name">Client#<wbr>sendSeen(chatId)</a>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
<dt class="symbol-index-name">
|
<dt class="symbol-index-name">
|
||||||
<a href="Client.html#setStatus" class="!symbol-index-name">Client#<wbr>setStatus(status)</a>
|
<a href="Client.html#setStatus" class="!symbol-index-name">Client#<wbr>setStatus(status)</a>
|
||||||
</dt>
|
</dt>
|
||||||
<dd>
|
<dd>
|
||||||
</dd>
|
</dd>
|
||||||
|
<dt class="symbol-index-name">
|
||||||
|
<a href="Client.html#unarchiveChat" class="!symbol-index-name">Client#<wbr>unarchiveChat()</a>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -647,7 +742,12 @@ client.initialize();
|
|||||||
<dd>
|
<dd>
|
||||||
</dd>
|
</dd>
|
||||||
<dt class="symbol-index-name">
|
<dt class="symbol-index-name">
|
||||||
<a href="global.html#Events#.MESSAGE_CREATE" class="!symbol-index-name">Events.<wbr>MESSAGE_CREATE</a>
|
<a href="global.html#Events#.GROUP_JOIN" class="!symbol-index-name">Events.<wbr>GROUP_JOIN</a>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
<dt class="symbol-index-name">
|
||||||
|
<a href="global.html#Events#.GROUP_LEAVE" class="!symbol-index-name">Events.<wbr>GROUP_LEAVE</a>
|
||||||
</dt>
|
</dt>
|
||||||
<dd>
|
<dd>
|
||||||
</dd>
|
</dd>
|
||||||
@@ -655,6 +755,21 @@ client.initialize();
|
|||||||
</div>
|
</div>
|
||||||
<div class="symbol-index-column">
|
<div class="symbol-index-column">
|
||||||
<dl class="symbol-index-list">
|
<dl class="symbol-index-list">
|
||||||
|
<dt class="symbol-index-name">
|
||||||
|
<a href="global.html#Events#.GROUP_UPDATE" class="!symbol-index-name">Events.<wbr>GROUP_UPDATE</a>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
<dt class="symbol-index-name">
|
||||||
|
<a href="global.html#Events#.MESSAGE_ACK" class="!symbol-index-name">Events.<wbr>MESSAGE_ACK</a>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
<dt class="symbol-index-name">
|
||||||
|
<a href="global.html#Events#.MESSAGE_CREATE" class="!symbol-index-name">Events.<wbr>MESSAGE_CREATE</a>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
<dt class="symbol-index-name">
|
<dt class="symbol-index-name">
|
||||||
<a href="global.html#Events#.MESSAGE_RECEIVED" class="!symbol-index-name">Events.<wbr>MESSAGE_RECEIVED</a>
|
<a href="global.html#Events#.MESSAGE_RECEIVED" class="!symbol-index-name">Events.<wbr>MESSAGE_RECEIVED</a>
|
||||||
</dt>
|
</dt>
|
||||||
@@ -665,6 +780,10 @@ client.initialize();
|
|||||||
</dt>
|
</dt>
|
||||||
<dd>
|
<dd>
|
||||||
</dd>
|
</dd>
|
||||||
|
</dl>
|
||||||
|
</div>
|
||||||
|
<div class="symbol-index-column">
|
||||||
|
<dl class="symbol-index-list">
|
||||||
<dt class="symbol-index-name">
|
<dt class="symbol-index-name">
|
||||||
<a href="global.html#Events#.MESSAGE_REVOKED_ME" class="!symbol-index-name">Events.<wbr>MESSAGE_REVOKED_ME</a>
|
<a href="global.html#Events#.MESSAGE_REVOKED_ME" class="!symbol-index-name">Events.<wbr>MESSAGE_REVOKED_ME</a>
|
||||||
</dt>
|
</dt>
|
||||||
@@ -675,10 +794,6 @@ client.initialize();
|
|||||||
</dt>
|
</dt>
|
||||||
<dd>
|
<dd>
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
|
||||||
</div>
|
|
||||||
<div class="symbol-index-column">
|
|
||||||
<dl class="symbol-index-list">
|
|
||||||
<dt class="symbol-index-name">
|
<dt class="symbol-index-name">
|
||||||
<a href="global.html#Events#.READY" class="!symbol-index-name">Events.<wbr>READY</a>
|
<a href="global.html#Events#.READY" class="!symbol-index-name">Events.<wbr>READY</a>
|
||||||
</dt>
|
</dt>
|
||||||
@@ -720,30 +835,60 @@ client.initialize();
|
|||||||
</dt>
|
</dt>
|
||||||
<dd>
|
<dd>
|
||||||
</dd>
|
</dd>
|
||||||
|
<dt class="symbol-index-name">
|
||||||
|
<a href="GroupChat.html#archive" class="!symbol-index-name">GroupChat#<wbr>archive()</a>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
<dt class="symbol-index-name">
|
||||||
|
<a href="GroupChat.html#archived" class="!symbol-index-name">GroupChat#<wbr>archived</a>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
<dt class="symbol-index-name">
|
||||||
|
<a href="GroupChat.html#clearMessages" class="!symbol-index-name">GroupChat#<wbr>clearMessages()</a>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
<dt class="symbol-index-name">
|
||||||
|
<a href="GroupChat.html#clearState" class="!symbol-index-name">GroupChat#<wbr>clearState()</a>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
<dt class="symbol-index-name">
|
<dt class="symbol-index-name">
|
||||||
<a href="GroupChat.html#createdAt" class="!symbol-index-name">GroupChat#<wbr>createdAt</a>
|
<a href="GroupChat.html#createdAt" class="!symbol-index-name">GroupChat#<wbr>createdAt</a>
|
||||||
</dt>
|
</dt>
|
||||||
<dd>
|
<dd>
|
||||||
</dd>
|
</dd>
|
||||||
|
<dt class="symbol-index-name">
|
||||||
|
<a href="GroupChat.html#delete" class="!symbol-index-name">GroupChat#<wbr>delete()</a>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
<dt class="symbol-index-name">
|
<dt class="symbol-index-name">
|
||||||
<a href="GroupChat.html#demoteParticipants" class="!symbol-index-name">GroupChat#<wbr>demoteParticipants(participantIds)</a>
|
<a href="GroupChat.html#demoteParticipants" class="!symbol-index-name">GroupChat#<wbr>demoteParticipants(participantIds)</a>
|
||||||
</dt>
|
</dt>
|
||||||
<dd>
|
<dd>
|
||||||
</dd>
|
</dd>
|
||||||
|
</dl>
|
||||||
|
</div>
|
||||||
|
<div class="symbol-index-column">
|
||||||
|
<dl class="symbol-index-list">
|
||||||
<dt class="symbol-index-name">
|
<dt class="symbol-index-name">
|
||||||
<a href="GroupChat.html#description" class="!symbol-index-name">GroupChat#<wbr>description</a>
|
<a href="GroupChat.html#description" class="!symbol-index-name">GroupChat#<wbr>description</a>
|
||||||
</dt>
|
</dt>
|
||||||
<dd>
|
<dd>
|
||||||
</dd>
|
</dd>
|
||||||
|
<dt class="symbol-index-name">
|
||||||
|
<a href="GroupChat.html#fetchMessages" class="!symbol-index-name">GroupChat#<wbr>fetchMessages(searchOptions)</a>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
<dt class="symbol-index-name">
|
<dt class="symbol-index-name">
|
||||||
<a href="GroupChat.html#getInviteCode" class="!symbol-index-name">GroupChat#<wbr>getInviteCode()</a>
|
<a href="GroupChat.html#getInviteCode" class="!symbol-index-name">GroupChat#<wbr>getInviteCode()</a>
|
||||||
</dt>
|
</dt>
|
||||||
<dd>
|
<dd>
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
|
||||||
</div>
|
|
||||||
<div class="symbol-index-column">
|
|
||||||
<dl class="symbol-index-list">
|
|
||||||
<dt class="symbol-index-name">
|
<dt class="symbol-index-name">
|
||||||
<a href="GroupChat.html#id" class="!symbol-index-name">GroupChat#<wbr>id</a>
|
<a href="GroupChat.html#id" class="!symbol-index-name">GroupChat#<wbr>id</a>
|
||||||
</dt>
|
</dt>
|
||||||
@@ -803,6 +948,21 @@ client.initialize();
|
|||||||
</dt>
|
</dt>
|
||||||
<dd>
|
<dd>
|
||||||
</dd>
|
</dd>
|
||||||
|
<dt class="symbol-index-name">
|
||||||
|
<a href="GroupChat.html#sendSeen" class="!symbol-index-name">GroupChat#<wbr>sendSeen()</a>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
<dt class="symbol-index-name">
|
||||||
|
<a href="GroupChat.html#sendStateRecording" class="!symbol-index-name">GroupChat#<wbr>sendStateRecording()</a>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
<dt class="symbol-index-name">
|
||||||
|
<a href="GroupChat.html#sendStateTyping" class="!symbol-index-name">GroupChat#<wbr>sendStateTyping()</a>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
<dt class="symbol-index-name">
|
<dt class="symbol-index-name">
|
||||||
<a href="GroupChat.html#setDescription" class="!symbol-index-name">GroupChat#<wbr>setDescription(description)</a>
|
<a href="GroupChat.html#setDescription" class="!symbol-index-name">GroupChat#<wbr>setDescription(description)</a>
|
||||||
</dt>
|
</dt>
|
||||||
@@ -818,6 +978,11 @@ client.initialize();
|
|||||||
</dt>
|
</dt>
|
||||||
<dd>
|
<dd>
|
||||||
</dd>
|
</dd>
|
||||||
|
<dt class="symbol-index-name">
|
||||||
|
<a href="GroupChat.html#unarchive" class="!symbol-index-name">GroupChat#<wbr>unarchive()</a>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
<dt class="symbol-index-name">
|
<dt class="symbol-index-name">
|
||||||
<a href="GroupChat.html#unreadCount" class="!symbol-index-name">GroupChat#<wbr>unreadCount</a>
|
<a href="GroupChat.html#unreadCount" class="!symbol-index-name">GroupChat#<wbr>unreadCount</a>
|
||||||
</dt>
|
</dt>
|
||||||
@@ -828,6 +993,149 @@ client.initialize();
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
<section>
|
||||||
|
<div class="symbol-index-content">
|
||||||
|
<h2 id="GroupNotification">GroupNotification</h2>
|
||||||
|
<div class="symbol-index-section">
|
||||||
|
<div class="symbol-index-column">
|
||||||
|
<dl class="symbol-index-list">
|
||||||
|
<dt class="symbol-index-name">
|
||||||
|
<a href="GroupNotification.html" class="!symbol-index-name">GroupNotification()</a>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
<dt class="symbol-index-name">
|
||||||
|
<a href="GroupNotification.html#author" class="!symbol-index-name">GroupNotification#<wbr>author</a>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
<dt class="symbol-index-name">
|
||||||
|
<a href="GroupNotification.html#body" class="!symbol-index-name">GroupNotification#<wbr>body</a>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
<dt class="symbol-index-name">
|
||||||
|
<a href="GroupNotification.html#chatId" class="!symbol-index-name">GroupNotification#<wbr>chatId</a>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
</div>
|
||||||
|
<div class="symbol-index-column">
|
||||||
|
<dl class="symbol-index-list">
|
||||||
|
<dt class="symbol-index-name">
|
||||||
|
<a href="GroupNotification.html#getChat" class="!symbol-index-name">GroupNotification#<wbr>getChat()</a>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
<dt class="symbol-index-name">
|
||||||
|
<a href="GroupNotification.html#getContact" class="!symbol-index-name">GroupNotification#<wbr>getContact()</a>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
<dt class="symbol-index-name">
|
||||||
|
<a href="GroupNotification.html#getRecipients" class="!symbol-index-name">GroupNotification#<wbr>getRecipients()</a>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
<dt class="symbol-index-name">
|
||||||
|
<a href="GroupNotification.html#id" class="!symbol-index-name">GroupNotification#<wbr>id</a>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
</div>
|
||||||
|
<div class="symbol-index-column">
|
||||||
|
<dl class="symbol-index-list">
|
||||||
|
<dt class="symbol-index-name">
|
||||||
|
<a href="GroupNotification.html#recipientIds" class="!symbol-index-name">GroupNotification#<wbr>recipientIds</a>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
<dt class="symbol-index-name">
|
||||||
|
<a href="GroupNotification.html#reply" class="!symbol-index-name">GroupNotification#<wbr>reply(content, options)</a>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
<dt class="symbol-index-name">
|
||||||
|
<a href="GroupNotification.html#timestamp" class="!symbol-index-name">GroupNotification#<wbr>timestamp</a>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
<dt class="symbol-index-name">
|
||||||
|
<a href="GroupNotification.html#type" class="!symbol-index-name">GroupNotification#<wbr>type</a>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
<section>
|
||||||
|
<div class="symbol-index-content">
|
||||||
|
<h2 id="GroupNotificationTypes">GroupNotificationTypes</h2>
|
||||||
|
<div class="symbol-index-section">
|
||||||
|
<div class="symbol-index-column">
|
||||||
|
<dl class="symbol-index-list">
|
||||||
|
<dt class="symbol-index-name">
|
||||||
|
<a href="global.html#GroupNotificationTypes#.ADD" class="!symbol-index-name">GroupNotificationTypes.<wbr>ADD</a>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
<dt class="symbol-index-name">
|
||||||
|
<a href="global.html#GroupNotificationTypes#.ANNOUNCE" class="!symbol-index-name">GroupNotificationTypes.<wbr>ANNOUNCE</a>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
<dt class="symbol-index-name">
|
||||||
|
<a href="global.html#GroupNotificationTypes#.DESCRIPTION" class="!symbol-index-name">GroupNotificationTypes.<wbr>DESCRIPTION</a>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
</div>
|
||||||
|
<div class="symbol-index-column">
|
||||||
|
<dl class="symbol-index-list">
|
||||||
|
<dt class="symbol-index-name">
|
||||||
|
<a href="global.html#GroupNotificationTypes#.INVITE" class="!symbol-index-name">GroupNotificationTypes.<wbr>INVITE</a>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
<dt class="symbol-index-name">
|
||||||
|
<a href="global.html#GroupNotificationTypes#.LEAVE" class="!symbol-index-name">GroupNotificationTypes.<wbr>LEAVE</a>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
<dt class="symbol-index-name">
|
||||||
|
<a href="global.html#GroupNotificationTypes#.PICTURE" class="!symbol-index-name">GroupNotificationTypes.<wbr>PICTURE</a>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
</div>
|
||||||
|
<div class="symbol-index-column">
|
||||||
|
<dl class="symbol-index-list">
|
||||||
|
<dt class="symbol-index-name">
|
||||||
|
<a href="global.html#GroupNotificationTypes#.REMOVE" class="!symbol-index-name">GroupNotificationTypes.<wbr>REMOVE</a>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
<dt class="symbol-index-name">
|
||||||
|
<a href="global.html#GroupNotificationTypes#.RESTRICT" class="!symbol-index-name">GroupNotificationTypes.<wbr>RESTRICT</a>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
<dt class="symbol-index-name">
|
||||||
|
<a href="global.html#GroupNotificationTypes#.SUBJECT" class="!symbol-index-name">GroupNotificationTypes.<wbr>SUBJECT</a>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
<section>
|
<section>
|
||||||
<div class="symbol-index-content">
|
<div class="symbol-index-content">
|
||||||
<h2 id="Location">Location</h2>
|
<h2 id="Location">Location</h2>
|
||||||
@@ -893,6 +1201,11 @@ client.initialize();
|
|||||||
</dt>
|
</dt>
|
||||||
<dd>
|
<dd>
|
||||||
</dd>
|
</dd>
|
||||||
|
<dt class="symbol-index-name">
|
||||||
|
<a href="Message.html#delete" class="!symbol-index-name">Message#<wbr>delete(everyone)</a>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
<dt class="symbol-index-name">
|
<dt class="symbol-index-name">
|
||||||
<a href="Message.html#downloadMedia" class="!symbol-index-name">Message#<wbr>downloadMedia()</a>
|
<a href="Message.html#downloadMedia" class="!symbol-index-name">Message#<wbr>downloadMedia()</a>
|
||||||
</dt>
|
</dt>
|
||||||
@@ -947,15 +1260,15 @@ client.initialize();
|
|||||||
</dt>
|
</dt>
|
||||||
<dd>
|
<dd>
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
|
||||||
</div>
|
|
||||||
<div class="symbol-index-column">
|
|
||||||
<dl class="symbol-index-list">
|
|
||||||
<dt class="symbol-index-name">
|
<dt class="symbol-index-name">
|
||||||
<a href="Message.html#isForwarded" class="!symbol-index-name">Message#<wbr>isForwarded</a>
|
<a href="Message.html#isForwarded" class="!symbol-index-name">Message#<wbr>isForwarded</a>
|
||||||
</dt>
|
</dt>
|
||||||
<dd>
|
<dd>
|
||||||
</dd>
|
</dd>
|
||||||
|
</dl>
|
||||||
|
</div>
|
||||||
|
<div class="symbol-index-column">
|
||||||
|
<dl class="symbol-index-list">
|
||||||
<dt class="symbol-index-name">
|
<dt class="symbol-index-name">
|
||||||
<a href="Message.html#location" class="!symbol-index-name">Message#<wbr>location</a>
|
<a href="Message.html#location" class="!symbol-index-name">Message#<wbr>location</a>
|
||||||
</dt>
|
</dt>
|
||||||
@@ -991,6 +1304,55 @@ client.initialize();
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
<section>
|
||||||
|
<div class="symbol-index-content">
|
||||||
|
<h2 id="MessageAck">MessageAck</h2>
|
||||||
|
<div class="symbol-index-section">
|
||||||
|
<div class="symbol-index-column">
|
||||||
|
<dl class="symbol-index-list">
|
||||||
|
<dt class="symbol-index-name">
|
||||||
|
<a href="global.html#MessageAck#.ACK_DEVICE" class="!symbol-index-name">MessageAck.<wbr>ACK_DEVICE</a>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
<dt class="symbol-index-name">
|
||||||
|
<a href="global.html#MessageAck#.ACK_ERROR" class="!symbol-index-name">MessageAck.<wbr>ACK_ERROR</a>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
</div>
|
||||||
|
<div class="symbol-index-column">
|
||||||
|
<dl class="symbol-index-list">
|
||||||
|
<dt class="symbol-index-name">
|
||||||
|
<a href="global.html#MessageAck#.ACK_PENDING" class="!symbol-index-name">MessageAck.<wbr>ACK_PENDING</a>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
<dt class="symbol-index-name">
|
||||||
|
<a href="global.html#MessageAck#.ACK_PLAYED" class="!symbol-index-name">MessageAck.<wbr>ACK_PLAYED</a>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
</div>
|
||||||
|
<div class="symbol-index-column">
|
||||||
|
<dl class="symbol-index-list">
|
||||||
|
<dt class="symbol-index-name">
|
||||||
|
<a href="global.html#MessageAck#.ACK_READ" class="!symbol-index-name">MessageAck.<wbr>ACK_READ</a>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
<dt class="symbol-index-name">
|
||||||
|
<a href="global.html#MessageAck#.ACK_SERVER" class="!symbol-index-name">MessageAck.<wbr>ACK_SERVER</a>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
<section>
|
<section>
|
||||||
<div class="symbol-index-content">
|
<div class="symbol-index-content">
|
||||||
<h2 id="MessageMedia">MessageMedia</h2>
|
<h2 id="MessageMedia">MessageMedia</h2>
|
||||||
@@ -1120,6 +1482,40 @@ client.initialize();
|
|||||||
</dt>
|
</dt>
|
||||||
<dd>
|
<dd>
|
||||||
</dd>
|
</dd>
|
||||||
|
<dt class="symbol-index-name">
|
||||||
|
<a href="PrivateChat.html#archive" class="!symbol-index-name">PrivateChat#<wbr>archive()</a>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
<dt class="symbol-index-name">
|
||||||
|
<a href="PrivateChat.html#archived" class="!symbol-index-name">PrivateChat#<wbr>archived</a>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
<dt class="symbol-index-name">
|
||||||
|
<a href="PrivateChat.html#clearMessages" class="!symbol-index-name">PrivateChat#<wbr>clearMessages()</a>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
<dt class="symbol-index-name">
|
||||||
|
<a href="PrivateChat.html#clearState" class="!symbol-index-name">PrivateChat#<wbr>clearState()</a>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
<dt class="symbol-index-name">
|
||||||
|
<a href="PrivateChat.html#delete" class="!symbol-index-name">PrivateChat#<wbr>delete()</a>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
</div>
|
||||||
|
<div class="symbol-index-column">
|
||||||
|
<dl class="symbol-index-list">
|
||||||
|
<dt class="symbol-index-name">
|
||||||
|
<a href="PrivateChat.html#fetchMessages" class="!symbol-index-name">PrivateChat#<wbr>fetchMessages(searchOptions)</a>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
<dt class="symbol-index-name">
|
<dt class="symbol-index-name">
|
||||||
<a href="PrivateChat.html#id" class="!symbol-index-name">PrivateChat#<wbr>id</a>
|
<a href="PrivateChat.html#id" class="!symbol-index-name">PrivateChat#<wbr>id</a>
|
||||||
</dt>
|
</dt>
|
||||||
@@ -1130,10 +1526,6 @@ client.initialize();
|
|||||||
</dt>
|
</dt>
|
||||||
<dd>
|
<dd>
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
|
||||||
</div>
|
|
||||||
<div class="symbol-index-column">
|
|
||||||
<dl class="symbol-index-list">
|
|
||||||
<dt class="symbol-index-name">
|
<dt class="symbol-index-name">
|
||||||
<a href="PrivateChat.html#isReadOnly" class="!symbol-index-name">PrivateChat#<wbr>isReadOnly</a>
|
<a href="PrivateChat.html#isReadOnly" class="!symbol-index-name">PrivateChat#<wbr>isReadOnly</a>
|
||||||
</dt>
|
</dt>
|
||||||
@@ -1153,11 +1545,31 @@ client.initialize();
|
|||||||
</div>
|
</div>
|
||||||
<div class="symbol-index-column">
|
<div class="symbol-index-column">
|
||||||
<dl class="symbol-index-list">
|
<dl class="symbol-index-list">
|
||||||
|
<dt class="symbol-index-name">
|
||||||
|
<a href="PrivateChat.html#sendSeen" class="!symbol-index-name">PrivateChat#<wbr>sendSeen()</a>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
<dt class="symbol-index-name">
|
||||||
|
<a href="PrivateChat.html#sendStateRecording" class="!symbol-index-name">PrivateChat#<wbr>sendStateRecording()</a>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
<dt class="symbol-index-name">
|
||||||
|
<a href="PrivateChat.html#sendStateTyping" class="!symbol-index-name">PrivateChat#<wbr>sendStateTyping()</a>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
<dt class="symbol-index-name">
|
<dt class="symbol-index-name">
|
||||||
<a href="PrivateChat.html#timestamp" class="!symbol-index-name">PrivateChat#<wbr>timestamp</a>
|
<a href="PrivateChat.html#timestamp" class="!symbol-index-name">PrivateChat#<wbr>timestamp</a>
|
||||||
</dt>
|
</dt>
|
||||||
<dd>
|
<dd>
|
||||||
</dd>
|
</dd>
|
||||||
|
<dt class="symbol-index-name">
|
||||||
|
<a href="PrivateChat.html#unarchive" class="!symbol-index-name">PrivateChat#<wbr>unarchive()</a>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
<dt class="symbol-index-name">
|
<dt class="symbol-index-name">
|
||||||
<a href="PrivateChat.html#unreadCount" class="!symbol-index-name">PrivateChat#<wbr>unreadCount</a>
|
<a href="PrivateChat.html#unreadCount" class="!symbol-index-name">PrivateChat#<wbr>unreadCount</a>
|
||||||
</dt>
|
</dt>
|
||||||
@@ -1403,7 +1815,7 @@ client.initialize();
|
|||||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||||
<div id="jsdoc-footer-container">
|
<div id="jsdoc-footer-container">
|
||||||
<p>
|
<p>
|
||||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.3 on February 10, 2020.
|
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.3 on March 14, 2020.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
treeNode.tree({
|
treeNode.tree({
|
||||||
autoEscape: false,
|
autoEscape: false,
|
||||||
closedIcon: '⇢',
|
closedIcon: '⇢',
|
||||||
data: [{"label":"<a href=\"global.html\">Globals</a>","id":"global","children":[]},{"label":"<a href=\"Base.html\">Base</a>","id":"Base","children":[]},{"label":"<a href=\"BusinessContact.html\">BusinessContact</a>","id":"BusinessContact","children":[]},{"label":"<a href=\"Chat.html\">Chat</a>","id":"Chat","children":[]},{"label":"<a href=\"Client.html\">Client</a>","id":"Client","children":[]},{"label":"<a href=\"ClientInfo.html\">ClientInfo</a>","id":"ClientInfo","children":[]},{"label":"<a href=\"Contact.html\">Contact</a>","id":"Contact","children":[]},{"label":"<a href=\"GroupChat.html\">GroupChat</a>","id":"GroupChat","children":[]},{"label":"<a href=\"Location.html\">Location</a>","id":"Location","children":[]},{"label":"<a href=\"Message.html\">Message</a>","id":"Message","children":[]},{"label":"<a href=\"MessageMedia.html\">MessageMedia</a>","id":"MessageMedia","children":[]},{"label":"<a href=\"PrivateChat.html\">PrivateChat</a>","id":"PrivateChat","children":[]},{"label":"<a href=\"PrivateContact.html\">PrivateContact</a>","id":"PrivateContact","children":[]},{"label":"<a href=\"Util.html\">Util</a>","id":"Util","children":[]}],
|
data: [{"label":"<a href=\"global.html\">Globals</a>","id":"global","children":[]},{"label":"<a href=\"Base.html\">Base</a>","id":"Base","children":[]},{"label":"<a href=\"BusinessContact.html\">BusinessContact</a>","id":"BusinessContact","children":[]},{"label":"<a href=\"Chat.html\">Chat</a>","id":"Chat","children":[]},{"label":"<a href=\"Client.html\">Client</a>","id":"Client","children":[]},{"label":"<a href=\"ClientInfo.html\">ClientInfo</a>","id":"ClientInfo","children":[]},{"label":"<a href=\"Contact.html\">Contact</a>","id":"Contact","children":[]},{"label":"<a href=\"GroupChat.html\">GroupChat</a>","id":"GroupChat","children":[]},{"label":"<a href=\"GroupNotification.html\">GroupNotification</a>","id":"GroupNotification","children":[]},{"label":"<a href=\"Location.html\">Location</a>","id":"Location","children":[]},{"label":"<a href=\"Message.html\">Message</a>","id":"Message","children":[]},{"label":"<a href=\"MessageMedia.html\">MessageMedia</a>","id":"MessageMedia","children":[]},{"label":"<a href=\"PrivateChat.html\">PrivateChat</a>","id":"PrivateChat","children":[]},{"label":"<a href=\"PrivateContact.html\">PrivateContact</a>","id":"PrivateContact","children":[]},{"label":"<a href=\"Util.html\">Util</a>","id":"Util","children":[]}],
|
||||||
openedIcon: ' ⇣',
|
openedIcon: ' ⇣',
|
||||||
saveState: false,
|
saveState: false,
|
||||||
useContextMenu: false
|
useContextMenu: false
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta name="generator" content="JSDoc 3.6.3">
|
<meta name="generator" content="JSDoc 3.6.3">
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>whatsapp-web.js 1.0.2 » Source: structures/Base.js</title>
|
<title>whatsapp-web.js 1.2.4 » Source: structures/Base.js</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/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/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 rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
||||||
<div id="jsdoc-navbar-container">
|
<div id="jsdoc-navbar-container">
|
||||||
<div id="jsdoc-navbar-content">
|
<div id="jsdoc-navbar-content">
|
||||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>0.<wbr>2</a>
|
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>2.<wbr>4</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
@@ -60,7 +60,7 @@ module.exports = Base;</code></pre>
|
|||||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||||
<div id="jsdoc-footer-container">
|
<div id="jsdoc-footer-container">
|
||||||
<p>
|
<p>
|
||||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.3 on February 10, 2020.
|
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.3 on March 14, 2020.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta name="generator" content="JSDoc 3.6.3">
|
<meta name="generator" content="JSDoc 3.6.3">
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>whatsapp-web.js 1.0.2 » Source: structures/BusinessContact.js</title>
|
<title>whatsapp-web.js 1.2.4 » Source: structures/BusinessContact.js</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/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/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 rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
||||||
<div id="jsdoc-navbar-container">
|
<div id="jsdoc-navbar-container">
|
||||||
<div id="jsdoc-navbar-content">
|
<div id="jsdoc-navbar-content">
|
||||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>0.<wbr>2</a>
|
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>2.<wbr>4</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
@@ -59,7 +59,7 @@ module.exports = BusinessContact;</code></pre>
|
|||||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||||
<div id="jsdoc-footer-container">
|
<div id="jsdoc-footer-container">
|
||||||
<p>
|
<p>
|
||||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.3 on February 10, 2020.
|
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.3 on March 14, 2020.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta name="generator" content="JSDoc 3.6.3">
|
<meta name="generator" content="JSDoc 3.6.3">
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>whatsapp-web.js 1.0.2 » Source: structures/Chat.js</title>
|
<title>whatsapp-web.js 1.2.4 » Source: structures/Chat.js</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/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/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 rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
||||||
<div id="jsdoc-navbar-container">
|
<div id="jsdoc-navbar-container">
|
||||||
<div id="jsdoc-navbar-content">
|
<div id="jsdoc-navbar-content">
|
||||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>0.<wbr>2</a>
|
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>2.<wbr>4</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
@@ -32,6 +32,7 @@
|
|||||||
<pre class="prettyprint linenums"><code>'use strict';
|
<pre class="prettyprint linenums"><code>'use strict';
|
||||||
|
|
||||||
const Base = require('./Base');
|
const Base = require('./Base');
|
||||||
|
const Message = require('./Message');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents a Chat on WhatsApp
|
* Represents a Chat on WhatsApp
|
||||||
@@ -41,7 +42,7 @@ class Chat extends Base {
|
|||||||
constructor(client, data) {
|
constructor(client, data) {
|
||||||
super(client);
|
super(client);
|
||||||
|
|
||||||
if(data) this._patch(data);
|
if (data) this._patch(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
_patch(data) {
|
_patch(data) {
|
||||||
@@ -81,6 +82,12 @@ class Chat extends Base {
|
|||||||
*/
|
*/
|
||||||
this.timestamp = data.t;
|
this.timestamp = data.t;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Indicates if the Chat is archived
|
||||||
|
* @type {boolean}
|
||||||
|
*/
|
||||||
|
this.archived = data.archive;
|
||||||
|
|
||||||
return super._patch(data);
|
return super._patch(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -93,9 +100,112 @@ class Chat extends Base {
|
|||||||
async sendMessage(content, options) {
|
async sendMessage(content, options) {
|
||||||
return this.client.sendMessage(this.id._serialized, content, options);
|
return this.client.sendMessage(this.id._serialized, content, options);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the message as seen
|
||||||
|
* @returns {Promise&lt;Boolean>} result
|
||||||
|
*/
|
||||||
|
async sendSeen() {
|
||||||
|
return this.client.sendSeen(this.id._serialized);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Clears all messages from the chat
|
||||||
|
* @returns {Promise&lt;Boolean>} result
|
||||||
|
*/
|
||||||
|
async clearMessages() {
|
||||||
|
return this.client.pupPage.evaluate(chatId => {
|
||||||
|
return window.WWebJS.sendClearChat(chatId);
|
||||||
|
}, this.id._serialized);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Deletes the chat
|
||||||
|
* @returns {Promise&lt;Boolean>} result
|
||||||
|
*/
|
||||||
|
async delete() {
|
||||||
|
return this.client.pupPage.evaluate(chatId => {
|
||||||
|
return window.WWebJS.sendDeleteChat(chatId);
|
||||||
|
}, this.id._serialized);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Archives this chat
|
||||||
|
*/
|
||||||
|
async archive() {
|
||||||
|
return this.client.archiveChat(this.id._serialized);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* un-archives this chat
|
||||||
|
*/
|
||||||
|
async unarchive() {
|
||||||
|
return this.client.unarchiveChat(this.id._serialized);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Loads chat messages, sorted from earliest to latest.
|
||||||
|
* @param {Object} searchOptions Options for searching messages. Right now only limit is supported.
|
||||||
|
* @param {Number} [searchOptions.limit=50] The amount of messages to return. Note that the actual number of returned messages may be smaller if there aren't enough messages in the conversation. Set this to Infinity to load all messages.
|
||||||
|
* @returns {Promise&lt;Array&lt;Message>>}
|
||||||
|
*/
|
||||||
|
async fetchMessages(searchOptions) {
|
||||||
|
if(!searchOptions || !searchOptions.limit) {
|
||||||
|
searchOptions = {limit: 50};
|
||||||
|
}
|
||||||
|
let messages = await this.client.pupPage.evaluate(async (chatId, limit) => {
|
||||||
|
const msgFilter = m => !m.isNotification; // dont include notification messages
|
||||||
|
|
||||||
|
const chat = window.Store.Chat.get(chatId);
|
||||||
|
let msgs = chat.msgs.models.filter(msgFilter);
|
||||||
|
|
||||||
|
while(msgs.length &lt; limit) {
|
||||||
|
const loadedMessages = await chat.loadEarlierMsgs();
|
||||||
|
if(!loadedMessages) break;
|
||||||
|
msgs = [...loadedMessages.filter(msgFilter), ...msgs];
|
||||||
|
}
|
||||||
|
|
||||||
|
msgs.sort((a, b) => (a.t > b.t) ? 1 : -1);
|
||||||
|
return msgs.splice(msgs.length - limit).map(m => m.serialize());
|
||||||
|
|
||||||
|
}, this.id._serialized, searchOptions.limit);
|
||||||
|
|
||||||
|
return messages.map(m => new Message(this.client, m));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Simulate typing in chat. This will last for 25 seconds.
|
||||||
|
*/
|
||||||
|
async sendStateTyping() {
|
||||||
|
return this.client.pupPage.evaluate(chatId => {
|
||||||
|
window.WWebJS.sendChatstate('typing', chatId);
|
||||||
|
return true;
|
||||||
|
}, this.id._serialized);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Simulate recording audio in chat. This will last for 25 seconds.
|
||||||
|
*/
|
||||||
|
async sendStateRecording() {
|
||||||
|
return this.client.pupPage.evaluate(chatId => {
|
||||||
|
window.WWebJS.sendChatstate('recording', chatId);
|
||||||
|
return true;
|
||||||
|
}, this.id._serialized);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Stops typing or recording in chat immediately.
|
||||||
|
*/
|
||||||
|
async clearState() {
|
||||||
|
return this.client.pupPage.evaluate(chatId => {
|
||||||
|
window.WWebJS.sendChatstate('stop', chatId);
|
||||||
|
return true;
|
||||||
|
}, this.id._serialized);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = Chat;</code></pre>
|
module.exports = Chat;
|
||||||
|
</code></pre>
|
||||||
</article>
|
</article>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -105,7 +215,7 @@ module.exports = Chat;</code></pre>
|
|||||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||||
<div id="jsdoc-footer-container">
|
<div id="jsdoc-footer-container">
|
||||||
<p>
|
<p>
|
||||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.3 on February 10, 2020.
|
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.3 on March 14, 2020.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta name="generator" content="JSDoc 3.6.3">
|
<meta name="generator" content="JSDoc 3.6.3">
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>whatsapp-web.js 1.0.2 » Source: structures/ClientInfo.js</title>
|
<title>whatsapp-web.js 1.2.4 » Source: structures/ClientInfo.js</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/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/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 rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
||||||
<div id="jsdoc-navbar-container">
|
<div id="jsdoc-navbar-container">
|
||||||
<div id="jsdoc-navbar-content">
|
<div id="jsdoc-navbar-content">
|
||||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>0.<wbr>2</a>
|
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>2.<wbr>4</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
@@ -89,7 +89,7 @@ module.exports = ClientInfo;</code></pre>
|
|||||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||||
<div id="jsdoc-footer-container">
|
<div id="jsdoc-footer-container">
|
||||||
<p>
|
<p>
|
||||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.3 on February 10, 2020.
|
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.3 on March 14, 2020.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta name="generator" content="JSDoc 3.6.3">
|
<meta name="generator" content="JSDoc 3.6.3">
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>whatsapp-web.js 1.0.2 » Source: structures/Contact.js</title>
|
<title>whatsapp-web.js 1.2.4 » Source: structures/Contact.js</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/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/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 rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
||||||
<div id="jsdoc-navbar-container">
|
<div id="jsdoc-navbar-container">
|
||||||
<div id="jsdoc-navbar-content">
|
<div id="jsdoc-navbar-content">
|
||||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>0.<wbr>2</a>
|
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>2.<wbr>4</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
@@ -153,7 +153,7 @@ module.exports = Contact;</code></pre>
|
|||||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||||
<div id="jsdoc-footer-container">
|
<div id="jsdoc-footer-container">
|
||||||
<p>
|
<p>
|
||||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.3 on February 10, 2020.
|
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.3 on March 14, 2020.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta name="generator" content="JSDoc 3.6.3">
|
<meta name="generator" content="JSDoc 3.6.3">
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>whatsapp-web.js 1.0.2 » Source: structures/GroupChat.js</title>
|
<title>whatsapp-web.js 1.2.4 » Source: structures/GroupChat.js</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/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/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 rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
||||||
<div id="jsdoc-navbar-container">
|
<div id="jsdoc-navbar-container">
|
||||||
<div id="jsdoc-navbar-content">
|
<div id="jsdoc-navbar-content">
|
||||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>0.<wbr>2</a>
|
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>2.<wbr>4</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
@@ -209,7 +209,7 @@ module.exports = GroupChat;</code></pre>
|
|||||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||||
<div id="jsdoc-footer-container">
|
<div id="jsdoc-footer-container">
|
||||||
<p>
|
<p>
|
||||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.3 on February 10, 2020.
|
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.3 on March 14, 2020.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
158
docs/structures_GroupNotification.js.html
Normal file
158
docs/structures_GroupNotification.js.html
Normal file
@@ -0,0 +1,158 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html>
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta name="generator" content="JSDoc 3.6.3">
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>whatsapp-web.js 1.2.4 » Source: structures/GroupNotification.js</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>2.<wbr>4</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</nav>
|
||||||
|
<div id="jsdoc-body-container">
|
||||||
|
<div id="jsdoc-content">
|
||||||
|
<div id="jsdoc-content-container">
|
||||||
|
<div id="jsdoc-banner" role="banner">
|
||||||
|
</div>
|
||||||
|
<div id="jsdoc-main" role="main">
|
||||||
|
<header class="page-header">
|
||||||
|
<h1>Source: structures/GroupNotification.js</h1>
|
||||||
|
</header>
|
||||||
|
<article>
|
||||||
|
<pre class="prettyprint linenums"><code>'use strict';
|
||||||
|
|
||||||
|
const Base = require('./Base');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Represents a GroupNotification on WhatsApp
|
||||||
|
* @extends {Base}
|
||||||
|
*/
|
||||||
|
class GroupNotification extends Base {
|
||||||
|
constructor(client, data) {
|
||||||
|
super(client);
|
||||||
|
|
||||||
|
if(data) this._patch(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
_patch(data) {
|
||||||
|
/**
|
||||||
|
* ID that represents the groupNotification
|
||||||
|
* @type {object}
|
||||||
|
*/
|
||||||
|
this.id = data.id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Extra content
|
||||||
|
* @type {string}
|
||||||
|
*/
|
||||||
|
this.body = data.body || '';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* GroupNotification type
|
||||||
|
* @type {GroupNotificationTypes}
|
||||||
|
*/
|
||||||
|
this.type = data.subtype;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Unix timestamp for when the groupNotification was created
|
||||||
|
* @type {number}
|
||||||
|
*/
|
||||||
|
this.timestamp = data.t;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ID for the Chat that this groupNotification was sent for.
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
*/
|
||||||
|
this.chatId = typeof (data.to) === 'object' ? data.to._serialized : data.to;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ContactId for the user that produced the GroupNotification.
|
||||||
|
* @type {string}
|
||||||
|
*/
|
||||||
|
this.author = typeof (data.author) === 'object' ? data.author._serialized : data.author;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Contact IDs for the users that were affected by this GroupNotification.
|
||||||
|
* @type {Array&lt;string>}
|
||||||
|
*/
|
||||||
|
this.recipientIds = [];
|
||||||
|
|
||||||
|
if (data.recipients) {
|
||||||
|
this.recipientIds = data.recipients;
|
||||||
|
}
|
||||||
|
|
||||||
|
return super._patch(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the Chat this groupNotification was sent in
|
||||||
|
* @returns {Promise&lt;Chat>}
|
||||||
|
*/
|
||||||
|
getChat() {
|
||||||
|
return this.client.getChatById(this.chatId);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the Contact this GroupNotification was produced by
|
||||||
|
* @returns {Promise&lt;Contact>}
|
||||||
|
*/
|
||||||
|
getContact() {
|
||||||
|
return this.client.getContactById(this.author);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the Contacts affected by this GroupNotification.
|
||||||
|
* @returns {Promise&lt;Array&lt;Contact>>}
|
||||||
|
*/
|
||||||
|
async getRecipients() {
|
||||||
|
return await Promise.all(this.recipientIds.map(async m => await this.client.getContactById(m)));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sends a message to the same chat this GroupNotification was produced in.
|
||||||
|
*
|
||||||
|
* @param {string|MessageMedia|Location} content
|
||||||
|
* @param {object} options
|
||||||
|
* @returns {Promise&lt;Message>}
|
||||||
|
*/
|
||||||
|
async reply(content, options={}) {
|
||||||
|
return this.client.sendMessage(this.chatId, content, options);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = GroupNotification;
|
||||||
|
</code></pre>
|
||||||
|
</article>
|
||||||
|
</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.3 on March 14, 2020.
|
||||||
|
</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>
|
||||||
@@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta name="generator" content="JSDoc 3.6.3">
|
<meta name="generator" content="JSDoc 3.6.3">
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>whatsapp-web.js 1.0.2 » Source: structures/Location.js</title>
|
<title>whatsapp-web.js 1.2.4 » Source: structures/Location.js</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/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/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 rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
||||||
<div id="jsdoc-navbar-container">
|
<div id="jsdoc-navbar-container">
|
||||||
<div id="jsdoc-navbar-content">
|
<div id="jsdoc-navbar-content">
|
||||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>0.<wbr>2</a>
|
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>2.<wbr>4</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
@@ -71,7 +71,7 @@ module.exports = Location;</code></pre>
|
|||||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||||
<div id="jsdoc-footer-container">
|
<div id="jsdoc-footer-container">
|
||||||
<p>
|
<p>
|
||||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.3 on February 10, 2020.
|
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.3 on March 14, 2020.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta name="generator" content="JSDoc 3.6.3">
|
<meta name="generator" content="JSDoc 3.6.3">
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>whatsapp-web.js 1.0.2 » Source: structures/Message.js</title>
|
<title>whatsapp-web.js 1.2.4 » Source: structures/Message.js</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/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/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 rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
||||||
<div id="jsdoc-navbar-container">
|
<div id="jsdoc-navbar-container">
|
||||||
<div id="jsdoc-navbar-content">
|
<div id="jsdoc-navbar-content">
|
||||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>0.<wbr>2</a>
|
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>2.<wbr>4</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
@@ -219,6 +219,11 @@ class Message extends Base {
|
|||||||
|
|
||||||
const {data, mimetype, filename} = await this.client.pupPage.evaluate(async (msgId) => {
|
const {data, mimetype, filename} = await this.client.pupPage.evaluate(async (msgId) => {
|
||||||
const msg = window.Store.Msg.get(msgId);
|
const msg = window.Store.Msg.get(msgId);
|
||||||
|
|
||||||
|
if(msg.mediaData.mediaStage != 'RESOLVED') {
|
||||||
|
await msg.downloadMedia(true, 1);
|
||||||
|
}
|
||||||
|
|
||||||
const buffer = await window.WWebJS.downloadBuffer(msg.clientUrl);
|
const buffer = await window.WWebJS.downloadBuffer(msg.clientUrl);
|
||||||
const decrypted = await window.Store.CryptoLib.decryptE2EMedia(msg.type, buffer, msg.mediaKey, msg.mimetype);
|
const decrypted = await window.Store.CryptoLib.decryptE2EMedia(msg.type, buffer, msg.mediaKey, msg.mimetype);
|
||||||
const data = await window.WWebJS.readBlobAsync(decrypted._blob);
|
const data = await window.WWebJS.readBlobAsync(decrypted._blob);
|
||||||
@@ -233,6 +238,22 @@ class Message extends Base {
|
|||||||
|
|
||||||
return new MessageMedia(mimetype, data, filename);
|
return new MessageMedia(mimetype, data, filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Deletes a message from the chat
|
||||||
|
* @param {?boolean} everyone If true and the message is sent by the current user, will delete it for everyone in the chat.
|
||||||
|
*/
|
||||||
|
async delete(everyone) {
|
||||||
|
await this.client.pupPage.evaluate((msgId, everyone) => {
|
||||||
|
let msg = window.Store.Msg.get(msgId);
|
||||||
|
|
||||||
|
if(everyone &amp;&amp; msg.id.fromMe &amp;&amp; msg.canRevoke()) {
|
||||||
|
return window.Store.Cmd.sendRevokeMsgs(msg.chat, [msg], true);
|
||||||
|
}
|
||||||
|
|
||||||
|
return window.Store.Cmd.sendDeleteMsgs(msg.chat, [msg], true);
|
||||||
|
}, this.id._serialized, everyone);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = Message;
|
module.exports = Message;
|
||||||
@@ -246,7 +267,7 @@ module.exports = Message;
|
|||||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||||
<div id="jsdoc-footer-container">
|
<div id="jsdoc-footer-container">
|
||||||
<p>
|
<p>
|
||||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.3 on February 10, 2020.
|
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.3 on March 14, 2020.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta name="generator" content="JSDoc 3.6.3">
|
<meta name="generator" content="JSDoc 3.6.3">
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>whatsapp-web.js 1.0.2 » Source: structures/MessageMedia.js</title>
|
<title>whatsapp-web.js 1.2.4 » Source: structures/MessageMedia.js</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/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/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 rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
||||||
<div id="jsdoc-navbar-container">
|
<div id="jsdoc-navbar-container">
|
||||||
<div id="jsdoc-navbar-content">
|
<div id="jsdoc-navbar-content">
|
||||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>0.<wbr>2</a>
|
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>2.<wbr>4</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
@@ -69,7 +69,7 @@ module.exports = MessageMedia;</code></pre>
|
|||||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||||
<div id="jsdoc-footer-container">
|
<div id="jsdoc-footer-container">
|
||||||
<p>
|
<p>
|
||||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.3 on February 10, 2020.
|
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.3 on March 14, 2020.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta name="generator" content="JSDoc 3.6.3">
|
<meta name="generator" content="JSDoc 3.6.3">
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>whatsapp-web.js 1.0.2 » Source: structures/PrivateChat.js</title>
|
<title>whatsapp-web.js 1.2.4 » Source: structures/PrivateChat.js</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/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/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 rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
||||||
<div id="jsdoc-navbar-container">
|
<div id="jsdoc-navbar-container">
|
||||||
<div id="jsdoc-navbar-content">
|
<div id="jsdoc-navbar-content">
|
||||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>0.<wbr>2</a>
|
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>2.<wbr>4</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
@@ -51,7 +51,7 @@ module.exports = PrivateChat;</code></pre>
|
|||||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||||
<div id="jsdoc-footer-container">
|
<div id="jsdoc-footer-container">
|
||||||
<p>
|
<p>
|
||||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.3 on February 10, 2020.
|
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.3 on March 14, 2020.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta name="generator" content="JSDoc 3.6.3">
|
<meta name="generator" content="JSDoc 3.6.3">
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>whatsapp-web.js 1.0.2 » Source: structures/PrivateContact.js</title>
|
<title>whatsapp-web.js 1.2.4 » Source: structures/PrivateContact.js</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/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/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 rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
||||||
<div id="jsdoc-navbar-container">
|
<div id="jsdoc-navbar-container">
|
||||||
<div id="jsdoc-navbar-content">
|
<div id="jsdoc-navbar-content">
|
||||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>0.<wbr>2</a>
|
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>2.<wbr>4</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
@@ -51,7 +51,7 @@ module.exports = PrivateContact;</code></pre>
|
|||||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||||
<div id="jsdoc-footer-container">
|
<div id="jsdoc-footer-container">
|
||||||
<p>
|
<p>
|
||||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.3 on February 10, 2020.
|
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.3 on March 14, 2020.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta name="generator" content="JSDoc 3.6.3">
|
<meta name="generator" content="JSDoc 3.6.3">
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>whatsapp-web.js 1.0.2 » Source: util/Constants.js</title>
|
<title>whatsapp-web.js 1.2.4 » Source: util/Constants.js</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/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/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 rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
||||||
<div id="jsdoc-navbar-container">
|
<div id="jsdoc-navbar-container">
|
||||||
<div id="jsdoc-navbar-content">
|
<div id="jsdoc-navbar-content">
|
||||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>0.<wbr>2</a>
|
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>2.<wbr>4</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
@@ -66,9 +66,13 @@ exports.Events = {
|
|||||||
MESSAGE_CREATE: 'message_create',
|
MESSAGE_CREATE: 'message_create',
|
||||||
MESSAGE_REVOKED_EVERYONE: 'message_revoke_everyone',
|
MESSAGE_REVOKED_EVERYONE: 'message_revoke_everyone',
|
||||||
MESSAGE_REVOKED_ME: 'message_revoke_me',
|
MESSAGE_REVOKED_ME: 'message_revoke_me',
|
||||||
|
MESSAGE_ACK: 'message_ack',
|
||||||
|
GROUP_JOIN: 'group_join',
|
||||||
|
GROUP_LEAVE: 'group_leave',
|
||||||
|
GROUP_UPDATE: 'group_update',
|
||||||
QR_RECEIVED: 'qr',
|
QR_RECEIVED: 'qr',
|
||||||
DISCONNECTED: 'disconnected',
|
DISCONNECTED: 'disconnected',
|
||||||
STATE_CHANGED: 'change_state'
|
STATE_CHANGED: 'change_state',
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -91,6 +95,23 @@ exports.MessageTypes = {
|
|||||||
UNKNOWN: 'unknown'
|
UNKNOWN: 'unknown'
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Group notification types
|
||||||
|
* @readonly
|
||||||
|
* @enum {string}
|
||||||
|
*/
|
||||||
|
exports.GroupNotificationTypes = {
|
||||||
|
ADD: 'add',
|
||||||
|
INVITE: 'invite',
|
||||||
|
REMOVE: 'remove',
|
||||||
|
LEAVE: 'leave',
|
||||||
|
SUBJECT: 'subject',
|
||||||
|
DESCRIPTION: 'description',
|
||||||
|
PICTURE: 'picture',
|
||||||
|
ANNOUNCE: 'announce',
|
||||||
|
RESTRICT: 'restrict',
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Chat types
|
* Chat types
|
||||||
* @readonly
|
* @readonly
|
||||||
@@ -120,7 +141,22 @@ exports.WAState = {
|
|||||||
UNLAUNCHED: 'UNLAUNCHED',
|
UNLAUNCHED: 'UNLAUNCHED',
|
||||||
UNPAIRED: 'UNPAIRED',
|
UNPAIRED: 'UNPAIRED',
|
||||||
UNPAIRED_IDLE: 'UNPAIRED_IDLE'
|
UNPAIRED_IDLE: 'UNPAIRED_IDLE'
|
||||||
};</code></pre>
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Message ACK
|
||||||
|
* @readonly
|
||||||
|
* @enum {number}
|
||||||
|
*/
|
||||||
|
exports.MessageAck = {
|
||||||
|
ACK_ERROR: -1,
|
||||||
|
ACK_PENDING: 0,
|
||||||
|
ACK_SERVER: 1,
|
||||||
|
ACK_DEVICE: 2,
|
||||||
|
ACK_READ: 3,
|
||||||
|
ACK_PLAYED: 4,
|
||||||
|
};
|
||||||
|
</code></pre>
|
||||||
</article>
|
</article>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -130,7 +166,7 @@ exports.WAState = {
|
|||||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||||
<div id="jsdoc-footer-container">
|
<div id="jsdoc-footer-container">
|
||||||
<p>
|
<p>
|
||||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.3 on February 10, 2020.
|
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.3 on March 14, 2020.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta name="generator" content="JSDoc 3.6.3">
|
<meta name="generator" content="JSDoc 3.6.3">
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>whatsapp-web.js 1.0.2 » Source: util/Util.js</title>
|
<title>whatsapp-web.js 1.2.4 » Source: util/Util.js</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/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/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 rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
||||||
<div id="jsdoc-navbar-container">
|
<div id="jsdoc-navbar-container">
|
||||||
<div id="jsdoc-navbar-content">
|
<div id="jsdoc-navbar-content">
|
||||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>0.<wbr>2</a>
|
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>2.<wbr>4</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
@@ -73,7 +73,7 @@ module.exports = Util;</code></pre>
|
|||||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||||
<div id="jsdoc-footer-container">
|
<div id="jsdoc-footer-container">
|
||||||
<p>
|
<p>
|
||||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.3 on February 10, 2020.
|
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.3 on March 14, 2020.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
120
example.js
120
example.js
@@ -7,7 +7,7 @@ if (fs.existsSync(SESSION_FILE_PATH)) {
|
|||||||
sessionCfg = require(SESSION_FILE_PATH);
|
sessionCfg = require(SESSION_FILE_PATH);
|
||||||
}
|
}
|
||||||
|
|
||||||
const client = new Client({puppeteer: {headless: false}, session: sessionCfg});
|
const client = new Client({ puppeteer: { headless: false }, session: sessionCfg });
|
||||||
// You can use an existing session and avoid scanning a QR code by adding a "session" object to the client options.
|
// You can use an existing session and avoid scanning a QR code by adding a "session" object to the client options.
|
||||||
// This object must include WABrowserId, WASecretBundle, WAToken1 and WAToken2.
|
// This object must include WABrowserId, WASecretBundle, WAToken1 and WAToken2.
|
||||||
|
|
||||||
@@ -20,14 +20,12 @@ client.on('qr', (qr) => {
|
|||||||
|
|
||||||
client.on('authenticated', (session) => {
|
client.on('authenticated', (session) => {
|
||||||
console.log('AUTHENTICATED', session);
|
console.log('AUTHENTICATED', session);
|
||||||
|
sessionCfg=session;
|
||||||
if (!fs.existsSync(SESSION_FILE_PATH)) {
|
fs.writeFile(SESSION_FILE_PATH, JSON.stringify(session), function (err) {
|
||||||
fs.writeFile(SESSION_FILE_PATH, JSON.stringify(session), function(err) {
|
if (err) {
|
||||||
if (err) {
|
console.error(err);
|
||||||
console.error(err);
|
}
|
||||||
}
|
});
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
client.on('auth_failure', msg => {
|
client.on('auth_failure', msg => {
|
||||||
@@ -50,10 +48,20 @@ client.on('message', async msg => {
|
|||||||
// Send a new message to the same chat
|
// Send a new message to the same chat
|
||||||
client.sendMessage(msg.from, 'pong');
|
client.sendMessage(msg.from, 'pong');
|
||||||
|
|
||||||
|
} else if (msg.body.startsWith('!sendto ')) {
|
||||||
|
// Direct send a new message to specific id
|
||||||
|
let number = msg.body.split(' ')[1];
|
||||||
|
let messageIndex = msg.body.indexOf(number) + number.length;
|
||||||
|
let message = msg.body.slice(messageIndex, msg.body.length);
|
||||||
|
number = number.includes('@c.us') ? number : `${number}@c.us`;
|
||||||
|
let chat = await msg.getChat();
|
||||||
|
chat.sendSeen();
|
||||||
|
client.sendMessage(number, message);
|
||||||
|
|
||||||
} else if (msg.body.startsWith('!subject ')) {
|
} else if (msg.body.startsWith('!subject ')) {
|
||||||
// Change the group subject
|
// Change the group subject
|
||||||
let chat = await msg.getChat();
|
let chat = await msg.getChat();
|
||||||
if(chat.isGroup) {
|
if (chat.isGroup) {
|
||||||
let newSubject = msg.body.slice(9);
|
let newSubject = msg.body.slice(9);
|
||||||
chat.setSubject(newSubject);
|
chat.setSubject(newSubject);
|
||||||
} else {
|
} else {
|
||||||
@@ -65,7 +73,7 @@ client.on('message', async msg => {
|
|||||||
} else if (msg.body.startsWith('!desc ')) {
|
} else if (msg.body.startsWith('!desc ')) {
|
||||||
// Change the group description
|
// Change the group description
|
||||||
let chat = await msg.getChat();
|
let chat = await msg.getChat();
|
||||||
if(chat.isGroup) {
|
if (chat.isGroup) {
|
||||||
let newDescription = msg.body.slice(6);
|
let newDescription = msg.body.slice(6);
|
||||||
chat.setDescription(newDescription);
|
chat.setDescription(newDescription);
|
||||||
} else {
|
} else {
|
||||||
@@ -74,22 +82,22 @@ client.on('message', async msg => {
|
|||||||
} else if (msg.body == '!leave') {
|
} else if (msg.body == '!leave') {
|
||||||
// Leave the group
|
// Leave the group
|
||||||
let chat = await msg.getChat();
|
let chat = await msg.getChat();
|
||||||
if(chat.isGroup) {
|
if (chat.isGroup) {
|
||||||
chat.leave();
|
chat.leave();
|
||||||
} else {
|
} else {
|
||||||
msg.reply('This command can only be used in a group!');
|
msg.reply('This command can only be used in a group!');
|
||||||
}
|
}
|
||||||
} else if(msg.body.startsWith('!join ')) {
|
} else if (msg.body.startsWith('!join ')) {
|
||||||
const inviteCode = msg.body.split(' ')[1];
|
const inviteCode = msg.body.split(' ')[1];
|
||||||
try {
|
try {
|
||||||
await client.acceptInvite(inviteCode);
|
await client.acceptInvite(inviteCode);
|
||||||
msg.reply('Joined the group!');
|
msg.reply('Joined the group!');
|
||||||
} catch(e) {
|
} catch (e) {
|
||||||
msg.reply('That invite code seems to be invalid.');
|
msg.reply('That invite code seems to be invalid.');
|
||||||
}
|
}
|
||||||
} else if(msg.body == '!groupinfo') {
|
} else if (msg.body == '!groupinfo') {
|
||||||
let chat = await msg.getChat();
|
let chat = await msg.getChat();
|
||||||
if(chat.isGroup) {
|
if (chat.isGroup) {
|
||||||
msg.reply(`
|
msg.reply(`
|
||||||
*Group Details*
|
*Group Details*
|
||||||
Name: ${chat.name}
|
Name: ${chat.name}
|
||||||
@@ -101,10 +109,10 @@ client.on('message', async msg => {
|
|||||||
} else {
|
} else {
|
||||||
msg.reply('This command can only be used in a group!');
|
msg.reply('This command can only be used in a group!');
|
||||||
}
|
}
|
||||||
} else if(msg.body == '!chats') {
|
} else if (msg.body == '!chats') {
|
||||||
const chats = await client.getChats();
|
const chats = await client.getChats();
|
||||||
client.sendMessage(msg.from, `The bot has ${chats.length} chats open.`);
|
client.sendMessage(msg.from, `The bot has ${chats.length} chats open.`);
|
||||||
} else if(msg.body == '!info') {
|
} else if (msg.body == '!info') {
|
||||||
let info = client.info;
|
let info = client.info;
|
||||||
client.sendMessage(msg.from, `
|
client.sendMessage(msg.from, `
|
||||||
*Connection info*
|
*Connection info*
|
||||||
@@ -113,7 +121,7 @@ client.on('message', async msg => {
|
|||||||
Platform: ${info.platform}
|
Platform: ${info.platform}
|
||||||
WhatsApp version: ${info.phone.wa_version}
|
WhatsApp version: ${info.phone.wa_version}
|
||||||
`);
|
`);
|
||||||
} else if(msg.body == '!mediainfo' && msg.hasMedia) {
|
} else if (msg.body == '!mediainfo' && msg.hasMedia) {
|
||||||
const attachmentData = await msg.downloadMedia();
|
const attachmentData = await msg.downloadMedia();
|
||||||
msg.reply(`
|
msg.reply(`
|
||||||
*Media info*
|
*Media info*
|
||||||
@@ -121,7 +129,7 @@ client.on('message', async msg => {
|
|||||||
Filename: ${attachmentData.filename}
|
Filename: ${attachmentData.filename}
|
||||||
Data (length): ${attachmentData.data.length}
|
Data (length): ${attachmentData.data.length}
|
||||||
`);
|
`);
|
||||||
} else if(msg.body == '!quoteinfo' && msg.hasQuotedMsg) {
|
} else if (msg.body == '!quoteinfo' && msg.hasQuotedMsg) {
|
||||||
const quotedMsg = await msg.getQuotedMessage();
|
const quotedMsg = await msg.getQuotedMessage();
|
||||||
|
|
||||||
quotedMsg.reply(`
|
quotedMsg.reply(`
|
||||||
@@ -131,18 +139,17 @@ client.on('message', async msg => {
|
|||||||
Timestamp: ${quotedMsg.timestamp}
|
Timestamp: ${quotedMsg.timestamp}
|
||||||
Has Media? ${quotedMsg.hasMedia}
|
Has Media? ${quotedMsg.hasMedia}
|
||||||
`);
|
`);
|
||||||
} else if(msg.body == '!resendmedia' && msg.hasQuotedMsg) {
|
} else if (msg.body == '!resendmedia' && msg.hasQuotedMsg) {
|
||||||
const quotedMsg = await msg.getQuotedMessage();
|
const quotedMsg = await msg.getQuotedMessage();
|
||||||
if(quotedMsg.hasMedia) {
|
if (quotedMsg.hasMedia) {
|
||||||
const attachmentData = await quotedMsg.downloadMedia();
|
const attachmentData = await quotedMsg.downloadMedia();
|
||||||
client.sendMessage(msg.from, attachmentData, {caption: 'Here\'s your requested media.'});
|
client.sendMessage(msg.from, attachmentData, { caption: 'Here\'s your requested media.' });
|
||||||
}
|
}
|
||||||
|
} else if (msg.body == '!location') {
|
||||||
} else if(msg.body == '!location') {
|
|
||||||
msg.reply(new Location(37.422, -122.084, 'Googleplex\nGoogle Headquarters'));
|
msg.reply(new Location(37.422, -122.084, 'Googleplex\nGoogle Headquarters'));
|
||||||
} else if(msg.location) {
|
} else if (msg.location) {
|
||||||
msg.reply(msg.location);
|
msg.reply(msg.location);
|
||||||
} else if(msg.body.startsWith('!status ')) {
|
} else if (msg.body.startsWith('!status ')) {
|
||||||
const newStatus = msg.body.split(' ')[1];
|
const newStatus = msg.body.split(' ')[1];
|
||||||
await client.setStatus(newStatus);
|
await client.setStatus(newStatus);
|
||||||
msg.reply(`Status was updated to *${newStatus}*`);
|
msg.reply(`Status was updated to *${newStatus}*`);
|
||||||
@@ -152,12 +159,34 @@ client.on('message', async msg => {
|
|||||||
chat.sendMessage(`Hi @${contact.number}!`, {
|
chat.sendMessage(`Hi @${contact.number}!`, {
|
||||||
mentions: [contact]
|
mentions: [contact]
|
||||||
});
|
});
|
||||||
|
} else if (msg.body == '!delete' && msg.hasQuotedMsg) {
|
||||||
|
const quotedMsg = await msg.getQuotedMessage();
|
||||||
|
if (quotedMsg.fromMe) {
|
||||||
|
quotedMsg.delete(true);
|
||||||
|
} else {
|
||||||
|
msg.reply('I can only delete my own messages');
|
||||||
|
}
|
||||||
|
} else if (msg.body === '!archive') {
|
||||||
|
const chat = await msg.getChat();
|
||||||
|
chat.archive();
|
||||||
|
} else if (msg.body === '!typing') {
|
||||||
|
const chat = await msg.getChat();
|
||||||
|
// simulates typing in the chat
|
||||||
|
chat.sendStateTyping();
|
||||||
|
} else if (msg.body === '!recording') {
|
||||||
|
const chat = await msg.getChat();
|
||||||
|
// simulates recording audio in the chat
|
||||||
|
chat.sendStateRecording();
|
||||||
|
} else if (msg.body === '!clearstate') {
|
||||||
|
const chat = await msg.getChat();
|
||||||
|
// stops typing or recording in the chat
|
||||||
|
chat.clearState();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
client.on('message_create', (msg) => {
|
client.on('message_create', (msg) => {
|
||||||
// Fired on all message creations, including your own
|
// Fired on all message creations, including your own
|
||||||
if(msg.fromMe) {
|
if (msg.fromMe) {
|
||||||
// do stuff here
|
// do stuff here
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -175,6 +204,39 @@ client.on('message_revoke_me', async (msg) => {
|
|||||||
console.log(msg.body); // message before it was deleted.
|
console.log(msg.body); // message before it was deleted.
|
||||||
});
|
});
|
||||||
|
|
||||||
|
client.on('message_ack', (msg, ack) => {
|
||||||
|
/*
|
||||||
|
== ACK VALUES ==
|
||||||
|
ACK_ERROR: -1
|
||||||
|
ACK_PENDING: 0
|
||||||
|
ACK_SERVER: 1
|
||||||
|
ACK_DEVICE: 2
|
||||||
|
ACK_READ: 3
|
||||||
|
ACK_PLAYED: 4
|
||||||
|
*/
|
||||||
|
|
||||||
|
if(ack == 3) {
|
||||||
|
// The message was read
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
client.on('group_join', (notification) => {
|
||||||
|
// User has joined or been added to the group.
|
||||||
|
console.log('join', notification);
|
||||||
|
notification.reply('User joined.');
|
||||||
|
});
|
||||||
|
|
||||||
|
client.on('group_leave', (notification) => {
|
||||||
|
// User has left or been kicked from the group.
|
||||||
|
console.log('leave', notification);
|
||||||
|
notification.reply('User left.');
|
||||||
|
});
|
||||||
|
|
||||||
|
client.on('group_update', (notification) => {
|
||||||
|
// Group picture, subject or description has been updated.
|
||||||
|
console.log('update', notification);
|
||||||
|
});
|
||||||
|
|
||||||
client.on('disconnected', (reason) => {
|
client.on('disconnected', (reason) => {
|
||||||
console.log('Client was logged out', reason);
|
console.log('Client was logged out', reason);
|
||||||
});
|
});
|
||||||
|
|||||||
8
package-lock.json
generated
8
package-lock.json
generated
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "whatsapp-web.js",
|
"name": "whatsapp-web.js",
|
||||||
"version": "0.3.2-post",
|
"version": "1.2.4",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@@ -42,9 +42,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"acorn": {
|
"acorn": {
|
||||||
"version": "7.1.0",
|
"version": "7.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/acorn/-/acorn-7.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/acorn/-/acorn-7.1.1.tgz",
|
||||||
"integrity": "sha512-kL5CuoXA/dgxlBbVrflsflzQ3PAas7RYZB52NOm/6839iVYJgKMJ3cQJD+t2i5+qFa8h3MDpEOJiS64E8JLnSQ==",
|
"integrity": "sha512-add7dgA5ppRPxCFJoAGfMDi7PIBXq1RtGo7BhbLaxwrXPOmw8gq48Y9ozT01hUKy9byMjlR20EJhu5zlkErEkg==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"acorn-jsx": {
|
"acorn-jsx": {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "whatsapp-web.js",
|
"name": "whatsapp-web.js",
|
||||||
"version": "1.0.2",
|
"version": "1.2.4",
|
||||||
"description": "Library for interacting with the WhatsApp Web API ",
|
"description": "Library for interacting with the WhatsApp Web API ",
|
||||||
"main": "./index.js",
|
"main": "./index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
207
src/Client.js
207
src/Client.js
@@ -10,11 +10,7 @@ const { WhatsWebURL, UserAgent, DefaultOptions, Events, WAState } = require('./u
|
|||||||
const { ExposeStore, LoadUtils } = require('./util/Injected');
|
const { ExposeStore, LoadUtils } = require('./util/Injected');
|
||||||
const ChatFactory = require('./factories/ChatFactory');
|
const ChatFactory = require('./factories/ChatFactory');
|
||||||
const ContactFactory = require('./factories/ContactFactory');
|
const ContactFactory = require('./factories/ContactFactory');
|
||||||
const ClientInfo = require('./structures/ClientInfo');
|
const { ClientInfo, Message, MessageMedia, Location, GroupNotification } = require('./structures');
|
||||||
const Message = require('./structures/Message');
|
|
||||||
const MessageMedia = require('./structures/MessageMedia');
|
|
||||||
const Location = require('./structures/Location');
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Starting point for interacting with the WhatsApp Web API
|
* Starting point for interacting with the WhatsApp Web API
|
||||||
* @extends {EventEmitter}
|
* @extends {EventEmitter}
|
||||||
@@ -23,9 +19,13 @@ const Location = require('./structures/Location');
|
|||||||
* @fires Client#auth_failure
|
* @fires Client#auth_failure
|
||||||
* @fires Client#ready
|
* @fires Client#ready
|
||||||
* @fires Client#message
|
* @fires Client#message
|
||||||
|
* @fires Client#message_ack
|
||||||
* @fires Client#message_create
|
* @fires Client#message_create
|
||||||
* @fires Client#message_revoke_me
|
* @fires Client#message_revoke_me
|
||||||
* @fires Client#message_revoke_everyone
|
* @fires Client#message_revoke_everyone
|
||||||
|
* @fires Client#group_join
|
||||||
|
* @fires Client#group_leave
|
||||||
|
* @fires Client#group_update
|
||||||
* @fires Client#disconnected
|
* @fires Client#disconnected
|
||||||
* @fires Client#change_state
|
* @fires Client#change_state
|
||||||
*/
|
*/
|
||||||
@@ -44,7 +44,7 @@ class Client extends EventEmitter {
|
|||||||
*/
|
*/
|
||||||
async initialize() {
|
async initialize() {
|
||||||
const browser = await puppeteer.launch(this.options.puppeteer);
|
const browser = await puppeteer.launch(this.options.puppeteer);
|
||||||
const page = await browser.newPage();
|
const page = (await browser.pages())[0];
|
||||||
page.setUserAgent(UserAgent);
|
page.setUserAgent(UserAgent);
|
||||||
|
|
||||||
if (this.options.session) {
|
if (this.options.session) {
|
||||||
@@ -83,21 +83,34 @@ class Client extends EventEmitter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// Wait for QR Code
|
const getQrCode = async () => {
|
||||||
const QR_CANVAS_SELECTOR = 'canvas';
|
// Check if retry button is present
|
||||||
await page.waitForSelector(QR_CANVAS_SELECTOR);
|
var QR_RETRY_SELECTOR = 'div[data-ref] > span > div';
|
||||||
const qrImgData = await page.$eval(QR_CANVAS_SELECTOR, canvas => [].slice.call(canvas.getContext('2d').getImageData(0,0,264,264).data));
|
var qrRetry = await page.$(QR_RETRY_SELECTOR);
|
||||||
const qr = jsQR(qrImgData, 264, 264).data;
|
if (qrRetry) {
|
||||||
|
await qrRetry.click();
|
||||||
/**
|
}
|
||||||
* Emitted when the QR code is received
|
|
||||||
* @event Client#qr
|
// Wait for QR Code
|
||||||
* @param {string} qr QR Code
|
|
||||||
*/
|
const QR_CANVAS_SELECTOR = 'canvas';
|
||||||
this.emit(Events.QR_RECEIVED, qr);
|
await page.waitForSelector(QR_CANVAS_SELECTOR);
|
||||||
|
const qrImgData = await page.$eval(QR_CANVAS_SELECTOR, canvas => [].slice.call(canvas.getContext('2d').getImageData(0, 0, 264, 264).data));
|
||||||
|
const qr = jsQR(qrImgData, 264, 264).data;
|
||||||
|
/**
|
||||||
|
* Emitted when the QR code is received
|
||||||
|
* @event Client#qr
|
||||||
|
* @param {string} qr QR Code
|
||||||
|
*/
|
||||||
|
this.emit(Events.QR_RECEIVED, qr);
|
||||||
|
};
|
||||||
|
getQrCode();
|
||||||
|
let retryInterval = setInterval(getQrCode, 20000); // check for qr code every 20 seconds
|
||||||
|
|
||||||
// Wait for code scan
|
// Wait for code scan
|
||||||
await page.waitForSelector(KEEP_PHONE_CONNECTED_IMG_SELECTOR, { timeout: 0 });
|
await page.waitForSelector(KEEP_PHONE_CONNECTED_IMG_SELECTOR, { timeout: 0 });
|
||||||
|
clearInterval(retryInterval);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
await page.evaluate(ExposeStore, moduleRaid.toString());
|
await page.evaluate(ExposeStore, moduleRaid.toString());
|
||||||
@@ -136,6 +149,33 @@ class Client extends EventEmitter {
|
|||||||
await page.exposeFunction('onAddMessageEvent', msg => {
|
await page.exposeFunction('onAddMessageEvent', msg => {
|
||||||
if (!msg.isNewMsg) return;
|
if (!msg.isNewMsg) return;
|
||||||
|
|
||||||
|
if (msg.type === 'gp2') {
|
||||||
|
const notification = new GroupNotification(this, msg);
|
||||||
|
if (msg.subtype === 'add' || msg.subtype === 'invite') {
|
||||||
|
/**
|
||||||
|
* Emitted when a user joins the chat via invite link or is added by an admin.
|
||||||
|
* @event Client#group_join
|
||||||
|
* @param {GroupNotification} notification GroupNotification with more information about the action
|
||||||
|
*/
|
||||||
|
this.emit(Events.GROUP_JOIN, notification);
|
||||||
|
} else if (msg.subtype === 'remove' || msg.subtype === 'leave') {
|
||||||
|
/**
|
||||||
|
* Emitted when a user leaves the chat or is removed by an admin.
|
||||||
|
* @event Client#group_leave
|
||||||
|
* @param {GroupNotification} notification GroupNotification with more information about the action
|
||||||
|
*/
|
||||||
|
this.emit(Events.GROUP_LEAVE, notification);
|
||||||
|
} else {
|
||||||
|
/**
|
||||||
|
* Emitted when group settings are updated, such as subject, description or picture.
|
||||||
|
* @event Client#group_update
|
||||||
|
* @param {GroupNotification} notification GroupNotification with more information about the action
|
||||||
|
*/
|
||||||
|
this.emit(Events.GROUP_UPDATE, notification);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const message = new Message(this, msg);
|
const message = new Message(this, msg);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -162,7 +202,7 @@ class Client extends EventEmitter {
|
|||||||
if (msg.type === 'revoked') {
|
if (msg.type === 'revoked') {
|
||||||
const message = new Message(this, msg);
|
const message = new Message(this, msg);
|
||||||
let revoked_msg;
|
let revoked_msg;
|
||||||
if(last_message && msg.id.id === last_message.id.id) {
|
if (last_message && msg.id.id === last_message.id.id) {
|
||||||
revoked_msg = new Message(this, last_message);
|
revoked_msg = new Message(this, last_message);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -175,11 +215,11 @@ class Client extends EventEmitter {
|
|||||||
*/
|
*/
|
||||||
this.emit(Events.MESSAGE_REVOKED_EVERYONE, message, revoked_msg);
|
this.emit(Events.MESSAGE_REVOKED_EVERYONE, message, revoked_msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
await page.exposeFunction('onChangeMessageEvent', (msg) => {
|
await page.exposeFunction('onChangeMessageEvent', (msg) => {
|
||||||
|
|
||||||
if (msg.type !== 'revoked') {
|
if (msg.type !== 'revoked') {
|
||||||
last_message = msg;
|
last_message = msg;
|
||||||
}
|
}
|
||||||
@@ -201,7 +241,21 @@ class Client extends EventEmitter {
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
await page.exposeFunction('onAppStateChangedEvent', (_AppState, state) => {
|
await page.exposeFunction('onMessageAckEvent', (msg, ack) => {
|
||||||
|
|
||||||
|
const message = new Message(this, msg);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Emitted when an ack event occurrs on message type.
|
||||||
|
* @event Client#message_ack
|
||||||
|
* @param {Message} message The message that was affected
|
||||||
|
* @param {MessageAck} ack The new ACK value
|
||||||
|
*/
|
||||||
|
this.emit(Events.MESSAGE_ACK, message, ack);
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
await page.exposeFunction('onAppStateChangedEvent', (state) => {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Emitted when the connection state changes
|
* Emitted when the connection state changes
|
||||||
@@ -223,11 +277,12 @@ class Client extends EventEmitter {
|
|||||||
});
|
});
|
||||||
|
|
||||||
await page.evaluate(() => {
|
await page.evaluate(() => {
|
||||||
window.Store.Msg.on('add', window.onAddMessageEvent);
|
window.Store.Msg.on('add', (msg) => { if(msg.isNewMsg) window.onAddMessageEvent(msg); });
|
||||||
window.Store.Msg.on('change', window.onChangeMessageEvent);
|
window.Store.Msg.on('change', (msg) => { window.onChangeMessageEvent(msg); });
|
||||||
window.Store.Msg.on('change:type', window.onChangeMessageTypeEvent);
|
window.Store.Msg.on('change:type', (msg) => { window.onChangeMessageTypeEvent(msg); });
|
||||||
window.Store.Msg.on('remove', window.onRemoveMessageEvent);
|
window.Store.Msg.on('change:ack', (msg, ack) => { window.onMessageAckEvent(msg, ack); });
|
||||||
window.Store.AppState.on('change:state', window.onAppStateChangedEvent);
|
window.Store.Msg.on('remove', (msg) => { if(msg.isNewMsg) window.onRemoveMessageEvent(msg); });
|
||||||
|
window.Store.AppState.on('change:state', (_AppState, state) => { window.onAppStateChangedEvent(state); });
|
||||||
});
|
});
|
||||||
|
|
||||||
this.pupBrowser = browser;
|
this.pupBrowser = browser;
|
||||||
@@ -246,7 +301,19 @@ class Client extends EventEmitter {
|
|||||||
async destroy() {
|
async destroy() {
|
||||||
await this.pupBrowser.close();
|
await this.pupBrowser.close();
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Mark as seen for the Chat
|
||||||
|
* @param {string} chatId
|
||||||
|
* @returns {Promise<boolean>} result
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
async sendSeen(chatId) {
|
||||||
|
const result = await this.pupPage.evaluate(async (chatId) => {
|
||||||
|
return window.WWebJS.sendSeen(chatId);
|
||||||
|
|
||||||
|
}, chatId);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* Send a message to a specific chatId
|
* Send a message to a specific chatId
|
||||||
* @param {string} chatId
|
* @param {string} chatId
|
||||||
@@ -254,28 +321,55 @@ class Client extends EventEmitter {
|
|||||||
* @param {object} options
|
* @param {object} options
|
||||||
* @returns {Promise<Message>} Message that was just sent
|
* @returns {Promise<Message>} Message that was just sent
|
||||||
*/
|
*/
|
||||||
async sendMessage(chatId, content, options={}) {
|
async sendMessage(chatId, content, options = {}) {
|
||||||
let internalOptions = {
|
let internalOptions = {
|
||||||
caption: options.caption,
|
caption: options.caption,
|
||||||
quotedMessageId: options.quotedMessageId,
|
quotedMessageId: options.quotedMessageId,
|
||||||
mentionedJidList: Array.isArray(options.mentions) ? options.mentions.map(contact => contact.id._serialized) : []
|
mentionedJidList: Array.isArray(options.mentions) ? options.mentions.map(contact => contact.id._serialized) : []
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const sendSeen = typeof options.sendSeen === 'undefined' ? true : options.sendSeen;
|
||||||
|
|
||||||
if(content instanceof MessageMedia) {
|
if (content instanceof MessageMedia) {
|
||||||
internalOptions.attachment = content;
|
internalOptions.attachment = content;
|
||||||
content = '';
|
content = '';
|
||||||
} else if(options.media instanceof MessageMedia) {
|
} else if (options.media instanceof MessageMedia) {
|
||||||
internalOptions.attachment = options.media;
|
internalOptions.attachment = options.media;
|
||||||
internalOptions.caption = content;
|
internalOptions.caption = content;
|
||||||
} else if(content instanceof Location) {
|
} else if (content instanceof Location) {
|
||||||
internalOptions.location = content;
|
internalOptions.location = content;
|
||||||
content = '';
|
content = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
const newMessage = await this.pupPage.evaluate(async (chatId, message, options) => {
|
const newMessage = await this.pupPage.evaluate(async (chatId, message, options, sendSeen) => {
|
||||||
const msg = await window.WWebJS.sendMessage(window.Store.Chat.get(chatId), message, options);
|
let chat = window.Store.Chat.get(chatId);
|
||||||
|
let msg;
|
||||||
|
if (!chat) { // The chat is not available in the previously chatted list
|
||||||
|
|
||||||
|
let newChatId = await window.WWebJS.getNumberId(chatId);
|
||||||
|
if (newChatId) {
|
||||||
|
//get the topmost chat object and assign the new chatId to it .
|
||||||
|
//This is just a workaround.May cause problem if there are no chats at all. Need to dig in and emulate how whatsapp web does
|
||||||
|
let chat = window.Store.Chat.models[0];
|
||||||
|
if (!chat)
|
||||||
|
throw 'Chat List empty! Need at least one open conversation with any of your contact';
|
||||||
|
|
||||||
|
let originalChatObjId = chat.id;
|
||||||
|
chat.id = newChatId;
|
||||||
|
|
||||||
|
msg = await window.WWebJS.sendMessage(chat, message, options);
|
||||||
|
chat.id = originalChatObjId; //replace the chat with its original id
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if(sendSeen) {
|
||||||
|
window.WWebJS.sendSeen(chatId);
|
||||||
|
}
|
||||||
|
|
||||||
|
msg = await window.WWebJS.sendMessage(chat, message, options, sendSeen);
|
||||||
|
}
|
||||||
return msg.serialize();
|
return msg.serialize();
|
||||||
}, chatId, content, internalOptions);
|
}, chatId, content, internalOptions, sendSeen);
|
||||||
|
|
||||||
return new Message(this, newMessage);
|
return new Message(this, newMessage);
|
||||||
}
|
}
|
||||||
@@ -352,6 +446,49 @@ class Client extends EventEmitter {
|
|||||||
}, status);
|
}, status);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the current connection state for the client
|
||||||
|
* @returns {WAState}
|
||||||
|
*/
|
||||||
|
async getState() {
|
||||||
|
return await this.pupPage.evaluate(() => {
|
||||||
|
return window.Store.AppState.state;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enables and returns the archive state of the Chat
|
||||||
|
* @returns {boolean}
|
||||||
|
*/
|
||||||
|
async archiveChat(chatId) {
|
||||||
|
return await this.pupPage.evaluate(async chatId => {
|
||||||
|
let chat = await window.Store.Chat.get(chatId);
|
||||||
|
await window.Store.Cmd.archiveChat(chat, true);
|
||||||
|
return chat.archive;
|
||||||
|
}, chatId);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Changes and returns the archive state of the Chat
|
||||||
|
* @returns {boolean}
|
||||||
|
*/
|
||||||
|
async unarchiveChat(chatId) {
|
||||||
|
return await this.pupPage.evaluate(async chatId => {
|
||||||
|
let chat = await window.Store.Chat.get(chatId);
|
||||||
|
await window.Store.Cmd.archiveChat(chat, false);
|
||||||
|
return chat.archive;
|
||||||
|
}, chatId);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Force reset of connection state for the client
|
||||||
|
*/
|
||||||
|
async resetState(){
|
||||||
|
await this.pupPage.evaluate(() => {
|
||||||
|
window.Store.AppState.phoneWatchdog.shiftTimer.forceRunNow();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = Client;
|
module.exports = Client;
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const Base = require('./Base');
|
const Base = require('./Base');
|
||||||
|
const Message = require('./Message');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents a Chat on WhatsApp
|
* Represents a Chat on WhatsApp
|
||||||
@@ -10,7 +11,7 @@ class Chat extends Base {
|
|||||||
constructor(client, data) {
|
constructor(client, data) {
|
||||||
super(client);
|
super(client);
|
||||||
|
|
||||||
if(data) this._patch(data);
|
if (data) this._patch(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
_patch(data) {
|
_patch(data) {
|
||||||
@@ -50,6 +51,12 @@ class Chat extends Base {
|
|||||||
*/
|
*/
|
||||||
this.timestamp = data.t;
|
this.timestamp = data.t;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Indicates if the Chat is archived
|
||||||
|
* @type {boolean}
|
||||||
|
*/
|
||||||
|
this.archived = data.archive;
|
||||||
|
|
||||||
return super._patch(data);
|
return super._patch(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -62,6 +69,108 @@ class Chat extends Base {
|
|||||||
async sendMessage(content, options) {
|
async sendMessage(content, options) {
|
||||||
return this.client.sendMessage(this.id._serialized, content, options);
|
return this.client.sendMessage(this.id._serialized, content, options);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the message as seen
|
||||||
|
* @returns {Promise<Boolean>} result
|
||||||
|
*/
|
||||||
|
async sendSeen() {
|
||||||
|
return this.client.sendSeen(this.id._serialized);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Clears all messages from the chat
|
||||||
|
* @returns {Promise<Boolean>} result
|
||||||
|
*/
|
||||||
|
async clearMessages() {
|
||||||
|
return this.client.pupPage.evaluate(chatId => {
|
||||||
|
return window.WWebJS.sendClearChat(chatId);
|
||||||
|
}, this.id._serialized);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Deletes the chat
|
||||||
|
* @returns {Promise<Boolean>} result
|
||||||
|
*/
|
||||||
|
async delete() {
|
||||||
|
return this.client.pupPage.evaluate(chatId => {
|
||||||
|
return window.WWebJS.sendDeleteChat(chatId);
|
||||||
|
}, this.id._serialized);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Archives this chat
|
||||||
|
*/
|
||||||
|
async archive() {
|
||||||
|
return this.client.archiveChat(this.id._serialized);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* un-archives this chat
|
||||||
|
*/
|
||||||
|
async unarchive() {
|
||||||
|
return this.client.unarchiveChat(this.id._serialized);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Loads chat messages, sorted from earliest to latest.
|
||||||
|
* @param {Object} searchOptions Options for searching messages. Right now only limit is supported.
|
||||||
|
* @param {Number} [searchOptions.limit=50] The amount of messages to return. Note that the actual number of returned messages may be smaller if there aren't enough messages in the conversation. Set this to Infinity to load all messages.
|
||||||
|
* @returns {Promise<Array<Message>>}
|
||||||
|
*/
|
||||||
|
async fetchMessages(searchOptions) {
|
||||||
|
if(!searchOptions || !searchOptions.limit) {
|
||||||
|
searchOptions = {limit: 50};
|
||||||
|
}
|
||||||
|
let messages = await this.client.pupPage.evaluate(async (chatId, limit) => {
|
||||||
|
const msgFilter = m => !m.isNotification; // dont include notification messages
|
||||||
|
|
||||||
|
const chat = window.Store.Chat.get(chatId);
|
||||||
|
let msgs = chat.msgs.models.filter(msgFilter);
|
||||||
|
|
||||||
|
while(msgs.length < limit) {
|
||||||
|
const loadedMessages = await chat.loadEarlierMsgs();
|
||||||
|
if(!loadedMessages) break;
|
||||||
|
msgs = [...loadedMessages.filter(msgFilter), ...msgs];
|
||||||
|
}
|
||||||
|
|
||||||
|
msgs.sort((a, b) => (a.t > b.t) ? 1 : -1);
|
||||||
|
return msgs.splice(msgs.length - limit).map(m => m.serialize());
|
||||||
|
|
||||||
|
}, this.id._serialized, searchOptions.limit);
|
||||||
|
|
||||||
|
return messages.map(m => new Message(this.client, m));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Simulate typing in chat. This will last for 25 seconds.
|
||||||
|
*/
|
||||||
|
async sendStateTyping() {
|
||||||
|
return this.client.pupPage.evaluate(chatId => {
|
||||||
|
window.WWebJS.sendChatstate('typing', chatId);
|
||||||
|
return true;
|
||||||
|
}, this.id._serialized);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Simulate recording audio in chat. This will last for 25 seconds.
|
||||||
|
*/
|
||||||
|
async sendStateRecording() {
|
||||||
|
return this.client.pupPage.evaluate(chatId => {
|
||||||
|
window.WWebJS.sendChatstate('recording', chatId);
|
||||||
|
return true;
|
||||||
|
}, this.id._serialized);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Stops typing or recording in chat immediately.
|
||||||
|
*/
|
||||||
|
async clearState() {
|
||||||
|
return this.client.pupPage.evaluate(chatId => {
|
||||||
|
window.WWebJS.sendChatstate('stop', chatId);
|
||||||
|
return true;
|
||||||
|
}, this.id._serialized);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = Chat;
|
module.exports = Chat;
|
||||||
|
|||||||
104
src/structures/GroupNotification.js
Normal file
104
src/structures/GroupNotification.js
Normal file
@@ -0,0 +1,104 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
|
const Base = require('./Base');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Represents a GroupNotification on WhatsApp
|
||||||
|
* @extends {Base}
|
||||||
|
*/
|
||||||
|
class GroupNotification extends Base {
|
||||||
|
constructor(client, data) {
|
||||||
|
super(client);
|
||||||
|
|
||||||
|
if(data) this._patch(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
_patch(data) {
|
||||||
|
/**
|
||||||
|
* ID that represents the groupNotification
|
||||||
|
* @type {object}
|
||||||
|
*/
|
||||||
|
this.id = data.id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Extra content
|
||||||
|
* @type {string}
|
||||||
|
*/
|
||||||
|
this.body = data.body || '';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* GroupNotification type
|
||||||
|
* @type {GroupNotificationTypes}
|
||||||
|
*/
|
||||||
|
this.type = data.subtype;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Unix timestamp for when the groupNotification was created
|
||||||
|
* @type {number}
|
||||||
|
*/
|
||||||
|
this.timestamp = data.t;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ID for the Chat that this groupNotification was sent for.
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
*/
|
||||||
|
this.chatId = typeof (data.to) === 'object' ? data.to._serialized : data.to;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ContactId for the user that produced the GroupNotification.
|
||||||
|
* @type {string}
|
||||||
|
*/
|
||||||
|
this.author = typeof (data.author) === 'object' ? data.author._serialized : data.author;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Contact IDs for the users that were affected by this GroupNotification.
|
||||||
|
* @type {Array<string>}
|
||||||
|
*/
|
||||||
|
this.recipientIds = [];
|
||||||
|
|
||||||
|
if (data.recipients) {
|
||||||
|
this.recipientIds = data.recipients;
|
||||||
|
}
|
||||||
|
|
||||||
|
return super._patch(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the Chat this groupNotification was sent in
|
||||||
|
* @returns {Promise<Chat>}
|
||||||
|
*/
|
||||||
|
getChat() {
|
||||||
|
return this.client.getChatById(this.chatId);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the Contact this GroupNotification was produced by
|
||||||
|
* @returns {Promise<Contact>}
|
||||||
|
*/
|
||||||
|
getContact() {
|
||||||
|
return this.client.getContactById(this.author);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the Contacts affected by this GroupNotification.
|
||||||
|
* @returns {Promise<Array<Contact>>}
|
||||||
|
*/
|
||||||
|
async getRecipients() {
|
||||||
|
return await Promise.all(this.recipientIds.map(async m => await this.client.getContactById(m)));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sends a message to the same chat this GroupNotification was produced in.
|
||||||
|
*
|
||||||
|
* @param {string|MessageMedia|Location} content
|
||||||
|
* @param {object} options
|
||||||
|
* @returns {Promise<Message>}
|
||||||
|
*/
|
||||||
|
async reply(content, options={}) {
|
||||||
|
return this.client.sendMessage(this.chatId, content, options);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = GroupNotification;
|
||||||
@@ -188,6 +188,11 @@ class Message extends Base {
|
|||||||
|
|
||||||
const {data, mimetype, filename} = await this.client.pupPage.evaluate(async (msgId) => {
|
const {data, mimetype, filename} = await this.client.pupPage.evaluate(async (msgId) => {
|
||||||
const msg = window.Store.Msg.get(msgId);
|
const msg = window.Store.Msg.get(msgId);
|
||||||
|
|
||||||
|
if(msg.mediaData.mediaStage != 'RESOLVED') {
|
||||||
|
await msg.downloadMedia(true, 1);
|
||||||
|
}
|
||||||
|
|
||||||
const buffer = await window.WWebJS.downloadBuffer(msg.clientUrl);
|
const buffer = await window.WWebJS.downloadBuffer(msg.clientUrl);
|
||||||
const decrypted = await window.Store.CryptoLib.decryptE2EMedia(msg.type, buffer, msg.mediaKey, msg.mimetype);
|
const decrypted = await window.Store.CryptoLib.decryptE2EMedia(msg.type, buffer, msg.mediaKey, msg.mimetype);
|
||||||
const data = await window.WWebJS.readBlobAsync(decrypted._blob);
|
const data = await window.WWebJS.readBlobAsync(decrypted._blob);
|
||||||
@@ -202,6 +207,22 @@ class Message extends Base {
|
|||||||
|
|
||||||
return new MessageMedia(mimetype, data, filename);
|
return new MessageMedia(mimetype, data, filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Deletes a message from the chat
|
||||||
|
* @param {?boolean} everyone If true and the message is sent by the current user, will delete it for everyone in the chat.
|
||||||
|
*/
|
||||||
|
async delete(everyone) {
|
||||||
|
await this.client.pupPage.evaluate((msgId, everyone) => {
|
||||||
|
let msg = window.Store.Msg.get(msgId);
|
||||||
|
|
||||||
|
if(everyone && msg.id.fromMe && msg.canRevoke()) {
|
||||||
|
return window.Store.Cmd.sendRevokeMsgs(msg.chat, [msg], true);
|
||||||
|
}
|
||||||
|
|
||||||
|
return window.Store.Cmd.sendDeleteMsgs(msg.chat, [msg], true);
|
||||||
|
}, this.id._serialized, everyone);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = Message;
|
module.exports = Message;
|
||||||
|
|||||||
13
src/structures/index.js
Normal file
13
src/structures/index.js
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
module.exports = {
|
||||||
|
Base: require('./Base'),
|
||||||
|
BusinessContact: require('./BusinessContact'),
|
||||||
|
Chat: require('./Chat'),
|
||||||
|
ClientInfo: require('./ClientInfo'),
|
||||||
|
Contact: require('./Contact'),
|
||||||
|
GroupChat: require('./GroupChat'),
|
||||||
|
Location: require('./Location'),
|
||||||
|
Message: require('./Message'),
|
||||||
|
MessageMedia: require('./MessageMedia'),
|
||||||
|
PrivateChat: require('./PrivateChat'),
|
||||||
|
PrivateContact: require('./PrivateContact'),
|
||||||
|
};
|
||||||
@@ -35,9 +35,13 @@ exports.Events = {
|
|||||||
MESSAGE_CREATE: 'message_create',
|
MESSAGE_CREATE: 'message_create',
|
||||||
MESSAGE_REVOKED_EVERYONE: 'message_revoke_everyone',
|
MESSAGE_REVOKED_EVERYONE: 'message_revoke_everyone',
|
||||||
MESSAGE_REVOKED_ME: 'message_revoke_me',
|
MESSAGE_REVOKED_ME: 'message_revoke_me',
|
||||||
|
MESSAGE_ACK: 'message_ack',
|
||||||
|
GROUP_JOIN: 'group_join',
|
||||||
|
GROUP_LEAVE: 'group_leave',
|
||||||
|
GROUP_UPDATE: 'group_update',
|
||||||
QR_RECEIVED: 'qr',
|
QR_RECEIVED: 'qr',
|
||||||
DISCONNECTED: 'disconnected',
|
DISCONNECTED: 'disconnected',
|
||||||
STATE_CHANGED: 'change_state'
|
STATE_CHANGED: 'change_state',
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -60,6 +64,23 @@ exports.MessageTypes = {
|
|||||||
UNKNOWN: 'unknown'
|
UNKNOWN: 'unknown'
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Group notification types
|
||||||
|
* @readonly
|
||||||
|
* @enum {string}
|
||||||
|
*/
|
||||||
|
exports.GroupNotificationTypes = {
|
||||||
|
ADD: 'add',
|
||||||
|
INVITE: 'invite',
|
||||||
|
REMOVE: 'remove',
|
||||||
|
LEAVE: 'leave',
|
||||||
|
SUBJECT: 'subject',
|
||||||
|
DESCRIPTION: 'description',
|
||||||
|
PICTURE: 'picture',
|
||||||
|
ANNOUNCE: 'announce',
|
||||||
|
RESTRICT: 'restrict',
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Chat types
|
* Chat types
|
||||||
* @readonly
|
* @readonly
|
||||||
@@ -89,4 +110,18 @@ exports.WAState = {
|
|||||||
UNLAUNCHED: 'UNLAUNCHED',
|
UNLAUNCHED: 'UNLAUNCHED',
|
||||||
UNPAIRED: 'UNPAIRED',
|
UNPAIRED: 'UNPAIRED',
|
||||||
UNPAIRED_IDLE: 'UNPAIRED_IDLE'
|
UNPAIRED_IDLE: 'UNPAIRED_IDLE'
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Message ACK
|
||||||
|
* @readonly
|
||||||
|
* @enum {number}
|
||||||
|
*/
|
||||||
|
exports.MessageAck = {
|
||||||
|
ACK_ERROR: -1,
|
||||||
|
ACK_PENDING: 0,
|
||||||
|
ACK_SERVER: 1,
|
||||||
|
ACK_DEVICE: 2,
|
||||||
|
ACK_READ: 3,
|
||||||
|
ACK_PLAYED: 4,
|
||||||
|
};
|
||||||
|
|||||||
@@ -10,6 +10,9 @@ exports.ExposeStore = (moduleRaidStr) => {
|
|||||||
window.Store.Conn = window.mR.findModule('Conn')[0].default;
|
window.Store.Conn = window.mR.findModule('Conn')[0].default;
|
||||||
window.Store.CryptoLib = window.mR.findModule('decryptE2EMedia')[0];
|
window.Store.CryptoLib = window.mR.findModule('decryptE2EMedia')[0];
|
||||||
window.Store.Wap = window.mR.findModule('Wap')[0].default;
|
window.Store.Wap = window.mR.findModule('Wap')[0].default;
|
||||||
|
window.Store.SendSeen = window.mR.findModule('sendSeen')[0];
|
||||||
|
window.Store.SendClear = window.mR.findModule('sendClear')[0];
|
||||||
|
window.Store.SendDelete = window.mR.findModule('sendDelete')[0];
|
||||||
window.Store.genId = window.mR.findModule((module) => module.default && typeof module.default === 'function' && module.default.toString().match(/crypto/))[0].default;
|
window.Store.genId = window.mR.findModule((module) => module.default && typeof module.default === 'function' && module.default.toString().match(/crypto/))[0].default;
|
||||||
window.Store.SendMessage = window.mR.findModule('addAndSendMsgToChat')[0];
|
window.Store.SendMessage = window.mR.findModule('addAndSendMsgToChat')[0];
|
||||||
window.Store.MsgKey = window.mR.findModule((module) => module.default && module.default.fromString)[0].default;
|
window.Store.MsgKey = window.mR.findModule((module) => module.default && module.default.fromString)[0].default;
|
||||||
@@ -18,13 +21,31 @@ exports.ExposeStore = (moduleRaidStr) => {
|
|||||||
window.Store.MediaPrep = window.mR.findModule('MediaPrep')[0];
|
window.Store.MediaPrep = window.mR.findModule('MediaPrep')[0];
|
||||||
window.Store.MediaObject = window.mR.findModule('getOrCreateMediaObject')[0];
|
window.Store.MediaObject = window.mR.findModule('getOrCreateMediaObject')[0];
|
||||||
window.Store.MediaUpload = window.mR.findModule('uploadMedia')[0];
|
window.Store.MediaUpload = window.mR.findModule('uploadMedia')[0];
|
||||||
|
window.Store.Cmd = window.mR.findModule('Cmd')[0].default;
|
||||||
window.Store.MediaTypes = window.mR.findModule('msgToMediaType')[0];
|
window.Store.MediaTypes = window.mR.findModule('msgToMediaType')[0];
|
||||||
|
window.Store.UserConstructor = window.mR.findModule((module) => (module.default && module.default.prototype && module.default.prototype.isServer && module.default.prototype.isUser) ? module.default : null)[0].default;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.LoadUtils = () => {
|
exports.LoadUtils = () => {
|
||||||
window.WWebJS = {};
|
window.WWebJS = {};
|
||||||
|
window.WWebJS.getNumberId = async (id) => {
|
||||||
|
|
||||||
window.WWebJS.sendMessage = async (chat, content, options={}) => {
|
let result = await window.Store.Wap.queryExist(id);
|
||||||
|
if (result.jid === undefined)
|
||||||
|
throw 'The number provided is not a registered whatsapp user';
|
||||||
|
return result.jid;
|
||||||
|
};
|
||||||
|
window.WWebJS.sendSeen = async (chatId) => {
|
||||||
|
let chat = window.Store.Chat.get(chatId);
|
||||||
|
if (chat !== undefined) {
|
||||||
|
await window.Store.SendSeen.sendSeen(chat, false);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
|
||||||
|
};
|
||||||
|
window.WWebJS.sendMessage = async (chat, content, options = {}) => {
|
||||||
let attOptions = {};
|
let attOptions = {};
|
||||||
if (options.attachment) {
|
if (options.attachment) {
|
||||||
attOptions = await window.WWebJS.processMediaData(options.attachment);
|
attOptions = await window.WWebJS.processMediaData(options.attachment);
|
||||||
@@ -34,27 +55,27 @@ exports.LoadUtils = () => {
|
|||||||
let quotedMsgOptions = {};
|
let quotedMsgOptions = {};
|
||||||
if (options.quotedMessageId) {
|
if (options.quotedMessageId) {
|
||||||
let quotedMessage = window.Store.Msg.get(options.quotedMessageId);
|
let quotedMessage = window.Store.Msg.get(options.quotedMessageId);
|
||||||
if(quotedMessage.canReply()) {
|
if (quotedMessage.canReply()) {
|
||||||
quotedMsgOptions = quotedMessage.msgContextInfo(chat);
|
quotedMsgOptions = quotedMessage.msgContextInfo(chat);
|
||||||
}
|
}
|
||||||
delete options.quotedMessageId;
|
delete options.quotedMessageId;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (options.mentionedJidList) {
|
if (options.mentionedJidList) {
|
||||||
options.mentionedJidList = options.mentionedJidList.map(cId=> window.Store.Contact.get(cId).id);
|
options.mentionedJidList = options.mentionedJidList.map(cId => window.Store.Contact.get(cId).id);
|
||||||
}
|
}
|
||||||
|
|
||||||
let locationOptions = {};
|
let locationOptions = {};
|
||||||
if (options.location) {
|
if (options.location) {
|
||||||
locationOptions = {
|
locationOptions = {
|
||||||
type: 'location',
|
type: 'location',
|
||||||
loc: options.location.description,
|
loc: options.location.description,
|
||||||
lat: options.location.latitude,
|
lat: options.location.latitude,
|
||||||
lng: options.location.longitude
|
lng: options.location.longitude
|
||||||
};
|
};
|
||||||
delete options.location;
|
delete options.location;
|
||||||
}
|
}
|
||||||
|
|
||||||
const newMsgId = new window.Store.MsgKey({
|
const newMsgId = new window.Store.MsgKey({
|
||||||
from: window.Store.Conn.me,
|
from: window.Store.Conn.me,
|
||||||
to: chat.id,
|
to: chat.id,
|
||||||
@@ -94,9 +115,9 @@ exports.LoadUtils = () => {
|
|||||||
isGif: mediaData.isGif
|
isGif: mediaData.isGif
|
||||||
});
|
});
|
||||||
|
|
||||||
if(!(mediaData.mediaBlob instanceof window.Store.OpaqueData.default)) {
|
if (!(mediaData.mediaBlob instanceof window.Store.OpaqueData.default)) {
|
||||||
mediaData.mediaBlob = await window.Store.OpaqueData.default.createFromData(mediaData.mediaBlob, mediaData.mediaBlob.type);
|
mediaData.mediaBlob = await window.Store.OpaqueData.default.createFromData(mediaData.mediaBlob, mediaData.mediaBlob.type);
|
||||||
}
|
}
|
||||||
|
|
||||||
mediaData.renderableUrl = mediaData.mediaBlob.url();
|
mediaData.renderableUrl = mediaData.mediaBlob.url();
|
||||||
mediaObject.consolidate(mediaData.toJSON());
|
mediaObject.consolidate(mediaData.toJSON());
|
||||||
@@ -161,7 +182,7 @@ exports.LoadUtils = () => {
|
|||||||
|
|
||||||
return res;
|
return res;
|
||||||
};
|
};
|
||||||
|
|
||||||
window.WWebJS.getContact = contactId => {
|
window.WWebJS.getContact = contactId => {
|
||||||
const contact = window.Store.Contact.get(contactId);
|
const contact = window.Store.Contact.get(contactId);
|
||||||
return window.WWebJS.getContactModel(contact);
|
return window.WWebJS.getContactModel(contact);
|
||||||
@@ -172,16 +193,16 @@ exports.LoadUtils = () => {
|
|||||||
return contacts.map(contact => window.WWebJS.getContactModel(contact));
|
return contacts.map(contact => window.WWebJS.getContactModel(contact));
|
||||||
};
|
};
|
||||||
|
|
||||||
window.WWebJS.mediaInfoToFile = ({data, mimetype, filename}) => {
|
window.WWebJS.mediaInfoToFile = ({ data, mimetype, filename }) => {
|
||||||
const binaryData = atob(data);
|
const binaryData = atob(data);
|
||||||
|
|
||||||
const buffer = new ArrayBuffer(binaryData.length);
|
const buffer = new ArrayBuffer(binaryData.length);
|
||||||
const view = new Uint8Array(buffer);
|
const view = new Uint8Array(buffer);
|
||||||
for(let i=0; i < binaryData.length; i++) {
|
for (let i = 0; i < binaryData.length; i++) {
|
||||||
view[i] = binaryData.charCodeAt(i);
|
view[i] = binaryData.charCodeAt(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
const blob = new Blob([buffer], {type: mimetype});
|
const blob = new Blob([buffer], { type: mimetype });
|
||||||
return new File([blob], filename, {
|
return new File([blob], filename, {
|
||||||
type: mimetype,
|
type: mimetype,
|
||||||
lastModified: Date.now()
|
lastModified: Date.now()
|
||||||
@@ -189,7 +210,7 @@ exports.LoadUtils = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
window.WWebJS.downloadBuffer = (url) => {
|
window.WWebJS.downloadBuffer = (url) => {
|
||||||
return new Promise(function(resolve, reject) {
|
return new Promise(function (resolve, reject) {
|
||||||
let xhr = new XMLHttpRequest();
|
let xhr = new XMLHttpRequest();
|
||||||
xhr.open('GET', url);
|
xhr.open('GET', url);
|
||||||
xhr.responseType = 'arraybuffer';
|
xhr.responseType = 'arraybuffer';
|
||||||
@@ -216,16 +237,53 @@ exports.LoadUtils = () => {
|
|||||||
window.WWebJS.readBlobAsync = (blob) => {
|
window.WWebJS.readBlobAsync = (blob) => {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
let reader = new FileReader();
|
let reader = new FileReader();
|
||||||
|
|
||||||
reader.onload = () => {
|
reader.onload = () => {
|
||||||
resolve(reader.result);
|
resolve(reader.result);
|
||||||
};
|
};
|
||||||
|
|
||||||
reader.onerror = reject;
|
reader.onerror = reject;
|
||||||
|
|
||||||
reader.readAsDataURL(blob);
|
reader.readAsDataURL(blob);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
window.WWebJS.sendClearChat = async (chatId) => {
|
||||||
|
let chat = window.Store.Chat.get(chatId);
|
||||||
|
if (chat !== undefined) {
|
||||||
|
await window.Store.SendClear.sendClear(chat, false);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
|
||||||
|
window.WWebJS.sendDeleteChat = async (chatId) => {
|
||||||
|
let chat = window.Store.Chat.get(chatId);
|
||||||
|
if (chat !== undefined) {
|
||||||
|
await window.Store.SendDelete.sendDelete(chat);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
|
||||||
|
window.WWebJS.sendChatstate = async (state, chatId) => {
|
||||||
|
switch(state) {
|
||||||
|
case 'typing':
|
||||||
|
await window.Store.Wap.sendChatstateComposing(chatId);
|
||||||
|
break;
|
||||||
|
case 'recording':
|
||||||
|
await window.Store.Wap.sendChatstateRecording(chatId);
|
||||||
|
break;
|
||||||
|
case 'stop':
|
||||||
|
await window.Store.Wap.sendChatstatePaused(chatId);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
throw 'Invalid chatstate';
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.MarkAllRead = () => {
|
exports.MarkAllRead = () => {
|
||||||
@@ -243,4 +301,4 @@ exports.MarkAllRead = () => {
|
|||||||
window.Store.Wap.sendConversationSeen(chat.id, chat.getLastMsgKeyForAction(), chat.unreadCount - chat.pendingSeenCount);
|
window.Store.Wap.sendConversationSeen(chat.id, chat.getLastMsgKeyForAction(), chat.unreadCount - chat.pendingSeenCount);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user