Compare commits

..

41 Commits

Author SHA1 Message Date
Pedro Lopez
c032ea4387 chore: mark version v1.6.0 2020-05-24 00:57:54 -04:00
Pedro Lopez
a80fcfa740 update supported whatsapp web version to v2.2021.3 2020-05-24 00:55:12 -04:00
Pedro Lopez
44f837c42a fix: remove unreliable return values for new mute state 2020-05-24 00:19:23 -04:00
Aliyss Snow
4beeab9b2c feat: mute/unmute chats (#168)
Co-authored-by: Pedro S. Lopez <pedroslopez@me.com>
2020-05-24 00:10:26 -04:00
Pedro Lopez
cca74ec8b9 docs: indicate return type for MessageMedia.fromFilePath 2020-05-23 23:28:19 -04:00
Pedro Lopez
8b656c2caf fix: set thumbnail for media messages
close #55
2020-05-23 23:21:13 -04:00
Pedro Lopez
4d09a4b60c fix: media would stay stuck uploading when using the media option 2020-05-23 22:55:18 -04:00
Pedro Lopez
7d2c89cf84 docs: fix wrong parameter name 2020-05-23 22:37:31 -04:00
Pedro Lopez
0928f48762 Merge branch 'master' of https://github.com/pedroslopez/whatsapp-web.js 2020-05-23 22:36:04 -04:00
Pedro Lopez
eb82e80343 feat: Helper function to create MessageMedia from a local file path 2020-05-23 22:35:59 -04:00
Caio Henrique Agiani
f5a0de7def fix: Wait for WhatsApp page load (#209)
* Fix bug on Puppeteer timeout 30000 ms exceeded
2020-05-23 21:52:46 -04:00
Pedro Lopez
d6637d662a fix: visual glitch when sending message to new chat; no longer require at least one chat to have been created 2020-05-16 02:08:13 -04:00
Pedro Lopez
4188734839 Ignore lock files 2020-05-16 01:22:05 -04:00
Pedro Lopez
207ea200b4 Merge branch 'master' of https://github.com/pedroslopez/whatsapp-web.js 2020-05-16 01:12:20 -04:00
Pedro Lopez
b062f9f82f Update puppeteer to version 3.0.4 2020-05-16 01:12:14 -04:00
Pedro S. Lopez
4d7a6ee4c2 Update supported whatsapp web version 2020-05-16 00:50:16 -04:00
depfu[bot]
e528e8c50e Update jsqr to version 1.3.1 (#185)
Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com>
2020-05-02 17:56:43 -04:00
Aliyss Snow
bcd02aa5e4 set defaultViewPort option for puppeteer (#167)
- Mainly for those who like to keep the GUI open.
- Expands to fit and looks like it usually would.
2020-04-20 22:57:59 -04:00
Pedro Lopez
686c99f0c7 feat: send audio as voice note
This adds the 'sendAudioAsVoice' option for messages

close #160
2020-04-14 23:18:08 -04:00
Pedro Lopez
59ee68b227 chore: bump version to v1.5.1-post 2020-04-14 22:49:57 -04:00
Pedro Lopez
f40c8d4ffe chore: mark version v1.5.1 2020-04-14 22:47:07 -04:00
Pedro Lopez
bab54aea8b fix: set url subtype for messages with link previews
Co-authored-by: João Vitor Miranda <joao.miranda@aluno.ufabc.edu.br>
Co-authored-by: Top <shmuliktop@users.noreply.github.com>
2020-04-14 22:42:05 -04:00
Pedro Lopez
f0a1e05600 chore: bump version v1.5.0-post 2020-04-11 20:00:28 -04:00
Pedro Lopez
303d814376 chore: mark version v1.5.0 2020-04-11 19:49:45 -04:00
Pedro Lopez
044f62216b feat: link previews
After this commit, previews for links will be enabled by default. To disable it, use linkPreview: false as an option when sending the message.

close #98
2020-04-11 19:45:06 -04:00
Pedro Lopez
2b3c3e971a docs: add new param to jsdoc for getProfilePicUrl 2020-04-11 19:04:15 -04:00
Pedro Lopez
8528d9b0b6 feat: get profile pic url by user ID
This moves the function from Contact to Client to enable getting profile picture without requiring a conversation before. The old function is still available on Contact for convenience and backwards-compatibility.
2020-04-11 19:03:47 -04:00
Pedro Lopez
7eb7fa8e28 feat: send online status
close #69
2020-04-11 18:56:23 -04:00
Pedro Lopez
8714e90df9 revert: included this by mistake on last commit 2020-04-11 18:52:01 -04:00
Pedro Lopez
478f7136d9 feat: takeover on conflict
This adds funcitonality to takeover after a certain timeout if WhatsApp Web has been opened in another browser

close #119
2020-04-11 18:48:50 -04:00
Pedro S. Lopez
20bbe3d0c4 readme: add discord logo to shield 2020-04-11 16:32:53 -04:00
Pedro S. Lopez
33db17e67d add discord link 2020-04-11 16:31:17 -04:00
Pedro Lopez
1c2b4592b5 chore: bump version to v1.4.1-post 2020-04-11 15:04:00 -04:00
Pedro Lopez
ce0a80383c chore: mark version v1.4.1 2020-04-11 15:01:44 -04:00
Pedro Lopez
97e488b10a chore: update supported WhatsApp Web version to 2.2013.7 2020-04-11 15:00:42 -04:00
Pedro Lopez
ef507fcb95 Merge branch 'master' of https://github.com/pedroslopez/whatsapp-web.js 2020-04-11 14:59:39 -04:00
Pedro Lopez
8e011e0233 feat: get current whatsapp web version 2020-04-11 14:59:32 -04:00
InstantlyMoist
470c7aea04 feat: added MediaKey in order to see which sticker has been sent (#146) 2020-04-11 14:54:19 -04:00
Antoine Schaller
f92f1ec6bf Fix uploadMedia arguments after origin code change (#153) 2020-04-11 14:53:22 -04:00
depfu[bot]
702a0ab103 Update jsdoc to version 3.6.4 (#144)
Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com>
2020-04-07 23:38:56 -04:00
Pedro Lopez
d9fb5693d1 chore: bump version v1.4.0-post 2020-04-05 23:45:18 -04:00
44 changed files with 901 additions and 1879 deletions

4
.gitignore vendored
View File

@@ -36,6 +36,10 @@ build/Release
node_modules/
jspm_packages/
# Lock files
package-lock.json
yarn.lock
# TypeScript v1 declaration files
typings/

View File

@@ -1,4 +1,4 @@
[![npm](https://img.shields.io/npm/v/whatsapp-web.js.svg)](https://www.npmjs.com/package/whatsapp-web.js) [![Depfu](https://badges.depfu.com/badges/4a65a0de96ece65fdf39e294e0c8dcba/overview.svg)](https://depfu.com/github/pedroslopez/whatsapp-web.js?project_id=9765) ![WhatsApp_Web 0.4.2088](https://img.shields.io/badge/WhatsApp_Web-0.4.2088-brightgreen.svg)
[![npm](https://img.shields.io/npm/v/whatsapp-web.js.svg)](https://www.npmjs.com/package/whatsapp-web.js) [![Depfu](https://badges.depfu.com/badges/4a65a0de96ece65fdf39e294e0c8dcba/overview.svg)](https://depfu.com/github/pedroslopez/whatsapp-web.js?project_id=9765) ![WhatsApp_Web 2.2021.3](https://img.shields.io/badge/WhatsApp_Web-2.2021.3-brightgreen.svg) [![Discord Chat](https://img.shields.io/discord/698610475432411196.svg?logo=discord)](https://discord.gg/H7DqQs4)
# whatsapp-web.js
A WhatsApp API client that connects through the WhatsApp Web browser app

BIN
docs/._Base.html Normal file

Binary file not shown.

View File

@@ -2,9 +2,9 @@
<html>
<head>
<meta name="generator" content="JSDoc 3.6.3">
<meta name="generator" content="JSDoc 3.6.4">
<meta charset="utf-8">
<title>whatsapp-web.js 1.4.0 &raquo; Class: Base</title>
<title>whatsapp-web.js 1.6.0 &raquo; 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>4.<wbr>0</a>
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>6.<wbr>0</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.3 on April 5, 2020.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.4 on May 24, 2020.
</p>
</div>
</footer>

View File

@@ -2,9 +2,9 @@
<html>
<head>
<meta name="generator" content="JSDoc 3.6.3">
<meta name="generator" content="JSDoc 3.6.4">
<meta charset="utf-8">
<title>whatsapp-web.js 1.4.0 &raquo; Class: BusinessContact</title>
<title>whatsapp-web.js 1.6.0 &raquo; 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>4.<wbr>0</a>
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>6.<wbr>0</a>
</div>
</div>
</nav>
@@ -227,7 +227,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.3 on April 5, 2020.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.4 on May 24, 2020.
</p>
</div>
</footer>

View File

@@ -2,9 +2,9 @@
<html>
<head>
<meta name="generator" content="JSDoc 3.6.3">
<meta name="generator" content="JSDoc 3.6.4">
<meta charset="utf-8">
<title>whatsapp-web.js 1.4.0 &raquo; Class: Chat</title>
<title>whatsapp-web.js 1.6.0 &raquo; 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>4.<wbr>0</a>
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>6.<wbr>0</a>
</div>
</div>
</nav>
@@ -96,25 +96,31 @@
<dt><a href="Chat.html#fetchMessages">fetchMessages(searchOptions)</a></dt>
<dd>
</dd>
<dt><a href="Chat.html#mute">mute(unmuteDate)</a></dt>
<dd>
</dd>
<dt><a href="Chat.html#sendMessage">sendMessage(content, options)</a></dt>
<dd>
</dd>
<dt><a href="Chat.html#sendSeen">sendSeen()</a></dt>
<dd>
</dd>
<dt><a href="Chat.html#sendStateRecording">sendStateRecording()</a></dt>
<dd>
</dd>
</dl>
</div>
<div class="summary-column">
<dl class="dl-summary-callout">
<dt><a href="Chat.html#sendStateRecording">sendStateRecording()</a></dt>
<dd>
</dd>
<dt><a href="Chat.html#sendStateTyping">sendStateTyping()</a></dt>
<dd>
</dd>
<dt><a href="Chat.html#unarchive">unarchive()</a></dt>
<dd>
</dd>
<dt><a href="Chat.html#unmute">unmute()</a></dt>
<dd>
</dd>
</dl>
</div>
</div>
@@ -265,6 +271,40 @@
</dd>
</dl>
<div class="symbol-detail-labels"><span class="label label-async">async</span></div>
<h3 id="mute"><span class="symbol-name">mute</span><span class="signature"><span class="signature-params">(unmuteDate)</span></span></h3>
<p>Mutes this chat until a specified date</p>
<section>
<h4>Parameter</h4>
<table class="jsdoc-details-table">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Optional</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<p>unmuteDate</p>
</td>
<td>
<p>Date</p>
</td>
<td>
<p>&nbsp;</p>
</td>
<td>
<p>Date at which the Chat will be unmuted</p>
</td>
</tr>
</tbody>
</table>
</section>
<dl class="dl-compact">
</dl>
<div class="symbol-detail-labels"><span class="label label-async">async</span></div>
<h3 id="sendMessage"><span class="symbol-name">sendMessage</span><span class="signature"><span class="signature-params">(content, options)</span>&nbsp;&rarr; <span class="signature-returns"> Promise containing <a href="Message.html">Message</a></span></span></h3>
<p>Send a message to this chat</p>
<section>
@@ -340,6 +380,11 @@
<p>un-archives this chat</p>
<dl class="dl-compact">
</dl>
<div class="symbol-detail-labels"><span class="label label-async">async</span></div>
<h3 id="unmute"><span class="symbol-name">unmute</span><span class="signature"><span class="signature-params">()</span></span></h3>
<p>Unmutes this chat</p>
<dl class="dl-compact">
</dl>
</section>
</section>
</div>
@@ -350,7 +395,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.3 on April 5, 2020.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.4 on May 24, 2020.
</p>
</div>
</footer>

View File

@@ -2,9 +2,9 @@
<html>
<head>
<meta name="generator" content="JSDoc 3.6.3">
<meta name="generator" content="JSDoc 3.6.4">
<meta charset="utf-8">
<title>whatsapp-web.js 1.4.0 &raquo; Class: Client</title>
<title>whatsapp-web.js 1.6.0 &raquo; 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>4.<wbr>0</a>
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>6.<wbr>0</a>
</div>
</div>
</nav>
@@ -57,35 +57,47 @@
<dt><a href="Client.html#getChats">getChats()</a></dt>
<dd>
</dd>
<dt><a href="Client.html#getContactById">getContactById(contactId)</a></dt>
<dd>
</dd>
</dl>
</div>
<div class="summary-column">
<dl class="dl-summary-callout">
<dt><a href="Client.html#getContactById">getContactById(contactId)</a></dt>
<dd>
</dd>
<dt><a href="Client.html#getContacts">getContacts()</a></dt>
<dd>
</dd>
<dt><a href="Client.html#getProfilePicUrl">getProfilePicUrl(contactId)</a></dt>
<dd>
</dd>
<dt><a href="Client.html#getState">getState()</a></dt>
<dd>
</dd>
<dt><a href="Client.html#getWWebVersion">getWWebVersion()</a></dt>
<dd>
</dd>
<dt><a href="Client.html#initialize">initialize()</a></dt>
<dd>
</dd>
<dt><a href="Client.html#isRegisteredUser">isRegisteredUser()</a></dt>
<dd>
</dd>
<dt><a href="Client.html#resetState">resetState()</a></dt>
<dt><a href="Client.html#muteChat">muteChat(chatId, unmuteDate)</a></dt>
<dd>
</dd>
</dl>
</div>
<div class="summary-column">
<dl class="dl-summary-callout">
<dt><a href="Client.html#resetState">resetState()</a></dt>
<dd>
</dd>
<dt><a href="Client.html#sendMessage">sendMessage(chatId, content, options)</a></dt>
<dd>
</dd>
<dt><a href="Client.html#sendPresenceAvailable">sendPresenceAvailable()</a></dt>
<dd>
</dd>
<dt><a href="Client.html#sendSeen">sendSeen(chatId)</a></dt>
<dd>
</dd>
@@ -95,6 +107,9 @@
<dt><a href="Client.html#unarchiveChat">unarchiveChat()</a></dt>
<dd>
</dd>
<dt><a href="Client.html#unmuteChat">unmuteChat(chatId)</a></dt>
<dd>
</dd>
</dl>
</div>
</div>
@@ -394,6 +409,44 @@
</dd>
</dl>
<div class="symbol-detail-labels"><span class="label label-async">async</span></div>
<h3 id="getProfilePicUrl"><span class="symbol-name">getProfilePicUrl</span><span class="signature"><span class="signature-params">(contactId)</span>&nbsp;&rarr; <span class="signature-returns"> Promise containing string</span></span></h3>
<p>Returns the contact ID's profile picture URL, if privacy settings allow it</p>
<section>
<h4>Parameter</h4>
<table class="jsdoc-details-table">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Optional</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<p>contactId</p>
</td>
<td>
<p>string</p>
</td>
<td>
<p>&nbsp;</p>
</td>
<td>
<p>the whatsapp user's ID</p>
</td>
</tr>
</tbody>
</table>
</section>
<dl class="dl-compact">
<dt>Returns</dt>
<dd>
<p><code>Promise containing string</code> </p>
</dd>
</dl>
<div class="symbol-detail-labels"><span class="label label-async">async</span></div>
<h3 id="getState"><span class="symbol-name">getState</span><span class="signature"><span class="signature-params">()</span>&nbsp;&rarr; <span class="signature-returns"> <a href="global.html#WAState">WAState</a></span></span></h3>
<p>Gets the current connection state for the client</p>
<dl class="dl-compact">
@@ -403,6 +456,16 @@
</dd>
</dl>
<div class="symbol-detail-labels"><span class="label label-async">async</span></div>
<h3 id="getWWebVersion"><span class="symbol-name">getWWebVersion</span><span class="signature"><span class="signature-params">()</span></span></h3>
<p>Returns the version of WhatsApp Web currently being run</p>
<dl class="dl-compact">
<dt>Returns</dt>
<dd>
<p>Promise<string>
</p>
</dd>
</dl>
<div class="symbol-detail-labels"><span class="label label-async">async</span></div>
<h3 id="initialize"><span class="symbol-name">initialize</span><span class="signature"><span class="signature-params">()</span></span></h3>
<p>Sets up events and requirements, kicks off authentication request</p>
<dl class="dl-compact">
@@ -417,6 +480,54 @@
</dd>
</dl>
<div class="symbol-detail-labels"><span class="label label-async">async</span></div>
<h3 id="muteChat"><span class="symbol-name">muteChat</span><span class="signature"><span class="signature-params">(chatId, unmuteDate)</span></span></h3>
<p>Mutes the Chat until a specified date</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>chatId</p>
</td>
<td>
<p>string</p>
</td>
<td>
<p>&nbsp;</p>
</td>
<td>
<p>ID of the chat that will be muted</p>
</td>
</tr>
<tr>
<td>
<p>unmuteDate</p>
</td>
<td>
<p>Date</p>
</td>
<td>
<p>&nbsp;</p>
</td>
<td>
<p>Date when the chat will be unmuted</p>
</td>
</tr>
</tbody>
</table>
</section>
<dl class="dl-compact">
</dl>
<div class="symbol-detail-labels"><span class="label label-async">async</span></div>
<h3 id="resetState"><span class="symbol-name">resetState</span><span class="signature"><span class="signature-params">()</span></span></h3>
<p>Force reset of connection state for the client</p>
<dl class="dl-compact">
@@ -486,6 +597,11 @@
</dd>
</dl>
<div class="symbol-detail-labels"><span class="label label-async">async</span></div>
<h3 id="sendPresenceAvailable"><span class="symbol-name">sendPresenceAvailable</span><span class="signature"><span class="signature-params">()</span></span></h3>
<p>Marks the client as online</p>
<dl class="dl-compact">
</dl>
<div class="symbol-detail-labels"><span class="label label-async">async</span></div>
<h3 id="sendSeen"><span class="symbol-name">sendSeen</span><span class="signature"><span class="signature-params">(chatId)</span>&nbsp;&rarr; <span class="signature-returns"> Promise containing boolean</span></span></h3>
<p>Mark as seen for the Chat</p>
<section>
@@ -566,6 +682,40 @@
<p><code>boolean</code> </p>
</dd>
</dl>
<div class="symbol-detail-labels"><span class="label label-async">async</span></div>
<h3 id="unmuteChat"><span class="symbol-name">unmuteChat</span><span class="signature"><span class="signature-params">(chatId)</span></span></h3>
<p>Unmutes the Chat</p>
<section>
<h4>Parameter</h4>
<table class="jsdoc-details-table">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Optional</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<p>chatId</p>
</td>
<td>
<p>string</p>
</td>
<td>
<p>&nbsp;</p>
</td>
<td>
<p>ID of the chat that will be unmuted</p>
</td>
</tr>
</tbody>
</table>
</section>
<dl class="dl-compact">
</dl>
</section>
<h2>Events</h2>
<section>
@@ -1147,7 +1297,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.3 on April 5, 2020.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.4 on May 24, 2020.
</p>
</div>
</footer>

View File

@@ -2,9 +2,9 @@
<html>
<head>
<meta name="generator" content="JSDoc 3.6.3">
<meta name="generator" content="JSDoc 3.6.4">
<meta charset="utf-8">
<title>whatsapp-web.js 1.4.0 &raquo; Source: Client.js</title>
<title>whatsapp-web.js 1.6.0 &raquo; 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>4.<wbr>0</a>
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>6.<wbr>0</a>
</div>
</div>
</nav>
@@ -94,8 +94,11 @@ class Client extends EventEmitter {
}, this.options.session);
}
await page.goto(WhatsWebURL);
await page.goto(WhatsWebURL, {
waitUntil: &#x27;load&#x27;,
timeout: 0,
});
const KEEP_PHONE_CONNECTED_IMG_SELECTOR &#x3D; &#x27;[data-asset-intro-image&#x3D;&quot;true&quot;]&#x27;;
if (this.options.session) {
@@ -317,6 +320,17 @@ class Client extends EventEmitter {
this.emit(Events.STATE_CHANGED, state);
const ACCEPTED_STATES &#x3D; [WAState.CONNECTED, WAState.OPENING, WAState.PAIRING, WAState.TIMEOUT];
if(this.options.takeoverOnConflict) {
ACCEPTED_STATES.push(WAState.CONFLICT);
if(state &#x3D;&#x3D;&#x3D; WAState.CONFLICT) {
setTimeout(() &#x3D;&gt; {
this.pupPage.evaluate(() &#x3D;&gt; window.Store.AppState.takeover());
}, this.options.takeoverTimeoutMs);
}
}
if (!ACCEPTED_STATES.includes(state)) {
/**
* Emitted when the client has been disconnected
@@ -329,9 +343,10 @@ class Client extends EventEmitter {
});
await page.exposeFunction(&#x27;onBatteryStateChangedEvent&#x27;, (state) &#x3D;&gt; {
const { battery, plugged } &#x3D; state;
if(battery &#x3D;&#x3D;&#x3D; undefined) return;
/**
* Emitted when the battery percentage for the attached device changes
* @event Client#change_battery
@@ -366,6 +381,17 @@ class Client extends EventEmitter {
async destroy() {
await this.pupBrowser.close();
}
/**
* Returns the version of WhatsApp Web currently being run
* @returns Promise&amp;lt;string&gt;
*/
async getWWebVersion() {
return await this.pupPage.evaluate(() &#x3D;&gt; {
return window.Debug.VERSION;
});
}
/**
* Mark as seen for the Chat
* @param {string} chatId
@@ -379,6 +405,7 @@ class Client extends EventEmitter {
}, chatId);
return result;
}
/**
* Send a message to a specific chatId
* @param {string} chatId
@@ -388,6 +415,8 @@ class Client extends EventEmitter {
*/
async sendMessage(chatId, content, options &#x3D; {}) {
let internalOptions &#x3D; {
linkPreview: options.linkPreview &#x3D;&#x3D;&#x3D; false ? undefined : true,
sendAudioAsVoice: options.sendAudioAsVoice,
caption: options.caption,
quotedMessageId: options.quotedMessageId,
mentionedJidList: Array.isArray(options.mentions) ? options.mentions.map(contact &#x3D;&gt; contact.id._serialized) : []
@@ -401,38 +430,21 @@ class Client extends EventEmitter {
} else if (options.media instanceof MessageMedia) {
internalOptions.attachment &#x3D; options.media;
internalOptions.caption &#x3D; content;
content &#x3D; &#x27;&#x27;;
} else if (content instanceof Location) {
internalOptions.location &#x3D; content;
content &#x3D; &#x27;&#x27;;
}
const newMessage &#x3D; await this.pupPage.evaluate(async (chatId, message, options, sendSeen) &#x3D;&gt; {
let chat &#x3D; window.Store.Chat.get(chatId);
let msg;
if (!chat) { // The chat is not available in the previously chatted list
const chatWid &#x3D; window.Store.WidFactory.createWid(chatId);
const chat &#x3D; await window.Store.Chat.find(chatWid);
let newChatId &#x3D; await window.WWebJS.getNumberId(chatId);
if (newChatId) {
//get the topmost chat object and assign the new chatId to it .
//This is just a workaround.May cause problem if there are no chats at all. Need to dig in and emulate how whatsapp web does
let chat &#x3D; window.Store.Chat.models[0];
if (!chat)
throw &#x27;Chat List empty! Need at least one open conversation with any of your contact&#x27;;
let originalChatObjId &#x3D; chat.id;
chat.id &#x3D; newChatId;
msg &#x3D; await window.WWebJS.sendMessage(chat, message, options);
chat.id &#x3D; originalChatObjId; //replace the chat with its original id
}
}
else {
if(sendSeen) {
window.WWebJS.sendSeen(chatId);
}
msg &#x3D; await window.WWebJS.sendMessage(chat, message, options, sendSeen);
if(sendSeen) {
window.WWebJS.sendSeen(chatId);
}
const msg &#x3D; await window.WWebJS.sendMessage(chat, message, options, sendSeen);
return msg.serialize();
}, chatId, content, internalOptions, sendSeen);
@@ -521,6 +533,15 @@ class Client extends EventEmitter {
});
}
/**
* Marks the client as online
*/
async sendPresenceAvailable() {
return await this.pupPage.evaluate(() &#x3D;&gt; {
return window.Store.Wap.sendPresenceAvailable();
});
}
/**
* Enables and returns the archive state of the Chat
* @returns {boolean}
@@ -545,6 +566,42 @@ class Client extends EventEmitter {
}, chatId);
}
/**
* Mutes the Chat until a specified date
* @param {string} chatId ID of the chat that will be muted
* @param {Date} unmuteDate Date when the chat will be unmuted
*/
async muteChat(chatId, unmuteDate) {
await this.pupPage.evaluate(async (chatId, timestamp) &#x3D;&gt; {
let chat &#x3D; await window.Store.Chat.get(chatId);
await chat.mute.mute(timestamp, !0);
}, chatId, unmuteDate.getTime() / 1000);
}
/**
* Unmutes the Chat
* @param {string} chatId ID of the chat that will be unmuted
*/
async unmuteChat(chatId) {
await this.pupPage.evaluate(async chatId &#x3D;&gt; {
let chat &#x3D; await window.Store.Chat.get(chatId);
await window.Store.Cmd.muteChat(chat, false);
}, chatId);
}
/**
* Returns the contact ID&#x27;s profile picture URL, if privacy settings allow it
* @param {string} contactId the whatsapp user&#x27;s ID
* @returns {Promise&amp;lt;string&gt;}
*/
async getProfilePicUrl(contactId) {
const profilePic &#x3D; await this.pupPage.evaluate((contactId) &#x3D;&gt; {
return window.Store.Wap.profilePicFind(contactId);
}, contactId);
return profilePic ? profilePic.eurl : undefined;
}
/**
* Force reset of connection state for the client
*/
@@ -615,7 +672,7 @@ module.exports &#x3D; 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.3 on April 5, 2020.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.4 on May 24, 2020.
</p>
</div>
</footer>

View File

@@ -2,9 +2,9 @@
<html>
<head>
<meta name="generator" content="JSDoc 3.6.3">
<meta name="generator" content="JSDoc 3.6.4">
<meta charset="utf-8">
<title>whatsapp-web.js 1.4.0 &raquo; Class: ClientInfo</title>
<title>whatsapp-web.js 1.6.0 &raquo; 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>4.<wbr>0</a>
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>6.<wbr>0</a>
</div>
</div>
</nav>
@@ -187,7 +187,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.3 on April 5, 2020.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.4 on May 24, 2020.
</p>
</div>
</footer>

View File

@@ -2,9 +2,9 @@
<html>
<head>
<meta name="generator" content="JSDoc 3.6.3">
<meta name="generator" content="JSDoc 3.6.4">
<meta charset="utf-8">
<title>whatsapp-web.js 1.4.0 &raquo; Class: Contact</title>
<title>whatsapp-web.js 1.6.0 &raquo; Class: Contact</title>
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
@@ -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>4.<wbr>0</a>
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>6.<wbr>0</a>
</div>
</div>
</nav>
@@ -196,7 +196,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.3 on April 5, 2020.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.4 on May 24, 2020.
</p>
</div>
</footer>

View File

@@ -2,9 +2,9 @@
<html>
<head>
<meta name="generator" content="JSDoc 3.6.3">
<meta name="generator" content="JSDoc 3.6.4">
<meta charset="utf-8">
<title>whatsapp-web.js 1.4.0 &raquo; Class: GroupChat</title>
<title>whatsapp-web.js 1.6.0 &raquo; 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>4.<wbr>0</a>
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>6.<wbr>0</a>
</div>
</div>
</nav>
@@ -110,13 +110,13 @@
<dt><a href="GroupChat.html#delete">delete()</a></dt>
<dd>
</dd>
<dt><a href="GroupChat.html#demoteParticipants">demoteParticipants(participantIds)</a></dt>
<dd>
</dd>
</dl>
</div>
<div class="summary-column">
<dl class="dl-summary-callout">
<dt><a href="GroupChat.html#demoteParticipants">demoteParticipants(participantIds)</a></dt>
<dd>
</dd>
<dt><a href="GroupChat.html#fetchMessages">fetchMessages(searchOptions)</a></dt>
<dd>
</dd>
@@ -126,6 +126,9 @@
<dt><a href="GroupChat.html#leave">leave()</a></dt>
<dd>
</dd>
<dt><a href="GroupChat.html#mute">mute(unmuteDate)</a></dt>
<dd>
</dd>
<dt><a href="GroupChat.html#promoteParticipants">promoteParticipants(participantIds)</a></dt>
<dd>
</dd>
@@ -135,13 +138,13 @@
<dt><a href="GroupChat.html#revokeInvite">revokeInvite()</a></dt>
<dd>
</dd>
<dt><a href="GroupChat.html#sendMessage">sendMessage(content, options)</a></dt>
<dd>
</dd>
</dl>
</div>
<div class="summary-column">
<dl class="dl-summary-callout">
<dt><a href="GroupChat.html#sendMessage">sendMessage(content, options)</a></dt>
<dd>
</dd>
<dt><a href="GroupChat.html#sendSeen">sendSeen()</a></dt>
<dd>
</dd>
@@ -160,6 +163,9 @@
<dt><a href="GroupChat.html#unarchive">unarchive()</a></dt>
<dd>
</dd>
<dt><a href="GroupChat.html#unmute">unmute()</a></dt>
<dd>
</dd>
</dl>
</div>
</div>
@@ -496,6 +502,42 @@
<dl class="dl-compact">
</dl>
<div class="symbol-detail-labels"><span class="label label-async">async</span></div>
<h3 id="mute"><span class="symbol-name">mute</span><span class="signature"><span class="signature-params">(unmuteDate)</span></span></h3>
<p>Mutes this chat until a specified date</p>
<section>
<h4>Parameter</h4>
<table class="jsdoc-details-table">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Optional</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<p>unmuteDate</p>
</td>
<td>
<p>&nbsp;</p>
</td>
<td>
<p>&nbsp;</p>
</td>
<td>
<p>Date at which the Chat will be unmuted</p>
</td>
</tr>
</tbody>
</table>
</section>
<dl class="dl-compact">
<dt>Inherited from</dt>
<dd><a href="Chat.html#mute">Chat#mute</a></dd>
</dl>
<div class="symbol-detail-labels"><span class="label label-async">async</span></div>
<h3 id="promoteParticipants"><span class="symbol-name">promoteParticipants</span><span class="signature"><span class="signature-params">(participantIds)</span></span></h3>
<p>Promotes participants by IDs to admins</p>
<section>
@@ -716,6 +758,13 @@
<dt>Inherited from</dt>
<dd><a href="Chat.html#unarchive">Chat#unarchive</a></dd>
</dl>
<div class="symbol-detail-labels"><span class="label label-async">async</span></div>
<h3 id="unmute"><span class="symbol-name">unmute</span><span class="signature"><span class="signature-params">()</span></span></h3>
<p>Unmutes this chat</p>
<dl class="dl-compact">
<dt>Inherited from</dt>
<dd><a href="Chat.html#unmute">Chat#unmute</a></dd>
</dl>
</section>
</section>
</div>
@@ -726,7 +775,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.3 on April 5, 2020.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.4 on May 24, 2020.
</p>
</div>
</footer>

View File

@@ -2,9 +2,9 @@
<html>
<head>
<meta name="generator" content="JSDoc 3.6.3">
<meta name="generator" content="JSDoc 3.6.4">
<meta charset="utf-8">
<title>whatsapp-web.js 1.4.0 &raquo; Class: GroupNotification</title>
<title>whatsapp-web.js 1.6.0 &raquo; 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>4.<wbr>0</a>
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>6.<wbr>0</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.3 on April 5, 2020.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.4 on May 24, 2020.
</p>
</div>
</footer>

View File

@@ -2,9 +2,9 @@
<html>
<head>
<meta name="generator" content="JSDoc 3.6.3">
<meta name="generator" content="JSDoc 3.6.4">
<meta charset="utf-8">
<title>whatsapp-web.js 1.4.0 &raquo; Class: Location</title>
<title>whatsapp-web.js 1.6.0 &raquo; 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>4.<wbr>0</a>
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>6.<wbr>0</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.3 on April 5, 2020.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.4 on May 24, 2020.
</p>
</div>
</footer>

View File

@@ -2,9 +2,9 @@
<html>
<head>
<meta name="generator" content="JSDoc 3.6.3">
<meta name="generator" content="JSDoc 3.6.4">
<meta charset="utf-8">
<title>whatsapp-web.js 1.4.0 &raquo; Class: Message</title>
<title>whatsapp-web.js 1.6.0 &raquo; 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>4.<wbr>0</a>
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>6.<wbr>0</a>
</div>
</div>
</nav>
@@ -54,13 +54,13 @@
<dt><a href="Message.html#from">from</a></dt>
<dd>
</dd>
<dt><a href="Message.html#fromMe">fromMe</a></dt>
<dd>
</dd>
</dl>
</div>
<div class="summary-column">
<dl class="dl-summary-callout">
<dt><a href="Message.html#fromMe">fromMe</a></dt>
<dd>
</dd>
<dt><a href="Message.html#hasMedia">hasMedia</a></dt>
<dd>
</dd>
@@ -73,13 +73,16 @@
<dt><a href="Message.html#isForwarded">isForwarded</a></dt>
<dd>
</dd>
<dt><a href="Message.html#location">location</a></dt>
<dd>
</dd>
<dt><a href="Message.html#mediaKey">mediaKey</a></dt>
<dd>
</dd>
</dl>
</div>
<div class="summary-column">
<dl class="dl-summary-callout">
<dt><a href="Message.html#location">location</a></dt>
<dd>
</dd>
<dt><a href="Message.html#mentionedIds">mentionedIds</a></dt>
<dd>
</dd>
@@ -200,6 +203,11 @@
<p>Location information contained in the message, if the message is type &quot;location&quot;</p>
<dl class="dl-compact">
</dl>
<h3 id="mediaKey"><span class="symbol-name">mediaKey</span><small class="property-type">
&nbsp;string</small></h3>
<p>MediaKey that represents the sticker 'ID'</p>
<dl class="dl-compact">
</dl>
<h3 id="mentionedIds"><span class="symbol-name">mentionedIds</span><small class="property-type">
&nbsp;Array of string</small></h3>
<p>Indicates the mentions in the message body.</p>
@@ -379,7 +387,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.3 on April 5, 2020.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.4 on May 24, 2020.
</p>
</div>
</footer>

View File

@@ -2,9 +2,9 @@
<html>
<head>
<meta name="generator" content="JSDoc 3.6.3">
<meta name="generator" content="JSDoc 3.6.4">
<meta charset="utf-8">
<title>whatsapp-web.js 1.4.0 &raquo; Class: MessageMedia</title>
<title>whatsapp-web.js 1.6.0 &raquo; 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>4.<wbr>0</a>
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>6.<wbr>0</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-10">structures/<wbr>MessageMedia.<wbr>js:10</a></p>
<p class="source-link">Source: <a href="structures_MessageMedia.js.html#source-line-14">structures/<wbr>MessageMedia.<wbr>js:14</a></p>
<div class="symbol-classdesc">
<p>Media attached to a message</p>
</div>
@@ -60,6 +60,22 @@
</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="MessageMedia.html#.fromFilePath">fromFilePath(filePath)</a></dt>
<dd>
</dd>
</dl>
</div>
<div class="summary-column">
</div>
<div class="summary-column">
</div>
</div>
</div>
</section>
<section>
<h2 id="MessageMedia">new&nbsp;<span class="symbol-name">MessageMedia</span><span class="signature"><span class="signature-params">(mimetype, data, filename)</span></span></h2>
@@ -143,6 +159,46 @@
<dl class="dl-compact">
</dl>
</section>
<h2>Method</h2>
<section>
<div class="symbol-detail-labels"><span class="label label-static">static</span></div>
<h3 id=".fromFilePath"><span class="symbol-name">fromFilePath</span><span class="signature"><span class="signature-params">(filePath)</span>&nbsp;&rarr; <span class="signature-returns"> <a href="MessageMedia.html">MessageMedia</a></span></span></h3>
<p>Creates a MessageMedia instance from a local file path</p>
<section>
<h4>Parameter</h4>
<table class="jsdoc-details-table">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Optional</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<p>filePath</p>
</td>
<td>
<p>string</p>
</td>
<td>
<p>&nbsp;</p>
</td>
<td>
</td>
</tr>
</tbody>
</table>
</section>
<dl class="dl-compact">
<dt>Returns</dt>
<dd>
<p><code><a href="MessageMedia.html">MessageMedia</a></code> </p>
</dd>
</dl>
</section>
</section>
</div>
</div>
@@ -152,7 +208,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.3 on April 5, 2020.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.4 on May 24, 2020.
</p>
</div>
</footer>

View File

@@ -2,9 +2,9 @@
<html>
<head>
<meta name="generator" content="JSDoc 3.6.3">
<meta name="generator" content="JSDoc 3.6.4">
<meta charset="utf-8">
<title>whatsapp-web.js 1.4.0 &raquo; Class: PrivateChat</title>
<title>whatsapp-web.js 1.6.0 &raquo; 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>4.<wbr>0</a>
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>6.<wbr>0</a>
</div>
</div>
</nav>
@@ -96,25 +96,31 @@
<dt><a href="PrivateChat.html#fetchMessages">fetchMessages(searchOptions)</a></dt>
<dd>
</dd>
<dt><a href="PrivateChat.html#mute">mute(unmuteDate)</a></dt>
<dd>
</dd>
<dt><a href="PrivateChat.html#sendMessage">sendMessage(content, options)</a></dt>
<dd>
</dd>
<dt><a href="PrivateChat.html#sendSeen">sendSeen()</a></dt>
<dd>
</dd>
<dt><a href="PrivateChat.html#sendStateRecording">sendStateRecording()</a></dt>
<dd>
</dd>
</dl>
</div>
<div class="summary-column">
<dl class="dl-summary-callout">
<dt><a href="PrivateChat.html#sendStateRecording">sendStateRecording()</a></dt>
<dd>
</dd>
<dt><a href="PrivateChat.html#sendStateTyping">sendStateTyping()</a></dt>
<dd>
</dd>
<dt><a href="PrivateChat.html#unarchive">unarchive()</a></dt>
<dd>
</dd>
<dt><a href="PrivateChat.html#unmute">unmute()</a></dt>
<dd>
</dd>
</dl>
</div>
</div>
@@ -285,6 +291,42 @@
<dd></dd>
</dl>
<div class="symbol-detail-labels"><span class="label label-async">async</span></div>
<h3 id="mute"><span class="symbol-name">mute</span><span class="signature"><span class="signature-params">(unmuteDate)</span></span></h3>
<p>Mutes this chat until a specified date</p>
<section>
<h4>Parameter</h4>
<table class="jsdoc-details-table">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Optional</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<p>unmuteDate</p>
</td>
<td>
<p>&nbsp;</p>
</td>
<td>
<p>&nbsp;</p>
</td>
<td>
<p>Date at which the Chat will be unmuted</p>
</td>
</tr>
</tbody>
</table>
</section>
<dl class="dl-compact">
<dt>Inherited from</dt>
<dd><a href="Chat.html#mute">Chat#mute</a></dd>
</dl>
<div class="symbol-detail-labels"><span class="label label-async">async</span></div>
<h3 id="sendMessage"><span class="symbol-name">sendMessage</span><span class="signature"><span class="signature-params">(content, options)</span>&nbsp;&rarr; <span class="signature-returns"> Promise containing <a href="Message.html">Message</a></span></span></h3>
<p>Send a message to this chat</p>
<section>
@@ -368,6 +410,13 @@
<dt>Inherited from</dt>
<dd><a href="Chat.html#unarchive">Chat#unarchive</a></dd>
</dl>
<div class="symbol-detail-labels"><span class="label label-async">async</span></div>
<h3 id="unmute"><span class="symbol-name">unmute</span><span class="signature"><span class="signature-params">()</span></span></h3>
<p>Unmutes this chat</p>
<dl class="dl-compact">
<dt>Inherited from</dt>
<dd><a href="Chat.html#unmute">Chat#unmute</a></dd>
</dl>
</section>
</section>
</div>
@@ -378,7 +427,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.3 on April 5, 2020.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.4 on May 24, 2020.
</p>
</div>
</footer>

View File

@@ -2,9 +2,9 @@
<html>
<head>
<meta name="generator" content="JSDoc 3.6.3">
<meta name="generator" content="JSDoc 3.6.4">
<meta charset="utf-8">
<title>whatsapp-web.js 1.4.0 &raquo; Class: PrivateContact</title>
<title>whatsapp-web.js 1.6.0 &raquo; 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>4.<wbr>0</a>
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>6.<wbr>0</a>
</div>
</div>
</nav>
@@ -220,7 +220,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.3 on April 5, 2020.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.4 on May 24, 2020.
</p>
</div>
</footer>

View File

@@ -2,9 +2,9 @@
<html>
<head>
<meta name="generator" content="JSDoc 3.6.3">
<meta name="generator" content="JSDoc 3.6.4">
<meta charset="utf-8">
<title>whatsapp-web.js 1.4.0 &raquo; Class: Util</title>
<title>whatsapp-web.js 1.6.0 &raquo; 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>4.<wbr>0</a>
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>6.<wbr>0</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.3 on April 5, 2020.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.4 on May 24, 2020.
</p>
</div>
</footer>

View File

@@ -2,9 +2,9 @@
<html>
<head>
<meta name="generator" content="JSDoc 3.6.3">
<meta name="generator" content="JSDoc 3.6.4">
<meta charset="utf-8">
<title>whatsapp-web.js 1.4.0 &raquo; Globals</title>
<title>whatsapp-web.js 1.6.0 &raquo; 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>4.<wbr>0</a>
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>6.<wbr>0</a>
</div>
</div>
</nav>
@@ -1017,7 +1017,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.3 on April 5, 2020.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.4 on May 24, 2020.
</p>
</div>
</footer>

View File

@@ -2,9 +2,9 @@
<html>
<head>
<meta name="generator" content="JSDoc 3.6.3">
<meta name="generator" content="JSDoc 3.6.4">
<meta charset="utf-8">
<title>whatsapp-web.js 1.4.0 &raquo; Home</title>
<title>whatsapp-web.js 1.6.0 &raquo; 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>4.<wbr>0</a>
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>6.<wbr>0</a>
</div>
</div>
</nav>
@@ -27,11 +27,11 @@
<div id="jsdoc-main" role="main">
<header class="page-header">
<h1>
whatsapp-web.js 1.4.0
whatsapp-web.js 1.6.0
</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-0.4.2088-brightgreen.svg" alt="WhatsApp_Web 0.4.2088"></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.2021.3-brightgreen.svg" alt="WhatsApp_Web 2.2021.3"> <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>
@@ -332,15 +332,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="Chat.html#fetchMessages" class="!symbol-index-name">Chat#<wbr>fetchMessages(searchOptions)</a>
</dt>
<dd>
</dd>
</dl>
</div>
<div class="symbol-index-column">
<dl class="symbol-index-list">
<dt class="symbol-index-name">
<a href="Chat.html#id" class="!symbol-index-name">Chat#<wbr>id</a>
</dt>
@@ -356,6 +356,11 @@ client.initialize();
</dt>
<dd>
</dd>
<dt class="symbol-index-name">
<a href="Chat.html#mute" class="!symbol-index-name">Chat#<wbr>mute(unmuteDate)</a>
</dt>
<dd>
</dd>
<dt class="symbol-index-name">
<a href="Chat.html#name" class="!symbol-index-name">Chat#<wbr>name</a>
</dt>
@@ -366,15 +371,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="Chat.html#sendSeen" class="!symbol-index-name">Chat#<wbr>sendSeen()</a>
</dt>
<dd>
</dd>
</dl>
</div>
<div class="symbol-index-column">
<dl class="symbol-index-list">
<dt class="symbol-index-name">
<a href="Chat.html#sendStateRecording" class="!symbol-index-name">Chat#<wbr>sendStateRecording()</a>
</dt>
@@ -395,6 +400,11 @@ client.initialize();
</dt>
<dd>
</dd>
<dt class="symbol-index-name">
<a href="Chat.html#unmute" class="!symbol-index-name">Chat#<wbr>unmute()</a>
</dt>
<dd>
</dd>
<dt class="symbol-index-name">
<a href="Chat.html#unreadCount" class="!symbol-index-name">Chat#<wbr>unreadCount</a>
</dt>
@@ -500,10 +510,6 @@ 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#event:group_leave" class="!symbol-index-name">Client#<wbr>event:group_leave</a>
</dt>
@@ -514,6 +520,10 @@ 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#event:media_uploaded" class="!symbol-index-name">Client#<wbr>event:media_uploaded</a>
</dt>
@@ -559,10 +569,6 @@ 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#getChats" class="!symbol-index-name">Client#<wbr>getChats()</a>
</dt>
@@ -578,11 +584,25 @@ client.initialize();
</dt>
<dd>
</dd>
<dt class="symbol-index-name">
<a href="Client.html#getProfilePicUrl" class="!symbol-index-name">Client#<wbr>getProfilePicUrl(contactId)</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#getState" class="!symbol-index-name">Client#<wbr>getState()</a>
</dt>
<dd>
</dd>
<dt class="symbol-index-name">
<a href="Client.html#getWWebVersion" class="!symbol-index-name">Client#<wbr>getWWebVersion()</a>
</dt>
<dd>
</dd>
<dt class="symbol-index-name">
<a href="Client.html#initialize" class="!symbol-index-name">Client#<wbr>initialize()</a>
</dt>
@@ -593,6 +613,11 @@ client.initialize();
</dt>
<dd>
</dd>
<dt class="symbol-index-name">
<a href="Client.html#muteChat" class="!symbol-index-name">Client#<wbr>muteChat(chatId, unmuteDate)</a>
</dt>
<dd>
</dd>
<dt class="symbol-index-name">
<a href="Client.html#resetState" class="!symbol-index-name">Client#<wbr>resetState()</a>
</dt>
@@ -603,6 +628,11 @@ client.initialize();
</dt>
<dd>
</dd>
<dt class="symbol-index-name">
<a href="Client.html#sendPresenceAvailable" class="!symbol-index-name">Client#<wbr>sendPresenceAvailable()</a>
</dt>
<dd>
</dd>
<dt class="symbol-index-name">
<a href="Client.html#sendSeen" class="!symbol-index-name">Client#<wbr>sendSeen(chatId)</a>
</dt>
@@ -618,6 +648,11 @@ client.initialize();
</dt>
<dd>
</dd>
<dt class="symbol-index-name">
<a href="Client.html#unmuteChat" class="!symbol-index-name">Client#<wbr>unmuteChat(chatId)</a>
</dt>
<dd>
</dd>
</dl>
</div>
</div>
@@ -916,15 +951,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="GroupChat.html#description" class="!symbol-index-name">GroupChat#<wbr>description</a>
</dt>
<dd>
</dd>
</dl>
</div>
<div class="symbol-index-column">
<dl class="symbol-index-list">
<dt class="symbol-index-name">
<a href="GroupChat.html#fetchMessages" class="!symbol-index-name">GroupChat#<wbr>fetchMessages(searchOptions)</a>
</dt>
@@ -955,6 +990,11 @@ client.initialize();
</dt>
<dd>
</dd>
<dt class="symbol-index-name">
<a href="GroupChat.html#mute" class="!symbol-index-name">GroupChat#<wbr>mute(unmuteDate)</a>
</dt>
<dd>
</dd>
<dt class="symbol-index-name">
<a href="GroupChat.html#name" class="!symbol-index-name">GroupChat#<wbr>name</a>
</dt>
@@ -975,15 +1015,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="GroupChat.html#removeParticipants" class="!symbol-index-name">GroupChat#<wbr>removeParticipants(participantIds)</a>
</dt>
<dd>
</dd>
</dl>
</div>
<div class="symbol-index-column">
<dl class="symbol-index-list">
<dt class="symbol-index-name">
<a href="GroupChat.html#revokeInvite" class="!symbol-index-name">GroupChat#<wbr>revokeInvite()</a>
</dt>
@@ -1029,6 +1069,11 @@ client.initialize();
</dt>
<dd>
</dd>
<dt class="symbol-index-name">
<a href="GroupChat.html#unmute" class="!symbol-index-name">GroupChat#<wbr>unmute()</a>
</dt>
<dd>
</dd>
<dt class="symbol-index-name">
<a href="GroupChat.html#unreadCount" class="!symbol-index-name">GroupChat#<wbr>unreadCount</a>
</dt>
@@ -1325,6 +1370,11 @@ client.initialize();
</dt>
<dd>
</dd>
<dt class="symbol-index-name">
<a href="Message.html#mediaKey" class="!symbol-index-name">Message#<wbr>mediaKey</a>
</dt>
<dd>
</dd>
<dt class="symbol-index-name">
<a href="Message.html#mentionedIds" class="!symbol-index-name">Message#<wbr>mentionedIds</a>
</dt>
@@ -1416,7 +1466,7 @@ client.initialize();
<dd>
</dd>
<dt class="symbol-index-name">
<a href="MessageMedia.html#data" class="!symbol-index-name">MessageMedia#<wbr>data</a>
<a href="MessageMedia.html#.fromFilePath" class="!symbol-index-name">MessageMedia.<wbr>fromFilePath(filePath)</a>
</dt>
<dd>
</dd>
@@ -1424,11 +1474,20 @@ client.initialize();
</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>
<dt class="symbol-index-name">
<a href="MessageMedia.html#filename" class="!symbol-index-name">MessageMedia#<wbr>filename</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>
@@ -1436,10 +1495,6 @@ client.initialize();
</dd>
</dl>
</div>
<div class="symbol-index-column">
<dl class="symbol-index-list">
</dl>
</div>
</div>
</div>
</section>
@@ -1558,15 +1613,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="PrivateChat.html#fetchMessages" class="!symbol-index-name">PrivateChat#<wbr>fetchMessages(searchOptions)</a>
</dt>
<dd>
</dd>
</dl>
</div>
<div class="symbol-index-column">
<dl class="symbol-index-list">
<dt class="symbol-index-name">
<a href="PrivateChat.html#id" class="!symbol-index-name">PrivateChat#<wbr>id</a>
</dt>
@@ -1582,6 +1637,11 @@ client.initialize();
</dt>
<dd>
</dd>
<dt class="symbol-index-name">
<a href="PrivateChat.html#mute" class="!symbol-index-name">PrivateChat#<wbr>mute(unmuteDate)</a>
</dt>
<dd>
</dd>
<dt class="symbol-index-name">
<a href="PrivateChat.html#name" class="!symbol-index-name">PrivateChat#<wbr>name</a>
</dt>
@@ -1592,15 +1652,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="PrivateChat.html#sendSeen" class="!symbol-index-name">PrivateChat#<wbr>sendSeen()</a>
</dt>
<dd>
</dd>
</dl>
</div>
<div class="symbol-index-column">
<dl class="symbol-index-list">
<dt class="symbol-index-name">
<a href="PrivateChat.html#sendStateRecording" class="!symbol-index-name">PrivateChat#<wbr>sendStateRecording()</a>
</dt>
@@ -1621,6 +1681,11 @@ client.initialize();
</dt>
<dd>
</dd>
<dt class="symbol-index-name">
<a href="PrivateChat.html#unmute" class="!symbol-index-name">PrivateChat#<wbr>unmute()</a>
</dt>
<dd>
</dd>
<dt class="symbol-index-name">
<a href="PrivateChat.html#unreadCount" class="!symbol-index-name">PrivateChat#<wbr>unreadCount</a>
</dt>
@@ -1866,7 +1931,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.3 on April 5, 2020.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.4 on May 24, 2020.
</p>
</div>
</footer>

View File

@@ -2,9 +2,9 @@
<html>
<head>
<meta name="generator" content="JSDoc 3.6.3">
<meta name="generator" content="JSDoc 3.6.4">
<meta charset="utf-8">
<title>whatsapp-web.js 1.4.0 &raquo; Source: structures/Base.js</title>
<title>whatsapp-web.js 1.6.0 &raquo; 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>4.<wbr>0</a>
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>6.<wbr>0</a>
</div>
</div>
</nav>
@@ -60,7 +60,7 @@ module.exports &#x3D; 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.3 on April 5, 2020.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.4 on May 24, 2020.
</p>
</div>
</footer>

View File

@@ -2,9 +2,9 @@
<html>
<head>
<meta name="generator" content="JSDoc 3.6.3">
<meta name="generator" content="JSDoc 3.6.4">
<meta charset="utf-8">
<title>whatsapp-web.js 1.4.0 &raquo; Source: structures/BusinessContact.js</title>
<title>whatsapp-web.js 1.6.0 &raquo; 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>4.<wbr>0</a>
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>6.<wbr>0</a>
</div>
</div>
</nav>
@@ -59,7 +59,7 @@ module.exports &#x3D; 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.3 on April 5, 2020.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.4 on May 24, 2020.
</p>
</div>
</footer>

View File

@@ -2,9 +2,9 @@
<html>
<head>
<meta name="generator" content="JSDoc 3.6.3">
<meta name="generator" content="JSDoc 3.6.4">
<meta charset="utf-8">
<title>whatsapp-web.js 1.4.0 &raquo; Source: structures/Chat.js</title>
<title>whatsapp-web.js 1.6.0 &raquo; 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>4.<wbr>0</a>
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>6.<wbr>0</a>
</div>
</div>
</nav>
@@ -143,6 +143,21 @@ class Chat extends Base {
return this.client.unarchiveChat(this.id._serialized);
}
/**
* Mutes this chat until a specified date
* @param {Date} unmuteDate Date at which the Chat will be unmuted
*/
async mute(unmuteDate) {
return this.client.muteChat(this.id._serialized, unmuteDate);
}
/**
* Unmutes this chat
*/
async unmute() {
return this.client.unmuteChat(this.id._serialized);
}
/**
* Loads chat messages, sorted from earliest to latest.
* @param {Object} searchOptions Options for searching messages. Right now only limit is supported.
@@ -215,7 +230,7 @@ module.exports &#x3D; 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.3 on April 5, 2020.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.4 on May 24, 2020.
</p>
</div>
</footer>

View File

@@ -2,9 +2,9 @@
<html>
<head>
<meta name="generator" content="JSDoc 3.6.3">
<meta name="generator" content="JSDoc 3.6.4">
<meta charset="utf-8">
<title>whatsapp-web.js 1.4.0 &raquo; Source: structures/ClientInfo.js</title>
<title>whatsapp-web.js 1.6.0 &raquo; 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>4.<wbr>0</a>
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>6.<wbr>0</a>
</div>
</div>
</nav>
@@ -89,7 +89,7 @@ module.exports &#x3D; 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.3 on April 5, 2020.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.4 on May 24, 2020.
</p>
</div>
</footer>

View File

@@ -2,9 +2,9 @@
<html>
<head>
<meta name="generator" content="JSDoc 3.6.3">
<meta name="generator" content="JSDoc 3.6.4">
<meta charset="utf-8">
<title>whatsapp-web.js 1.4.0 &raquo; Source: structures/Contact.js</title>
<title>whatsapp-web.js 1.6.0 &raquo; 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>4.<wbr>0</a>
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>6.<wbr>0</a>
</div>
</div>
</nav>
@@ -134,11 +134,7 @@ class Contact extends Base {
* @returns {Promise&amp;lt;string&gt;}
*/
async getProfilePicUrl() {
const profilePic &#x3D; await this.client.pupPage.evaluate((contactId) &#x3D;&gt; {
return window.Store.Wap.profilePicFind(contactId);
}, this.id._serialized);
return profilePic ? profilePic.eurl : undefined;
return await this.client.getProfilePicUrl(this.id._serialized);
}
}
@@ -153,7 +149,7 @@ module.exports &#x3D; Contact;</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.3 on April 5, 2020.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.4 on May 24, 2020.
</p>
</div>
</footer>

View File

@@ -2,9 +2,9 @@
<html>
<head>
<meta name="generator" content="JSDoc 3.6.3">
<meta name="generator" content="JSDoc 3.6.4">
<meta charset="utf-8">
<title>whatsapp-web.js 1.4.0 &raquo; Source: structures/GroupChat.js</title>
<title>whatsapp-web.js 1.6.0 &raquo; 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>4.<wbr>0</a>
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>6.<wbr>0</a>
</div>
</div>
</nav>
@@ -209,7 +209,7 @@ module.exports &#x3D; 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.3 on April 5, 2020.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.4 on May 24, 2020.
</p>
</div>
</footer>

View File

@@ -2,9 +2,9 @@
<html>
<head>
<meta name="generator" content="JSDoc 3.6.3">
<meta name="generator" content="JSDoc 3.6.4">
<meta charset="utf-8">
<title>whatsapp-web.js 1.4.0 &raquo; Source: structures/GroupNotification.js</title>
<title>whatsapp-web.js 1.6.0 &raquo; 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>4.<wbr>0</a>
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>6.<wbr>0</a>
</div>
</div>
</nav>
@@ -143,7 +143,7 @@ module.exports &#x3D; 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.3 on April 5, 2020.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.4 on May 24, 2020.
</p>
</div>
</footer>

View File

@@ -2,9 +2,9 @@
<html>
<head>
<meta name="generator" content="JSDoc 3.6.3">
<meta name="generator" content="JSDoc 3.6.4">
<meta charset="utf-8">
<title>whatsapp-web.js 1.4.0 &raquo; Source: structures/Location.js</title>
<title>whatsapp-web.js 1.6.0 &raquo; 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>4.<wbr>0</a>
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>6.<wbr>0</a>
</div>
</div>
</nav>
@@ -71,7 +71,7 @@ module.exports &#x3D; 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.3 on April 5, 2020.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.4 on May 24, 2020.
</p>
</div>
</footer>

View File

@@ -2,9 +2,9 @@
<html>
<head>
<meta name="generator" content="JSDoc 3.6.3">
<meta name="generator" content="JSDoc 3.6.4">
<meta charset="utf-8">
<title>whatsapp-web.js 1.4.0 &raquo; Source: structures/Message.js</title>
<title>whatsapp-web.js 1.6.0 &raquo; 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>4.<wbr>0</a>
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>6.<wbr>0</a>
</div>
</div>
</nav>
@@ -48,6 +48,13 @@ class Message extends Base {
}
_patch(data) {
/**
* MediaKey that represents the sticker &#x27;ID&#x27;
* @type {string}
*/
this.mediaKey &#x3D; data.mediaKey;
/**
* ID that represents the message
* @type {object}
@@ -280,7 +287,7 @@ module.exports &#x3D; 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.3 on April 5, 2020.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.4 on May 24, 2020.
</p>
</div>
</footer>

View File

@@ -2,9 +2,9 @@
<html>
<head>
<meta name="generator" content="JSDoc 3.6.3">
<meta name="generator" content="JSDoc 3.6.4">
<meta charset="utf-8">
<title>whatsapp-web.js 1.4.0 &raquo; Source: structures/MessageMedia.js</title>
<title>whatsapp-web.js 1.6.0 &raquo; 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>4.<wbr>0</a>
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>6.<wbr>0</a>
</div>
</div>
</nav>
@@ -31,6 +31,10 @@
<article>
<pre class="prettyprint linenums"><code>&#x27;use strict&#x27;;
const fs &#x3D; require(&#x27;fs&#x27;);
const path &#x3D; require(&#x27;path&#x27;);
const mime &#x3D; require(&#x27;mime&#x27;);
/**
* Media attached to a message
* @param {string} mimetype MIME type of the attachment
@@ -57,6 +61,19 @@ class MessageMedia {
*/
this.filename &#x3D; filename;
}
/**
* Creates a MessageMedia instance from a local file path
* @param {string} filePath
* @returns {MessageMedia}
*/
static fromFilePath(filePath) {
const b64data &#x3D; fs.readFileSync(filePath, {encoding: &#x27;base64&#x27;});
const mimetype &#x3D; mime.getType(filePath);
const filename &#x3D; path.basename(filePath);
return new MessageMedia(mimetype, b64data, filename);
}
}
module.exports &#x3D; MessageMedia;</code></pre>
@@ -69,7 +86,7 @@ module.exports &#x3D; MessageMedia;</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.3 on April 5, 2020.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.4 on May 24, 2020.
</p>
</div>
</footer>

View File

@@ -2,9 +2,9 @@
<html>
<head>
<meta name="generator" content="JSDoc 3.6.3">
<meta name="generator" content="JSDoc 3.6.4">
<meta charset="utf-8">
<title>whatsapp-web.js 1.4.0 &raquo; Source: structures/PrivateChat.js</title>
<title>whatsapp-web.js 1.6.0 &raquo; 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>4.<wbr>0</a>
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>6.<wbr>0</a>
</div>
</div>
</nav>
@@ -51,7 +51,7 @@ module.exports &#x3D; 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.3 on April 5, 2020.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.4 on May 24, 2020.
</p>
</div>
</footer>

View File

@@ -2,9 +2,9 @@
<html>
<head>
<meta name="generator" content="JSDoc 3.6.3">
<meta name="generator" content="JSDoc 3.6.4">
<meta charset="utf-8">
<title>whatsapp-web.js 1.4.0 &raquo; Source: structures/PrivateContact.js</title>
<title>whatsapp-web.js 1.6.0 &raquo; 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>4.<wbr>0</a>
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>6.<wbr>0</a>
</div>
</div>
</nav>
@@ -51,7 +51,7 @@ module.exports &#x3D; 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.3 on April 5, 2020.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.4 on May 24, 2020.
</p>
</div>
</footer>

View File

@@ -2,9 +2,9 @@
<html>
<head>
<meta name="generator" content="JSDoc 3.6.3">
<meta name="generator" content="JSDoc 3.6.4">
<meta charset="utf-8">
<title>whatsapp-web.js 1.4.0 &raquo; Source: util/Constants.js</title>
<title>whatsapp-web.js 1.6.0 &raquo; 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>4.<wbr>0</a>
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>6.<wbr>0</a>
</div>
</div>
</nav>
@@ -37,12 +37,15 @@ exports.UserAgent &#x3D; &#x27;Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) A
exports.DefaultOptions &#x3D; {
puppeteer: {
headless: true
headless: true,
defaultViewport: null
},
session: false,
qrTimeoutMs: 45000,
qrRefreshIntervalMs: 20000,
authTimeoutMs: 45000,
takeoverOnConflict: false,
takeoverTimeoutMs: 0
};
/**
@@ -171,7 +174,7 @@ exports.MessageAck &#x3D; {
<footer id="jsdoc-footer" class="jsdoc-footer">
<div id="jsdoc-footer-container">
<p>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.3 on April 5, 2020.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.4 on May 24, 2020.
</p>
</div>
</footer>

View File

@@ -2,9 +2,9 @@
<html>
<head>
<meta name="generator" content="JSDoc 3.6.3">
<meta name="generator" content="JSDoc 3.6.4">
<meta charset="utf-8">
<title>whatsapp-web.js 1.4.0 &raquo; Source: util/Util.js</title>
<title>whatsapp-web.js 1.6.0 &raquo; 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>4.<wbr>0</a>
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>6.<wbr>0</a>
</div>
</div>
</nav>
@@ -73,7 +73,7 @@ module.exports &#x3D; Util;</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.3 on April 5, 2020.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.4 on May 24, 2020.
</p>
</div>
</footer>

View File

@@ -169,6 +169,12 @@ client.on('message', async msg => {
} else if (msg.body === '!archive') {
const chat = await msg.getChat();
chat.archive();
} else if (msg.body === '!mute') {
const chat = await msg.getChat();
// mute the chat for 20 seconds
const unmuteDate = new Date();
unmuteDate.setSeconds(unmuteDate.getSeconds() + 20);
await chat.mute(unmuteDate);
} else if (msg.body === '!typing') {
const chat = await msg.getChat();
// simulates typing in the chat

1618
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{
"name": "whatsapp-web.js",
"version": "1.4.0",
"version": "1.6.0",
"description": "Library for interacting with the WhatsApp Web API ",
"main": "./index.js",
"scripts": {
@@ -27,12 +27,13 @@
"homepage": "https://github.com/pedroslopez/whatsapp-web.js#readme",
"dependencies": {
"@pedroslopez/moduleraid": "^4.1.0",
"jsqr": "^1.2.0",
"puppeteer": "^2.1.1"
"jsqr": "^1.3.1",
"mime": "^2.4.5",
"puppeteer": "^3.0.4"
},
"devDependencies": {
"eslint": "^6.8.0",
"jsdoc": "^3.6.3",
"jsdoc": "^3.6.4",
"jsdoc-baseline": "^0.1.5"
}
}

View File

@@ -63,8 +63,11 @@ class Client extends EventEmitter {
}, this.options.session);
}
await page.goto(WhatsWebURL);
await page.goto(WhatsWebURL, {
waitUntil: 'load',
timeout: 0,
});
const KEEP_PHONE_CONNECTED_IMG_SELECTOR = '[data-asset-intro-image="true"]';
if (this.options.session) {
@@ -286,6 +289,17 @@ class Client extends EventEmitter {
this.emit(Events.STATE_CHANGED, state);
const ACCEPTED_STATES = [WAState.CONNECTED, WAState.OPENING, WAState.PAIRING, WAState.TIMEOUT];
if(this.options.takeoverOnConflict) {
ACCEPTED_STATES.push(WAState.CONFLICT);
if(state === WAState.CONFLICT) {
setTimeout(() => {
this.pupPage.evaluate(() => window.Store.AppState.takeover());
}, this.options.takeoverTimeoutMs);
}
}
if (!ACCEPTED_STATES.includes(state)) {
/**
* Emitted when the client has been disconnected
@@ -298,9 +312,10 @@ class Client extends EventEmitter {
});
await page.exposeFunction('onBatteryStateChangedEvent', (state) => {
const { battery, plugged } = state;
if(battery === undefined) return;
/**
* Emitted when the battery percentage for the attached device changes
* @event Client#change_battery
@@ -335,6 +350,17 @@ class Client extends EventEmitter {
async destroy() {
await this.pupBrowser.close();
}
/**
* Returns the version of WhatsApp Web currently being run
* @returns Promise<string>
*/
async getWWebVersion() {
return await this.pupPage.evaluate(() => {
return window.Debug.VERSION;
});
}
/**
* Mark as seen for the Chat
* @param {string} chatId
@@ -348,6 +374,7 @@ class Client extends EventEmitter {
}, chatId);
return result;
}
/**
* Send a message to a specific chatId
* @param {string} chatId
@@ -357,6 +384,8 @@ class Client extends EventEmitter {
*/
async sendMessage(chatId, content, options = {}) {
let internalOptions = {
linkPreview: options.linkPreview === false ? undefined : true,
sendAudioAsVoice: options.sendAudioAsVoice,
caption: options.caption,
quotedMessageId: options.quotedMessageId,
mentionedJidList: Array.isArray(options.mentions) ? options.mentions.map(contact => contact.id._serialized) : []
@@ -370,38 +399,21 @@ class Client extends EventEmitter {
} else if (options.media instanceof MessageMedia) {
internalOptions.attachment = options.media;
internalOptions.caption = content;
content = '';
} else if (content instanceof Location) {
internalOptions.location = content;
content = '';
}
const newMessage = await this.pupPage.evaluate(async (chatId, message, options, sendSeen) => {
let chat = window.Store.Chat.get(chatId);
let msg;
if (!chat) { // The chat is not available in the previously chatted list
const chatWid = window.Store.WidFactory.createWid(chatId);
const chat = await window.Store.Chat.find(chatWid);
let newChatId = await window.WWebJS.getNumberId(chatId);
if (newChatId) {
//get the topmost chat object and assign the new chatId to it .
//This is just a workaround.May cause problem if there are no chats at all. Need to dig in and emulate how whatsapp web does
let chat = window.Store.Chat.models[0];
if (!chat)
throw 'Chat List empty! Need at least one open conversation with any of your contact';
let originalChatObjId = chat.id;
chat.id = newChatId;
msg = await window.WWebJS.sendMessage(chat, message, options);
chat.id = originalChatObjId; //replace the chat with its original id
}
}
else {
if(sendSeen) {
window.WWebJS.sendSeen(chatId);
}
msg = await window.WWebJS.sendMessage(chat, message, options, sendSeen);
if(sendSeen) {
window.WWebJS.sendSeen(chatId);
}
const msg = await window.WWebJS.sendMessage(chat, message, options, sendSeen);
return msg.serialize();
}, chatId, content, internalOptions, sendSeen);
@@ -490,6 +502,15 @@ class Client extends EventEmitter {
});
}
/**
* Marks the client as online
*/
async sendPresenceAvailable() {
return await this.pupPage.evaluate(() => {
return window.Store.Wap.sendPresenceAvailable();
});
}
/**
* Enables and returns the archive state of the Chat
* @returns {boolean}
@@ -514,6 +535,42 @@ class Client extends EventEmitter {
}, chatId);
}
/**
* Mutes the Chat until a specified date
* @param {string} chatId ID of the chat that will be muted
* @param {Date} unmuteDate Date when the chat will be unmuted
*/
async muteChat(chatId, unmuteDate) {
await this.pupPage.evaluate(async (chatId, timestamp) => {
let chat = await window.Store.Chat.get(chatId);
await chat.mute.mute(timestamp, !0);
}, chatId, unmuteDate.getTime() / 1000);
}
/**
* Unmutes the Chat
* @param {string} chatId ID of the chat that will be unmuted
*/
async unmuteChat(chatId) {
await this.pupPage.evaluate(async chatId => {
let chat = await window.Store.Chat.get(chatId);
await window.Store.Cmd.muteChat(chat, false);
}, chatId);
}
/**
* Returns the contact ID's profile picture URL, if privacy settings allow it
* @param {string} contactId the whatsapp user's ID
* @returns {Promise<string>}
*/
async getProfilePicUrl(contactId) {
const profilePic = await this.pupPage.evaluate((contactId) => {
return window.Store.Wap.profilePicFind(contactId);
}, contactId);
return profilePic ? profilePic.eurl : undefined;
}
/**
* Force reset of connection state for the client
*/

View File

@@ -112,6 +112,21 @@ class Chat extends Base {
return this.client.unarchiveChat(this.id._serialized);
}
/**
* Mutes this chat until a specified date
* @param {Date} unmuteDate Date at which the Chat will be unmuted
*/
async mute(unmuteDate) {
return this.client.muteChat(this.id._serialized, unmuteDate);
}
/**
* Unmutes this chat
*/
async unmute() {
return this.client.unmuteChat(this.id._serialized);
}
/**
* Loads chat messages, sorted from earliest to latest.
* @param {Object} searchOptions Options for searching messages. Right now only limit is supported.

View File

@@ -103,11 +103,7 @@ class Contact extends Base {
* @returns {Promise<string>}
*/
async getProfilePicUrl() {
const profilePic = await this.client.pupPage.evaluate((contactId) => {
return window.Store.Wap.profilePicFind(contactId);
}, this.id._serialized);
return profilePic ? profilePic.eurl : undefined;
return await this.client.getProfilePicUrl(this.id._serialized);
}
}

