mirror of
https://github.com/cheveguerra/whatsapp-web.js.git
synced 2026-04-18 03:29:14 +00:00
Compare commits
1 Commits
main
...
tuyuribr-p
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
89af3bb375 |
3
.github/FUNDING.yml
vendored
3
.github/FUNDING.yml
vendored
@@ -1,3 +0,0 @@
|
||||
github: [pedroslopez, PurpShell]
|
||||
ko_fi: pedroslopez
|
||||
custom: ["paypal.me/psla", "buymeacoff.ee/pedroslopez"]
|
||||
@@ -1,4 +1,4 @@
|
||||
[](https://www.npmjs.com/package/whatsapp-web.js) [](https://depfu.com/github/pedroslopez/whatsapp-web.js?project_id=9765)  [](https://discord.gg/H7DqQs4)
|
||||
[](https://www.npmjs.com/package/whatsapp-web.js) [](https://depfu.com/github/pedroslopez/whatsapp-web.js?project_id=9765)  [](https://discord.gg/H7DqQs4)
|
||||
|
||||
# whatsapp-web.js
|
||||
A WhatsApp API client that connects through the WhatsApp Web browser app
|
||||
@@ -7,6 +7,7 @@ It uses Puppeteer to run a real instance of Whatsapp Web to avoid getting blocke
|
||||
|
||||
**NOTE:** I can't guarantee you will not be blocked by using this method, although it has worked for me. WhatsApp does not allow bots or unofficial clients on their platform, so this shouldn't be considered totally safe.
|
||||
|
||||
|
||||
## Quick Links
|
||||
|
||||
* [Guide / Getting Started](https://wwebjs.dev/guide) _(work in progress)_
|
||||
@@ -94,7 +95,7 @@ You can support the maintainer of this project through the links below
|
||||
|
||||
- [Support via GitHub Sponsors](https://github.com/sponsors/pedroslopez)
|
||||
- [Support via PayPal](https://www.paypal.me/psla/)
|
||||
- [Sign up for DigitalOcean](https://m.do.co/c/73f906a36ed4) and get $200 in credit when you sign up (Referral)
|
||||
- [Sign up for DigitalOcean](https://m.do.co/c/73f906a36ed4) and get $100 in credit when you sign up (Referral)
|
||||
|
||||
## Disclaimer
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta name="generator" content="JSDoc 3.6.7">
|
||||
<meta charset="utf-8">
|
||||
<title>whatsapp-web.js 1.19.5 » Class: Base</title>
|
||||
<title>whatsapp-web.js 1.17.1 » 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/Noto+Serif:400,400i,700,700i" 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">
|
||||
<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>19.<wbr>5</a>
|
||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>17.<wbr>1</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
@@ -50,7 +50,7 @@
|
||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||
<div id="jsdoc-footer-container">
|
||||
<p>
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on March 18, 2023.
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on July 10, 2022.
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta name="generator" content="JSDoc 3.6.7">
|
||||
<meta charset="utf-8">
|
||||
<title>whatsapp-web.js 1.19.5 » Class: BaseAuthStrategy</title>
|
||||
<title>whatsapp-web.js 1.17.1 » Class: BaseAuthStrategy</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">
|
||||
@@ -15,7 +15,7 @@
|
||||
<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>19.<wbr>5</a>
|
||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>17.<wbr>1</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
@@ -50,7 +50,7 @@
|
||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||
<div id="jsdoc-footer-container">
|
||||
<p>
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on March 18, 2023.
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on July 10, 2022.
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta name="generator" content="JSDoc 3.6.7">
|
||||
<meta charset="utf-8">
|
||||
<title>whatsapp-web.js 1.19.5 » Class: BusinessContact</title>
|
||||
<title>whatsapp-web.js 1.17.1 » 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/Noto+Serif:400,400i,700,700i" 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">
|
||||
<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>19.<wbr>5</a>
|
||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>17.<wbr>1</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
@@ -326,7 +326,7 @@
|
||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||
<div id="jsdoc-footer-container">
|
||||
<p>
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on March 18, 2023.
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on July 10, 2022.
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta name="generator" content="JSDoc 3.6.7">
|
||||
<meta charset="utf-8">
|
||||
<title>whatsapp-web.js 1.19.5 » Class: Buttons</title>
|
||||
<title>whatsapp-web.js 1.17.1 » Class: Buttons</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">
|
||||
@@ -15,7 +15,7 @@
|
||||
<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>19.<wbr>5</a>
|
||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>17.<wbr>1</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
@@ -234,7 +234,7 @@ Returns: [{ buttonId:'customId',buttonText:{'displayText':&#
|
||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||
<div id="jsdoc-footer-container">
|
||||
<p>
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on March 18, 2023.
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on July 10, 2022.
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta name="generator" content="JSDoc 3.6.7">
|
||||
<meta charset="utf-8">
|
||||
<title>whatsapp-web.js 1.19.5 » Class: Call</title>
|
||||
<title>whatsapp-web.js 1.17.1 » Class: Call</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">
|
||||
@@ -15,7 +15,7 @@
|
||||
<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>19.<wbr>5</a>
|
||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>17.<wbr>1</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
@@ -78,22 +78,6 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="summary-callout">
|
||||
<h2 class="summary-callout-heading">Method</h2>
|
||||
<div class="summary-content">
|
||||
<div class="summary-column">
|
||||
<dl class="dl-summary-callout">
|
||||
<dt><a href="Call.html#reject">reject()</a></dt>
|
||||
<dd>
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
<div class="summary-column">
|
||||
</div>
|
||||
<div class="summary-column">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<section>
|
||||
<h2 id="Call">new <span class="symbol-name">Call</span><span class="signature"><span class="signature-params">()</span></span></h2>
|
||||
@@ -151,14 +135,6 @@
|
||||
<dl class="dl-compact">
|
||||
</dl>
|
||||
</section>
|
||||
<h2>Method</h2>
|
||||
<section>
|
||||
<div class="symbol-detail-labels"><span class="label label-async">async</span></div>
|
||||
<h3 id="reject"><span class="symbol-name">reject</span><span class="signature"><span class="signature-params">()</span></span></h3>
|
||||
<p>Reject the call</p>
|
||||
<dl class="dl-compact">
|
||||
</dl>
|
||||
</section>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
@@ -168,7 +144,7 @@
|
||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||
<div id="jsdoc-footer-container">
|
||||
<p>
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on March 18, 2023.
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on July 10, 2022.
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta name="generator" content="JSDoc 3.6.7">
|
||||
<meta charset="utf-8">
|
||||
<title>whatsapp-web.js 1.19.5 » Class: Chat</title>
|
||||
<title>whatsapp-web.js 1.17.1 » 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/Noto+Serif:400,400i,700,700i" 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">
|
||||
<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>19.<wbr>5</a>
|
||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>17.<wbr>1</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
@@ -271,7 +271,7 @@
|
||||
<p> </p>
|
||||
</td>
|
||||
<td>
|
||||
<p>Options for searching messages. Right now only limit and fromMe is supported.</p>
|
||||
<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>
|
||||
@@ -297,20 +297,6 @@
|
||||
<p>The amount of messages to return. If no limit is specified, the available messages will be returned. 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>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>fromMe</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>Boolean</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>Yes</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>Return only messages from the bot number or vise versa. To get all messages, leave the option undefined.</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</td>
|
||||
@@ -497,7 +483,7 @@
|
||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||
<div id="jsdoc-footer-container">
|
||||
<p>
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on March 18, 2023.
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on July 10, 2022.
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
182
docs/Client.html
182
docs/Client.html
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta name="generator" content="JSDoc 3.6.7">
|
||||
<meta charset="utf-8">
|
||||
<title>whatsapp-web.js 1.19.5 » Class: Client</title>
|
||||
<title>whatsapp-web.js 1.17.1 » 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/Noto+Serif:400,400i,700,700i" 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">
|
||||
<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>19.<wbr>5</a>
|
||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>17.<wbr>1</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
@@ -236,9 +236,6 @@
|
||||
<dt><a href="Client.html#event:message_create">message_create</a></dt>
|
||||
<dd>
|
||||
</dd>
|
||||
<dt><a href="Client.html#event:message_reaction">message_reaction</a></dt>
|
||||
<dd>
|
||||
</dd>
|
||||
<dt><a href="Client.html#event:message_revoke_everyone">message_revoke_everyone</a></dt>
|
||||
<dd>
|
||||
</dd>
|
||||
@@ -2184,179 +2181,6 @@
|
||||
</section>
|
||||
<dl class="dl-compact">
|
||||
</dl>
|
||||
<h3 id="event:message_reaction"><span class="symbol-name">message_reaction</span></h3>
|
||||
<p>Emitted when a reaction is sent, received, updated or removed</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>reaction</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>object</p>
|
||||
</td>
|
||||
<td>
|
||||
<p> </p>
|
||||
</td>
|
||||
<td>
|
||||
<p>Values in <code>reaction</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>id</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>object</p>
|
||||
</td>
|
||||
<td>
|
||||
<p> </p>
|
||||
</td>
|
||||
<td>
|
||||
<p>Reaction id</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>orphan</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>number</p>
|
||||
</td>
|
||||
<td>
|
||||
<p> </p>
|
||||
</td>
|
||||
<td>
|
||||
<p>Orphan</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>orphanReason</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>string</p>
|
||||
</td>
|
||||
<td>
|
||||
<p> </p>
|
||||
</td>
|
||||
<td>
|
||||
<p>Orphan reason</p>
|
||||
<p>Value can be null.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>timestamp</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>number</p>
|
||||
</td>
|
||||
<td>
|
||||
<p> </p>
|
||||
</td>
|
||||
<td>
|
||||
<p>Timestamp</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>reaction</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>string</p>
|
||||
</td>
|
||||
<td>
|
||||
<p> </p>
|
||||
</td>
|
||||
<td>
|
||||
<p>Reaction</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>read</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>boolean</p>
|
||||
</td>
|
||||
<td>
|
||||
<p> </p>
|
||||
</td>
|
||||
<td>
|
||||
<p>Read</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>msgId</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>object</p>
|
||||
</td>
|
||||
<td>
|
||||
<p> </p>
|
||||
</td>
|
||||
<td>
|
||||
<p>Parent message id</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>senderId</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>string</p>
|
||||
</td>
|
||||
<td>
|
||||
<p> </p>
|
||||
</td>
|
||||
<td>
|
||||
<p>Sender id</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>ack</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>number</p>
|
||||
</td>
|
||||
<td>
|
||||
<p> </p>
|
||||
</td>
|
||||
<td>
|
||||
<p>Ack</p>
|
||||
<p>Value can be null.</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
<dl class="dl-compact">
|
||||
</dl>
|
||||
<h3 id="event:message_revoke_everyone"><span class="symbol-name">message_revoke_everyone</span></h3>
|
||||
<p>Emitted when a message is deleted for everyone in the chat.</p>
|
||||
<section>
|
||||
@@ -2486,7 +2310,7 @@
|
||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||
<div id="jsdoc-footer-container">
|
||||
<p>
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on March 18, 2023.
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on July 10, 2022.
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta name="generator" content="JSDoc 3.6.7">
|
||||
<meta charset="utf-8">
|
||||
<title>whatsapp-web.js 1.19.5 » Source: Client.js</title>
|
||||
<title>whatsapp-web.js 1.17.1 » 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/Noto+Serif:400,400i,700,700i" 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">
|
||||
<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>19.<wbr>5</a>
|
||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>17.<wbr>1</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
@@ -41,7 +41,7 @@ const { WhatsWebURL, DefaultOptions, Events, WAState } = require('./ut
|
||||
const { ExposeStore, LoadUtils } = require('./util/Injected');
|
||||
const ChatFactory = require('./factories/ChatFactory');
|
||||
const ContactFactory = require('./factories/ContactFactory');
|
||||
const { ClientInfo, Message, MessageMedia, Contact, Location, GroupNotification, Label, Call, Buttons, List, Reaction } = require('./structures');
|
||||
const { ClientInfo, Message, MessageMedia, Contact, Location, GroupNotification, Label, Call, Buttons, List} = require('./structures');
|
||||
const LegacySessionAuth = require('./authStrategies/LegacySessionAuth');
|
||||
const NoAuth = require('./authStrategies/NoAuth');
|
||||
|
||||
@@ -146,52 +146,6 @@ class Client extends EventEmitter {
|
||||
referer: 'https://whatsapp.com/'
|
||||
});
|
||||
|
||||
await page.evaluate(`function getElementByXpath(path) {
|
||||
return document.evaluate(path, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
|
||||
}`);
|
||||
|
||||
let lastPercent = null,
|
||||
lastPercentMessage = null;
|
||||
|
||||
await page.exposeFunction('loadingScreen', async (percent, message) => {
|
||||
if (lastPercent !== percent || lastPercentMessage !== message) {
|
||||
this.emit(Events.LOADING_SCREEN, percent, message);
|
||||
lastPercent = percent;
|
||||
lastPercentMessage = message;
|
||||
}
|
||||
});
|
||||
|
||||
await page.evaluate(
|
||||
async function (selectors) {
|
||||
var observer = new MutationObserver(function () {
|
||||
let progressBar = window.getElementByXpath(
|
||||
selectors.PROGRESS
|
||||
);
|
||||
let progressMessage = window.getElementByXpath(
|
||||
selectors.PROGRESS_MESSAGE
|
||||
);
|
||||
|
||||
if (progressBar) {
|
||||
window.loadingScreen(
|
||||
progressBar.value,
|
||||
progressMessage.innerText
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
observer.observe(document, {
|
||||
attributes: true,
|
||||
childList: true,
|
||||
characterData: true,
|
||||
subtree: true,
|
||||
});
|
||||
},
|
||||
{
|
||||
PROGRESS: '//*[@id=\'app\']/div/div/div[2]/progress',
|
||||
PROGRESS_MESSAGE: '//*[@id=\'app\']/div/div/div[3]',
|
||||
}
|
||||
);
|
||||
|
||||
const INTRO_IMG_SELECTOR = '[data-testid="intro-md-beta-logo-dark"], [data-testid="intro-md-beta-logo-light"], [data-asset-intro-image-light="true"], [data-asset-intro-image-dark="true"]';
|
||||
const INTRO_QRCODE_SELECTOR = 'div[data-ref] canvas';
|
||||
|
||||
@@ -450,7 +404,7 @@ class Client extends EventEmitter {
|
||||
this.emit(Events.MEDIA_UPLOADED, message);
|
||||
});
|
||||
|
||||
await page.exposeFunction('onAppStateChangedEvent', async (state) => {
|
||||
await page.exposeFunction('onAppStateChangedEvent', (state) => {
|
||||
|
||||
/**
|
||||
* Emitted when the connection state changes
|
||||
@@ -477,7 +431,6 @@ class Client extends EventEmitter {
|
||||
* @event Client#disconnected
|
||||
* @param {WAState|"NAVIGATION"} reason reason that caused the disconnect
|
||||
*/
|
||||
await this.authStrategy.disconnect();
|
||||
this.emit(Events.DISCONNECTED, state);
|
||||
this.destroy();
|
||||
}
|
||||
@@ -517,27 +470,6 @@ class Client extends EventEmitter {
|
||||
this.emit(Events.INCOMING_CALL, cll);
|
||||
});
|
||||
|
||||
await page.exposeFunction('onReaction', (reactions) => {
|
||||
for (const reaction of reactions) {
|
||||
/**
|
||||
* Emitted when a reaction is sent, received, updated or removed
|
||||
* @event Client#message_reaction
|
||||
* @param {object} reaction
|
||||
* @param {object} reaction.id - Reaction id
|
||||
* @param {number} reaction.orphan - Orphan
|
||||
* @param {?string} reaction.orphanReason - Orphan reason
|
||||
* @param {number} reaction.timestamp - Timestamp
|
||||
* @param {string} reaction.reaction - Reaction
|
||||
* @param {boolean} reaction.read - Read
|
||||
* @param {object} reaction.msgId - Parent message id
|
||||
* @param {string} reaction.senderId - Sender id
|
||||
* @param {?number} reaction.ack - Ack
|
||||
*/
|
||||
|
||||
this.emit(Events.MESSAGE_REACTION, new Reaction(this, reaction));
|
||||
}
|
||||
});
|
||||
|
||||
await page.evaluate(() => {
|
||||
window.Store.Msg.on('change', (msg) => { window.onChangeMessageEvent(window.WWebJS.getMessageModel(msg)); });
|
||||
window.Store.Msg.on('change:type', (msg) => { window.onChangeMessageTypeEvent(window.WWebJS.getMessageModel(msg)); });
|
||||
@@ -557,22 +489,6 @@ class Client extends EventEmitter {
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
{
|
||||
const module = window.Store.createOrUpdateReactionsModule;
|
||||
const ogMethod = module.createOrUpdateReactions;
|
||||
module.createOrUpdateReactions = ((...args) => {
|
||||
window.onReaction(args[0].map(reaction => {
|
||||
const msgKey = window.Store.MsgKey.fromString(reaction.msgKey);
|
||||
const parentMsgKey = window.Store.MsgKey.fromString(reaction.parentMsgKey);
|
||||
const timestamp = reaction.timestamp / 1000;
|
||||
|
||||
return {...reaction, msgKey, parentMsgKey, timestamp };
|
||||
}));
|
||||
|
||||
return ogMethod(...args);
|
||||
}).bind(module);
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
@@ -580,13 +496,11 @@ class Client extends EventEmitter {
|
||||
* @event Client#ready
|
||||
*/
|
||||
this.emit(Events.READY);
|
||||
this.authStrategy.afterAuthReady();
|
||||
|
||||
// Disconnect when navigating away when in PAIRING state (detect logout)
|
||||
this.pupPage.on('framenavigated', async () => {
|
||||
const appState = await this.getState();
|
||||
if(!appState || appState === WAState.PAIRING) {
|
||||
await this.authStrategy.disconnect();
|
||||
this.emit(Events.DISCONNECTED, 'NAVIGATION');
|
||||
await this.destroy();
|
||||
}
|
||||
@@ -598,7 +512,6 @@ class Client extends EventEmitter {
|
||||
*/
|
||||
async destroy() {
|
||||
await this.pupBrowser.close();
|
||||
await this.authStrategy.destroy();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -805,7 +718,7 @@ class Client extends EventEmitter {
|
||||
*/
|
||||
async getInviteInfo(inviteCode) {
|
||||
return await this.pupPage.evaluate(inviteCode => {
|
||||
return window.Store.InviteInfo.queryGroupInvite(inviteCode);
|
||||
return window.Store.InviteInfo.sendQueryGroupInvite(inviteCode);
|
||||
}, inviteCode);
|
||||
}
|
||||
|
||||
@@ -815,11 +728,11 @@ class Client extends EventEmitter {
|
||||
* @returns {Promise&lt;string>} Id of the joined Chat
|
||||
*/
|
||||
async acceptInvite(inviteCode) {
|
||||
const res = await this.pupPage.evaluate(async inviteCode => {
|
||||
return await window.Store.Invite.joinGroupViaInvite(inviteCode);
|
||||
const chatId = await this.pupPage.evaluate(async inviteCode => {
|
||||
return await window.Store.Invite.sendJoinGroupViaInvite(inviteCode);
|
||||
}, inviteCode);
|
||||
|
||||
return res.gid._serialized;
|
||||
return chatId._serialized;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -968,7 +881,7 @@ class Client extends EventEmitter {
|
||||
unmuteDate = unmuteDate ? unmuteDate.getTime() / 1000 : -1;
|
||||
await this.pupPage.evaluate(async (chatId, timestamp) => {
|
||||
let chat = await window.Store.Chat.get(chatId);
|
||||
await chat.mute.mute({expiration: timestamp, sendDevice:!0});
|
||||
await chat.mute.mute(timestamp, !0);
|
||||
}, chatId, unmuteDate || -1);
|
||||
}
|
||||
|
||||
@@ -1020,13 +933,7 @@ class Client extends EventEmitter {
|
||||
*/
|
||||
async getCommonGroups(contactId) {
|
||||
const commonGroups = await this.pupPage.evaluate(async (contactId) => {
|
||||
let contact = window.Store.Contact.get(contactId);
|
||||
if (!contact) {
|
||||
const wid = window.Store.WidFactory.createUserWid(contactId);
|
||||
const chatConstructor = window.Store.Contact.getModelsArray().find(c=>!c.isGroup).constructor;
|
||||
contact = new chatConstructor({id: wid});
|
||||
}
|
||||
|
||||
const contact = window.Store.Contact.get(contactId);
|
||||
if (contact.commonGroups) {
|
||||
return contact.commonGroups.serialize();
|
||||
}
|
||||
@@ -1126,17 +1033,19 @@ class Client extends EventEmitter {
|
||||
|
||||
const createRes = await this.pupPage.evaluate(async (name, participantIds) => {
|
||||
const participantWIDs = participantIds.map(p => window.Store.WidFactory.createWid(p));
|
||||
return await window.Store.GroupUtils.createGroup(name, participantWIDs, 0);
|
||||
const id = window.Store.MsgKey.newId();
|
||||
const res = await window.Store.GroupUtils.sendCreateGroup(name, participantWIDs, undefined, id);
|
||||
return res;
|
||||
}, name, participants);
|
||||
|
||||
const missingParticipants = createRes.participants.reduce(((missing, c) => {
|
||||
const id = c.wid._serialized;
|
||||
const statusCode = c.error ? c.error.toString() : '200';
|
||||
const id = Object.keys(c)[0];
|
||||
const statusCode = c[id].code;
|
||||
if (statusCode != 200) return Object.assign(missing, { [id]: statusCode });
|
||||
return missing;
|
||||
}), {});
|
||||
|
||||
return { gid: createRes.wid, missingParticipants };
|
||||
return { gid: createRes.gid, missingParticipants };
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1222,7 +1131,7 @@ module.exports = Client;
|
||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||
<div id="jsdoc-footer-container">
|
||||
<p>
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on March 18, 2023.
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on July 10, 2022.
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta name="generator" content="JSDoc 3.6.7">
|
||||
<meta charset="utf-8">
|
||||
<title>whatsapp-web.js 1.19.5 » Class: ClientInfo</title>
|
||||
<title>whatsapp-web.js 1.17.1 » 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/Noto+Serif:400,400i,700,700i" 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">
|
||||
<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>19.<wbr>5</a>
|
||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>17.<wbr>1</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
@@ -242,7 +242,7 @@
|
||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||
<div id="jsdoc-footer-container">
|
||||
<p>
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on March 18, 2023.
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on July 10, 2022.
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta name="generator" content="JSDoc 3.6.7">
|
||||
<meta charset="utf-8">
|
||||
<title>whatsapp-web.js 1.19.5 » Class: Contact</title>
|
||||
<title>whatsapp-web.js 1.17.1 » Class: Contact</title>
|
||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
|
||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
||||
@@ -15,7 +15,7 @@
|
||||
<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>19.<wbr>5</a>
|
||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>17.<wbr>1</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
@@ -293,7 +293,7 @@
|
||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||
<div id="jsdoc-footer-container">
|
||||
<p>
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on March 18, 2023.
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on July 10, 2022.
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta name="generator" content="JSDoc 3.6.7">
|
||||
<meta charset="utf-8">
|
||||
<title>whatsapp-web.js 1.19.5 » Class: GroupChat</title>
|
||||
<title>whatsapp-web.js 1.17.1 » 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/Noto+Serif:400,400i,700,700i" 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">
|
||||
<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>19.<wbr>5</a>
|
||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>17.<wbr>1</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
@@ -436,7 +436,7 @@
|
||||
<p> </p>
|
||||
</td>
|
||||
<td>
|
||||
<p>Options for searching messages. Right now only limit and fromMe is supported.</p>
|
||||
<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>
|
||||
@@ -462,20 +462,6 @@
|
||||
<p>The amount of messages to return. If no limit is specified, the available messages will be returned. 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>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>fromMe</p>
|
||||
</td>
|
||||
<td>
|
||||
<p> </p>
|
||||
</td>
|
||||
<td>
|
||||
<p>Yes</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>Return only messages from the bot number or vise versa. To get all messages, leave the option undefined.</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</td>
|
||||
@@ -941,7 +927,7 @@
|
||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||
<div id="jsdoc-footer-container">
|
||||
<p>
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on March 18, 2023.
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on July 10, 2022.
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta name="generator" content="JSDoc 3.6.7">
|
||||
<meta charset="utf-8">
|
||||
<title>whatsapp-web.js 1.19.5 » Class: GroupNotification</title>
|
||||
<title>whatsapp-web.js 1.17.1 » 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">
|
||||
@@ -15,7 +15,7 @@
|
||||
<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>19.<wbr>5</a>
|
||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>17.<wbr>1</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
@@ -233,7 +233,7 @@
|
||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||
<div id="jsdoc-footer-container">
|
||||
<p>
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on March 18, 2023.
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on July 10, 2022.
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta name="generator" content="JSDoc 3.6.7">
|
||||
<meta charset="utf-8">
|
||||
<title>whatsapp-web.js 1.19.5 » Class: InterfaceController</title>
|
||||
<title>whatsapp-web.js 1.17.1 » Class: InterfaceController</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">
|
||||
@@ -15,7 +15,7 @@
|
||||
<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>19.<wbr>5</a>
|
||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>17.<wbr>1</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
@@ -382,7 +382,7 @@
|
||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||
<div id="jsdoc-footer-container">
|
||||
<p>
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on March 18, 2023.
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on July 10, 2022.
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta name="generator" content="JSDoc 3.6.7">
|
||||
<meta charset="utf-8">
|
||||
<title>whatsapp-web.js 1.19.5 » Class: Label</title>
|
||||
<title>whatsapp-web.js 1.17.1 » Class: Label</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">
|
||||
@@ -15,7 +15,7 @@
|
||||
<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>19.<wbr>5</a>
|
||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>17.<wbr>1</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
@@ -163,7 +163,7 @@
|
||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||
<div id="jsdoc-footer-container">
|
||||
<p>
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on March 18, 2023.
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on July 10, 2022.
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta name="generator" content="JSDoc 3.6.7">
|
||||
<meta charset="utf-8">
|
||||
<title>whatsapp-web.js 1.19.5 » Class: LegacySessionAuth</title>
|
||||
<title>whatsapp-web.js 1.17.1 » Class: LegacySessionAuth</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">
|
||||
@@ -15,7 +15,7 @@
|
||||
<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>19.<wbr>5</a>
|
||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>17.<wbr>1</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
@@ -173,7 +173,7 @@
|
||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||
<div id="jsdoc-footer-container">
|
||||
<p>
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on March 18, 2023.
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on July 10, 2022.
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta name="generator" content="JSDoc 3.6.7">
|
||||
<meta charset="utf-8">
|
||||
<title>whatsapp-web.js 1.19.5 » Class: List</title>
|
||||
<title>whatsapp-web.js 1.17.1 » Class: List</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">
|
||||
@@ -15,7 +15,7 @@
|
||||
<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>19.<wbr>5</a>
|
||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>17.<wbr>1</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
@@ -256,7 +256,7 @@ Returns: [{'title':'sectionTitle','rows':[{'r
|
||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||
<div id="jsdoc-footer-container">
|
||||
<p>
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on March 18, 2023.
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on July 10, 2022.
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta name="generator" content="JSDoc 3.6.7">
|
||||
<meta charset="utf-8">
|
||||
<title>whatsapp-web.js 1.19.5 » Class: LocalAuth</title>
|
||||
<title>whatsapp-web.js 1.17.1 » Class: LocalAuth</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">
|
||||
@@ -15,7 +15,7 @@
|
||||
<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>19.<wbr>5</a>
|
||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>17.<wbr>1</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
@@ -120,7 +120,7 @@
|
||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||
<div id="jsdoc-footer-container">
|
||||
<p>
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on March 18, 2023.
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on July 10, 2022.
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta name="generator" content="JSDoc 3.6.7">
|
||||
<meta charset="utf-8">
|
||||
<title>whatsapp-web.js 1.19.5 » Class: Location</title>
|
||||
<title>whatsapp-web.js 1.17.1 » 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/Noto+Serif:400,400i,700,700i" 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">
|
||||
<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>19.<wbr>5</a>
|
||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>17.<wbr>1</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
@@ -149,7 +149,7 @@
|
||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||
<div id="jsdoc-footer-container">
|
||||
<p>
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on March 18, 2023.
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on July 10, 2022.
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta name="generator" content="JSDoc 3.6.7">
|
||||
<meta charset="utf-8">
|
||||
<title>whatsapp-web.js 1.19.5 » Class: Message</title>
|
||||
<title>whatsapp-web.js 1.17.1 » 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/Noto+Serif:400,400i,700,700i" 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">
|
||||
<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>19.<wbr>5</a>
|
||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>17.<wbr>1</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
@@ -400,7 +400,7 @@
|
||||
<p> </p>
|
||||
</td>
|
||||
<td>
|
||||
<p>If true and the message is sent by the current user or the user is an admin, will delete it for everyone in the chat.</p>
|
||||
<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>
|
||||
@@ -420,7 +420,7 @@
|
||||
</dl>
|
||||
<div class="symbol-detail-labels"><span class="label label-async">async</span></div>
|
||||
<h3 id="forward"><span class="symbol-name">forward</span><span class="signature"><span class="signature-params">(chat)</span> → <span class="signature-returns"> Promise</span></span></h3>
|
||||
<p>Forwards this message to another chat (that you chatted before, otherwise it will fail)</p>
|
||||
<p>Forwards this message to another chat</p>
|
||||
<section>
|
||||
<h4>Parameter</h4>
|
||||
<table class="jsdoc-details-table">
|
||||
@@ -650,7 +650,7 @@
|
||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||
<div id="jsdoc-footer-container">
|
||||
<p>
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on March 18, 2023.
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on July 10, 2022.
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta name="generator" content="JSDoc 3.6.7">
|
||||
<meta charset="utf-8">
|
||||
<title>whatsapp-web.js 1.19.5 » Class: MessageMedia</title>
|
||||
<title>whatsapp-web.js 1.17.1 » 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/Noto+Serif:400,400i,700,700i" 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">
|
||||
<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>19.<wbr>5</a>
|
||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>17.<wbr>1</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
@@ -26,7 +26,7 @@
|
||||
<header class="page-header">
|
||||
<div class="symbol-detail-labels"><span class="label label-kind">class</span></div>
|
||||
<h1><small></small><span class="symbol-name">MessageMedia</span></h1>
|
||||
<p class="source-link">Source: <a href="structures_MessageMedia.js.html#source-line-16">structures/<wbr>MessageMedia.<wbr>js:16</a></p>
|
||||
<p class="source-link">Source: <a href="structures_MessageMedia.js.html#source-line-15">structures/<wbr>MessageMedia.<wbr>js:15</a></p>
|
||||
<div class="symbol-classdesc">
|
||||
<p>Media attached to a message</p>
|
||||
</div>
|
||||
@@ -42,6 +42,10 @@
|
||||
<dt><a href="MessageMedia.html#data">data</a></dt>
|
||||
<dd>
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
<div class="summary-column">
|
||||
<dl class="dl-summary-callout">
|
||||
<dt><a href="MessageMedia.html#filename">filename</a></dt>
|
||||
<dd>
|
||||
</dd>
|
||||
@@ -49,16 +53,11 @@
|
||||
</div>
|
||||
<div class="summary-column">
|
||||
<dl class="dl-summary-callout">
|
||||
<dt><a href="MessageMedia.html#filesize">filesize</a></dt>
|
||||
<dd>
|
||||
</dd>
|
||||
<dt><a href="MessageMedia.html#mimetype">mimetype</a></dt>
|
||||
<dd>
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
<div class="summary-column">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="summary-callout">
|
||||
@@ -84,7 +83,7 @@
|
||||
</div>
|
||||
</section>
|
||||
<section>
|
||||
<h2 id="MessageMedia">new <span class="symbol-name">MessageMedia</span><span class="signature"><span class="signature-params">(mimetype, data, filename, filesize)</span></span></h2>
|
||||
<h2 id="MessageMedia">new <span class="symbol-name">MessageMedia</span><span class="signature"><span class="signature-params">(mimetype, data, filename)</span></span></h2>
|
||||
<section>
|
||||
<h3>Parameters</h3>
|
||||
<table class="jsdoc-details-table">
|
||||
@@ -136,22 +135,7 @@
|
||||
<p> </p>
|
||||
</td>
|
||||
<td>
|
||||
<p>Document file name. Value can be null</p>
|
||||
<p>Value can be null.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>filesize</p>
|
||||
</td>
|
||||
<td>
|
||||
<p> </p>
|
||||
</td>
|
||||
<td>
|
||||
<p> </p>
|
||||
</td>
|
||||
<td>
|
||||
<p>Document file size in bytes. Value can be null</p>
|
||||
<p>Document file name</p>
|
||||
<p>Value can be null.</p>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -171,12 +155,7 @@
|
||||
</dl>
|
||||
<h3 id="filename"><span class="symbol-name">filename</span><small class="property-type">
|
||||
nullable string</small></h3>
|
||||
<p>Document file name. Value can be null</p>
|
||||
<dl class="dl-compact">
|
||||
</dl>
|
||||
<h3 id="filesize"><span class="symbol-name">filesize</span><small class="property-type">
|
||||
nullable number</small></h3>
|
||||
<p>Document file size in bytes. Value can be null</p>
|
||||
<p>Name of the file (for documents)</p>
|
||||
<dl class="dl-compact">
|
||||
</dl>
|
||||
<h3 id="mimetype"><span class="symbol-name">mimetype</span><small class="property-type">
|
||||
@@ -364,7 +343,7 @@
|
||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||
<div id="jsdoc-footer-container">
|
||||
<p>
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on March 18, 2023.
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on July 10, 2022.
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta name="generator" content="JSDoc 3.6.7">
|
||||
<meta charset="utf-8">
|
||||
<title>whatsapp-web.js 1.19.5 » Class: NoAuth</title>
|
||||
<title>whatsapp-web.js 1.17.1 » Class: NoAuth</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">
|
||||
@@ -15,7 +15,7 @@
|
||||
<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>19.<wbr>5</a>
|
||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>17.<wbr>1</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
@@ -51,7 +51,7 @@
|
||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||
<div id="jsdoc-footer-container">
|
||||
<p>
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on March 18, 2023.
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on July 10, 2022.
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta name="generator" content="JSDoc 3.6.7">
|
||||
<meta charset="utf-8">
|
||||
<title>whatsapp-web.js 1.19.5 » Class: Order</title>
|
||||
<title>whatsapp-web.js 1.17.1 » Class: Order</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">
|
||||
@@ -15,7 +15,7 @@
|
||||
<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>19.<wbr>5</a>
|
||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>17.<wbr>1</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
@@ -102,7 +102,7 @@
|
||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||
<div id="jsdoc-footer-container">
|
||||
<p>
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on March 18, 2023.
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on July 10, 2022.
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta name="generator" content="JSDoc 3.6.7">
|
||||
<meta charset="utf-8">
|
||||
<title>whatsapp-web.js 1.19.5 » Class: PrivateChat</title>
|
||||
<title>whatsapp-web.js 1.17.1 » 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/Noto+Serif:400,400i,700,700i" 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">
|
||||
<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>19.<wbr>5</a>
|
||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>17.<wbr>1</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
@@ -295,7 +295,7 @@
|
||||
<p> </p>
|
||||
</td>
|
||||
<td>
|
||||
<p>Options for searching messages. Right now only limit and fromMe is supported.</p>
|
||||
<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>
|
||||
@@ -321,20 +321,6 @@
|
||||
<p>The amount of messages to return. If no limit is specified, the available messages will be returned. 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>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>fromMe</p>
|
||||
</td>
|
||||
<td>
|
||||
<p> </p>
|
||||
</td>
|
||||
<td>
|
||||
<p>Yes</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>Return only messages from the bot number or vise versa. To get all messages, leave the option undefined.</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</td>
|
||||
@@ -533,7 +519,7 @@
|
||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||
<div id="jsdoc-footer-container">
|
||||
<p>
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on March 18, 2023.
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on July 10, 2022.
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta name="generator" content="JSDoc 3.6.7">
|
||||
<meta charset="utf-8">
|
||||
<title>whatsapp-web.js 1.19.5 » Class: PrivateContact</title>
|
||||
<title>whatsapp-web.js 1.17.1 » 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/Noto+Serif:400,400i,700,700i" 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">
|
||||
<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>19.<wbr>5</a>
|
||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>17.<wbr>1</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
@@ -319,7 +319,7 @@
|
||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||
<div id="jsdoc-footer-container">
|
||||
<p>
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on March 18, 2023.
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on July 10, 2022.
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta name="generator" content="JSDoc 3.6.7">
|
||||
<meta charset="utf-8">
|
||||
<title>whatsapp-web.js 1.19.5 » Class: Product</title>
|
||||
<title>whatsapp-web.js 1.17.1 » Class: Product</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">
|
||||
@@ -15,7 +15,7 @@
|
||||
<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>19.<wbr>5</a>
|
||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>17.<wbr>1</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
@@ -127,7 +127,7 @@
|
||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||
<div id="jsdoc-footer-container">
|
||||
<p>
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on March 18, 2023.
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on July 10, 2022.
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
@@ -1,159 +0,0 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta name="generator" content="JSDoc 3.6.7">
|
||||
<meta charset="utf-8">
|
||||
<title>whatsapp-web.js 1.19.5 » Class: Reaction</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>19.<wbr>5</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">Reaction</span></h1>
|
||||
<p class="source-link">Source: <a href="structures_Reaction.js.html#source-line-9">structures/<wbr>Reaction.<wbr>js:9</a></p>
|
||||
<div class="symbol-classdesc">
|
||||
<p>Represents a Reaction 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="Reaction.html#ack">ack</a></dt>
|
||||
<dd>
|
||||
</dd>
|
||||
<dt><a href="Reaction.html#id">id</a></dt>
|
||||
<dd>
|
||||
</dd>
|
||||
<dt><a href="Reaction.html#msgId">msgId</a></dt>
|
||||
<dd>
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
<div class="summary-column">
|
||||
<dl class="dl-summary-callout">
|
||||
<dt><a href="Reaction.html#orphan">orphan</a></dt>
|
||||
<dd>
|
||||
</dd>
|
||||
<dt><a href="Reaction.html#orphanReason">orphanReason</a></dt>
|
||||
<dd>
|
||||
</dd>
|
||||
<dt><a href="Reaction.html#reaction">reaction</a></dt>
|
||||
<dd>
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
<div class="summary-column">
|
||||
<dl class="dl-summary-callout">
|
||||
<dt><a href="Reaction.html#read">read</a></dt>
|
||||
<dd>
|
||||
</dd>
|
||||
<dt><a href="Reaction.html#senderId">senderId</a></dt>
|
||||
<dd>
|
||||
</dd>
|
||||
<dt><a href="Reaction.html#timestamp">timestamp</a></dt>
|
||||
<dd>
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<section>
|
||||
<h2 id="Reaction">new <span class="symbol-name">Reaction</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="ack"><span class="symbol-name">ack</span><small class="property-type">
|
||||
nullable number</small></h3>
|
||||
<p>ACK</p>
|
||||
<dl class="dl-compact">
|
||||
</dl>
|
||||
<h3 id="id"><span class="symbol-name">id</span><small class="property-type">
|
||||
object</small></h3>
|
||||
<p>Reaction ID</p>
|
||||
<dl class="dl-compact">
|
||||
</dl>
|
||||
<h3 id="msgId"><span class="symbol-name">msgId</span><small class="property-type">
|
||||
object</small></h3>
|
||||
<p>Message ID</p>
|
||||
<dl class="dl-compact">
|
||||
</dl>
|
||||
<h3 id="orphan"><span class="symbol-name">orphan</span><small class="property-type">
|
||||
number</small></h3>
|
||||
<p>Orphan</p>
|
||||
<dl class="dl-compact">
|
||||
</dl>
|
||||
<h3 id="orphanReason"><span class="symbol-name">orphanReason</span><small class="property-type">
|
||||
nullable string</small></h3>
|
||||
<p>Orphan reason</p>
|
||||
<dl class="dl-compact">
|
||||
</dl>
|
||||
<h3 id="reaction"><span class="symbol-name">reaction</span><small class="property-type">
|
||||
string</small></h3>
|
||||
<p>Reaction</p>
|
||||
<dl class="dl-compact">
|
||||
</dl>
|
||||
<h3 id="read"><span class="symbol-name">read</span><small class="property-type">
|
||||
boolean</small></h3>
|
||||
<p>Read</p>
|
||||
<dl class="dl-compact">
|
||||
</dl>
|
||||
<h3 id="senderId"><span class="symbol-name">senderId</span><small class="property-type">
|
||||
string</small></h3>
|
||||
<p>Sender ID</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 reaction was created</p>
|
||||
<dl class="dl-compact">
|
||||
</dl>
|
||||
</section>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
<nav id="jsdoc-toc-nav" role="navigation"></nav>
|
||||
</div>
|
||||
</div>
|
||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||
<div id="jsdoc-footer-container">
|
||||
<p>
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on March 18, 2023.
|
||||
</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>
|
||||
@@ -1,163 +0,0 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta name="generator" content="JSDoc 3.6.7">
|
||||
<meta charset="utf-8">
|
||||
<title>whatsapp-web.js 1.19.5 » Class: RemoteAuth</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>19.<wbr>5</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">RemoteAuth</span></h1>
|
||||
<p class="source-link">Source: <a href="authStrategies_RemoteAuth.js.html#source-line-26">authStrategies/<wbr>RemoteAuth.<wbr>js:26</a></p>
|
||||
<div class="symbol-classdesc">
|
||||
<p>Remote-based authentication</p>
|
||||
</div>
|
||||
<dl class="dl-compact">
|
||||
</dl>
|
||||
</header>
|
||||
<section id="summary">
|
||||
</section>
|
||||
<section>
|
||||
<h2 id="RemoteAuth">new <span class="symbol-name">RemoteAuth</span><span class="signature"><span class="signature-params">(options)</span></span></h2>
|
||||
<section>
|
||||
<h3>Parameters</h3>
|
||||
<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>options</p>
|
||||
</td>
|
||||
<td>
|
||||
<p> </p>
|
||||
</td>
|
||||
<td>
|
||||
<p> </p>
|
||||
</td>
|
||||
<td>
|
||||
<p>options</p>
|
||||
<p>Values in <code>options</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>store</p>
|
||||
</td>
|
||||
<td>
|
||||
<p> </p>
|
||||
</td>
|
||||
<td>
|
||||
<p> </p>
|
||||
</td>
|
||||
<td>
|
||||
<p>Remote database store instance</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>clientId</p>
|
||||
</td>
|
||||
<td>
|
||||
<p> </p>
|
||||
</td>
|
||||
<td>
|
||||
<p> </p>
|
||||
</td>
|
||||
<td>
|
||||
<p>Client id to distinguish instances if you are using multiple, otherwise keep null if you are using only one instance</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>dataPath</p>
|
||||
</td>
|
||||
<td>
|
||||
<p> </p>
|
||||
</td>
|
||||
<td>
|
||||
<p> </p>
|
||||
</td>
|
||||
<td>
|
||||
<p>Change the default path for saving session files, default is: "./.wwebjs_auth/"</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>backupSyncIntervalMs</p>
|
||||
</td>
|
||||
<td>
|
||||
<p> </p>
|
||||
</td>
|
||||
<td>
|
||||
<p> </p>
|
||||
</td>
|
||||
<td>
|
||||
<p>Sets the time interval for periodic session backups. Accepts values starting from 60000ms {1 minute}</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
<dl class="dl-compact">
|
||||
</dl>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
<nav id="jsdoc-toc-nav" role="navigation"></nav>
|
||||
</div>
|
||||
</div>
|
||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||
<div id="jsdoc-footer-container">
|
||||
<p>
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on March 18, 2023.
|
||||
</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>
|
||||
<meta name="generator" content="JSDoc 3.6.7">
|
||||
<meta charset="utf-8">
|
||||
<title>whatsapp-web.js 1.19.5 » Class: Util</title>
|
||||
<title>whatsapp-web.js 1.17.1 » 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/Noto+Serif:400,400i,700,700i" 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">
|
||||
<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>19.<wbr>5</a>
|
||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>17.<wbr>1</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
@@ -243,7 +243,7 @@
|
||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||
<div id="jsdoc-footer-container">
|
||||
<p>
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on March 18, 2023.
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on July 10, 2022.
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta name="generator" content="JSDoc 3.6.7">
|
||||
<meta charset="utf-8">
|
||||
<title>whatsapp-web.js 1.19.5 » Source: authStrategies/BaseAuthStrategy.js</title>
|
||||
<title>whatsapp-web.js 1.17.1 » Source: authStrategies/BaseAuthStrategy.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">
|
||||
@@ -15,7 +15,7 @@
|
||||
<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>19.<wbr>5</a>
|
||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>17.<wbr>1</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
@@ -49,9 +49,6 @@ class BaseAuthStrategy {
|
||||
};
|
||||
}
|
||||
async getAuthEventPayload() {}
|
||||
async afterAuthReady() {}
|
||||
async disconnect() {}
|
||||
async destroy() {}
|
||||
async logout() {}
|
||||
}
|
||||
|
||||
@@ -65,7 +62,7 @@ module.exports = BaseAuthStrategy;</code></pre>
|
||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||
<div id="jsdoc-footer-container">
|
||||
<p>
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on March 18, 2023.
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on July 10, 2022.
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta name="generator" content="JSDoc 3.6.7">
|
||||
<meta charset="utf-8">
|
||||
<title>whatsapp-web.js 1.19.5 » Source: authStrategies/LegacySessionAuth.js</title>
|
||||
<title>whatsapp-web.js 1.17.1 » Source: authStrategies/LegacySessionAuth.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">
|
||||
@@ -15,7 +15,7 @@
|
||||
<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>19.<wbr>5</a>
|
||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>17.<wbr>1</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
@@ -111,7 +111,7 @@ module.exports = LegacySessionAuth;
|
||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||
<div id="jsdoc-footer-container">
|
||||
<p>
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on March 18, 2023.
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on July 10, 2022.
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta name="generator" content="JSDoc 3.6.7">
|
||||
<meta charset="utf-8">
|
||||
<title>whatsapp-web.js 1.19.5 » Source: authStrategies/LocalAuth.js</title>
|
||||
<title>whatsapp-web.js 1.17.1 » Source: authStrategies/LocalAuth.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">
|
||||
@@ -15,7 +15,7 @@
|
||||
<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>19.<wbr>5</a>
|
||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>17.<wbr>1</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
@@ -91,7 +91,7 @@ module.exports = LocalAuth;</code></pre>
|
||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||
<div id="jsdoc-footer-container">
|
||||
<p>
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on March 18, 2023.
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on July 10, 2022.
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta name="generator" content="JSDoc 3.6.7">
|
||||
<meta charset="utf-8">
|
||||
<title>whatsapp-web.js 1.19.5 » Source: authStrategies/NoAuth.js</title>
|
||||
<title>whatsapp-web.js 1.17.1 » Source: authStrategies/NoAuth.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">
|
||||
@@ -15,7 +15,7 @@
|
||||
<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>19.<wbr>5</a>
|
||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>17.<wbr>1</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
@@ -50,7 +50,7 @@ module.exports = NoAuth;</code></pre>
|
||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||
<div id="jsdoc-footer-container">
|
||||
<p>
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on March 18, 2023.
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on July 10, 2022.
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
@@ -1,258 +0,0 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta name="generator" content="JSDoc 3.6.7">
|
||||
<meta charset="utf-8">
|
||||
<title>whatsapp-web.js 1.19.5 » Source: authStrategies/RemoteAuth.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>19.<wbr>5</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: authStrategies/RemoteAuth.js</h1>
|
||||
</header>
|
||||
<article>
|
||||
<pre class="prettyprint linenums"><code>'use strict';
|
||||
|
||||
/* Require Optional Dependencies */
|
||||
try {
|
||||
var fs = require('fs-extra');
|
||||
var unzipper = require('unzipper');
|
||||
var archiver = require('archiver');
|
||||
} catch {
|
||||
fs = undefined;
|
||||
unzipper = undefined;
|
||||
archiver = undefined;
|
||||
}
|
||||
|
||||
const path = require('path');
|
||||
const { Events } = require('./../util/Constants');
|
||||
const BaseAuthStrategy = require('./BaseAuthStrategy');
|
||||
|
||||
/**
|
||||
* Remote-based authentication
|
||||
* @param {object} options - options
|
||||
* @param {object} options.store - Remote database store instance
|
||||
* @param {string} options.clientId - Client id to distinguish instances if you are using multiple, otherwise keep null if you are using only one instance
|
||||
* @param {string} options.dataPath - Change the default path for saving session files, default is: "./.wwebjs_auth/"
|
||||
* @param {number} options.backupSyncIntervalMs - Sets the time interval for periodic session backups. Accepts values starting from 60000ms {1 minute}
|
||||
*/
|
||||
class RemoteAuth extends BaseAuthStrategy {
|
||||
constructor({ clientId, dataPath, store, backupSyncIntervalMs } = {}) {
|
||||
if (!fs &amp;&amp; !unzipper &amp;&amp; !archiver) throw new Error('Optional Dependencies [fs-extra, unzipper, archiver] are required to use RemoteAuth. Make sure to run npm install correctly and remove the --no-optional flag');
|
||||
super();
|
||||
|
||||
const idRegex = /^[-_\w]+$/i;
|
||||
if (clientId &amp;&amp; !idRegex.test(clientId)) {
|
||||
throw new Error('Invalid clientId. Only alphanumeric characters, underscores and hyphens are allowed.');
|
||||
}
|
||||
if (!backupSyncIntervalMs || backupSyncIntervalMs &lt; 60000) {
|
||||
throw new Error('Invalid backupSyncIntervalMs. Accepts values starting from 60000ms {1 minute}.');
|
||||
}
|
||||
if(!store) throw new Error('Remote database store is required.');
|
||||
|
||||
this.store = store;
|
||||
this.clientId = clientId;
|
||||
this.backupSyncIntervalMs = backupSyncIntervalMs;
|
||||
this.dataPath = path.resolve(dataPath || './.wwebjs_auth/');
|
||||
this.tempDir = `${this.dataPath}/wwebjs_temp_session`;
|
||||
this.requiredDirs = ['Default', 'IndexedDB', 'Local Storage']; /* => Required Files &amp; Dirs in WWebJS to restore session */
|
||||
}
|
||||
|
||||
async beforeBrowserInitialized() {
|
||||
const puppeteerOpts = this.client.options.puppeteer;
|
||||
const sessionDirName = this.clientId ? `RemoteAuth-${this.clientId}` : 'RemoteAuth';
|
||||
const dirPath = path.join(this.dataPath, sessionDirName);
|
||||
|
||||
if (puppeteerOpts.userDataDir &amp;&amp; puppeteerOpts.userDataDir !== dirPath) {
|
||||
throw new Error('RemoteAuth is not compatible with a user-supplied userDataDir.');
|
||||
}
|
||||
|
||||
this.userDataDir = dirPath;
|
||||
this.sessionName = sessionDirName;
|
||||
|
||||
await this.extractRemoteSession();
|
||||
|
||||
this.client.options.puppeteer = {
|
||||
...puppeteerOpts,
|
||||
userDataDir: dirPath
|
||||
};
|
||||
}
|
||||
|
||||
async logout() {
|
||||
await this.disconnect();
|
||||
}
|
||||
|
||||
async destroy() {
|
||||
clearInterval(this.backupSync);
|
||||
}
|
||||
|
||||
async disconnect() {
|
||||
await this.deleteRemoteSession();
|
||||
|
||||
let pathExists = await this.isValidPath(this.userDataDir);
|
||||
if (pathExists) {
|
||||
await fs.promises.rm(this.userDataDir, {
|
||||
recursive: true,
|
||||
force: true
|
||||
}).catch(() => {});
|
||||
}
|
||||
clearInterval(this.backupSync);
|
||||
}
|
||||
|
||||
async afterAuthReady() {
|
||||
const sessionExists = await this.store.sessionExists({session: this.sessionName});
|
||||
if(!sessionExists) {
|
||||
await this.delay(60000); /* Initial delay sync required for session to be stable enough to recover */
|
||||
await this.storeRemoteSession({emit: true});
|
||||
}
|
||||
var self = this;
|
||||
this.backupSync = setInterval(async function () {
|
||||
await self.storeRemoteSession();
|
||||
}, this.backupSyncIntervalMs);
|
||||
}
|
||||
|
||||
async storeRemoteSession(options) {
|
||||
/* Compress &amp; Store Session */
|
||||
const pathExists = await this.isValidPath(this.userDataDir);
|
||||
if (pathExists) {
|
||||
await this.compressSession();
|
||||
await this.store.save({session: this.sessionName});
|
||||
await fs.promises.unlink(`${this.sessionName}.zip`);
|
||||
await fs.promises.rm(`${this.tempDir}`, {
|
||||
recursive: true,
|
||||
force: true
|
||||
}).catch(() => {});
|
||||
if(options &amp;&amp; options.emit) this.client.emit(Events.REMOTE_SESSION_SAVED);
|
||||
}
|
||||
}
|
||||
|
||||
async extractRemoteSession() {
|
||||
const pathExists = await this.isValidPath(this.userDataDir);
|
||||
const compressedSessionPath = `${this.sessionName}.zip`;
|
||||
const sessionExists = await this.store.sessionExists({session: this.sessionName});
|
||||
if (pathExists) {
|
||||
await fs.promises.rm(this.userDataDir, {
|
||||
recursive: true,
|
||||
force: true
|
||||
}).catch(() => {});
|
||||
}
|
||||
if (sessionExists) {
|
||||
await this.store.extract({session: this.sessionName, path: compressedSessionPath});
|
||||
await this.unCompressSession(compressedSessionPath);
|
||||
} else {
|
||||
fs.mkdirSync(this.userDataDir, { recursive: true });
|
||||
}
|
||||
}
|
||||
|
||||
async deleteRemoteSession() {
|
||||
const sessionExists = await this.store.sessionExists({session: this.sessionName});
|
||||
if (sessionExists) await this.store.delete({session: this.sessionName});
|
||||
}
|
||||
|
||||
async compressSession() {
|
||||
const archive = archiver('zip');
|
||||
const stream = fs.createWriteStream(`${this.sessionName}.zip`);
|
||||
|
||||
await fs.copy(this.userDataDir, this.tempDir).catch(() => {});
|
||||
await this.deleteMetadata();
|
||||
return new Promise((resolve, reject) => {
|
||||
archive
|
||||
.directory(this.tempDir, false)
|
||||
.on('error', err => reject(err))
|
||||
.pipe(stream);
|
||||
|
||||
stream.on('close', () => resolve());
|
||||
archive.finalize();
|
||||
});
|
||||
}
|
||||
|
||||
async unCompressSession(compressedSessionPath) {
|
||||
var stream = fs.createReadStream(compressedSessionPath);
|
||||
await new Promise((resolve, reject) => {
|
||||
stream.pipe(unzipper.Extract({
|
||||
path: this.userDataDir
|
||||
}))
|
||||
.on('error', err => reject(err))
|
||||
.on('finish', () => resolve());
|
||||
});
|
||||
await fs.promises.unlink(compressedSessionPath);
|
||||
}
|
||||
|
||||
async deleteMetadata() {
|
||||
const sessionDirs = [this.tempDir, path.join(this.tempDir, 'Default')];
|
||||
for (const dir of sessionDirs) {
|
||||
const sessionFiles = await fs.promises.readdir(dir);
|
||||
for (const element of sessionFiles) {
|
||||
if (!this.requiredDirs.includes(element)) {
|
||||
const dirElement = path.join(dir, element);
|
||||
const stats = await fs.promises.lstat(dirElement);
|
||||
|
||||
if (stats.isDirectory()) {
|
||||
await fs.promises.rm(dirElement, {
|
||||
recursive: true,
|
||||
force: true
|
||||
}).catch(() => {});
|
||||
} else {
|
||||
await fs.promises.unlink(dirElement).catch(() => {});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async isValidPath(path) {
|
||||
try {
|
||||
await fs.promises.access(path);
|
||||
return true;
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
async delay(ms) {
|
||||
return new Promise(resolve => setTimeout(resolve, ms));
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = RemoteAuth;
|
||||
</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.7 on March 18, 2023.
|
||||
</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>
|
||||
<meta name="generator" content="JSDoc 3.6.7">
|
||||
<meta charset="utf-8">
|
||||
<title>whatsapp-web.js 1.19.5 » Globals</title>
|
||||
<title>whatsapp-web.js 1.17.1 » 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/Noto+Serif:400,400i,700,700i" 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">
|
||||
<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>19.<wbr>5</a>
|
||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>17.<wbr>1</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
@@ -285,19 +285,6 @@
|
||||
<td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>MESSAGE_REACTION</p>
|
||||
</td>
|
||||
<td>
|
||||
<p> </p>
|
||||
</td>
|
||||
<td>
|
||||
<p> </p>
|
||||
</td>
|
||||
<td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>MEDIA_UPLOADED</p>
|
||||
@@ -363,19 +350,6 @@
|
||||
<td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>LOADING_SCREEN</p>
|
||||
</td>
|
||||
<td>
|
||||
<p> </p>
|
||||
</td>
|
||||
<td>
|
||||
<p> </p>
|
||||
</td>
|
||||
<td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>DISCONNECTED</p>
|
||||
@@ -428,19 +402,6 @@
|
||||
<td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>REMOTE_SESSION_SAVED</p>
|
||||
</td>
|
||||
<td>
|
||||
<p> </p>
|
||||
</td>
|
||||
<td>
|
||||
<p> </p>
|
||||
</td>
|
||||
<td>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
@@ -2019,7 +1980,7 @@
|
||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||
<div id="jsdoc-footer-container">
|
||||
<p>
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on March 18, 2023.
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on July 10, 2022.
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
167
docs/index.html
167
docs/index.html
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta name="generator" content="JSDoc 3.6.7">
|
||||
<meta charset="utf-8">
|
||||
<title>whatsapp-web.js 1.19.5 » Home</title>
|
||||
<title>whatsapp-web.js 1.17.1 » 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/Noto+Serif:400,400i,700,700i" 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">
|
||||
<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>19.<wbr>5</a>
|
||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>17.<wbr>1</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
@@ -27,11 +27,11 @@
|
||||
<div id="jsdoc-main" role="main">
|
||||
<header class="page-header">
|
||||
<h1>
|
||||
whatsapp-web.js 1.19.5
|
||||
whatsapp-web.js 1.17.1
|
||||
</h1>
|
||||
</header>
|
||||
<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-2.2306.7-brightgreen.svg" alt="WhatsApp_Web 2.2306.7"> <a href="https://discord.gg/H7DqQs4"><img src="https://img.shields.io/discord/698610475432411196.svg?logo=discord" alt="Discord Chat"></a></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-2.2220.8-brightgreen.svg" alt="WhatsApp_Web 2.2220.8"> <a href="https://discord.gg/H7DqQs4"><img src="https://img.shields.io/discord/698610475432411196.svg?logo=discord" alt="Discord Chat"></a></p>
|
||||
<h1>whatsapp-web.js</h1>
|
||||
<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>
|
||||
@@ -197,7 +197,7 @@ client.initialize();
|
||||
<ul>
|
||||
<li><a href="https://github.com/sponsors/pedroslopez">Support via GitHub Sponsors</a></li>
|
||||
<li><a href="https://www.paypal.me/psla/">Support via PayPal</a></li>
|
||||
<li><a href="https://m.do.co/c/73f906a36ed4">Sign up for DigitalOcean</a> and get $200 in credit when you sign up (Referral)</li>
|
||||
<li><a href="https://m.do.co/c/73f906a36ed4">Sign up for DigitalOcean</a> and get $100 in credit when you sign up (Referral)</li>
|
||||
</ul>
|
||||
<h2>Disclaimer</h2>
|
||||
<p>This project is not affiliated, associated, authorized, endorsed by, or in any way officially connected with WhatsApp or any of its subsidiaries or its affiliates. The official WhatsApp website can be found at https://whatsapp.com. "WhatsApp" as well as related names, marks, emblems and images are registered trademarks of their respective owners.</p>
|
||||
@@ -498,11 +498,6 @@ client.initialize();
|
||||
</div>
|
||||
<div class="symbol-index-column">
|
||||
<dl class="symbol-index-list">
|
||||
<dt class="symbol-index-name">
|
||||
<a href="Call.html#reject" class="!symbol-index-name">Call#<wbr>reject()</a>
|
||||
</dt>
|
||||
<dd>
|
||||
</dd>
|
||||
<dt class="symbol-index-name">
|
||||
<a href="Call.html#timestamp" class="!symbol-index-name">Call#<wbr>timestamp</a>
|
||||
</dt>
|
||||
@@ -813,7 +808,7 @@ client.initialize();
|
||||
<dd>
|
||||
</dd>
|
||||
<dt class="symbol-index-name">
|
||||
<a href="Client.html#event:message_reaction" class="!symbol-index-name">Client#<wbr>event:message_reaction</a>
|
||||
<a href="Client.html#event:message_revoke_everyone" class="!symbol-index-name">Client#<wbr>event:message_revoke_everyone</a>
|
||||
</dt>
|
||||
<dd>
|
||||
</dd>
|
||||
@@ -821,11 +816,6 @@ client.initialize();
|
||||
</div>
|
||||
<div class="symbol-index-column">
|
||||
<dl class="symbol-index-list">
|
||||
<dt class="symbol-index-name">
|
||||
<a href="Client.html#event:message_revoke_everyone" class="!symbol-index-name">Client#<wbr>event:message_revoke_everyone</a>
|
||||
</dt>
|
||||
<dd>
|
||||
</dd>
|
||||
<dt class="symbol-index-name">
|
||||
<a href="Client.html#event:message_revoke_me" class="!symbol-index-name">Client#<wbr>event:message_revoke_me</a>
|
||||
</dt>
|
||||
@@ -921,15 +911,15 @@ client.initialize();
|
||||
</dt>
|
||||
<dd>
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
<div class="symbol-index-column">
|
||||
<dl class="symbol-index-list">
|
||||
<dt class="symbol-index-name">
|
||||
<a href="Client.html#getWWebVersion" class="!symbol-index-name">Client#<wbr>getWWebVersion()</a>
|
||||
</dt>
|
||||
<dd>
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
<div class="symbol-index-column">
|
||||
<dl class="symbol-index-list">
|
||||
<dt class="symbol-index-name">
|
||||
<a href="Client.html#info" class="!symbol-index-name">Client#<wbr>info</a>
|
||||
</dt>
|
||||
@@ -1244,22 +1234,17 @@ client.initialize();
|
||||
</dt>
|
||||
<dd>
|
||||
</dd>
|
||||
<dt class="symbol-index-name">
|
||||
<a href="global.html#Events#.GROUP_UPDATE" class="!symbol-index-name">Events.<wbr>GROUP_UPDATE</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#Events#.INCOMING_CALL" class="!symbol-index-name">Events.<wbr>INCOMING_CALL</a>
|
||||
<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#.LOADING_SCREEN" class="!symbol-index-name">Events.<wbr>LOADING_SCREEN</a>
|
||||
<a href="global.html#Events#.INCOMING_CALL" class="!symbol-index-name">Events.<wbr>INCOMING_CALL</a>
|
||||
</dt>
|
||||
<dd>
|
||||
</dd>
|
||||
@@ -1278,11 +1263,6 @@ client.initialize();
|
||||
</dt>
|
||||
<dd>
|
||||
</dd>
|
||||
<dt class="symbol-index-name">
|
||||
<a href="global.html#Events#.MESSAGE_REACTION" class="!symbol-index-name">Events.<wbr>MESSAGE_REACTION</a>
|
||||
</dt>
|
||||
<dd>
|
||||
</dd>
|
||||
<dt class="symbol-index-name">
|
||||
<a href="global.html#Events#.MESSAGE_RECEIVED" class="!symbol-index-name">Events.<wbr>MESSAGE_RECEIVED</a>
|
||||
</dt>
|
||||
@@ -1312,11 +1292,6 @@ client.initialize();
|
||||
</dt>
|
||||
<dd>
|
||||
</dd>
|
||||
<dt class="symbol-index-name">
|
||||
<a href="global.html#Events#.REMOTE_SESSION_SAVED" class="!symbol-index-name">Events.<wbr>REMOTE_SESSION_SAVED</a>
|
||||
</dt>
|
||||
<dd>
|
||||
</dd>
|
||||
<dt class="symbol-index-name">
|
||||
<a href="global.html#Events#.STATE_CHANGED" class="!symbol-index-name">Events.<wbr>STATE_CHANGED</a>
|
||||
</dt>
|
||||
@@ -2268,7 +2243,7 @@ client.initialize();
|
||||
<div class="symbol-index-column">
|
||||
<dl class="symbol-index-list">
|
||||
<dt class="symbol-index-name">
|
||||
<a href="MessageMedia.html" class="!symbol-index-name">MessageMedia(mimetype, data, filename, filesize)</a>
|
||||
<a href="MessageMedia.html" class="!symbol-index-name">MessageMedia(mimetype, data, filename)</a>
|
||||
</dt>
|
||||
<dd>
|
||||
</dd>
|
||||
@@ -2277,34 +2252,29 @@ client.initialize();
|
||||
</dt>
|
||||
<dd>
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
<div class="symbol-index-column">
|
||||
<dl class="symbol-index-list">
|
||||
<dt class="symbol-index-name">
|
||||
<a href="MessageMedia.html#.fromUrl" class="!symbol-index-name">MessageMedia.<wbr>fromUrl(url[, options])</a>
|
||||
</dt>
|
||||
<dd>
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
<div class="symbol-index-column">
|
||||
<dl class="symbol-index-list">
|
||||
<dt class="symbol-index-name">
|
||||
<a href="MessageMedia.html#data" class="!symbol-index-name">MessageMedia#<wbr>data</a>
|
||||
</dt>
|
||||
<dd>
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
<div class="symbol-index-column">
|
||||
<dl class="symbol-index-list">
|
||||
<dt class="symbol-index-name">
|
||||
<a href="MessageMedia.html#filename" class="!symbol-index-name">MessageMedia#<wbr>filename</a>
|
||||
</dt>
|
||||
<dd>
|
||||
</dd>
|
||||
<dt class="symbol-index-name">
|
||||
<a href="MessageMedia.html#filesize" class="!symbol-index-name">MessageMedia#<wbr>filesize</a>
|
||||
</dt>
|
||||
<dd>
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
<div class="symbol-index-column">
|
||||
<dl class="symbol-index-list">
|
||||
<dt class="symbol-index-name">
|
||||
<a href="MessageMedia.html#mimetype" class="!symbol-index-name">MessageMedia#<wbr>mimetype</a>
|
||||
</dt>
|
||||
@@ -3022,99 +2992,6 @@ client.initialize();
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<section>
|
||||
<div class="symbol-index-content">
|
||||
<h2 id="Reaction">Reaction</h2>
|
||||
<div class="symbol-index-section">
|
||||
<div class="symbol-index-column">
|
||||
<dl class="symbol-index-list">
|
||||
<dt class="symbol-index-name">
|
||||
<a href="Reaction.html" class="!symbol-index-name">Reaction()</a>
|
||||
</dt>
|
||||
<dd>
|
||||
</dd>
|
||||
<dt class="symbol-index-name">
|
||||
<a href="Reaction.html#ack" class="!symbol-index-name">Reaction#<wbr>ack</a>
|
||||
</dt>
|
||||
<dd>
|
||||
</dd>
|
||||
<dt class="symbol-index-name">
|
||||
<a href="Reaction.html#id" class="!symbol-index-name">Reaction#<wbr>id</a>
|
||||
</dt>
|
||||
<dd>
|
||||
</dd>
|
||||
<dt class="symbol-index-name">
|
||||
<a href="Reaction.html#msgId" class="!symbol-index-name">Reaction#<wbr>msgId</a>
|
||||
</dt>
|
||||
<dd>
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
<div class="symbol-index-column">
|
||||
<dl class="symbol-index-list">
|
||||
<dt class="symbol-index-name">
|
||||
<a href="Reaction.html#orphan" class="!symbol-index-name">Reaction#<wbr>orphan</a>
|
||||
</dt>
|
||||
<dd>
|
||||
</dd>
|
||||
<dt class="symbol-index-name">
|
||||
<a href="Reaction.html#orphanReason" class="!symbol-index-name">Reaction#<wbr>orphanReason</a>
|
||||
</dt>
|
||||
<dd>
|
||||
</dd>
|
||||
<dt class="symbol-index-name">
|
||||
<a href="Reaction.html#reaction" class="!symbol-index-name">Reaction#<wbr>reaction</a>
|
||||
</dt>
|
||||
<dd>
|
||||
</dd>
|
||||
<dt class="symbol-index-name">
|
||||
<a href="Reaction.html#read" class="!symbol-index-name">Reaction#<wbr>read</a>
|
||||
</dt>
|
||||
<dd>
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
<div class="symbol-index-column">
|
||||
<dl class="symbol-index-list">
|
||||
<dt class="symbol-index-name">
|
||||
<a href="Reaction.html#senderId" class="!symbol-index-name">Reaction#<wbr>senderId</a>
|
||||
</dt>
|
||||
<dd>
|
||||
</dd>
|
||||
<dt class="symbol-index-name">
|
||||
<a href="Reaction.html#timestamp" class="!symbol-index-name">Reaction#<wbr>timestamp</a>
|
||||
</dt>
|
||||
<dd>
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<section>
|
||||
<div class="symbol-index-content">
|
||||
<h2 id="RemoteAuth">RemoteAuth</h2>
|
||||
<div class="symbol-index-section">
|
||||
<div class="symbol-index-column">
|
||||
<dl class="symbol-index-list">
|
||||
<dt class="symbol-index-name">
|
||||
<a href="RemoteAuth.html" class="!symbol-index-name">RemoteAuth(options)</a>
|
||||
</dt>
|
||||
<dd>
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
<div class="symbol-index-column">
|
||||
<dl class="symbol-index-list">
|
||||
</dl>
|
||||
</div>
|
||||
<div class="symbol-index-column">
|
||||
<dl class="symbol-index-list">
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<section>
|
||||
<div class="symbol-index-content">
|
||||
<h2 id="Status">Status</h2>
|
||||
@@ -3281,7 +3158,7 @@ client.initialize();
|
||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||
<div id="jsdoc-footer-container">
|
||||
<p>
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on March 18, 2023.
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on July 10, 2022.
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
treeNode.tree({
|
||||
autoEscape: false,
|
||||
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=\"BaseAuthStrategy.html\">BaseAuthStrategy</a>","id":"BaseAuthStrategy","children":[]},{"label":"<a href=\"BusinessContact.html\">BusinessContact</a>","id":"BusinessContact","children":[]},{"label":"<a href=\"Buttons.html\">Buttons</a>","id":"Buttons","children":[]},{"label":"<a href=\"Call.html\">Call</a>","id":"Call","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=\"InterfaceController.html\">InterfaceController</a>","id":"InterfaceController","children":[]},{"label":"<a href=\"Label.html\">Label</a>","id":"Label","children":[]},{"label":"<a href=\"LegacySessionAuth.html\">LegacySessionAuth</a>","id":"LegacySessionAuth","children":[]},{"label":"<a href=\"List.html\">List</a>","id":"List","children":[]},{"label":"<a href=\"LocalAuth.html\">LocalAuth</a>","id":"LocalAuth","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=\"NoAuth.html\">NoAuth</a>","id":"NoAuth","children":[]},{"label":"<a href=\"Order.html\">Order</a>","id":"Order","children":[]},{"label":"<a href=\"PrivateChat.html\">PrivateChat</a>","id":"PrivateChat","children":[]},{"label":"<a href=\"PrivateContact.html\">PrivateContact</a>","id":"PrivateContact","children":[]},{"label":"<a href=\"Product.html\">Product</a>","id":"Product","children":[]},{"label":"<a href=\"Reaction.html\">Reaction</a>","id":"Reaction","children":[]},{"label":"<a href=\"RemoteAuth.html\">RemoteAuth</a>","id":"RemoteAuth","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=\"BaseAuthStrategy.html\">BaseAuthStrategy</a>","id":"BaseAuthStrategy","children":[]},{"label":"<a href=\"BusinessContact.html\">BusinessContact</a>","id":"BusinessContact","children":[]},{"label":"<a href=\"Buttons.html\">Buttons</a>","id":"Buttons","children":[]},{"label":"<a href=\"Call.html\">Call</a>","id":"Call","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=\"InterfaceController.html\">InterfaceController</a>","id":"InterfaceController","children":[]},{"label":"<a href=\"Label.html\">Label</a>","id":"Label","children":[]},{"label":"<a href=\"LegacySessionAuth.html\">LegacySessionAuth</a>","id":"LegacySessionAuth","children":[]},{"label":"<a href=\"List.html\">List</a>","id":"List","children":[]},{"label":"<a href=\"LocalAuth.html\">LocalAuth</a>","id":"LocalAuth","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=\"NoAuth.html\">NoAuth</a>","id":"NoAuth","children":[]},{"label":"<a href=\"Order.html\">Order</a>","id":"Order","children":[]},{"label":"<a href=\"PrivateChat.html\">PrivateChat</a>","id":"PrivateChat","children":[]},{"label":"<a href=\"PrivateContact.html\">PrivateContact</a>","id":"PrivateContact","children":[]},{"label":"<a href=\"Product.html\">Product</a>","id":"Product","children":[]},{"label":"<a href=\"Util.html\">Util</a>","id":"Util","children":[]}],
|
||||
openedIcon: ' ⇣',
|
||||
saveState: false,
|
||||
useContextMenu: false
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta name="generator" content="JSDoc 3.6.7">
|
||||
<meta charset="utf-8">
|
||||
<title>whatsapp-web.js 1.19.5 » Source: structures/Base.js</title>
|
||||
<title>whatsapp-web.js 1.17.1 » 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/Noto+Serif:400,400i,700,700i" 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">
|
||||
<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>19.<wbr>5</a>
|
||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>17.<wbr>1</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
@@ -60,7 +60,7 @@ module.exports = Base;</code></pre>
|
||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||
<div id="jsdoc-footer-container">
|
||||
<p>
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on March 18, 2023.
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on July 10, 2022.
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta name="generator" content="JSDoc 3.6.7">
|
||||
<meta charset="utf-8">
|
||||
<title>whatsapp-web.js 1.19.5 » Source: structures/BusinessContact.js</title>
|
||||
<title>whatsapp-web.js 1.17.1 » 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/Noto+Serif:400,400i,700,700i" 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">
|
||||
<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>19.<wbr>5</a>
|
||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>17.<wbr>1</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
@@ -59,7 +59,7 @@ module.exports = BusinessContact;</code></pre>
|
||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||
<div id="jsdoc-footer-container">
|
||||
<p>
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on March 18, 2023.
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on July 10, 2022.
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta name="generator" content="JSDoc 3.6.7">
|
||||
<meta charset="utf-8">
|
||||
<title>whatsapp-web.js 1.19.5 » Source: structures/Buttons.js</title>
|
||||
<title>whatsapp-web.js 1.17.1 » Source: structures/Buttons.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">
|
||||
@@ -15,7 +15,7 @@
|
||||
<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>19.<wbr>5</a>
|
||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>17.<wbr>1</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
@@ -120,7 +120,7 @@ module.exports = Buttons;</code></pre>
|
||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||
<div id="jsdoc-footer-container">
|
||||
<p>
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on March 18, 2023.
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on July 10, 2022.
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta name="generator" content="JSDoc 3.6.7">
|
||||
<meta charset="utf-8">
|
||||
<title>whatsapp-web.js 1.19.5 » Source: structures/Call.js</title>
|
||||
<title>whatsapp-web.js 1.17.1 » Source: structures/Call.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">
|
||||
@@ -15,7 +15,7 @@
|
||||
<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>19.<wbr>5</a>
|
||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>17.<wbr>1</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
@@ -93,15 +93,7 @@ class Call extends Base {
|
||||
|
||||
return super._patch(data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reject the call
|
||||
*/
|
||||
async reject() {
|
||||
return this.client.pupPage.evaluate((peerJid, id) => {
|
||||
return window.WWebJS.rejectCall(peerJid, id);
|
||||
}, this.from, this.id);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
module.exports = Call;</code></pre>
|
||||
@@ -114,7 +106,7 @@ module.exports = Call;</code></pre>
|
||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||
<div id="jsdoc-footer-container">
|
||||
<p>
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on March 18, 2023.
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on July 10, 2022.
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta name="generator" content="JSDoc 3.6.7">
|
||||
<meta charset="utf-8">
|
||||
<title>whatsapp-web.js 1.19.5 » Source: structures/Chat.js</title>
|
||||
<title>whatsapp-web.js 1.17.1 » 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/Noto+Serif:400,400i,700,700i" 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">
|
||||
<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>19.<wbr>5</a>
|
||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>17.<wbr>1</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
@@ -201,22 +201,13 @@ class Chat extends Base {
|
||||
|
||||
/**
|
||||
* Loads chat messages, sorted from earliest to latest.
|
||||
* @param {Object} searchOptions Options for searching messages. Right now only limit and fromMe is supported.
|
||||
* @param {Object} searchOptions Options for searching messages. Right now only limit is supported.
|
||||
* @param {Number} [searchOptions.limit] The amount of messages to return. If no limit is specified, the available messages will be returned. 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.
|
||||
* @param {Boolean} [searchOptions.fromMe] Return only messages from the bot number or vise versa. To get all messages, leave the option undefined.
|
||||
* @returns {Promise&lt;Array&lt;Message>>}
|
||||
*/
|
||||
async fetchMessages(searchOptions) {
|
||||
let messages = await this.client.pupPage.evaluate(async (chatId, searchOptions) => {
|
||||
const msgFilter = (m) => {
|
||||
if (m.isNotification) {
|
||||
return false; // dont include notification messages
|
||||
}
|
||||
if (searchOptions &amp;&amp; searchOptions.fromMe &amp;&amp; m.id.fromMe !== searchOptions.fromMe) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
};
|
||||
const msgFilter = m => !m.isNotification; // dont include notification messages
|
||||
|
||||
const chat = window.Store.Chat.get(chatId);
|
||||
let msgs = chat.msgs.getModelsArray().filter(msgFilter);
|
||||
@@ -299,7 +290,7 @@ module.exports = Chat;
|
||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||
<div id="jsdoc-footer-container">
|
||||
<p>
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on March 18, 2023.
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on July 10, 2022.
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta name="generator" content="JSDoc 3.6.7">
|
||||
<meta charset="utf-8">
|
||||
<title>whatsapp-web.js 1.19.5 » Source: structures/ClientInfo.js</title>
|
||||
<title>whatsapp-web.js 1.17.1 » 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/Noto+Serif:400,400i,700,700i" 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">
|
||||
<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>19.<wbr>5</a>
|
||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>17.<wbr>1</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
@@ -109,7 +109,7 @@ module.exports = ClientInfo;</code></pre>
|
||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||
<div id="jsdoc-footer-container">
|
||||
<p>
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on March 18, 2023.
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on July 10, 2022.
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta name="generator" content="JSDoc 3.6.7">
|
||||
<meta charset="utf-8">
|
||||
<title>whatsapp-web.js 1.19.5 » Source: structures/Contact.js</title>
|
||||
<title>whatsapp-web.js 1.17.1 » 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/Noto+Serif:400,400i,700,700i" 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">
|
||||
<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>19.<wbr>5</a>
|
||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>17.<wbr>1</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
@@ -245,7 +245,7 @@ module.exports = Contact;
|
||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||
<div id="jsdoc-footer-container">
|
||||
<p>
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on March 18, 2023.
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on July 10, 2022.
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta name="generator" content="JSDoc 3.6.7">
|
||||
<meta charset="utf-8">
|
||||
<title>whatsapp-web.js 1.19.5 » Source: structures/GroupChat.js</title>
|
||||
<title>whatsapp-web.js 1.17.1 » 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/Noto+Serif:400,400i,700,700i" 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">
|
||||
<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>19.<wbr>5</a>
|
||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>17.<wbr>1</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
@@ -90,15 +90,10 @@ class GroupChat extends Chat {
|
||||
* @returns {Promise&lt;Object>}
|
||||
*/
|
||||
async addParticipants(participantIds) {
|
||||
return await this.client.pupPage.evaluate(async (chatId, participantIds) => {
|
||||
return await this.client.pupPage.evaluate((chatId, participantIds) => {
|
||||
const chatWid = window.Store.WidFactory.createWid(chatId);
|
||||
const chat = await window.Store.Chat.find(chatWid);
|
||||
const participants = await Promise.all(participantIds.map(async p => {
|
||||
const wid = window.Store.WidFactory.createWid(p);
|
||||
return await window.Store.Contact.get(wid);
|
||||
}));
|
||||
await window.Store.GroupParticipants.addParticipants(chat, participants);
|
||||
return { status: 200 };
|
||||
const participantWids = participantIds.map(p => window.Store.WidFactory.createWid(p));
|
||||
return window.Store.GroupParticipants.sendAddParticipants(chatWid, participantWids);
|
||||
}, this.id._serialized, participantIds);
|
||||
}
|
||||
|
||||
@@ -108,14 +103,10 @@ class GroupChat extends Chat {
|
||||
* @returns {Promise&lt;Object>}
|
||||
*/
|
||||
async removeParticipants(participantIds) {
|
||||
return await this.client.pupPage.evaluate(async (chatId, participantIds) => {
|
||||
return await this.client.pupPage.evaluate((chatId, participantIds) => {
|
||||
const chatWid = window.Store.WidFactory.createWid(chatId);
|
||||
const chat = await window.Store.Chat.find(chatWid);
|
||||
const participants = participantIds.map(p => {
|
||||
return chat.groupMetadata.participants.get(p);
|
||||
}).filter(p => Boolean(p));
|
||||
await window.Store.GroupParticipants.removeParticipants(chat, participants);
|
||||
return { status: 200 };
|
||||
const participantWids = participantIds.map(p => window.Store.WidFactory.createWid(p));
|
||||
return window.Store.GroupParticipants.sendRemoveParticipants(chatWid, participantWids);
|
||||
}, this.id._serialized, participantIds);
|
||||
}
|
||||
|
||||
@@ -125,14 +116,10 @@ class GroupChat extends Chat {
|
||||
* @returns {Promise&lt;{ status: number }>} Object with status code indicating if the operation was successful
|
||||
*/
|
||||
async promoteParticipants(participantIds) {
|
||||
return await this.client.pupPage.evaluate(async (chatId, participantIds) => {
|
||||
return await this.client.pupPage.evaluate((chatId, participantIds) => {
|
||||
const chatWid = window.Store.WidFactory.createWid(chatId);
|
||||
const chat = await window.Store.Chat.find(chatWid);
|
||||
const participants = participantIds.map(p => {
|
||||
return chat.groupMetadata.participants.get(p);
|
||||
}).filter(p => Boolean(p));
|
||||
await window.Store.GroupParticipants.promoteParticipants(chat, participants);
|
||||
return { status: 200 };
|
||||
const participantWids = participantIds.map(p => window.Store.WidFactory.createWid(p));
|
||||
return window.Store.GroupParticipants.sendPromoteParticipants(chatWid, participantWids);
|
||||
}, this.id._serialized, participantIds);
|
||||
}
|
||||
|
||||
@@ -142,14 +129,10 @@ class GroupChat extends Chat {
|
||||
* @returns {Promise&lt;{ status: number }>} Object with status code indicating if the operation was successful
|
||||
*/
|
||||
async demoteParticipants(participantIds) {
|
||||
return await this.client.pupPage.evaluate(async (chatId, participantIds) => {
|
||||
return await this.client.pupPage.evaluate((chatId, participantIds) => {
|
||||
const chatWid = window.Store.WidFactory.createWid(chatId);
|
||||
const chat = await window.Store.Chat.find(chatWid);
|
||||
const participants = participantIds.map(p => {
|
||||
return chat.groupMetadata.participants.get(p);
|
||||
}).filter(p => Boolean(p));
|
||||
await window.Store.GroupParticipants.demoteParticipants(chat, participants);
|
||||
return { status: 200 };
|
||||
const participantWids = participantIds.map(p => window.Store.WidFactory.createWid(p));
|
||||
return window.Store.GroupParticipants.sendDemoteParticipants(chatWid, participantWids);
|
||||
}, this.id._serialized, participantIds);
|
||||
}
|
||||
|
||||
@@ -162,8 +145,7 @@ class GroupChat extends Chat {
|
||||
const success = await this.client.pupPage.evaluate(async (chatId, subject) => {
|
||||
const chatWid = window.Store.WidFactory.createWid(chatId);
|
||||
try {
|
||||
await window.Store.GroupUtils.setGroupSubject(chatWid, subject);
|
||||
return true;
|
||||
return await window.Store.GroupUtils.sendSetGroupSubject(chatWid, subject);
|
||||
} catch (err) {
|
||||
if(err.name === 'ServerStatusCodeError') return false;
|
||||
throw err;
|
||||
@@ -185,8 +167,7 @@ class GroupChat extends Chat {
|
||||
const chatWid = window.Store.WidFactory.createWid(chatId);
|
||||
let descId = window.Store.GroupMetadata.get(chatWid).descId;
|
||||
try {
|
||||
await window.Store.GroupUtils.setGroupDescription(chatWid, description, window.Store.MsgKey.newId(), descId);
|
||||
return true;
|
||||
return await window.Store.GroupUtils.sendSetGroupDescription(chatWid, description, window.Store.MsgKey.newId(), descId);
|
||||
} catch (err) {
|
||||
if(err.name === 'ServerStatusCodeError') return false;
|
||||
throw err;
|
||||
@@ -207,8 +188,7 @@ class GroupChat extends Chat {
|
||||
const success = await this.client.pupPage.evaluate(async (chatId, adminsOnly) => {
|
||||
const chatWid = window.Store.WidFactory.createWid(chatId);
|
||||
try {
|
||||
await window.Store.GroupUtils.setGroupProperty(chatWid, 'announcement', adminsOnly ? 1 : 0);
|
||||
return true;
|
||||
return await window.Store.GroupUtils.sendSetGroupProperty(chatWid, 'announcement', adminsOnly ? 1 : 0);
|
||||
} catch (err) {
|
||||
if(err.name === 'ServerStatusCodeError') return false;
|
||||
throw err;
|
||||
@@ -230,8 +210,7 @@ class GroupChat extends Chat {
|
||||
const success = await this.client.pupPage.evaluate(async (chatId, adminsOnly) => {
|
||||
const chatWid = window.Store.WidFactory.createWid(chatId);
|
||||
try {
|
||||
await window.Store.GroupUtils.setGroupProperty(chatWid, 'restrict', adminsOnly ? 1 : 0);
|
||||
return true;
|
||||
return await window.Store.GroupUtils.sendSetGroupProperty(chatWid, 'restrict', adminsOnly ? 1 : 0);
|
||||
} catch (err) {
|
||||
if(err.name === 'ServerStatusCodeError') return false;
|
||||
throw err;
|
||||
@@ -249,12 +228,12 @@ class GroupChat extends Chat {
|
||||
* @returns {Promise&lt;string>} Group's invite code
|
||||
*/
|
||||
async getInviteCode() {
|
||||
const codeRes = await this.client.pupPage.evaluate(async chatId => {
|
||||
const code = await this.client.pupPage.evaluate(async chatId => {
|
||||
const chatWid = window.Store.WidFactory.createWid(chatId);
|
||||
return window.Store.Invite.queryGroupInviteCode(chatWid);
|
||||
return window.Store.Invite.sendQueryGroupInviteCode(chatWid);
|
||||
}, this.id._serialized);
|
||||
|
||||
return codeRes.code;
|
||||
return code;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -262,12 +241,12 @@ class GroupChat extends Chat {
|
||||
* @returns {Promise&lt;string>} New invite code
|
||||
*/
|
||||
async revokeInvite() {
|
||||
const codeRes = await this.client.pupPage.evaluate(chatId => {
|
||||
const code = await this.client.pupPage.evaluate(chatId => {
|
||||
const chatWid = window.Store.WidFactory.createWid(chatId);
|
||||
return window.Store.Invite.resetGroupInviteCode(chatWid);
|
||||
return window.Store.Invite.sendRevokeGroupInviteCode(chatWid);
|
||||
}, this.id._serialized);
|
||||
|
||||
return codeRes.code;
|
||||
return code;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -275,10 +254,9 @@ class GroupChat extends Chat {
|
||||
* @returns {Promise}
|
||||
*/
|
||||
async leave() {
|
||||
await this.client.pupPage.evaluate(async chatId => {
|
||||
await this.client.pupPage.evaluate(chatId => {
|
||||
const chatWid = window.Store.WidFactory.createWid(chatId);
|
||||
const chat = await window.Store.Chat.find(chatWid);
|
||||
return window.Store.GroupUtils.sendExitGroup(chat);
|
||||
return window.Store.GroupUtils.sendExitGroup(chatWid);
|
||||
}, this.id._serialized);
|
||||
}
|
||||
|
||||
@@ -294,7 +272,7 @@ module.exports = GroupChat;</code></pre>
|
||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||
<div id="jsdoc-footer-container">
|
||||
<p>
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on March 18, 2023.
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on July 10, 2022.
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta name="generator" content="JSDoc 3.6.7">
|
||||
<meta charset="utf-8">
|
||||
<title>whatsapp-web.js 1.19.5 » Source: structures/GroupNotification.js</title>
|
||||
<title>whatsapp-web.js 1.17.1 » 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">
|
||||
@@ -15,7 +15,7 @@
|
||||
<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>19.<wbr>5</a>
|
||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>17.<wbr>1</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
@@ -143,7 +143,7 @@ module.exports = GroupNotification;
|
||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||
<div id="jsdoc-footer-container">
|
||||
<p>
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on March 18, 2023.
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on July 10, 2022.
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta name="generator" content="JSDoc 3.6.7">
|
||||
<meta charset="utf-8">
|
||||
<title>whatsapp-web.js 1.19.5 » Source: structures/Label.js</title>
|
||||
<title>whatsapp-web.js 1.17.1 » Source: structures/Label.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">
|
||||
@@ -15,7 +15,7 @@
|
||||
<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>19.<wbr>5</a>
|
||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>17.<wbr>1</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
@@ -88,7 +88,7 @@ module.exports = Label;</code></pre>
|
||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||
<div id="jsdoc-footer-container">
|
||||
<p>
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on March 18, 2023.
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on July 10, 2022.
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta name="generator" content="JSDoc 3.6.7">
|
||||
<meta charset="utf-8">
|
||||
<title>whatsapp-web.js 1.19.5 » Source: structures/List.js</title>
|
||||
<title>whatsapp-web.js 1.17.1 » Source: structures/List.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">
|
||||
@@ -15,7 +15,7 @@
|
||||
<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>19.<wbr>5</a>
|
||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>17.<wbr>1</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
@@ -118,7 +118,7 @@ module.exports = List;
|
||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||
<div id="jsdoc-footer-container">
|
||||
<p>
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on March 18, 2023.
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on July 10, 2022.
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta name="generator" content="JSDoc 3.6.7">
|
||||
<meta charset="utf-8">
|
||||
<title>whatsapp-web.js 1.19.5 » Source: structures/Location.js</title>
|
||||
<title>whatsapp-web.js 1.17.1 » 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/Noto+Serif:400,400i,700,700i" 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">
|
||||
<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>19.<wbr>5</a>
|
||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>17.<wbr>1</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
@@ -71,7 +71,7 @@ module.exports = Location;</code></pre>
|
||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||
<div id="jsdoc-footer-container">
|
||||
<p>
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on March 18, 2023.
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on July 10, 2022.
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta name="generator" content="JSDoc 3.6.7">
|
||||
<meta charset="utf-8">
|
||||
<title>whatsapp-web.js 1.19.5 » Source: structures/Message.js</title>
|
||||
<title>whatsapp-web.js 1.17.1 » 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/Noto+Serif:400,400i,700,700i" 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">
|
||||
<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>19.<wbr>5</a>
|
||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>17.<wbr>1</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
@@ -336,9 +336,8 @@ class Message extends Base {
|
||||
if (!this.hasQuotedMsg) return undefined;
|
||||
|
||||
const quotedMsg = await this.client.pupPage.evaluate((msgId) => {
|
||||
const msg = window.Store.Msg.get(msgId);
|
||||
const quotedMsg = window.Store.QuotedMsg.getQuotedMsgObj(msg);
|
||||
return window.WWebJS.getMessageModel(quotedMsg);
|
||||
let msg = window.Store.Msg.get(msgId);
|
||||
return msg.quotedMsgObj().serialize();
|
||||
}, this.id._serialized);
|
||||
|
||||
return new Message(this.client, quotedMsg);
|
||||
@@ -374,8 +373,6 @@ class Message extends Base {
|
||||
*/
|
||||
async react(reaction){
|
||||
await this.client.pupPage.evaluate(async (messageId, reaction) => {
|
||||
if (!messageId) { return undefined; }
|
||||
|
||||
const msg = await window.Store.Msg.get(messageId);
|
||||
await window.Store.sendReactionToMsg(msg, reaction);
|
||||
}, this.id._serialized, reaction);
|
||||
@@ -390,7 +387,7 @@ class Message extends Base {
|
||||
}
|
||||
|
||||
/**
|
||||
* Forwards this message to another chat (that you chatted before, otherwise it will fail)
|
||||
* Forwards this message to another chat
|
||||
*
|
||||
* @param {string|Chat} chat Chat model or chat ID to which the message will be forwarded
|
||||
* @returns {Promise}
|
||||
@@ -417,9 +414,7 @@ class Message extends Base {
|
||||
|
||||
const result = await this.client.pupPage.evaluate(async (msgId) => {
|
||||
const msg = window.Store.Msg.get(msgId);
|
||||
if (!msg) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
if (msg.mediaData.mediaStage != 'RESOLVED') {
|
||||
// try to resolve media
|
||||
await msg.downloadMedia({
|
||||
@@ -434,7 +429,7 @@ class Message extends Base {
|
||||
}
|
||||
|
||||
try {
|
||||
const decryptedMedia = await window.Store.DownloadManager.downloadAndMaybeDecrypt({
|
||||
const decryptedMedia = await window.Store.DownloadManager.downloadAndDecrypt({
|
||||
directPath: msg.directPath,
|
||||
encFilehash: msg.encFilehash,
|
||||
filehash: msg.filehash,
|
||||
@@ -444,13 +439,12 @@ class Message extends Base {
|
||||
signal: (new AbortController).signal
|
||||
});
|
||||
|
||||
const data = await window.WWebJS.arrayBufferToBase64Async(decryptedMedia);
|
||||
const data = window.WWebJS.arrayBufferToBase64(decryptedMedia);
|
||||
|
||||
return {
|
||||
data,
|
||||
mimetype: msg.mimetype,
|
||||
filename: msg.filename,
|
||||
filesize: msg.size
|
||||
filename: msg.filename
|
||||
};
|
||||
} catch (e) {
|
||||
if(e.status &amp;&amp; e.status === 404) return undefined;
|
||||
@@ -459,20 +453,19 @@ class Message extends Base {
|
||||
}, this.id._serialized);
|
||||
|
||||
if (!result) return undefined;
|
||||
return new MessageMedia(result.mimetype, result.data, result.filename, result.filesize);
|
||||
return new MessageMedia(result.mimetype, result.data, result.filename);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes a message from the chat
|
||||
* @param {?boolean} everyone If true and the message is sent by the current user or the user is an admin, will delete it for everyone in 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);
|
||||
|
||||
const canRevoke = window.Store.MsgActionChecks.canSenderRevokeMsg(msg) || window.Store.MsgActionChecks.canAdminRevokeMsg(msg);
|
||||
if (everyone &amp;&amp; canRevoke) {
|
||||
return window.Store.Cmd.sendRevokeMsgs(msg.chat, [msg], { type: msg.id.fromMe ? 'Sender' : 'Admin' });
|
||||
if (everyone &amp;&amp; msg.id.fromMe &amp;&amp; msg._canRevoke()) {
|
||||
return window.Store.Cmd.sendRevokeMsgs(msg.chat, [msg], {type: 'Sender'});
|
||||
}
|
||||
|
||||
return window.Store.Cmd.sendDeleteMsgs(msg.chat, [msg], true);
|
||||
@@ -486,7 +479,7 @@ class Message extends Base {
|
||||
await this.client.pupPage.evaluate((msgId) => {
|
||||
let msg = window.Store.Msg.get(msgId);
|
||||
|
||||
if (window.Store.MsgActionChecks.canStarMsg(msg)) {
|
||||
if (msg.canStar()) {
|
||||
return window.Store.Cmd.sendStarMsgs(msg.chat, [msg], false);
|
||||
}
|
||||
}, this.id._serialized);
|
||||
@@ -499,7 +492,7 @@ class Message extends Base {
|
||||
await this.client.pupPage.evaluate((msgId) => {
|
||||
let msg = window.Store.Msg.get(msgId);
|
||||
|
||||
if (window.Store.MsgActionChecks.canStarMsg(msg)) {
|
||||
if (msg.canStar()) {
|
||||
return window.Store.Cmd.sendUnstarMsgs(msg.chat, [msg], false);
|
||||
}
|
||||
}, this.id._serialized);
|
||||
@@ -525,7 +518,7 @@ class Message extends Base {
|
||||
const msg = window.Store.Msg.get(msgId);
|
||||
if (!msg) return null;
|
||||
|
||||
return await window.Store.MessageInfo.sendQueryMsgInfo(msg.id);
|
||||
return await window.Store.MessageInfo.sendQueryMsgInfo(msg);
|
||||
}, this.id._serialized);
|
||||
|
||||
return info;
|
||||
@@ -573,7 +566,7 @@ module.exports = Message;
|
||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||
<div id="jsdoc-footer-container">
|
||||
<p>
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on March 18, 2023.
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on July 10, 2022.
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta name="generator" content="JSDoc 3.6.7">
|
||||
<meta charset="utf-8">
|
||||
<title>whatsapp-web.js 1.19.5 » Source: structures/MessageMedia.js</title>
|
||||
<title>whatsapp-web.js 1.17.1 » 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/Noto+Serif:400,400i,700,700i" 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">
|
||||
<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>19.<wbr>5</a>
|
||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>17.<wbr>1</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
@@ -41,11 +41,10 @@ const { URL } = require('url');
|
||||
* Media attached to a message
|
||||
* @param {string} mimetype MIME type of the attachment
|
||||
* @param {string} data Base64-encoded data of the file
|
||||
* @param {?string} filename Document file name. Value can be null
|
||||
* @param {?number} filesize Document file size in bytes. Value can be null
|
||||
* @param {?string} filename Document file name
|
||||
*/
|
||||
class MessageMedia {
|
||||
constructor(mimetype, data, filename, filesize) {
|
||||
constructor(mimetype, data, filename) {
|
||||
/**
|
||||
* MIME type of the attachment
|
||||
* @type {string}
|
||||
@@ -59,16 +58,10 @@ class MessageMedia {
|
||||
this.data = data;
|
||||
|
||||
/**
|
||||
* Document file name. Value can be null
|
||||
* Name of the file (for documents)
|
||||
* @type {?string}
|
||||
*/
|
||||
this.filename = filename;
|
||||
|
||||
/**
|
||||
* Document file size in bytes. Value can be null
|
||||
* @type {?number}
|
||||
*/
|
||||
this.filesize = filesize;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -106,7 +99,6 @@ class MessageMedia {
|
||||
const reqOptions = Object.assign({ headers: { accept: 'image/* video/* text/* audio/*' } }, options);
|
||||
const response = await fetch(url, reqOptions);
|
||||
const mime = response.headers.get('Content-Type');
|
||||
const size = response.headers.get('Content-Length');
|
||||
|
||||
const contentDisposition = response.headers.get('Content-Disposition');
|
||||
const name = contentDisposition ? contentDisposition.match(/((?&lt;=filename=")(.*)(?="))/) : null;
|
||||
@@ -122,7 +114,7 @@ class MessageMedia {
|
||||
data = btoa(data);
|
||||
}
|
||||
|
||||
return { data, mime, name, size };
|
||||
return { data, mime, name };
|
||||
}
|
||||
|
||||
const res = options.client
|
||||
@@ -135,7 +127,7 @@ class MessageMedia {
|
||||
if (!mimetype)
|
||||
mimetype = res.mime;
|
||||
|
||||
return new MessageMedia(mimetype, res.data, filename, res.size || null);
|
||||
return new MessageMedia(mimetype, res.data, filename);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -150,7 +142,7 @@ module.exports = MessageMedia;
|
||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||
<div id="jsdoc-footer-container">
|
||||
<p>
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on March 18, 2023.
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on July 10, 2022.
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta name="generator" content="JSDoc 3.6.7">
|
||||
<meta charset="utf-8">
|
||||
<title>whatsapp-web.js 1.19.5 » Source: structures/Order.js</title>
|
||||
<title>whatsapp-web.js 1.17.1 » Source: structures/Order.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">
|
||||
@@ -15,7 +15,7 @@
|
||||
<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>19.<wbr>5</a>
|
||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>17.<wbr>1</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
@@ -90,7 +90,7 @@ module.exports = Order;</code></pre>
|
||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||
<div id="jsdoc-footer-container">
|
||||
<p>
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on March 18, 2023.
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on July 10, 2022.
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta name="generator" content="JSDoc 3.6.7">
|
||||
<meta charset="utf-8">
|
||||
<title>whatsapp-web.js 1.19.5 » Source: structures/Payment.js</title>
|
||||
<title>whatsapp-web.js 1.17.1 » Source: structures/Payment.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">
|
||||
@@ -15,7 +15,7 @@
|
||||
<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>19.<wbr>5</a>
|
||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>17.<wbr>1</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
@@ -118,7 +118,7 @@ module.exports = Payment;
|
||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||
<div id="jsdoc-footer-container">
|
||||
<p>
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on March 18, 2023.
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on July 10, 2022.
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta name="generator" content="JSDoc 3.6.7">
|
||||
<meta charset="utf-8">
|
||||
<title>whatsapp-web.js 1.19.5 » Source: structures/PrivateChat.js</title>
|
||||
<title>whatsapp-web.js 1.17.1 » 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/Noto+Serif:400,400i,700,700i" 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">
|
||||
<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>19.<wbr>5</a>
|
||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>17.<wbr>1</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
@@ -51,7 +51,7 @@ module.exports = PrivateChat;</code></pre>
|
||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||
<div id="jsdoc-footer-container">
|
||||
<p>
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on March 18, 2023.
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on July 10, 2022.
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta name="generator" content="JSDoc 3.6.7">
|
||||
<meta charset="utf-8">
|
||||
<title>whatsapp-web.js 1.19.5 » Source: structures/PrivateContact.js</title>
|
||||
<title>whatsapp-web.js 1.17.1 » 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/Noto+Serif:400,400i,700,700i" 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">
|
||||
<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>19.<wbr>5</a>
|
||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>17.<wbr>1</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
@@ -51,7 +51,7 @@ module.exports = PrivateContact;</code></pre>
|
||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||
<div id="jsdoc-footer-container">
|
||||
<p>
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on March 18, 2023.
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on July 10, 2022.
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta name="generator" content="JSDoc 3.6.7">
|
||||
<meta charset="utf-8">
|
||||
<title>whatsapp-web.js 1.19.5 » Source: structures/Product.js</title>
|
||||
<title>whatsapp-web.js 1.17.1 » Source: structures/Product.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">
|
||||
@@ -15,7 +15,7 @@
|
||||
<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>19.<wbr>5</a>
|
||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>17.<wbr>1</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
@@ -106,7 +106,7 @@ module.exports = Product;</code></pre>
|
||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||
<div id="jsdoc-footer-container">
|
||||
<p>
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on March 18, 2023.
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on July 10, 2022.
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta name="generator" content="JSDoc 3.6.7">
|
||||
<meta charset="utf-8">
|
||||
<title>whatsapp-web.js 1.19.5 » Source: structures/ProductMetadata.js</title>
|
||||
<title>whatsapp-web.js 1.17.1 » Source: structures/ProductMetadata.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">
|
||||
@@ -15,7 +15,7 @@
|
||||
<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>19.<wbr>5</a>
|
||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>17.<wbr>1</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
@@ -63,7 +63,7 @@ module.exports = ProductMetadata;</code></pre>
|
||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||
<div id="jsdoc-footer-container">
|
||||
<p>
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on March 18, 2023.
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on July 10, 2022.
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
@@ -1,122 +0,0 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta name="generator" content="JSDoc 3.6.7">
|
||||
<meta charset="utf-8">
|
||||
<title>whatsapp-web.js 1.19.5 » Source: structures/Reaction.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>19.<wbr>5</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/Reaction.js</h1>
|
||||
</header>
|
||||
<article>
|
||||
<pre class="prettyprint linenums"><code>'use strict';
|
||||
|
||||
const Base = require('./Base');
|
||||
|
||||
/**
|
||||
* Represents a Reaction on WhatsApp
|
||||
* @extends {Base}
|
||||
*/
|
||||
class Reaction extends Base {
|
||||
constructor(client, data) {
|
||||
super(client);
|
||||
|
||||
if (data) this._patch(data);
|
||||
}
|
||||
|
||||
_patch(data) {
|
||||
/**
|
||||
* Reaction ID
|
||||
* @type {object}
|
||||
*/
|
||||
this.id = data.msgKey;
|
||||
/**
|
||||
* Orphan
|
||||
* @type {number}
|
||||
*/
|
||||
this.orphan = data.orphan;
|
||||
/**
|
||||
* Orphan reason
|
||||
* @type {?string}
|
||||
*/
|
||||
this.orphanReason = data.orphanReason;
|
||||
/**
|
||||
* Unix timestamp for when the reaction was created
|
||||
* @type {number}
|
||||
*/
|
||||
this.timestamp = data.timestamp;
|
||||
/**
|
||||
* Reaction
|
||||
* @type {string}
|
||||
*/
|
||||
this.reaction = data.reactionText;
|
||||
/**
|
||||
* Read
|
||||
* @type {boolean}
|
||||
*/
|
||||
this.read = data.read;
|
||||
/**
|
||||
* Message ID
|
||||
* @type {object}
|
||||
*/
|
||||
this.msgId = data.parentMsgKey;
|
||||
/**
|
||||
* Sender ID
|
||||
* @type {string}
|
||||
*/
|
||||
this.senderId = data.senderUserJid;
|
||||
/**
|
||||
* ACK
|
||||
* @type {?number}
|
||||
*/
|
||||
this.ack = data.ack;
|
||||
|
||||
|
||||
return super._patch(data);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
module.exports = Reaction;</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.7 on March 18, 2023.
|
||||
</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>
|
||||
<meta name="generator" content="JSDoc 3.6.7">
|
||||
<meta charset="utf-8">
|
||||
<title>whatsapp-web.js 1.19.5 » Source: util/Constants.js</title>
|
||||
<title>whatsapp-web.js 1.17.1 » 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/Noto+Serif:400,400i,700,700i" 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">
|
||||
<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>19.<wbr>5</a>
|
||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>17.<wbr>1</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
@@ -42,7 +42,7 @@ exports.DefaultOptions = {
|
||||
qrMaxRetries: 0,
|
||||
takeoverOnConflict: false,
|
||||
takeoverTimeoutMs: 0,
|
||||
userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.67 Safari/537.36',
|
||||
userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.109 Safari/537.36',
|
||||
ffmpegPath: 'ffmpeg',
|
||||
bypassCSP: false
|
||||
};
|
||||
@@ -72,18 +72,15 @@ exports.Events = {
|
||||
MESSAGE_REVOKED_EVERYONE: 'message_revoke_everyone',
|
||||
MESSAGE_REVOKED_ME: 'message_revoke_me',
|
||||
MESSAGE_ACK: 'message_ack',
|
||||
MESSAGE_REACTION: 'message_reaction',
|
||||
MEDIA_UPLOADED: 'media_uploaded',
|
||||
GROUP_JOIN: 'group_join',
|
||||
GROUP_LEAVE: 'group_leave',
|
||||
GROUP_UPDATE: 'group_update',
|
||||
QR_RECEIVED: 'qr',
|
||||
LOADING_SCREEN: 'loading_screen',
|
||||
DISCONNECTED: 'disconnected',
|
||||
STATE_CHANGED: 'change_state',
|
||||
BATTERY_CHANGED: 'change_battery',
|
||||
INCOMING_CALL: 'call',
|
||||
REMOTE_SESSION_SAVED: 'remote_session_saved'
|
||||
INCOMING_CALL: 'incoming_call'
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -200,7 +197,7 @@ exports.MessageAck = {
|
||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||
<div id="jsdoc-footer-container">
|
||||
<p>
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on March 18, 2023.
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on July 10, 2022.
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta name="generator" content="JSDoc 3.6.7">
|
||||
<meta charset="utf-8">
|
||||
<title>whatsapp-web.js 1.19.5 » Source: util/InterfaceController.js</title>
|
||||
<title>whatsapp-web.js 1.17.1 » Source: util/InterfaceController.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">
|
||||
@@ -15,7 +15,7 @@
|
||||
<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>19.<wbr>5</a>
|
||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>17.<wbr>1</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
@@ -110,7 +110,6 @@ class InterfaceController {
|
||||
*/
|
||||
async getFeatures() {
|
||||
return await this.pupPage.evaluate(() => {
|
||||
if(!window.Store.Features) throw new Error('This version of Whatsapp Web does not support features');
|
||||
return window.Store.Features.F;
|
||||
});
|
||||
}
|
||||
@@ -121,7 +120,6 @@ class InterfaceController {
|
||||
*/
|
||||
async checkFeatureStatus(feature) {
|
||||
return await this.pupPage.evaluate((feature) => {
|
||||
if(!window.Store.Features) throw new Error('This version of Whatsapp Web does not support features');
|
||||
return window.Store.Features.supportsFeature(feature);
|
||||
}, feature);
|
||||
}
|
||||
@@ -132,7 +130,6 @@ class InterfaceController {
|
||||
*/
|
||||
async enableFeatures(features) {
|
||||
await this.pupPage.evaluate((features) => {
|
||||
if(!window.Store.Features) throw new Error('This version of Whatsapp Web does not support features');
|
||||
for (const feature in features) {
|
||||
window.Store.Features.setFeature(features[feature], true);
|
||||
}
|
||||
@@ -145,7 +142,6 @@ class InterfaceController {
|
||||
*/
|
||||
async disableFeatures(features) {
|
||||
await this.pupPage.evaluate((features) => {
|
||||
if(!window.Store.Features) throw new Error('This version of Whatsapp Web does not support features');
|
||||
for (const feature in features) {
|
||||
window.Store.Features.setFeature(features[feature], false);
|
||||
}
|
||||
@@ -164,7 +160,7 @@ module.exports = InterfaceController;
|
||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||
<div id="jsdoc-footer-container">
|
||||
<p>
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on March 18, 2023.
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on July 10, 2022.
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta name="generator" content="JSDoc 3.6.7">
|
||||
<meta charset="utf-8">
|
||||
<title>whatsapp-web.js 1.19.5 » Source: util/Util.js</title>
|
||||
<title>whatsapp-web.js 1.17.1 » 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/Noto+Serif:400,400i,700,700i" 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">
|
||||
<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>19.<wbr>5</a>
|
||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>17.<wbr>1</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
@@ -225,7 +225,7 @@ module.exports = Util;
|
||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||
<div id="jsdoc-footer-container">
|
||||
<p>
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on March 18, 2023.
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on July 10, 2022.
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
69
example.js
69
example.js
@@ -1,4 +1,4 @@
|
||||
const { Client, Location, List, Buttons, LocalAuth } = require('./index');
|
||||
const { Client, Location, List, Buttons, LocalAuth} = require('./index');
|
||||
|
||||
const client = new Client({
|
||||
authStrategy: new LocalAuth(),
|
||||
@@ -189,11 +189,11 @@ client.on('message', async msg => {
|
||||
client.interface.openChatWindowAt(quotedMsg.id._serialized);
|
||||
}
|
||||
} else if (msg.body === '!buttons') {
|
||||
let button = new Buttons('Button body', [{ body: 'bt1' }, { body: 'bt2' }, { body: 'bt3' }], 'title', 'footer');
|
||||
let button = new Buttons('Button body',[{body:'bt1'},{body:'bt2'},{body:'bt3'}],'title','footer');
|
||||
client.sendMessage(msg.from, button);
|
||||
} else if (msg.body === '!list') {
|
||||
let sections = [{ title: 'sectionTitle', rows: [{ title: 'ListItem1', description: 'desc' }, { title: 'ListItem2' }] }];
|
||||
let list = new List('List body', 'btnText', sections, 'Title', 'footer');
|
||||
let sections = [{title:'sectionTitle',rows:[{title:'ListItem1', description: 'desc'},{title:'ListItem2'}]}];
|
||||
let list = new List('List body','btnText',sections,'Title','footer');
|
||||
client.sendMessage(msg.from, list);
|
||||
} else if (msg.body === '!reaction') {
|
||||
msg.react('👍');
|
||||
@@ -231,7 +231,7 @@ client.on('message_ack', (msg, ack) => {
|
||||
ACK_PLAYED: 4
|
||||
*/
|
||||
|
||||
if (ack == 3) {
|
||||
if(ack == 3) {
|
||||
// The message was read
|
||||
}
|
||||
});
|
||||
@@ -254,67 +254,10 @@ client.on('group_update', (notification) => {
|
||||
});
|
||||
|
||||
client.on('change_state', state => {
|
||||
console.log('CHANGE STATE', state);
|
||||
});
|
||||
|
||||
// Change to false if you don't want to reject incoming calls
|
||||
let rejectCalls = true;
|
||||
|
||||
client.on('call', async (call) => {
|
||||
console.log('Call received, rejecting. GOTO Line 261 to disable', call);
|
||||
if (rejectCalls) await call.reject();
|
||||
await client.sendMessage(call.from, `[${call.fromMe ? 'Outgoing' : 'Incoming'}] Phone call from ${call.from}, type ${call.isGroup ? 'group' : ''} ${call.isVideo ? 'video' : 'audio'} call. ${rejectCalls ? 'This call was automatically rejected by the script.' : ''}`);
|
||||
console.log('CHANGE STATE', state );
|
||||
});
|
||||
|
||||
client.on('disconnected', (reason) => {
|
||||
console.log('Client was logged out', reason);
|
||||
});
|
||||
|
||||
client.on('contact_changed', async (message, oldId, newId, isContact) => {
|
||||
/** The time the event occurred. */
|
||||
const eventTime = (new Date(message.timestamp * 1000)).toLocaleString();
|
||||
|
||||
console.log(
|
||||
`The contact ${oldId.slice(0, -5)}` +
|
||||
`${!isContact ? ' that participates in group ' +
|
||||
`${(await client.getChatById(message.to ?? message.from)).name} ` : ' '}` +
|
||||
`changed their phone number\nat ${eventTime}.\n` +
|
||||
`Their new phone number is ${newId.slice(0, -5)}.\n`);
|
||||
|
||||
/**
|
||||
* Information about the {@name message}:
|
||||
*
|
||||
* 1. If a notification was emitted due to a group participant changing their phone number:
|
||||
* {@name message.author} is a participant's id before the change.
|
||||
* {@name message.recipients[0]} is a participant's id after the change (a new one).
|
||||
*
|
||||
* 1.1 If the contact who changed their number WAS in the current user's contact list at the time of the change:
|
||||
* {@name message.to} is a group chat id the event was emitted in.
|
||||
* {@name message.from} is a current user's id that got an notification message in the group.
|
||||
* Also the {@name message.fromMe} is TRUE.
|
||||
*
|
||||
* 1.2 Otherwise:
|
||||
* {@name message.from} is a group chat id the event was emitted in.
|
||||
* {@name message.to} is @type {undefined}.
|
||||
* Also {@name message.fromMe} is FALSE.
|
||||
*
|
||||
* 2. If a notification was emitted due to a contact changing their phone number:
|
||||
* {@name message.templateParams} is an array of two user's ids:
|
||||
* the old (before the change) and a new one, stored in alphabetical order.
|
||||
* {@name message.from} is a current user's id that has a chat with a user,
|
||||
* whos phone number was changed.
|
||||
* {@name message.to} is a user's id (after the change), the current user has a chat with.
|
||||
*/
|
||||
});
|
||||
|
||||
client.on('group_admin_changed', (notification) => {
|
||||
if (notification.type === 'promote') {
|
||||
/**
|
||||
* Emitted when a current user is promoted to an admin.
|
||||
* {@link notification.author} is a user who performs the action of promoting/demoting the current user.
|
||||
*/
|
||||
console.log(`You were promoted by ${notification.author}`);
|
||||
} else if (notification.type === 'demote')
|
||||
/** Emitted when a current user is demoted to a regular user. */
|
||||
console.log(`You were demoted by ${notification.author}`);
|
||||
});
|
||||
|
||||
74
index.d.ts
vendored
74
index.d.ts
vendored
@@ -148,12 +148,6 @@ declare namespace WAWebJS {
|
||||
/** Unmutes the Chat */
|
||||
unmuteChat(chatId: string): Promise<void>
|
||||
|
||||
/** Sets the current user's profile picture */
|
||||
setProfilePicture(media: MessageMedia): Promise<boolean>
|
||||
|
||||
/** Deletes the current user's profile picture */
|
||||
deleteProfilePicture(): Promise<boolean>
|
||||
|
||||
/** Generic event */
|
||||
on(event: string, listener: (...args: any) => void): this
|
||||
|
||||
@@ -198,30 +192,12 @@ declare namespace WAWebJS {
|
||||
notification: GroupNotification
|
||||
) => void): this
|
||||
|
||||
/** Emitted when a current user is promoted to an admin or demoted to a regular user */
|
||||
on(event: 'group_admin_changed', listener: (
|
||||
/** GroupNotification with more information about the action */
|
||||
notification: GroupNotification
|
||||
) => void): this
|
||||
|
||||
/** Emitted when group settings are updated, such as subject, description or picture */
|
||||
on(event: 'group_update', listener: (
|
||||
/** GroupNotification with more information about the action */
|
||||
notification: GroupNotification
|
||||
) => void): this
|
||||
|
||||
/** Emitted when a contact or a group participant changed their phone number. */
|
||||
on(event: 'contact_changed', listener: (
|
||||
/** Message with more information about the event. */
|
||||
message: Message,
|
||||
/** Old user's id. */
|
||||
oldId : String,
|
||||
/** New user's id. */
|
||||
newId : String,
|
||||
/** Indicates if a contact or a group participant changed their phone number. */
|
||||
isContact : Boolean
|
||||
) => void): this
|
||||
|
||||
/** Emitted when media has been uploaded for a message sent by the client */
|
||||
on(event: 'media_uploaded', listener: (
|
||||
/** The message with media that was uploaded */
|
||||
@@ -241,12 +217,6 @@ declare namespace WAWebJS {
|
||||
/** The new ACK value */
|
||||
ack: MessageAck
|
||||
) => void): this
|
||||
|
||||
/** Emitted when a chat unread count changes */
|
||||
on(event: 'unread_count', listener: (
|
||||
/** The chat that was affected */
|
||||
chat: Chat
|
||||
) => void): this
|
||||
|
||||
/** Emitted when a new message is created, which may include the current user's own messages */
|
||||
on(event: 'message_create', listener: (
|
||||
@@ -277,22 +247,6 @@ declare namespace WAWebJS {
|
||||
reaction: Reaction
|
||||
) => void): this
|
||||
|
||||
/** Emitted when a chat is removed */
|
||||
on(event: 'chat_removed', listener: (
|
||||
/** The chat that was removed */
|
||||
chat: Chat
|
||||
) => void): this
|
||||
|
||||
/** Emitted when a chat is archived/unarchived */
|
||||
on(event: 'chat_archived', listener: (
|
||||
/** The chat that was archived/unarchived */
|
||||
chat: Chat,
|
||||
/** State the chat is currently in */
|
||||
currState: boolean,
|
||||
/** State the chat was previously in */
|
||||
prevState: boolean
|
||||
) => void): this
|
||||
|
||||
/** Emitted when loading screen is appearing */
|
||||
on(event: 'loading_screen', listener: (percent: string, message: string) => void): this
|
||||
|
||||
@@ -544,18 +498,15 @@ declare namespace WAWebJS {
|
||||
MESSAGE_REVOKED_ME = 'message_revoke_me',
|
||||
MESSAGE_ACK = 'message_ack',
|
||||
MEDIA_UPLOADED = 'media_uploaded',
|
||||
CONTACT_CHANGED = 'contact_changed',
|
||||
GROUP_JOIN = 'group_join',
|
||||
GROUP_LEAVE = 'group_leave',
|
||||
GROUP_ADMIN_CHANGED = 'group_admin_changed',
|
||||
GROUP_UPDATE = 'group_update',
|
||||
QR_RECEIVED = 'qr',
|
||||
LOADING_SCREEN = 'loading_screen',
|
||||
DISCONNECTED = 'disconnected',
|
||||
STATE_CHANGED = 'change_state',
|
||||
BATTERY_CHANGED = 'change_battery',
|
||||
REMOTE_SESSION_SAVED = 'remote_session_saved',
|
||||
CALL = 'call'
|
||||
REMOTE_SESSION_SAVED = 'remote_session_saved'
|
||||
}
|
||||
|
||||
/** Group notification types */
|
||||
@@ -685,7 +636,6 @@ declare namespace WAWebJS {
|
||||
* broadcast: false,
|
||||
* fromMe: false,
|
||||
* hasQuotedMsg: false,
|
||||
* hasReaction: false,
|
||||
* location: undefined,
|
||||
* mentionedIds: []
|
||||
* }
|
||||
@@ -715,8 +665,6 @@ declare namespace WAWebJS {
|
||||
hasMedia: boolean,
|
||||
/** Indicates if the message was sent as a reply to another message */
|
||||
hasQuotedMsg: boolean,
|
||||
/** Indicates whether there are reactions to the message */
|
||||
hasReaction: boolean,
|
||||
/** Indicates the duration of the message in seconds */
|
||||
duration: string,
|
||||
/** ID that represents the message */
|
||||
@@ -818,10 +766,6 @@ declare namespace WAWebJS {
|
||||
* Gets the payment details associated with a given message
|
||||
*/
|
||||
getPayment: () => Promise<Payment>,
|
||||
/**
|
||||
* Gets the reactions associated with the given message
|
||||
*/
|
||||
getReactions: () => Promise<ReactionList[]>,
|
||||
}
|
||||
|
||||
/** ID that represents a message */
|
||||
@@ -1074,8 +1018,6 @@ declare namespace WAWebJS {
|
||||
timestamp: number,
|
||||
/** Amount of messages unread */
|
||||
unreadCount: number,
|
||||
/** Last message fo chat */
|
||||
lastMessage: Message,
|
||||
|
||||
/** Archives this chat */
|
||||
archive: () => Promise<void>,
|
||||
@@ -1219,10 +1161,6 @@ declare namespace WAWebJS {
|
||||
revokeInvite: () => Promise<void>;
|
||||
/** Makes the bot leave the group */
|
||||
leave: () => Promise<void>;
|
||||
/** Sets the group's picture.*/
|
||||
setPicture: (media: MessageMedia) => Promise<boolean>;
|
||||
/** Deletes the group's picture */
|
||||
deletePicture: () => Promise<boolean>;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1388,9 +1326,6 @@ declare namespace WAWebJS {
|
||||
webClientShouldHandle: boolean,
|
||||
/** Object with participants */
|
||||
participants: object
|
||||
|
||||
/** Reject the call */
|
||||
reject: () => Promise<void>
|
||||
}
|
||||
|
||||
/** Message type List */
|
||||
@@ -1426,13 +1361,6 @@ declare namespace WAWebJS {
|
||||
senderId: string
|
||||
ack?: number
|
||||
}
|
||||
|
||||
export type ReactionList = {
|
||||
id: string,
|
||||
aggregateEmoji: string,
|
||||
hasReactionByMe: boolean,
|
||||
senders: Array<Reaction>
|
||||
}
|
||||
}
|
||||
|
||||
export = WAWebJS
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "whatsapp-web.js",
|
||||
"version": "1.19.5",
|
||||
"version": "1.18.0-alpha.1",
|
||||
"description": "Library for interacting with the WhatsApp Web API ",
|
||||
"main": "./index.js",
|
||||
"typings": "./index.d.ts",
|
||||
|
||||
120
src/Client.js
120
src/Client.js
@@ -10,7 +10,7 @@ const { WhatsWebURL, DefaultOptions, Events, WAState } = require('./util/Constan
|
||||
const { ExposeStore, LoadUtils } = require('./util/Injected');
|
||||
const ChatFactory = require('./factories/ChatFactory');
|
||||
const ContactFactory = require('./factories/ContactFactory');
|
||||
const { ClientInfo, Message, MessageMedia, Contact, Location, GroupNotification, Label, Call, Buttons, List, Reaction, Chat } = require('./structures');
|
||||
const { ClientInfo, Message, MessageMedia, Contact, Location, GroupNotification, Label, Call, Buttons, List, Reaction } = require('./structures');
|
||||
const LegacySessionAuth = require('./authStrategies/LegacySessionAuth');
|
||||
const NoAuth = require('./authStrategies/NoAuth');
|
||||
|
||||
@@ -45,8 +45,6 @@ const NoAuth = require('./authStrategies/NoAuth');
|
||||
* @fires Client#group_update
|
||||
* @fires Client#disconnected
|
||||
* @fires Client#change_state
|
||||
* @fires Client#contact_changed
|
||||
* @fires Client#group_admin_changed
|
||||
*/
|
||||
class Client extends EventEmitter {
|
||||
constructor(options = {}) {
|
||||
@@ -319,13 +317,6 @@ class Client extends EventEmitter {
|
||||
* @param {GroupNotification} notification GroupNotification with more information about the action
|
||||
*/
|
||||
this.emit(Events.GROUP_LEAVE, notification);
|
||||
} else if (msg.subtype === 'promote' || msg.subtype === 'demote') {
|
||||
/**
|
||||
* Emitted when a current user is promoted to an admin or demoted to a regular user.
|
||||
* @event Client#group_admin_changed
|
||||
* @param {GroupNotification} notification GroupNotification with more information about the action
|
||||
*/
|
||||
this.emit(Events.GROUP_ADMIN_CHANGED, notification);
|
||||
} else {
|
||||
/**
|
||||
* Emitted when group settings are updated, such as subject, description or picture.
|
||||
@@ -385,36 +376,6 @@ class Client extends EventEmitter {
|
||||
last_message = msg;
|
||||
}
|
||||
|
||||
/**
|
||||
* The event notification that is received when one of
|
||||
* the group participants changes thier phone number.
|
||||
*/
|
||||
const isParticipant = msg.type === 'gp2' && msg.subtype === 'modify';
|
||||
|
||||
/**
|
||||
* The event notification that is received when one of
|
||||
* the contacts changes thier phone number.
|
||||
*/
|
||||
const isContact = msg.type === 'notification_template' && msg.subtype === 'change_number';
|
||||
|
||||
if (isParticipant || isContact) {
|
||||
/** {@link GroupNotification} object does not provide enough information about this event, so a {@link Message} object is used. */
|
||||
const message = new Message(this, msg);
|
||||
|
||||
const newId = isParticipant ? msg.recipients[0] : msg.to;
|
||||
const oldId = isParticipant ? msg.author : msg.templateParams.find(id => id !== newId);
|
||||
|
||||
/**
|
||||
* Emitted when a contact or a group participant changes their phone number.
|
||||
* @event Client#contact_changed
|
||||
* @param {Message} message Message with more information about the event.
|
||||
* @param {String} oldId The user's id (an old one) who changed their phone number
|
||||
* and who triggered the notification.
|
||||
* @param {String} newId The user's new id after the change.
|
||||
* @param {Boolean} isContact Indicates if a contact or a group participant changed their phone number.
|
||||
*/
|
||||
this.emit(Events.CONTACT_CHANGED, message, oldId, newId, isContact);
|
||||
}
|
||||
});
|
||||
|
||||
await page.exposeFunction('onRemoveMessageEvent', (msg) => {
|
||||
@@ -446,15 +407,6 @@ class Client extends EventEmitter {
|
||||
|
||||
});
|
||||
|
||||
await page.exposeFunction('onChatUnreadCountEvent', async (data) =>{
|
||||
const chat = await this.getChatById(data.id);
|
||||
|
||||
/**
|
||||
* Emitted when the chat unread count changes
|
||||
*/
|
||||
this.emit(Events.UNREAD_COUNT, chat);
|
||||
});
|
||||
|
||||
await page.exposeFunction('onMessageMediaUploadedEvent', (msg) => {
|
||||
|
||||
const message = new Message(this, msg);
|
||||
@@ -555,26 +507,6 @@ class Client extends EventEmitter {
|
||||
}
|
||||
});
|
||||
|
||||
await page.exposeFunction('onRemoveChatEvent', (chat) => {
|
||||
/**
|
||||
* Emitted when a chat is removed
|
||||
* @event Client#chat_removed
|
||||
* @param {Chat} chat
|
||||
*/
|
||||
this.emit(Events.CHAT_REMOVED, new Chat(this, chat));
|
||||
});
|
||||
|
||||
await page.exposeFunction('onArchiveChatEvent', (chat, currState, prevState) => {
|
||||
/**
|
||||
* Emitted when a chat is archived/unarchived
|
||||
* @event Client#chat_archived
|
||||
* @param {Chat} chat
|
||||
* @param {boolean} currState
|
||||
* @param {boolean} prevState
|
||||
*/
|
||||
this.emit(Events.CHAT_ARCHIVED, new Chat(this, chat), currState, prevState);
|
||||
});
|
||||
|
||||
await page.evaluate(() => {
|
||||
window.Store.Msg.on('change', (msg) => { window.onChangeMessageEvent(window.WWebJS.getMessageModel(msg)); });
|
||||
window.Store.Msg.on('change:type', (msg) => { window.onChangeMessageTypeEvent(window.WWebJS.getMessageModel(msg)); });
|
||||
@@ -584,8 +516,6 @@ class Client extends EventEmitter {
|
||||
window.Store.AppState.on('change:state', (_AppState, state) => { window.onAppStateChangedEvent(state); });
|
||||
window.Store.Conn.on('change:battery', (state) => { window.onBatteryStateChangedEvent(state); });
|
||||
window.Store.Call.on('add', (call) => { window.onIncomingCall(call); });
|
||||
window.Store.Chat.on('remove', async (chat) => { window.onRemoveChatEvent(await window.WWebJS.getChatModel(chat)); });
|
||||
window.Store.Chat.on('change:archive', async (chat, currState, prevState) => { window.onArchiveChatEvent(await window.WWebJS.getChatModel(chat), currState, prevState); });
|
||||
window.Store.Msg.on('add', (msg) => {
|
||||
if (msg.isNewMsg) {
|
||||
if(msg.type === 'ciphertext') {
|
||||
@@ -596,8 +526,7 @@ class Client extends EventEmitter {
|
||||
}
|
||||
}
|
||||
});
|
||||
window.Store.Chat.on('change:unreadCount', (chat) => {window.onChatUnreadCountEvent(chat);});
|
||||
|
||||
|
||||
{
|
||||
const module = window.Store.createOrUpdateReactionsModule;
|
||||
const ogMethod = module.createOrUpdateReactions;
|
||||
@@ -845,7 +774,7 @@ class Client extends EventEmitter {
|
||||
*/
|
||||
async getInviteInfo(inviteCode) {
|
||||
return await this.pupPage.evaluate(inviteCode => {
|
||||
return window.Store.InviteInfo.queryGroupInvite(inviteCode);
|
||||
return window.Store.InviteInfo.sendQueryGroupInvite(inviteCode);
|
||||
}, inviteCode);
|
||||
}
|
||||
|
||||
@@ -855,11 +784,11 @@ class Client extends EventEmitter {
|
||||
* @returns {Promise<string>} Id of the joined Chat
|
||||
*/
|
||||
async acceptInvite(inviteCode) {
|
||||
const res = await this.pupPage.evaluate(async inviteCode => {
|
||||
return await window.Store.Invite.joinGroupViaInvite(inviteCode);
|
||||
const chatId = await this.pupPage.evaluate(async inviteCode => {
|
||||
return await window.Store.Invite.sendJoinGroupViaInvite(inviteCode);
|
||||
}, inviteCode);
|
||||
|
||||
return res.gid._serialized;
|
||||
return chatId._serialized;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1008,7 +937,7 @@ class Client extends EventEmitter {
|
||||
unmuteDate = unmuteDate ? unmuteDate.getTime() / 1000 : -1;
|
||||
await this.pupPage.evaluate(async (chatId, timestamp) => {
|
||||
let chat = await window.Store.Chat.get(chatId);
|
||||
await chat.mute.mute({expiration: timestamp, sendDevice:!0});
|
||||
await chat.mute.mute(timestamp, !0);
|
||||
}, chatId, unmuteDate || -1);
|
||||
}
|
||||
|
||||
@@ -1166,17 +1095,19 @@ class Client extends EventEmitter {
|
||||
|
||||
const createRes = await this.pupPage.evaluate(async (name, participantIds) => {
|
||||
const participantWIDs = participantIds.map(p => window.Store.WidFactory.createWid(p));
|
||||
return await window.Store.GroupUtils.createGroup(name, participantWIDs, 0);
|
||||
const id = window.Store.MsgKey.newId();
|
||||
const res = await window.Store.GroupUtils.sendCreateGroup(name, participantWIDs, undefined, id);
|
||||
return res;
|
||||
}, name, participants);
|
||||
|
||||
const missingParticipants = createRes.participants.reduce(((missing, c) => {
|
||||
const id = c.wid._serialized;
|
||||
const statusCode = c.error ? c.error.toString() : '200';
|
||||
const id = Object.keys(c)[0];
|
||||
const statusCode = c[id].code;
|
||||
if (statusCode != 200) return Object.assign(missing, { [id]: statusCode });
|
||||
return missing;
|
||||
}), {});
|
||||
|
||||
return { gid: createRes.wid, missingParticipants };
|
||||
return { gid: createRes.gid, missingParticipants };
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1249,31 +1180,6 @@ class Client extends EventEmitter {
|
||||
|
||||
return blockedContacts.map(contact => ContactFactory.create(this.client, contact));
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the current user's profile picture.
|
||||
* @param {MessageMedia} media
|
||||
* @returns {Promise<boolean>} Returns true if the picture was properly updated.
|
||||
*/
|
||||
async setProfilePicture(media) {
|
||||
const success = await this.pupPage.evaluate((chatid, media) => {
|
||||
return window.WWebJS.setPicture(chatid, media);
|
||||
}, this.info.wid._serialized, media);
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes the current user's profile picture.
|
||||
* @returns {Promise<boolean>} Returns true if the picture was properly deleted.
|
||||
*/
|
||||
async deleteProfilePicture() {
|
||||
const success = await this.pupPage.evaluate((chatid) => {
|
||||
return window.WWebJS.deletePicture(chatid);
|
||||
}, this.info.wid._serialized);
|
||||
|
||||
return success;
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Client;
|
||||
|
||||
@@ -62,15 +62,7 @@ class Call extends Base {
|
||||
|
||||
return super._patch(data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reject the call
|
||||
*/
|
||||
async reject() {
|
||||
return this.client.pupPage.evaluate((peerJid, id) => {
|
||||
return window.WWebJS.rejectCall(peerJid, id);
|
||||
}, this.from, this.id);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
module.exports = Call;
|
||||
@@ -75,12 +75,6 @@ class Chat extends Base {
|
||||
*/
|
||||
this.muteExpiration = data.muteExpiration;
|
||||
|
||||
/**
|
||||
* Last message fo chat
|
||||
* @type {Message}
|
||||
*/
|
||||
this.lastMessage = data.lastMessage ? new Message(super.client, data.lastMessage) : undefined;
|
||||
|
||||
return super._patch(data);
|
||||
}
|
||||
|
||||
|
||||
@@ -59,15 +59,10 @@ class GroupChat extends Chat {
|
||||
* @returns {Promise<Object>}
|
||||
*/
|
||||
async addParticipants(participantIds) {
|
||||
return await this.client.pupPage.evaluate(async (chatId, participantIds) => {
|
||||
return await this.client.pupPage.evaluate((chatId, participantIds) => {
|
||||
const chatWid = window.Store.WidFactory.createWid(chatId);
|
||||
const chat = await window.Store.Chat.find(chatWid);
|
||||
const participants = await Promise.all(participantIds.map(async p => {
|
||||
const wid = window.Store.WidFactory.createWid(p);
|
||||
return await window.Store.Contact.get(wid);
|
||||
}));
|
||||
await window.Store.GroupParticipants.addParticipants(chat, participants);
|
||||
return { status: 200 };
|
||||
const participantWids = participantIds.map(p => window.Store.WidFactory.createWid(p));
|
||||
return window.Store.GroupParticipants.sendAddParticipants(chatWid, participantWids);
|
||||
}, this.id._serialized, participantIds);
|
||||
}
|
||||
|
||||
@@ -77,14 +72,10 @@ class GroupChat extends Chat {
|
||||
* @returns {Promise<Object>}
|
||||
*/
|
||||
async removeParticipants(participantIds) {
|
||||
return await this.client.pupPage.evaluate(async (chatId, participantIds) => {
|
||||
return await this.client.pupPage.evaluate((chatId, participantIds) => {
|
||||
const chatWid = window.Store.WidFactory.createWid(chatId);
|
||||
const chat = await window.Store.Chat.find(chatWid);
|
||||
const participants = participantIds.map(p => {
|
||||
return chat.groupMetadata.participants.get(p);
|
||||
}).filter(p => Boolean(p));
|
||||
await window.Store.GroupParticipants.removeParticipants(chat, participants);
|
||||
return { status: 200 };
|
||||
const participantWids = participantIds.map(p => window.Store.WidFactory.createWid(p));
|
||||
return window.Store.GroupParticipants.sendRemoveParticipants(chatWid, participantWids);
|
||||
}, this.id._serialized, participantIds);
|
||||
}
|
||||
|
||||
@@ -94,14 +85,10 @@ class GroupChat extends Chat {
|
||||
* @returns {Promise<{ status: number }>} Object with status code indicating if the operation was successful
|
||||
*/
|
||||
async promoteParticipants(participantIds) {
|
||||
return await this.client.pupPage.evaluate(async (chatId, participantIds) => {
|
||||
return await this.client.pupPage.evaluate((chatId, participantIds) => {
|
||||
const chatWid = window.Store.WidFactory.createWid(chatId);
|
||||
const chat = await window.Store.Chat.find(chatWid);
|
||||
const participants = participantIds.map(p => {
|
||||
return chat.groupMetadata.participants.get(p);
|
||||
}).filter(p => Boolean(p));
|
||||
await window.Store.GroupParticipants.promoteParticipants(chat, participants);
|
||||
return { status: 200 };
|
||||
const participantWids = participantIds.map(p => window.Store.WidFactory.createWid(p));
|
||||
return window.Store.GroupParticipants.sendPromoteParticipants(chatWid, participantWids);
|
||||
}, this.id._serialized, participantIds);
|
||||
}
|
||||
|
||||
@@ -111,14 +98,10 @@ class GroupChat extends Chat {
|
||||
* @returns {Promise<{ status: number }>} Object with status code indicating if the operation was successful
|
||||
*/
|
||||
async demoteParticipants(participantIds) {
|
||||
return await this.client.pupPage.evaluate(async (chatId, participantIds) => {
|
||||
return await this.client.pupPage.evaluate((chatId, participantIds) => {
|
||||
const chatWid = window.Store.WidFactory.createWid(chatId);
|
||||
const chat = await window.Store.Chat.find(chatWid);
|
||||
const participants = participantIds.map(p => {
|
||||
return chat.groupMetadata.participants.get(p);
|
||||
}).filter(p => Boolean(p));
|
||||
await window.Store.GroupParticipants.demoteParticipants(chat, participants);
|
||||
return { status: 200 };
|
||||
const participantWids = participantIds.map(p => window.Store.WidFactory.createWid(p));
|
||||
return window.Store.GroupParticipants.sendDemoteParticipants(chatWid, participantWids);
|
||||
}, this.id._serialized, participantIds);
|
||||
}
|
||||
|
||||
@@ -131,8 +114,7 @@ class GroupChat extends Chat {
|
||||
const success = await this.client.pupPage.evaluate(async (chatId, subject) => {
|
||||
const chatWid = window.Store.WidFactory.createWid(chatId);
|
||||
try {
|
||||
await window.Store.GroupUtils.setGroupSubject(chatWid, subject);
|
||||
return true;
|
||||
return await window.Store.GroupUtils.sendSetGroupSubject(chatWid, subject);
|
||||
} catch (err) {
|
||||
if(err.name === 'ServerStatusCodeError') return false;
|
||||
throw err;
|
||||
@@ -154,8 +136,7 @@ class GroupChat extends Chat {
|
||||
const chatWid = window.Store.WidFactory.createWid(chatId);
|
||||
let descId = window.Store.GroupMetadata.get(chatWid).descId;
|
||||
try {
|
||||
await window.Store.GroupUtils.setGroupDescription(chatWid, description, window.Store.MsgKey.newId(), descId);
|
||||
return true;
|
||||
return await window.Store.GroupUtils.sendSetGroupDescription(chatWid, description, window.Store.MsgKey.newId(), descId);
|
||||
} catch (err) {
|
||||
if(err.name === 'ServerStatusCodeError') return false;
|
||||
throw err;
|
||||
@@ -176,8 +157,7 @@ class GroupChat extends Chat {
|
||||
const success = await this.client.pupPage.evaluate(async (chatId, adminsOnly) => {
|
||||
const chatWid = window.Store.WidFactory.createWid(chatId);
|
||||
try {
|
||||
await window.Store.GroupUtils.setGroupProperty(chatWid, 'announcement', adminsOnly ? 1 : 0);
|
||||
return true;
|
||||
return await window.Store.GroupUtils.sendSetGroupProperty(chatWid, 'announcement', adminsOnly ? 1 : 0);
|
||||
} catch (err) {
|
||||
if(err.name === 'ServerStatusCodeError') return false;
|
||||
throw err;
|
||||
@@ -199,8 +179,7 @@ class GroupChat extends Chat {
|
||||
const success = await this.client.pupPage.evaluate(async (chatId, adminsOnly) => {
|
||||
const chatWid = window.Store.WidFactory.createWid(chatId);
|
||||
try {
|
||||
await window.Store.GroupUtils.setGroupProperty(chatWid, 'restrict', adminsOnly ? 1 : 0);
|
||||
return true;
|
||||
return await window.Store.GroupUtils.sendSetGroupProperty(chatWid, 'restrict', adminsOnly ? 1 : 0);
|
||||
} catch (err) {
|
||||
if(err.name === 'ServerStatusCodeError') return false;
|
||||
throw err;
|
||||
@@ -213,42 +192,17 @@ class GroupChat extends Chat {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes the group's picture.
|
||||
* @returns {Promise<boolean>} Returns true if the picture was properly deleted. This can return false if the user does not have the necessary permissions.
|
||||
*/
|
||||
async deletePicture() {
|
||||
const success = await this.client.pupPage.evaluate((chatid) => {
|
||||
return window.WWebJS.deletePicture(chatid);
|
||||
}, this.id._serialized);
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the group's picture.
|
||||
* @param {MessageMedia} media
|
||||
* @returns {Promise<boolean>} Returns true if the picture was properly updated. This can return false if the user does not have the necessary permissions.
|
||||
*/
|
||||
async setPicture(media) {
|
||||
const success = await this.client.pupPage.evaluate((chatid, media) => {
|
||||
return window.WWebJS.setPicture(chatid, media);
|
||||
}, this.id._serialized, media);
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the invite code for a specific group
|
||||
* @returns {Promise<string>} Group's invite code
|
||||
*/
|
||||
async getInviteCode() {
|
||||
const codeRes = await this.client.pupPage.evaluate(async chatId => {
|
||||
const code = await this.client.pupPage.evaluate(async chatId => {
|
||||
const chatWid = window.Store.WidFactory.createWid(chatId);
|
||||
return window.Store.Invite.queryGroupInviteCode(chatWid);
|
||||
return window.Store.Invite.sendQueryGroupInviteCode(chatWid);
|
||||
}, this.id._serialized);
|
||||
|
||||
return codeRes.code;
|
||||
return code;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -256,12 +210,12 @@ class GroupChat extends Chat {
|
||||
* @returns {Promise<string>} New invite code
|
||||
*/
|
||||
async revokeInvite() {
|
||||
const codeRes = await this.client.pupPage.evaluate(chatId => {
|
||||
const code = await this.client.pupPage.evaluate(chatId => {
|
||||
const chatWid = window.Store.WidFactory.createWid(chatId);
|
||||
return window.Store.Invite.resetGroupInviteCode(chatWid);
|
||||
return window.Store.Invite.sendRevokeGroupInviteCode(chatWid);
|
||||
}, this.id._serialized);
|
||||
|
||||
return codeRes.code;
|
||||
return code;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -269,10 +223,9 @@ class GroupChat extends Chat {
|
||||
* @returns {Promise}
|
||||
*/
|
||||
async leave() {
|
||||
await this.client.pupPage.evaluate(async chatId => {
|
||||
await this.client.pupPage.evaluate(chatId => {
|
||||
const chatWid = window.Store.WidFactory.createWid(chatId);
|
||||
const chat = await window.Store.Chat.find(chatWid);
|
||||
return window.Store.GroupUtils.sendExitGroup(chat);
|
||||
return window.Store.GroupUtils.sendExitGroup(chatWid);
|
||||
}, this.id._serialized);
|
||||
}
|
||||
|
||||
|
||||
@@ -5,8 +5,7 @@ const MessageMedia = require('./MessageMedia');
|
||||
const Location = require('./Location');
|
||||
const Order = require('./Order');
|
||||
const Payment = require('./Payment');
|
||||
const Reaction = require('./Reaction');
|
||||
const {MessageTypes} = require('../util/Constants');
|
||||
const { MessageTypes } = require('../util/Constants');
|
||||
|
||||
/**
|
||||
* Represents a Message on WhatsApp
|
||||
@@ -135,12 +134,6 @@ class Message extends Base {
|
||||
*/
|
||||
this.hasQuotedMsg = data.quotedMsg ? true : false;
|
||||
|
||||
/**
|
||||
* Indicates whether there are reactions to the message
|
||||
* @type {boolean}
|
||||
*/
|
||||
this.hasReaction = data.hasReaction ? true : false;
|
||||
|
||||
/**
|
||||
* Indicates the duration of the message in seconds
|
||||
* @type {string}
|
||||
@@ -312,9 +305,8 @@ class Message extends Base {
|
||||
if (!this.hasQuotedMsg) return undefined;
|
||||
|
||||
const quotedMsg = await this.client.pupPage.evaluate((msgId) => {
|
||||
const msg = window.Store.Msg.get(msgId);
|
||||
const quotedMsg = window.Store.QuotedMsg.getQuotedMsgObj(msg);
|
||||
return window.WWebJS.getMessageModel(quotedMsg);
|
||||
let msg = window.Store.Msg.get(msgId);
|
||||
return msg.quotedMsgObj().serialize();
|
||||
}, this.id._serialized);
|
||||
|
||||
return new Message(this.client, quotedMsg);
|
||||
@@ -393,9 +385,7 @@ class Message extends Base {
|
||||
|
||||
const result = await this.client.pupPage.evaluate(async (msgId) => {
|
||||
const msg = window.Store.Msg.get(msgId);
|
||||
if (!msg) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
if (msg.mediaData.mediaStage != 'RESOLVED') {
|
||||
// try to resolve media
|
||||
await msg.downloadMedia({
|
||||
@@ -410,7 +400,7 @@ class Message extends Base {
|
||||
}
|
||||
|
||||
try {
|
||||
const decryptedMedia = await window.Store.DownloadManager.downloadAndMaybeDecrypt({
|
||||
const decryptedMedia = await window.Store.DownloadManager.downloadAndDecrypt({
|
||||
directPath: msg.directPath,
|
||||
encFilehash: msg.encFilehash,
|
||||
filehash: msg.filehash,
|
||||
@@ -446,8 +436,7 @@ class Message extends Base {
|
||||
await this.client.pupPage.evaluate((msgId, everyone) => {
|
||||
let msg = window.Store.Msg.get(msgId);
|
||||
|
||||
const canRevoke = window.Store.MsgActionChecks.canSenderRevokeMsg(msg) || window.Store.MsgActionChecks.canAdminRevokeMsg(msg);
|
||||
if (everyone && canRevoke) {
|
||||
if (everyone && msg._canRevoke()) {
|
||||
return window.Store.Cmd.sendRevokeMsgs(msg.chat, [msg], { type: msg.id.fromMe ? 'Sender' : 'Admin' });
|
||||
}
|
||||
|
||||
@@ -462,7 +451,7 @@ class Message extends Base {
|
||||
await this.client.pupPage.evaluate((msgId) => {
|
||||
let msg = window.Store.Msg.get(msgId);
|
||||
|
||||
if (window.Store.MsgActionChecks.canStarMsg(msg)) {
|
||||
if (msg.canStar()) {
|
||||
return window.Store.Cmd.sendStarMsgs(msg.chat, [msg], false);
|
||||
}
|
||||
}, this.id._serialized);
|
||||
@@ -475,7 +464,7 @@ class Message extends Base {
|
||||
await this.client.pupPage.evaluate((msgId) => {
|
||||
let msg = window.Store.Msg.get(msgId);
|
||||
|
||||
if (window.Store.MsgActionChecks.canStarMsg(msg)) {
|
||||
if (msg.canStar()) {
|
||||
return window.Store.Cmd.sendUnstarMsgs(msg.chat, [msg], false);
|
||||
}
|
||||
}, this.id._serialized);
|
||||
@@ -501,7 +490,7 @@ class Message extends Base {
|
||||
const msg = window.Store.Msg.get(msgId);
|
||||
if (!msg) return null;
|
||||
|
||||
return await window.Store.MessageInfo.sendQueryMsgInfo(msg.id);
|
||||
return await window.Store.MessageInfo.sendQueryMsgInfo(msg);
|
||||
}, this.id._serialized);
|
||||
|
||||
return info;
|
||||
@@ -536,44 +525,6 @@ class Message extends Base {
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Reaction List
|
||||
* @typedef {Object} ReactionList
|
||||
* @property {string} id Original emoji
|
||||
* @property {string} aggregateEmoji aggregate emoji
|
||||
* @property {boolean} hasReactionByMe Flag who sent the reaction
|
||||
* @property {Array<Reaction>} senders Reaction senders, to this message
|
||||
*/
|
||||
|
||||
/**
|
||||
* Gets the reactions associated with the given message
|
||||
* @return {Promise<ReactionList[]>}
|
||||
*/
|
||||
async getReactions() {
|
||||
if (!this.hasReaction) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
const reactions = await this.client.pupPage.evaluate(async (msgId) => {
|
||||
const msgReactions = await window.Store.Reactions.find(msgId);
|
||||
if (!msgReactions || !msgReactions.reactions.length) return null;
|
||||
return msgReactions.reactions.serialize();
|
||||
}, this.id._serialized);
|
||||
|
||||
if (!reactions) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
return reactions.map(reaction => {
|
||||
reaction.senders = reaction.senders.map(sender => {
|
||||
sender.timestamp = Math.round(sender.timestamp / 1000);
|
||||
return new Reaction(this.client, sender);
|
||||
});
|
||||
return reaction;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Message;
|
||||
|
||||
@@ -36,27 +36,22 @@ exports.Events = {
|
||||
AUTHENTICATED: 'authenticated',
|
||||
AUTHENTICATION_FAILURE: 'auth_failure',
|
||||
READY: 'ready',
|
||||
CHAT_REMOVED: 'chat_removed',
|
||||
CHAT_ARCHIVED: 'chat_archived',
|
||||
MESSAGE_RECEIVED: 'message',
|
||||
MESSAGE_CREATE: 'message_create',
|
||||
MESSAGE_REVOKED_EVERYONE: 'message_revoke_everyone',
|
||||
MESSAGE_REVOKED_ME: 'message_revoke_me',
|
||||
MESSAGE_ACK: 'message_ack',
|
||||
UNREAD_COUNT: 'unread_count',
|
||||
MESSAGE_REACTION: 'message_reaction',
|
||||
MEDIA_UPLOADED: 'media_uploaded',
|
||||
CONTACT_CHANGED: 'contact_changed',
|
||||
GROUP_JOIN: 'group_join',
|
||||
GROUP_LEAVE: 'group_leave',
|
||||
GROUP_ADMIN_CHANGED: 'group_admin_changed',
|
||||
GROUP_UPDATE: 'group_update',
|
||||
QR_RECEIVED: 'qr',
|
||||
LOADING_SCREEN: 'loading_screen',
|
||||
DISCONNECTED: 'disconnected',
|
||||
STATE_CHANGED: 'change_state',
|
||||
BATTERY_CHANGED: 'change_battery',
|
||||
INCOMING_CALL: 'call',
|
||||
INCOMING_CALL: 'incoming_call',
|
||||
REMOTE_SESSION_SAVED: 'remote_session_saved'
|
||||
};
|
||||
|
||||
|
||||
@@ -13,11 +13,13 @@ exports.ExposeStore = (moduleRaidStr) => {
|
||||
window.Store.Cmd = window.mR.findModule('Cmd')[0].Cmd;
|
||||
window.Store.CryptoLib = window.mR.findModule('decryptE2EMedia')[0];
|
||||
window.Store.DownloadManager = window.mR.findModule('downloadManager')[0].downloadManager;
|
||||
window.Store.GroupMetadata = window.mR.findModule('GroupMetadata')[0].default.GroupMetadata;
|
||||
window.Store.Invite = window.mR.findModule('resetGroupInviteCode')[0];
|
||||
window.Store.InviteInfo = window.mR.findModule('queryGroupInvite')[0];
|
||||
window.Store.MDBackend = window.mR.findModule('isMDBackend')[0].isMDBackend();
|
||||
window.Store.Features = window.mR.findModule('FEATURE_CHANGE_EVENT')[0].LegacyPhoneFeatures;
|
||||
window.Store.GroupMetadata = window.mR.findModule((module) => module.default && module.default.handlePendingInvite)[0].default;
|
||||
window.Store.Invite = window.mR.findModule('sendJoinGroupViaInvite')[0];
|
||||
window.Store.InviteInfo = window.mR.findModule('sendQueryGroupInvite')[0];
|
||||
window.Store.Label = window.mR.findModule('LabelCollection')[0].LabelCollection;
|
||||
window.Store.MediaPrep = window.mR.findModule('prepRawMedia')[0];
|
||||
window.Store.MediaPrep = window.mR.findModule('MediaPrep')[0];
|
||||
window.Store.MediaObject = window.mR.findModule('getOrCreateMediaObject')[0];
|
||||
window.Store.NumberInfo = window.mR.findModule('formattedPhoneNumber')[0];
|
||||
window.Store.MediaTypes = window.mR.findModule('msgToMediaType')[0];
|
||||
@@ -25,7 +27,7 @@ exports.ExposeStore = (moduleRaidStr) => {
|
||||
window.Store.MsgKey = window.mR.findModule((module) => module.default && module.default.fromString)[0].default;
|
||||
window.Store.MessageInfo = window.mR.findModule('sendQueryMsgInfo')[0];
|
||||
window.Store.OpaqueData = window.mR.findModule(module => module.default && module.default.createFromData)[0].default;
|
||||
window.Store.QueryExist = window.mR.findModule('queryExists')[0] ? window.mR.findModule('queryExists')[0].queryExists : window.mR.findModule('queryExist')[0].queryWidExists;
|
||||
window.Store.QueryExist = window.mR.findModule('queryExists')[0].queryExists;
|
||||
window.Store.QueryProduct = window.mR.findModule('queryProduct')[0];
|
||||
window.Store.QueryOrder = window.mR.findModule('queryOrder')[0];
|
||||
window.Store.SendClear = window.mR.findModule('sendClear')[0];
|
||||
@@ -37,33 +39,27 @@ exports.ExposeStore = (moduleRaidStr) => {
|
||||
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;
|
||||
window.Store.Validators = window.mR.findModule('findLinks')[0];
|
||||
window.Store.VCard = window.mR.findModule('vcardFromContactModel')[0];
|
||||
window.Store.Wap = window.mR.findModule('queryLinkPreview')[0].default;
|
||||
window.Store.WidFactory = window.mR.findModule('createWid')[0];
|
||||
window.Store.ProfilePic = window.mR.findModule('profilePicResync')[0];
|
||||
window.Store.PresenceUtils = window.mR.findModule('sendPresenceAvailable')[0];
|
||||
window.Store.ChatState = window.mR.findModule('sendChatStateComposing')[0];
|
||||
window.Store.GroupParticipants = window.mR.findModule('promoteParticipants')[0];
|
||||
window.Store.GroupParticipants = window.mR.findModule('sendPromoteParticipants')[0];
|
||||
window.Store.JoinInviteV4 = window.mR.findModule('sendJoinGroupViaInviteV4')[0];
|
||||
window.Store.findCommonGroups = window.mR.findModule('findCommonGroups')[0].findCommonGroups;
|
||||
window.Store.StatusUtils = window.mR.findModule('setMyStatus')[0];
|
||||
window.Store.ConversationMsgs = window.mR.findModule('loadEarlierMsgs')[0];
|
||||
window.Store.sendReactionToMsg = window.mR.findModule('sendReactionToMsg')[0].sendReactionToMsg;
|
||||
window.Store.createOrUpdateReactionsModule = window.mR.findModule('createOrUpdateReactions')[0];
|
||||
window.Store.EphemeralFields = window.mR.findModule('getEphemeralFields')[0];
|
||||
window.Store.ReplyUtils = window.mR.findModule('canReplyMsg').length > 0 && window.mR.findModule('canReplyMsg')[0];
|
||||
window.Store.MsgActionChecks = window.mR.findModule('canSenderRevokeMsg')[0];
|
||||
window.Store.QuotedMsg = window.mR.findModule('getQuotedMsgObj')[0];
|
||||
window.Store.Socket = window.mR.findModule('deprecatedSendIq')[0];
|
||||
window.Store.SocketWap = window.mR.findModule('wap')[0];
|
||||
window.Store.StickerTools = {
|
||||
...window.mR.findModule('toWebpSticker')[0],
|
||||
...window.mR.findModule('addWebpMetadata')[0]
|
||||
};
|
||||
|
||||
window.Store.GroupUtils = {
|
||||
...window.mR.findModule('createGroup')[0],
|
||||
...window.mR.findModule('setGroupDescription')[0],
|
||||
...window.mR.findModule('sendExitGroup')[0],
|
||||
...window.mR.findModule('sendSetPicture')[0]
|
||||
...window.mR.findModule('sendCreateGroup')[0],
|
||||
...window.mR.findModule('sendSetGroupSubject')[0],
|
||||
...window.mR.findModule('markExited')[0]
|
||||
};
|
||||
|
||||
if (!window.Store.Chat._find) {
|
||||
@@ -74,24 +70,6 @@ exports.ExposeStore = (moduleRaidStr) => {
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
// TODO remove these once everybody has been updated to WWebJS with legacy sessions removed
|
||||
const _linkPreview = window.mR.findModule('queryLinkPreview');
|
||||
if (_linkPreview && _linkPreview[0] && _linkPreview[0].default) {
|
||||
window.Store.Wap = _linkPreview[0].default;
|
||||
}
|
||||
|
||||
const _isMDBackend = window.mR.findModule('isMDBackend');
|
||||
if(_isMDBackend && _isMDBackend[0] && _isMDBackend[0].isMDBackend) {
|
||||
window.Store.MDBackend = _isMDBackend[0].isMDBackend();
|
||||
} else {
|
||||
window.Store.MDBackend = true;
|
||||
}
|
||||
|
||||
const _features = window.mR.findModule('FEATURE_CHANGE_EVENT')[0];
|
||||
if(_features) {
|
||||
window.Store.Features = _features.LegacyPhoneFeatures;
|
||||
}
|
||||
};
|
||||
|
||||
exports.LoadUtils = () => {
|
||||
@@ -126,13 +104,7 @@ exports.LoadUtils = () => {
|
||||
let quotedMsgOptions = {};
|
||||
if (options.quotedMessageId) {
|
||||
let quotedMessage = window.Store.Msg.get(options.quotedMessageId);
|
||||
|
||||
// TODO remove .canReply() once all clients are updated to >= v2.2241.6
|
||||
const canReply = window.Store.ReplyUtils ?
|
||||
window.Store.ReplyUtils.canReplyMsg(quotedMessage.unsafe()) :
|
||||
quotedMessage.canReply();
|
||||
|
||||
if (canReply) {
|
||||
if (quotedMessage.canReply()) {
|
||||
quotedMsgOptions = quotedMessage.msgContextInfo(chat);
|
||||
}
|
||||
delete options.quotedMessageId;
|
||||
@@ -255,7 +227,11 @@ exports.LoadUtils = () => {
|
||||
const extraOptions = options.extraOptions || {};
|
||||
delete options.extraOptions;
|
||||
|
||||
const ephemeralFields = window.Store.EphemeralFields.getEphemeralFields(chat);
|
||||
const ephemeralSettings = {
|
||||
ephemeralDuration: chat.isEphemeralSettingOn() ? chat.getEphemeralSetting() : undefined,
|
||||
ephemeralSettingTimestamp: chat.getEphemeralSettingTimestamp() || undefined,
|
||||
disappearingModeInitiator: chat.getDisappearingModeInitiator() || undefined,
|
||||
};
|
||||
|
||||
const message = {
|
||||
...options,
|
||||
@@ -269,10 +245,9 @@ exports.LoadUtils = () => {
|
||||
t: parseInt(new Date().getTime() / 1000),
|
||||
isNewMsg: true,
|
||||
type: 'chat',
|
||||
...ephemeralFields,
|
||||
...ephemeralSettings,
|
||||
...locationOptions,
|
||||
...attOptions,
|
||||
...(attOptions.toJSON ? attOptions.toJSON() : {}),
|
||||
...quotedMsgOptions,
|
||||
...vcardOptions,
|
||||
...buttonOptions,
|
||||
@@ -391,7 +366,7 @@ exports.LoadUtils = () => {
|
||||
|
||||
msg.isEphemeral = message.isEphemeral;
|
||||
msg.isStatusV3 = message.isStatusV3;
|
||||
msg.links = (message.getRawLinks()).map(link => ({
|
||||
msg.links = (message.getLinks()).map(link => ({
|
||||
link: link.href,
|
||||
isSuspicious: Boolean(link.suspiciousCharacters && link.suspiciousCharacters.size)
|
||||
}));
|
||||
@@ -428,15 +403,7 @@ exports.LoadUtils = () => {
|
||||
await window.Store.GroupMetadata.update(chatWid);
|
||||
res.groupMetadata = chat.groupMetadata.serialize();
|
||||
}
|
||||
|
||||
res.lastMessage = null;
|
||||
if (res.msgs && res.msgs.length) {
|
||||
const lastMessage = window.Store.Msg.get(chat.lastReceivedKey._serialized);
|
||||
if (lastMessage) {
|
||||
res.lastMessage = window.WWebJS.getMessageModel(lastMessage);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
delete res.msgs;
|
||||
delete res.msgUnsyncedButtonReplyMsgs;
|
||||
delete res.unsyncedButtonReplies;
|
||||
@@ -618,90 +585,4 @@ exports.LoadUtils = () => {
|
||||
|
||||
return undefined;
|
||||
};
|
||||
|
||||
window.WWebJS.rejectCall = async (peerJid, id) => {
|
||||
peerJid = peerJid.split('@')[0] + '@s.whatsapp.net';
|
||||
let userId = window.Store.User.getMaybeMeUser().user + '@s.whatsapp.net';
|
||||
const stanza = window.Store.SocketWap.wap('call', {
|
||||
id: window.Store.SocketWap.generateId(),
|
||||
from: window.Store.SocketWap.USER_JID(userId),
|
||||
to: window.Store.SocketWap.USER_JID(peerJid),
|
||||
}, [
|
||||
window.Store.SocketWap.wap('reject', {
|
||||
'call-id': id,
|
||||
'call-creator': window.Store.SocketWap.USER_JID(peerJid),
|
||||
count: '0',
|
||||
})
|
||||
]);
|
||||
await window.Store.Socket.deprecatedCastStanza(stanza);
|
||||
};
|
||||
|
||||
window.WWebJS.cropAndResizeImage = async (media, options = {}) => {
|
||||
if (!media.mimetype.includes('image'))
|
||||
throw new Error('Media is not an image');
|
||||
|
||||
if (options.mimetype && !options.mimetype.includes('image'))
|
||||
delete options.mimetype;
|
||||
|
||||
options = Object.assign({ size: 640, mimetype: media.mimetype, quality: .75, asDataUrl: false }, options);
|
||||
|
||||
const img = await new Promise ((resolve, reject) => {
|
||||
const img = new Image();
|
||||
img.onload = () => resolve(img);
|
||||
img.onerror = reject;
|
||||
img.src = `data:${media.mimetype};base64,${media.data}`;
|
||||
});
|
||||
|
||||
const sl = Math.min(img.width, img.height);
|
||||
const sx = Math.floor((img.width - sl) / 2);
|
||||
const sy = Math.floor((img.height - sl) / 2);
|
||||
|
||||
const canvas = document.createElement('canvas');
|
||||
canvas.width = options.size;
|
||||
canvas.height = options.size;
|
||||
|
||||
const ctx = canvas.getContext('2d');
|
||||
ctx.drawImage(img, sx, sy, sl, sl, 0, 0, options.size, options.size);
|
||||
|
||||
const dataUrl = canvas.toDataURL(options.mimetype, options.quality);
|
||||
|
||||
if (options.asDataUrl)
|
||||
return dataUrl;
|
||||
|
||||
return Object.assign(media, {
|
||||
mimetype: options.mimeType,
|
||||
data: dataUrl.replace(`data:${options.mimeType};base64,`, '')
|
||||
});
|
||||
};
|
||||
|
||||
window.WWebJS.setPicture = async (chatid, media) => {
|
||||
const thumbnail = await window.WWebJS.cropAndResizeImage(media, { asDataUrl: true, mimetype: 'image/jpeg', size: 96 });
|
||||
const profilePic = await window.WWebJS.cropAndResizeImage(media, { asDataUrl: true, mimetype: 'image/jpeg', size: 640 });
|
||||
|
||||
const chatWid = window.Store.WidFactory.createWid(chatid);
|
||||
try {
|
||||
const collection = window.Store.ProfilePicThumb.get(chatid);
|
||||
if (!collection.canSet()) return;
|
||||
|
||||
const res = await window.Store.GroupUtils.sendSetPicture(chatWid, thumbnail, profilePic);
|
||||
return res ? res.status === 200 : false;
|
||||
} catch (err) {
|
||||
if(err.name === 'ServerStatusCodeError') return false;
|
||||
throw err;
|
||||
}
|
||||
};
|
||||
|
||||
window.WWebJS.deletePicture = async (chatid) => {
|
||||
const chatWid = window.Store.WidFactory.createWid(chatid);
|
||||
try {
|
||||
const collection = window.Store.ProfilePicThumb.get(chatid);
|
||||
if (!collection.canDelete()) return;
|
||||
|
||||
const res = await window.Store.GroupUtils.requestDeletePicture(chatWid);
|
||||
return res ? res.status === 200 : false;
|
||||
} catch (err) {
|
||||
if(err.name === 'ServerStatusCodeError') return false;
|
||||
throw err;
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
@@ -79,7 +79,6 @@ class InterfaceController {
|
||||
*/
|
||||
async getFeatures() {
|
||||
return await this.pupPage.evaluate(() => {
|
||||
if(!window.Store.Features) throw new Error('This version of Whatsapp Web does not support features');
|
||||
return window.Store.Features.F;
|
||||
});
|
||||
}
|
||||
@@ -90,7 +89,6 @@ class InterfaceController {
|
||||
*/
|
||||
async checkFeatureStatus(feature) {
|
||||
return await this.pupPage.evaluate((feature) => {
|
||||
if(!window.Store.Features) throw new Error('This version of Whatsapp Web does not support features');
|
||||
return window.Store.Features.supportsFeature(feature);
|
||||
}, feature);
|
||||
}
|
||||
@@ -101,7 +99,6 @@ class InterfaceController {
|
||||
*/
|
||||
async enableFeatures(features) {
|
||||
await this.pupPage.evaluate((features) => {
|
||||
if(!window.Store.Features) throw new Error('This version of Whatsapp Web does not support features');
|
||||
for (const feature in features) {
|
||||
window.Store.Features.setFeature(features[feature], true);
|
||||
}
|
||||
@@ -114,7 +111,6 @@ class InterfaceController {
|
||||
*/
|
||||
async disableFeatures(features) {
|
||||
await this.pupPage.evaluate((features) => {
|
||||
if(!window.Store.Features) throw new Error('This version of Whatsapp Web does not support features');
|
||||
for (const feature in features) {
|
||||
window.Store.Features.setFeature(features[feature], false);
|
||||
}
|
||||
|
||||
@@ -98,7 +98,7 @@ describe('Client', function() {
|
||||
await helper.sleep(20000);
|
||||
|
||||
expect(callback.called).to.equal(true);
|
||||
expect(callback.args[0][0]).to.have.length.greaterThanOrEqual(152);
|
||||
expect(callback.args[0][0]).to.have.lengthOf(152);
|
||||
|
||||
await client.destroy();
|
||||
});
|
||||
@@ -224,7 +224,7 @@ describe('Client', function() {
|
||||
|
||||
expect(authFailCallback.called).to.equal(true);
|
||||
expect(qrCallback.called).to.equal(true);
|
||||
expect(qrCallback.args[0][0]).to.have.length.greaterThanOrEqual(152);
|
||||
expect(qrCallback.args[0][0]).to.have.lengthOf(152);
|
||||
|
||||
await client.destroy();
|
||||
});
|
||||
@@ -313,7 +313,6 @@ describe('Client', function() {
|
||||
'Conn',
|
||||
'Contact',
|
||||
'DownloadManager',
|
||||
'EphemeralFields',
|
||||
'Features',
|
||||
'GroupMetadata',
|
||||
'GroupParticipants',
|
||||
@@ -346,6 +345,7 @@ describe('Client', function() {
|
||||
'UserConstructor',
|
||||
'VCard',
|
||||
'Validators',
|
||||
'Wap',
|
||||
'WidFactory',
|
||||
'findCommonGroups',
|
||||
'sendReactionToMsg',
|
||||
|
||||
@@ -66,8 +66,6 @@ describe('Message', function () {
|
||||
expect(message.isStarred).to.equal(false);
|
||||
await message.star();
|
||||
|
||||
await helper.sleep(1000);
|
||||
|
||||
// reload and check
|
||||
await message.reload();
|
||||
expect(message.isStarred).to.equal(true);
|
||||
@@ -77,8 +75,6 @@ describe('Message', function () {
|
||||
expect(message.isStarred).to.equal(true);
|
||||
await message.unstar();
|
||||
|
||||
await helper.sleep(1000);
|
||||
|
||||
// reload and check
|
||||
await message.reload();
|
||||
expect(message.isStarred).to.equal(false);
|
||||
@@ -89,7 +85,7 @@ describe('Message', function () {
|
||||
it('can delete a message for me', async function () {
|
||||
await message.delete();
|
||||
|
||||
await helper.sleep(5000);
|
||||
await helper.sleep(1000);
|
||||
expect(await message.reload()).to.equal(null);
|
||||
});
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
2.2306.7
|
||||
2.2224.8
|
||||
Reference in New Issue
Block a user