View File

@@ -17,6 +17,13 @@ class Message extends Base {
}
_patch(data) {
/**
* MediaKey that represents the sticker 'ID'
* @type {string}
*/
this.mediaKey = data.mediaKey;
/**
* ID that represents the message
* @type {object}

View File

@@ -1,5 +1,9 @@
'use strict';
const fs = require('fs');
const path = require('path');
const mime = require('mime');
/**
* Media attached to a message
* @param {string} mimetype MIME type of the attachment
@@ -26,6 +30,19 @@ class MessageMedia {
*/
this.filename = filename;
}
/**
* Creates a MessageMedia instance from a local file path
* @param {string} filePath
* @returns {MessageMedia}
*/
static fromFilePath(filePath) {
const b64data = fs.readFileSync(filePath, {encoding: 'base64'});
const mimetype = mime.getType(filePath);
const filename = path.basename(filePath);
return new MessageMedia(mimetype, b64data, filename);
}
}
module.exports = MessageMedia;

View File

@@ -6,12 +6,15 @@ exports.UserAgent = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit
exports.DefaultOptions = {
puppeteer: {
headless: true
headless: true,
defaultViewport: null
},
session: false,
qrTimeoutMs: 45000,
qrRefreshIntervalMs: 20000,
authTimeoutMs: 45000,
takeoverOnConflict: false,
takeoverTimeoutMs: 0
};
/**

View File

@@ -24,7 +24,8 @@ exports.ExposeStore = (moduleRaidStr) => {
window.Store.Cmd = window.mR.findModule('Cmd')[0].default;
window.Store.MediaTypes = window.mR.findModule('msgToMediaType')[0];
window.Store.UserConstructor = window.mR.findModule((module) => (module.default && module.default.prototype && module.default.prototype.isServer && module.default.prototype.isUser) ? module.default : null)[0].default;
window.Store.Validators = window.mR.findModule('findLinks')[0];
window.Store.WidFactory = window.mR.findModule('createWid')[0];
};
exports.LoadUtils = () => {
@@ -48,7 +49,8 @@ exports.LoadUtils = () => {
window.WWebJS.sendMessage = async (chat, content, options = {}) => {
let attOptions = {};
if (options.attachment) {
attOptions = await window.WWebJS.processMediaData(options.attachment);
attOptions = await window.WWebJS.processMediaData(options.attachment, options.sendAudioAsVoice);
content = attOptions.preview;
delete options.attachment;
}
@@ -76,6 +78,17 @@ exports.LoadUtils = () => {
delete options.location;
}
if (options.linkPreview) {
delete options.linkPreview;
const link = window.Store.Validators.findLink(content);
if (link) {
const preview = await window.Store.Wap.queryLinkPreview(link.url);
preview.preview = true;
preview.subtype = 'url';
options = { ...options, ...preview };
}
}
const newMsgId = new window.Store.MsgKey({
from: window.Store.Conn.me,
to: chat.id,
@@ -103,7 +116,7 @@ exports.LoadUtils = () => {
return window.Store.Msg.get(newMsgId._serialized);
};
window.WWebJS.processMediaData = async (mediaInfo) => {
window.WWebJS.processMediaData = async (mediaInfo, forceVoice) => {
const file = window.WWebJS.mediaInfoToFile(mediaInfo);
const mData = await window.Store.OpaqueData.default.createFromData(file, file.type);
const mediaPrep = window.Store.MediaPrep.prepRawMedia(mData, {});
@@ -115,6 +128,10 @@ exports.LoadUtils = () => {
isGif: mediaData.isGif
});
if(forceVoice && mediaData.type === 'audio') {
mediaData.type = 'ptt';
}
if (!(mediaData.mediaBlob instanceof window.Store.OpaqueData.default)) {
mediaData.mediaBlob = await window.Store.OpaqueData.default.createFromData(mediaData.mediaBlob, mediaData.mediaBlob.type);
}
@@ -123,7 +140,7 @@ exports.LoadUtils = () => {
mediaObject.consolidate(mediaData.toJSON());
mediaData.mediaBlob.autorelease();
const uploadedMedia = await window.Store.MediaUpload.uploadMedia(mediaData.mimetype, mediaObject, mediaType);
const uploadedMedia = await window.Store.MediaUpload.uploadMedia({ mimetype: mediaData.mimetype, mediaObject, mediaType });
if (!uploadedMedia) {
throw new Error('upload failed: media entry was not created');
}