mirror of
https://github.com/cheveguerra/whatsapp-web.js.git
synced 2026-04-18 03:29:14 +00:00
Compare commits
33 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4afff38713 | ||
|
|
b13dea0339 | ||
|
|
0ef6061d7e | ||
|
|
0465507009 | ||
|
|
2fd96e76b9 | ||
|
|
caab11cfe4 | ||
|
|
ebba1b9ab9 | ||
|
|
cdc00e934d | ||
|
|
795570a697 | ||
|
|
0465742ffb | ||
|
|
38976558f5 | ||
|
|
b895437458 | ||
|
|
0a061f982c | ||
|
|
63d11d3f84 | ||
|
|
5177a257cf | ||
|
|
f506c171c1 | ||
|
|
64e2cc48fc | ||
|
|
6c66ab2bef | ||
|
|
efc7018f9a | ||
|
|
5991b28b88 | ||
|
|
2894832b00 | ||
|
|
6cece4a006 | ||
|
|
f1e2f32988 | ||
|
|
f564e41781 | ||
|
|
e6015162c5 | ||
|
|
bc90ffcb19 | ||
|
|
2702757dce | ||
|
|
56171f957e | ||
|
|
204a1c79af | ||
|
|
168c84250e | ||
|
|
d96e8e5eb5 | ||
|
|
0cbb0373ad | ||
|
|
1f756142e4 |
@@ -11,8 +11,9 @@
|
||||
"SharedArrayBuffer": "readonly"
|
||||
},
|
||||
"parserOptions": {
|
||||
"ecmaVersion": 2018
|
||||
"ecmaVersion": 2020
|
||||
},
|
||||
"ignorePatterns": ["docs"],
|
||||
"rules": {
|
||||
"indent": [
|
||||
"error",
|
||||
|
||||
1
.github/ISSUE_TEMPLATE/bug_report.md
vendored
1
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@@ -2,7 +2,6 @@
|
||||
name: Bug report
|
||||
about: Is something not working as intended? Report it here.
|
||||
title: ''
|
||||
labels: bug
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
20
.github/workflows/lint.yml
vendored
20
.github/workflows/lint.yml
vendored
@@ -6,19 +6,15 @@ on:
|
||||
|
||||
jobs:
|
||||
eslint:
|
||||
name: eslint
|
||||
name: ESLint
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: install node v12
|
||||
uses: actions/setup-node@v1
|
||||
- uses: actions/checkout@v2
|
||||
- name: Install node v14
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 12
|
||||
- name: npm install
|
||||
node-version: '14'
|
||||
- name: Install dependencies
|
||||
run: npm install
|
||||
- name: eslint
|
||||
uses: icrawl/action-eslint@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
job-name: eslint
|
||||
- name: Run ESLint
|
||||
run: ./node_modules/.bin/eslint .
|
||||
|
||||
@@ -5,4 +5,10 @@ docs/*
|
||||
.jsdoc.json
|
||||
.editorconfig
|
||||
|
||||
logs
|
||||
*.log
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
|
||||
*session.json
|
||||
|
||||
@@ -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
|
||||
@@ -11,7 +11,7 @@ It uses Puppeteer to run a real instance of Whatsapp Web to avoid getting blocke
|
||||
|
||||
The module is now available on npm! `npm i whatsapp-web.js`
|
||||
|
||||
Please note that Node v10.18.1+ is required due to Puppeteer.
|
||||
Please note that Node v14+ is required.
|
||||
|
||||
## Example usage
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta name="generator" content="JSDoc 3.6.6">
|
||||
<meta name="generator" content="JSDoc 3.6.7">
|
||||
<meta charset="utf-8">
|
||||
<title>whatsapp-web.js 1.12.2 » Class: Base</title>
|
||||
<title>whatsapp-web.js 1.13.2 » 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>12.<wbr>2</a>
|
||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>13.<wbr>2</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.6 on February 9, 2021.
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on July 9, 2021.
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta name="generator" content="JSDoc 3.6.6">
|
||||
<meta name="generator" content="JSDoc 3.6.7">
|
||||
<meta charset="utf-8">
|
||||
<title>whatsapp-web.js 1.12.2 » Class: BusinessContact</title>
|
||||
<title>whatsapp-web.js 1.13.2 » 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>12.<wbr>2</a>
|
||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>13.<wbr>2</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
@@ -290,7 +290,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.6 on February 9, 2021.
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on July 9, 2021.
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta name="generator" content="JSDoc 3.6.6">
|
||||
<meta name="generator" content="JSDoc 3.6.7">
|
||||
<meta charset="utf-8">
|
||||
<title>whatsapp-web.js 1.12.2 » Class: Chat</title>
|
||||
<title>whatsapp-web.js 1.13.2 » 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>12.<wbr>2</a>
|
||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>13.<wbr>2</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
@@ -224,8 +224,7 @@
|
||||
<dl class="dl-compact">
|
||||
<dt>Returns</dt>
|
||||
<dd>
|
||||
<p><code>Promise containing Boolean</code>
|
||||
<p>result</p>
|
||||
<p><code>Promise containing Boolean</code> <p>result</p>
|
||||
</p>
|
||||
</dd>
|
||||
</dl>
|
||||
@@ -240,8 +239,7 @@
|
||||
<dl class="dl-compact">
|
||||
<dt>Returns</dt>
|
||||
<dd>
|
||||
<p><code>Promise containing Boolean</code>
|
||||
<p>result</p>
|
||||
<p><code>Promise containing Boolean</code> <p>result</p>
|
||||
</p>
|
||||
</dd>
|
||||
</dl>
|
||||
@@ -374,8 +372,7 @@
|
||||
<dl class="dl-compact">
|
||||
<dt>Returns</dt>
|
||||
<dd>
|
||||
<p><code>Promise containing boolean</code>
|
||||
<p>New pin state. Could be false if the max number of pinned chats was reached.</p>
|
||||
<p><code>Promise containing boolean</code> <p>New pin state. Could be false if the max number of pinned chats was reached.</p>
|
||||
</p>
|
||||
</dd>
|
||||
</dl>
|
||||
@@ -426,8 +423,7 @@
|
||||
<dl class="dl-compact">
|
||||
<dt>Returns</dt>
|
||||
<dd>
|
||||
<p><code>Promise containing <a href="Message.html">Message</a></code>
|
||||
<p>Message that was just sent</p>
|
||||
<p><code>Promise containing <a href="Message.html">Message</a></code> <p>Message that was just sent</p>
|
||||
</p>
|
||||
</dd>
|
||||
</dl>
|
||||
@@ -437,8 +433,7 @@
|
||||
<dl class="dl-compact">
|
||||
<dt>Returns</dt>
|
||||
<dd>
|
||||
<p><code>Promise containing Boolean</code>
|
||||
<p>result</p>
|
||||
<p><code>Promise containing Boolean</code> <p>result</p>
|
||||
</p>
|
||||
</dd>
|
||||
</dl>
|
||||
@@ -468,8 +463,7 @@
|
||||
<dl class="dl-compact">
|
||||
<dt>Returns</dt>
|
||||
<dd>
|
||||
<p><code>Promise containing boolean</code>
|
||||
<p>New pin state</p>
|
||||
<p><code>Promise containing boolean</code> <p>New pin state</p>
|
||||
</p>
|
||||
</dd>
|
||||
</dl>
|
||||
@@ -483,7 +477,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.6 on February 9, 2021.
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on July 9, 2021.
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
205
docs/Client.html
205
docs/Client.html
@@ -2,9 +2,9 @@
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta name="generator" content="JSDoc 3.6.6">
|
||||
<meta name="generator" content="JSDoc 3.6.7">
|
||||
<meta charset="utf-8">
|
||||
<title>whatsapp-web.js 1.12.2 » Class: Client</title>
|
||||
<title>whatsapp-web.js 1.13.2 » 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>12.<wbr>2</a>
|
||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>13.<wbr>2</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">Client</span></h1>
|
||||
<p class="source-link">Source: <a href="Client.js.html#source-line-51">Client.<wbr>js:51</a></p>
|
||||
<p class="source-link">Source: <a href="Client.js.html#source-line-52">Client.<wbr>js:52</a></p>
|
||||
<div class="symbol-classdesc">
|
||||
<p>Starting point for interacting with the WhatsApp Web API</p>
|
||||
</div>
|
||||
@@ -55,6 +55,9 @@
|
||||
<div class="summary-content">
|
||||
<div class="summary-column">
|
||||
<dl class="dl-summary-callout">
|
||||
<dt><a href="Client.html#acceptGroupV4Invite">acceptGroupV4Invite(inviteV4)</a></dt>
|
||||
<dd>
|
||||
</dd>
|
||||
<dt><a href="Client.html#acceptInvite">acceptInvite(inviteCode)</a></dt>
|
||||
<dd>
|
||||
</dd>
|
||||
@@ -125,14 +128,17 @@
|
||||
<dt><a href="Client.html#muteChat">muteChat(chatId, unmuteDate)</a></dt>
|
||||
<dd>
|
||||
</dd>
|
||||
<dt><a href="Client.html#pinChat">pinChat()</a></dt>
|
||||
<dd>
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
<div class="summary-column">
|
||||
<dl class="dl-summary-callout">
|
||||
<dt><a href="Client.html#pinChat">pinChat()</a></dt>
|
||||
<dt><a href="Client.html#resetState">resetState()</a></dt>
|
||||
<dd>
|
||||
</dd>
|
||||
<dt><a href="Client.html#resetState">resetState()</a></dt>
|
||||
<dt><a href="Client.html#searchMessages">searchMessages(query[, options])</a></dt>
|
||||
<dd>
|
||||
</dd>
|
||||
<dt><a href="Client.html#sendMessage">sendMessage(chatId, content[, options])</a></dt>
|
||||
@@ -458,6 +464,20 @@
|
||||
<p>Ffmpeg path to use when formating videos to webp while sending stickers</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>bypassCSP</p>
|
||||
</td>
|
||||
<td>
|
||||
<p> </p>
|
||||
</td>
|
||||
<td>
|
||||
<p> </p>
|
||||
</td>
|
||||
<td>
|
||||
<p>Sets bypassing of page's Content-Security-Policy.</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</td>
|
||||
@@ -498,6 +518,44 @@
|
||||
</section>
|
||||
<h2>Methods</h2>
|
||||
<section>
|
||||
<div class="symbol-detail-labels"><span class="label label-async">async</span></div>
|
||||
<h3 id="acceptGroupV4Invite"><span class="symbol-name">acceptGroupV4Invite</span><span class="signature"><span class="signature-params">(inviteV4)</span> → <span class="signature-returns"> Promise containing Object</span></span></h3>
|
||||
<p>Accepts a private invitation to join a group</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>inviteV4</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>object</p>
|
||||
</td>
|
||||
<td>
|
||||
<p> </p>
|
||||
</td>
|
||||
<td>
|
||||
<p>Invite V4 Info</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
<dl class="dl-compact">
|
||||
<dt>Returns</dt>
|
||||
<dd>
|
||||
<p><code>Promise containing Object</code> </p>
|
||||
</dd>
|
||||
</dl>
|
||||
<div class="symbol-detail-labels"><span class="label label-async">async</span></div>
|
||||
<h3 id="acceptInvite"><span class="symbol-name">acceptInvite</span><span class="signature"><span class="signature-params">(inviteCode)</span> → <span class="signature-returns"> Promise containing string</span></span></h3>
|
||||
<p>Accepts an invitation to join a group</p>
|
||||
@@ -533,8 +591,7 @@
|
||||
<dl class="dl-compact">
|
||||
<dt>Returns</dt>
|
||||
<dd>
|
||||
<p><code>Promise containing string</code>
|
||||
<p>Id of the joined Chat</p>
|
||||
<p><code>Promise containing string</code> <p>Id of the joined Chat</p>
|
||||
</p>
|
||||
</dd>
|
||||
</dl>
|
||||
@@ -596,18 +653,15 @@
|
||||
<dl class="dl-compact">
|
||||
<dt>Returns</dt>
|
||||
<dd>
|
||||
<p><code>Object</code>
|
||||
<p>createRes</p>
|
||||
<p><code>Object</code> <p>createRes</p>
|
||||
</p>
|
||||
</dd>
|
||||
<dd>
|
||||
<p><code>string</code>
|
||||
<p>createRes.gid - ID for the group that was just created</p>
|
||||
<p><code>string</code> <p>createRes.gid - ID for the group that was just created</p>
|
||||
</p>
|
||||
</dd>
|
||||
<dd>
|
||||
<p><code>Object with string properties</code>
|
||||
<p>createRes.missingParticipants - participants that were not added to the group. Keys represent the ID for participant that was not added and its value is a status code that represents the reason why participant could not be added. This is usually 403 if the user's privacy settings don't allow you to add them to groups.</p>
|
||||
<p><code>Object with string properties</code> <p>createRes.missingParticipants - participants that were not added to the group. Keys represent the ID for participant that was not added and its value is a status code that represents the reason why participant could not be added. This is usually 403 if the user's privacy settings don't allow you to add them to groups.</p>
|
||||
</p>
|
||||
</dd>
|
||||
</dl>
|
||||
@@ -816,8 +870,7 @@
|
||||
<dl class="dl-compact">
|
||||
<dt>Returns</dt>
|
||||
<dd>
|
||||
<p><code>Promise containing object</code>
|
||||
<p>Invite information</p>
|
||||
<p><code>Promise containing object</code> <p>Invite information</p>
|
||||
</p>
|
||||
</dd>
|
||||
</dl>
|
||||
@@ -1098,8 +1151,7 @@
|
||||
<dl class="dl-compact">
|
||||
<dt>Returns</dt>
|
||||
<dd>
|
||||
<p><code>Promise containing boolean</code>
|
||||
<p>New pin state. Could be false if the max number of pinned chats was reached.</p>
|
||||
<p><code>Promise containing boolean</code> <p>New pin state. Could be false if the max number of pinned chats was reached.</p>
|
||||
</p>
|
||||
</dd>
|
||||
</dl>
|
||||
@@ -1109,6 +1161,108 @@
|
||||
<dl class="dl-compact">
|
||||
</dl>
|
||||
<div class="symbol-detail-labels"><span class="label label-async">async</span></div>
|
||||
<h3 id="searchMessages"><span class="symbol-name">searchMessages</span><span class="signature"><span class="signature-params">(query[, options])</span> → <span class="signature-returns"> Promise containing Array of <a href="Message.html">Message</a></span></span></h3>
|
||||
<p>Searches for messages</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>query</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>string</p>
|
||||
</td>
|
||||
<td>
|
||||
<p> </p>
|
||||
</td>
|
||||
<td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>options</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>Object</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>Yes</p>
|
||||
</td>
|
||||
<td>
|
||||
<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>page</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>number</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>Yes</p>
|
||||
</td>
|
||||
<td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>limit</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>number</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>Yes</p>
|
||||
</td>
|
||||
<td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>chatId</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>string</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>Yes</p>
|
||||
</td>
|
||||
<td>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
<dl class="dl-compact">
|
||||
<dt>Returns</dt>
|
||||
<dd>
|
||||
<p><code>Promise containing Array of <a href="Message.html">Message</a></code> </p>
|
||||
</dd>
|
||||
</dl>
|
||||
<div class="symbol-detail-labels"><span class="label label-async">async</span></div>
|
||||
<h3 id="sendMessage"><span class="symbol-name">sendMessage</span><span class="signature"><span class="signature-params">(chatId, content[, options])</span> → <span class="signature-returns"> Promise containing <a href="Message.html">Message</a></span></span></h3>
|
||||
<p>Send a message to a specific chatId</p>
|
||||
<section>
|
||||
@@ -1169,8 +1323,7 @@
|
||||
<dl class="dl-compact">
|
||||
<dt>Returns</dt>
|
||||
<dd>
|
||||
<p><code>Promise containing <a href="Message.html">Message</a></code>
|
||||
<p>Message that was just sent</p>
|
||||
<p><code>Promise containing <a href="Message.html">Message</a></code> <p>Message that was just sent</p>
|
||||
</p>
|
||||
</dd>
|
||||
</dl>
|
||||
@@ -1213,8 +1366,7 @@
|
||||
<dl class="dl-compact">
|
||||
<dt>Returns</dt>
|
||||
<dd>
|
||||
<p><code>Promise containing boolean</code>
|
||||
<p>result</p>
|
||||
<p><code>Promise containing boolean</code> <p>result</p>
|
||||
</p>
|
||||
</dd>
|
||||
</dl>
|
||||
@@ -1336,8 +1488,7 @@
|
||||
<dl class="dl-compact">
|
||||
<dt>Returns</dt>
|
||||
<dd>
|
||||
<p><code>Promise containing boolean</code>
|
||||
<p>New pin state</p>
|
||||
<p><code>Promise containing boolean</code> <p>New pin state</p>
|
||||
</p>
|
||||
</dd>
|
||||
</dl>
|
||||
@@ -1599,13 +1750,13 @@
|
||||
<p>reason</p>
|
||||
</td>
|
||||
<td>
|
||||
<p><a href="global.html#WAState">WAState</a></p>
|
||||
<p>(<a href="global.html#WAState">WAState</a> or "NAVIGATION")</p>
|
||||
</td>
|
||||
<td>
|
||||
<p> </p>
|
||||
</td>
|
||||
<td>
|
||||
<p>state that caused the disconnect</p>
|
||||
<p>reason that caused the disconnect</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
@@ -1987,7 +2138,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.6 on February 9, 2021.
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on July 9, 2021.
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta name="generator" content="JSDoc 3.6.6">
|
||||
<meta name="generator" content="JSDoc 3.6.7">
|
||||
<meta charset="utf-8">
|
||||
<title>whatsapp-web.js 1.12.2 » Source: Client.js</title>
|
||||
<title>whatsapp-web.js 1.13.2 » 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>12.<wbr>2</a>
|
||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>13.<wbr>2</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
@@ -61,6 +61,7 @@ const { ClientInfo, Message, MessageMedia, Contact, Location, GroupNotification
|
||||
* @param {number} options.takeoverTimeoutMs - How much time to wait before taking over the session
|
||||
* @param {string} options.userAgent - User agent to use in puppeteer
|
||||
* @param {string} options.ffmpegPath - Ffmpeg path to use when formating videos to webp while sending stickers
|
||||
* @param {boolean} options.bypassCSP - Sets bypassing of page's Content-Security-Policy.
|
||||
*
|
||||
* @fires Client#qr
|
||||
* @fires Client#authenticated
|
||||
@@ -113,6 +114,10 @@ class Client extends EventEmitter {
|
||||
}, this.options.session);
|
||||
}
|
||||
|
||||
if(this.options.bypassCSP) {
|
||||
await page.setBypassCSP(true);
|
||||
}
|
||||
|
||||
await page.goto(WhatsWebURL, {
|
||||
waitUntil: 'load',
|
||||
timeout: 0,
|
||||
@@ -147,18 +152,18 @@ class Client extends EventEmitter {
|
||||
} else {
|
||||
const getQrCode = async () => {
|
||||
// Check if retry button is present
|
||||
var QR_RETRY_SELECTOR = 'div[data-ref] > span > div';
|
||||
var QR_RETRY_SELECTOR = 'div[data-ref] > span > button';
|
||||
var qrRetry = await page.$(QR_RETRY_SELECTOR);
|
||||
if (qrRetry) {
|
||||
await qrRetry.click();
|
||||
}
|
||||
|
||||
// Wait for QR Code
|
||||
|
||||
const QR_CANVAS_SELECTOR = 'canvas';
|
||||
await page.waitForSelector(QR_CANVAS_SELECTOR, { timeout: this.options.qrTimeoutMs });
|
||||
const qrImgData = await page.$eval(QR_CANVAS_SELECTOR, canvas => [].slice.call(canvas.getContext('2d').getImageData(0, 0, 264, 264).data));
|
||||
const qr = jsQR(qrImgData, 264, 264).data;
|
||||
|
||||
/**
|
||||
* Emitted when the QR code is received
|
||||
* @event Client#qr
|
||||
@@ -366,7 +371,7 @@ class Client extends EventEmitter {
|
||||
/**
|
||||
* Emitted when the client has been disconnected
|
||||
* @event Client#disconnected
|
||||
* @param {WAState} reason state that caused the disconnect
|
||||
* @param {WAState|"NAVIGATION"} reason reason that caused the disconnect
|
||||
*/
|
||||
this.emit(Events.DISCONNECTED, state);
|
||||
this.destroy();
|
||||
@@ -404,6 +409,13 @@ class Client extends EventEmitter {
|
||||
* @event Client#ready
|
||||
*/
|
||||
this.emit(Events.READY);
|
||||
|
||||
// Disconnect when navigating away
|
||||
// Because WhatsApp Web now reloads when logging out from the device, this also covers that case
|
||||
this.pupPage.on('framenavigated', async () => {
|
||||
this.emit(Events.DISCONNECTED, 'NAVIGATION');
|
||||
await this.destroy();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -454,6 +466,7 @@ class Client extends EventEmitter {
|
||||
* @typedef {Object} MessageSendOptions
|
||||
* @property {boolean} [linkPreview=true] - Show links preview
|
||||
* @property {boolean} [sendAudioAsVoice=false] - Send audio as voice message
|
||||
* @property {boolean} [sendVideoAsGif=false] - Send video as gif
|
||||
* @property {boolean} [sendMediaAsSticker=false] - Send media as a sticker
|
||||
* @property {boolean} [sendMediaAsDocument=false] - Send media as a document
|
||||
* @property {boolean} [parseVCards=true] - Automatically parse vCards and send them as contacts
|
||||
@@ -461,7 +474,10 @@ class Client extends EventEmitter {
|
||||
* @property {string} [quotedMessageId] - Id of the message that is being quoted (or replied to)
|
||||
* @property {Contact[]} [mentions] - Contacts that are being mentioned in the message
|
||||
* @property {boolean} [sendSeen=true] - Mark the conversation as seen after sending the message
|
||||
* @property {boolean} [media] - Media to be sent
|
||||
* @property {string} [stickerAuthor=undefined] - Sets the author of the sticker, (if sendMediaAsSticker is true).
|
||||
* @property {string} [stickerName=undefined] - Sets the name of the sticker, (if sendMediaAsSticker is true).
|
||||
* @property {string[]} [stickerCategories=undefined] - Sets the categories of the sticker, (if sendMediaAsSticker is true). Provide emoji char array, can be null.
|
||||
* @property {MessageMedia} [media] - Media to be sent
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -476,12 +492,14 @@ class Client extends EventEmitter {
|
||||
let internalOptions = {
|
||||
linkPreview: options.linkPreview === false ? undefined : true,
|
||||
sendAudioAsVoice: options.sendAudioAsVoice,
|
||||
sendVideoAsGif: options.sendVideoAsGif,
|
||||
sendMediaAsSticker: options.sendMediaAsSticker,
|
||||
sendMediaAsDocument: options.sendMediaAsDocument,
|
||||
caption: options.caption,
|
||||
quotedMessageId: options.quotedMessageId,
|
||||
parseVCards: options.parseVCards === false ? false : true,
|
||||
mentionedJidList: Array.isArray(options.mentions) ? options.mentions.map(contact => contact.id._serialized) : []
|
||||
mentionedJidList: Array.isArray(options.mentions) ? options.mentions.map(contact => contact.id._serialized) : [],
|
||||
...options.extra
|
||||
};
|
||||
|
||||
const sendSeen = typeof options.sendSeen === 'undefined' ? true : options.sendSeen;
|
||||
@@ -505,7 +523,12 @@ class Client extends EventEmitter {
|
||||
}
|
||||
|
||||
if (internalOptions.sendMediaAsSticker &amp;&amp; internalOptions.attachment) {
|
||||
internalOptions.attachment = await Util.formatToWebpSticker(internalOptions.attachment);
|
||||
internalOptions.attachment =
|
||||
await Util.formatToWebpSticker(internalOptions.attachment, {
|
||||
name: options.stickerName,
|
||||
author: options.stickerAuthor,
|
||||
categories: options.stickerCategories
|
||||
});
|
||||
}
|
||||
|
||||
const newMessage = await this.pupPage.evaluate(async (chatId, message, options, sendSeen) => {
|
||||
@@ -523,6 +546,24 @@ class Client extends EventEmitter {
|
||||
return new Message(this, newMessage);
|
||||
}
|
||||
|
||||
/**
|
||||
* Searches for messages
|
||||
* @param {string} query
|
||||
* @param {Object} [options]
|
||||
* @param {number} [options.page]
|
||||
* @param {number} [options.limit]
|
||||
* @param {string} [options.chatId]
|
||||
* @returns {Promise&lt;Message[]>}
|
||||
*/
|
||||
async searchMessages(query, options = {}) {
|
||||
const messages = await this.pupPage.evaluate(async (query, page, count, remote) => {
|
||||
const { messages } = await window.Store.Msg.search(query, page, count, remote);
|
||||
return messages.map(msg => window.WWebJS.getMessageModel(msg));
|
||||
}, query, options.page, options.limit, options.chatId);
|
||||
|
||||
return messages.map(msg => new Message(this, msg));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all current chat instances
|
||||
* @returns {Promise&lt;Array&lt;Chat>>}
|
||||
@@ -597,6 +638,20 @@ class Client extends EventEmitter {
|
||||
return chatId._serialized;
|
||||
}
|
||||
|
||||
/**
|
||||
* Accepts a private invitation to join a group
|
||||
* @param {object} inviteV4 Invite V4 Info
|
||||
* @returns {Promise&lt;Object>}
|
||||
*/
|
||||
async acceptGroupV4Invite(inviteInfo) {
|
||||
if(!inviteInfo.inviteCode) throw 'Invalid invite code, try passing the message.inviteV4 object';
|
||||
if (inviteInfo.inviteCodeExp == 0) throw 'Expired invite code';
|
||||
return await this.pupPage.evaluate(async inviteInfo => {
|
||||
let { groupId, fromId, inviteCode, inviteCodeExp, toId } = inviteInfo;
|
||||
return await window.Store.Wap.acceptGroupV4Invite(groupId, fromId, inviteCode, String(inviteCodeExp), toId);
|
||||
}, inviteInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the current user's status message
|
||||
* @param {string} status New status message
|
||||
@@ -893,7 +948,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.6 on February 9, 2021.
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on July 9, 2021.
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta name="generator" content="JSDoc 3.6.6">
|
||||
<meta name="generator" content="JSDoc 3.6.7">
|
||||
<meta charset="utf-8">
|
||||
<title>whatsapp-web.js 1.12.2 » Class: ClientInfo</title>
|
||||
<title>whatsapp-web.js 1.13.2 » 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>12.<wbr>2</a>
|
||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>13.<wbr>2</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
@@ -213,18 +213,15 @@
|
||||
<dl class="dl-compact">
|
||||
<dt>Returns</dt>
|
||||
<dd>
|
||||
<p><code>object</code>
|
||||
<p>batteryStatus</p>
|
||||
<p><code>object</code> <p>batteryStatus</p>
|
||||
</p>
|
||||
</dd>
|
||||
<dd>
|
||||
<p><code>number</code>
|
||||
<p>batteryStatus.battery - The current battery percentage</p>
|
||||
<p><code>number</code> <p>batteryStatus.battery - The current battery percentage</p>
|
||||
</p>
|
||||
</dd>
|
||||
<dd>
|
||||
<p><code>boolean</code>
|
||||
<p>batteryStatus.plugged - Indicates if the phone is plugged in (true) or not (false)</p>
|
||||
<p><code>boolean</code> <p>batteryStatus.plugged - Indicates if the phone is plugged in (true) or not (false)</p>
|
||||
</p>
|
||||
</dd>
|
||||
</dl>
|
||||
@@ -238,7 +235,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.6 on February 9, 2021.
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on July 9, 2021.
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta name="generator" content="JSDoc 3.6.6">
|
||||
<meta name="generator" content="JSDoc 3.6.7">
|
||||
<meta charset="utf-8">
|
||||
<title>whatsapp-web.js 1.12.2 » Class: Contact</title>
|
||||
<title>whatsapp-web.js 1.13.2 » 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>12.<wbr>2</a>
|
||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>13.<wbr>2</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
@@ -257,7 +257,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.6 on February 9, 2021.
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on July 9, 2021.
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta name="generator" content="JSDoc 3.6.6">
|
||||
<meta name="generator" content="JSDoc 3.6.7">
|
||||
<meta charset="utf-8">
|
||||
<title>whatsapp-web.js 1.12.2 » Class: GroupChat</title>
|
||||
<title>whatsapp-web.js 1.13.2 » 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>12.<wbr>2</a>
|
||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>13.<wbr>2</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
@@ -405,8 +405,7 @@
|
||||
<dl class="dl-compact">
|
||||
<dt>Returns</dt>
|
||||
<dd>
|
||||
<p><code>Promise containing {status: number}</code>
|
||||
<p>Object with status code indicating if the operation was successful</p>
|
||||
<p><code>Promise containing {status: number}</code> <p>Object with status code indicating if the operation was successful</p>
|
||||
</p>
|
||||
</dd>
|
||||
</dl>
|
||||
@@ -491,8 +490,7 @@
|
||||
<dl class="dl-compact">
|
||||
<dt>Returns</dt>
|
||||
<dd>
|
||||
<p><code>Promise containing string</code>
|
||||
<p>Group's invite code</p>
|
||||
<p><code>Promise containing string</code> <p>Group's invite code</p>
|
||||
</p>
|
||||
</dd>
|
||||
</dl>
|
||||
@@ -602,8 +600,7 @@
|
||||
<dl class="dl-compact">
|
||||
<dt>Returns</dt>
|
||||
<dd>
|
||||
<p><code>Promise containing {status: number}</code>
|
||||
<p>Object with status code indicating if the operation was successful</p>
|
||||
<p><code>Promise containing {status: number}</code> <p>Object with status code indicating if the operation was successful</p>
|
||||
</p>
|
||||
</dd>
|
||||
</dl>
|
||||
@@ -803,8 +800,7 @@
|
||||
<dl class="dl-compact">
|
||||
<dt>Returns</dt>
|
||||
<dd>
|
||||
<p><code>Promise containing boolean</code>
|
||||
<p>Returns true if the setting was properly updated. This can return false if the user does not have the necessary permissions.</p>
|
||||
<p><code>Promise containing boolean</code> <p>Returns true if the setting was properly updated. This can return false if the user does not have the necessary permissions.</p>
|
||||
</p>
|
||||
</dd>
|
||||
</dl>
|
||||
@@ -844,8 +840,7 @@
|
||||
<dl class="dl-compact">
|
||||
<dt>Returns</dt>
|
||||
<dd>
|
||||
<p><code>Promise containing boolean</code>
|
||||
<p>Returns true if the setting was properly updated. This can return false if the user does not have the necessary permissions.</p>
|
||||
<p><code>Promise containing boolean</code> <p>Returns true if the setting was properly updated. This can return false if the user does not have the necessary permissions.</p>
|
||||
</p>
|
||||
</dd>
|
||||
</dl>
|
||||
@@ -921,7 +916,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.6 on February 9, 2021.
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on July 9, 2021.
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta name="generator" content="JSDoc 3.6.6">
|
||||
<meta name="generator" content="JSDoc 3.6.7">
|
||||
<meta charset="utf-8">
|
||||
<title>whatsapp-web.js 1.12.2 » Class: GroupNotification</title>
|
||||
<title>whatsapp-web.js 1.13.2 » 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>12.<wbr>2</a>
|
||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>13.<wbr>2</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.6 on February 9, 2021.
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on July 9, 2021.
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta name="generator" content="JSDoc 3.6.6">
|
||||
<meta name="generator" content="JSDoc 3.6.7">
|
||||
<meta charset="utf-8">
|
||||
<title>whatsapp-web.js 1.12.2 » Class: InterfaceController</title>
|
||||
<title>whatsapp-web.js 1.13.2 » 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>12.<wbr>2</a>
|
||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>13.<wbr>2</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
@@ -39,16 +39,28 @@
|
||||
<div class="summary-content">
|
||||
<div class="summary-column">
|
||||
<dl class="dl-summary-callout">
|
||||
<dt><a href="InterfaceController.html#checkFeatureStatus">checkFeatureStatus(feature)</a></dt>
|
||||
<dd>
|
||||
</dd>
|
||||
<dt><a href="InterfaceController.html#closeRightDrawer">closeRightDrawer()</a></dt>
|
||||
<dd>
|
||||
</dd>
|
||||
<dt><a href="InterfaceController.html#openChatDrawer">openChatDrawer(chatId)</a></dt>
|
||||
<dt><a href="InterfaceController.html#disableFeatures">disableFeatures(features)</a></dt>
|
||||
<dd>
|
||||
</dd>
|
||||
<dt><a href="InterfaceController.html#enableFeatures">enableFeatures(features)</a></dt>
|
||||
<dd>
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
<div class="summary-column">
|
||||
<dl class="dl-summary-callout">
|
||||
<dt><a href="InterfaceController.html#getFeatures">getFeatures()</a></dt>
|
||||
<dd>
|
||||
</dd>
|
||||
<dt><a href="InterfaceController.html#openChatDrawer">openChatDrawer(chatId)</a></dt>
|
||||
<dd>
|
||||
</dd>
|
||||
<dt><a href="InterfaceController.html#openChatSearch">openChatSearch(chatId)</a></dt>
|
||||
<dd>
|
||||
</dd>
|
||||
@@ -78,12 +90,119 @@
|
||||
<section>
|
||||
<h2>Methods</h2>
|
||||
<section>
|
||||
<div class="symbol-detail-labels"><span class="label label-async">async</span></div>
|
||||
<h3 id="checkFeatureStatus"><span class="symbol-name">checkFeatureStatus</span><span class="signature"><span class="signature-params">(feature)</span></span></h3>
|
||||
<p>Check if Feature is enabled</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>feature</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>string</p>
|
||||
</td>
|
||||
<td>
|
||||
<p> </p>
|
||||
</td>
|
||||
<td>
|
||||
<p>status to check</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="closeRightDrawer"><span class="symbol-name">closeRightDrawer</span><span class="signature"><span class="signature-params">()</span></span></h3>
|
||||
<p>Closes the Right Drawer</p>
|
||||
<dl class="dl-compact">
|
||||
</dl>
|
||||
<div class="symbol-detail-labels"><span class="label label-async">async</span></div>
|
||||
<h3 id="disableFeatures"><span class="symbol-name">disableFeatures</span><span class="signature"><span class="signature-params">(features)</span></span></h3>
|
||||
<p>Disable Features</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>features</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>Array of string</p>
|
||||
</td>
|
||||
<td>
|
||||
<p> </p>
|
||||
</td>
|
||||
<td>
|
||||
<p>to be disabled</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="enableFeatures"><span class="symbol-name">enableFeatures</span><span class="signature"><span class="signature-params">(features)</span></span></h3>
|
||||
<p>Enable Features</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>features</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>Array of string</p>
|
||||
</td>
|
||||
<td>
|
||||
<p> </p>
|
||||
</td>
|
||||
<td>
|
||||
<p>to be enabled</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="getFeatures"><span class="symbol-name">getFeatures</span><span class="signature"><span class="signature-params">()</span></span></h3>
|
||||
<p>Get all Features</p>
|
||||
<dl class="dl-compact">
|
||||
</dl>
|
||||
<div class="symbol-detail-labels"><span class="label label-async">async</span></div>
|
||||
<h3 id="openChatDrawer"><span class="symbol-name">openChatDrawer</span><span class="signature"><span class="signature-params">(chatId)</span></span></h3>
|
||||
<p>Opens the Chat Drawer</p>
|
||||
<section>
|
||||
@@ -263,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.6 on February 9, 2021.
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on July 9, 2021.
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta name="generator" content="JSDoc 3.6.6">
|
||||
<meta name="generator" content="JSDoc 3.6.7">
|
||||
<meta charset="utf-8">
|
||||
<title>whatsapp-web.js 1.12.2 » Class: Label</title>
|
||||
<title>whatsapp-web.js 1.13.2 » 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>12.<wbr>2</a>
|
||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>13.<wbr>2</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.6 on February 9, 2021.
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on July 9, 2021.
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta name="generator" content="JSDoc 3.6.6">
|
||||
<meta name="generator" content="JSDoc 3.6.7">
|
||||
<meta charset="utf-8">
|
||||
<title>whatsapp-web.js 1.12.2 » Class: Location</title>
|
||||
<title>whatsapp-web.js 1.13.2 » 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>12.<wbr>2</a>
|
||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>13.<wbr>2</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.6 on February 9, 2021.
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on July 9, 2021.
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta name="generator" content="JSDoc 3.6.6">
|
||||
<meta name="generator" content="JSDoc 3.6.7">
|
||||
<meta charset="utf-8">
|
||||
<title>whatsapp-web.js 1.12.2 » Class: Message</title>
|
||||
<title>whatsapp-web.js 1.13.2 » 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>12.<wbr>2</a>
|
||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>13.<wbr>2</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">Message</span></h1>
|
||||
<p class="source-link">Source: <a href="structures_Message.js.html#source-line-12">structures/<wbr>Message.<wbr>js:12</a></p>
|
||||
<p class="source-link">Source: <a href="structures_Message.js.html#source-line-13">structures/<wbr>Message.<wbr>js:13</a></p>
|
||||
<div class="symbol-classdesc">
|
||||
<p>Represents a Message on WhatsApp</p>
|
||||
</div>
|
||||
@@ -51,6 +51,9 @@
|
||||
<dt><a href="Message.html#broadcast">broadcast</a></dt>
|
||||
<dd>
|
||||
</dd>
|
||||
<dt><a href="Message.html#deviceType">deviceType</a></dt>
|
||||
<dd>
|
||||
</dd>
|
||||
<dt><a href="Message.html#from">from</a></dt>
|
||||
<dd>
|
||||
</dd>
|
||||
@@ -70,6 +73,9 @@
|
||||
<dt><a href="Message.html#id">id</a></dt>
|
||||
<dd>
|
||||
</dd>
|
||||
<dt><a href="Message.html#inviteV4">inviteV4</a></dt>
|
||||
<dd>
|
||||
</dd>
|
||||
<dt><a href="Message.html#isForwarded">isForwarded</a></dt>
|
||||
<dd>
|
||||
</dd>
|
||||
@@ -95,12 +101,18 @@
|
||||
<dt><a href="Message.html#mentionedIds">mentionedIds</a></dt>
|
||||
<dd>
|
||||
</dd>
|
||||
<dt><a href="Message.html#orderId">orderId</a></dt>
|
||||
<dd>
|
||||
</dd>
|
||||
<dt><a href="Message.html#timestamp">timestamp</a></dt>
|
||||
<dd>
|
||||
</dd>
|
||||
<dt><a href="Message.html#to">to</a></dt>
|
||||
<dd>
|
||||
</dd>
|
||||
<dt><a href="Message.html#token">token</a></dt>
|
||||
<dd>
|
||||
</dd>
|
||||
<dt><a href="Message.html#type">type</a></dt>
|
||||
<dd>
|
||||
</dd>
|
||||
@@ -116,6 +128,9 @@
|
||||
<div class="summary-content">
|
||||
<div class="summary-column">
|
||||
<dl class="dl-summary-callout">
|
||||
<dt><a href="Message.html#acceptGroupV4Invite">acceptGroupV4Invite()</a></dt>
|
||||
<dd>
|
||||
</dd>
|
||||
<dt><a href="Message.html#delete">delete(everyone)</a></dt>
|
||||
<dd>
|
||||
</dd>
|
||||
@@ -141,6 +156,9 @@
|
||||
<dt><a href="Message.html#getMentions">getMentions()</a></dt>
|
||||
<dd>
|
||||
</dd>
|
||||
<dt><a href="Message.html#getOrder">getOrder()</a></dt>
|
||||
<dd>
|
||||
</dd>
|
||||
<dt><a href="Message.html#getQuotedMessage">getQuotedMessage()</a></dt>
|
||||
<dd>
|
||||
</dd>
|
||||
@@ -192,6 +210,11 @@
|
||||
<p>Indicates if the message was a broadcast</p>
|
||||
<dl class="dl-compact">
|
||||
</dl>
|
||||
<h3 id="deviceType"><span class="symbol-name">deviceType</span><small class="property-type">
|
||||
string</small></h3>
|
||||
<p>String that represents from which device type the message was sent</p>
|
||||
<dl class="dl-compact">
|
||||
</dl>
|
||||
<h3 id="from"><span class="symbol-name">from</span><small class="property-type">
|
||||
string</small></h3>
|
||||
<p>ID for the Chat that this message was sent to, except if the message was sent by the current user.</p>
|
||||
@@ -217,6 +240,11 @@
|
||||
<p>ID that represents the message</p>
|
||||
<dl class="dl-compact">
|
||||
</dl>
|
||||
<h3 id="inviteV4"><span class="symbol-name">inviteV4</span><small class="property-type">
|
||||
object</small></h3>
|
||||
<p>Group Invite Data</p>
|
||||
<dl class="dl-compact">
|
||||
</dl>
|
||||
<h3 id="isForwarded"><span class="symbol-name">isForwarded</span><small class="property-type">
|
||||
boolean</small></h3>
|
||||
<p>Indicates if the message was forwarded</p>
|
||||
@@ -252,6 +280,11 @@
|
||||
<p>Indicates the mentions in the message body.</p>
|
||||
<dl class="dl-compact">
|
||||
</dl>
|
||||
<h3 id="orderId"><span class="symbol-name">orderId</span><small class="property-type">
|
||||
string</small></h3>
|
||||
<p>Order ID for message type ORDER</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 message was created</p>
|
||||
@@ -264,6 +297,11 @@
|
||||
If the message is sent by another user, it will be the ID for the current user.</p>
|
||||
<dl class="dl-compact">
|
||||
</dl>
|
||||
<h3 id="token"><span class="symbol-name">token</span><small class="property-type">
|
||||
string</small></h3>
|
||||
<p>Order Token for message type ORDER</p>
|
||||
<dl class="dl-compact">
|
||||
</dl>
|
||||
<h3 id="type"><span class="symbol-name">type</span><small class="property-type">
|
||||
<a href="global.html#MessageTypes">MessageTypes</a></small></h3>
|
||||
<p>Message type</p>
|
||||
@@ -277,6 +315,15 @@
|
||||
</section>
|
||||
<h2>Methods</h2>
|
||||
<section>
|
||||
<div class="symbol-detail-labels"><span class="label label-async">async</span></div>
|
||||
<h3 id="acceptGroupV4Invite"><span class="symbol-name">acceptGroupV4Invite</span><span class="signature"><span class="signature-params">()</span> → <span class="signature-returns"> Promise containing Object</span></span></h3>
|
||||
<p>Accept Group V4 Invite</p>
|
||||
<dl class="dl-compact">
|
||||
<dt>Returns</dt>
|
||||
<dd>
|
||||
<p><code>Promise containing Object</code> </p>
|
||||
</dd>
|
||||
</dl>
|
||||
<div class="symbol-detail-labels"><span class="label label-async">async</span></div>
|
||||
<h3 id="delete"><span class="symbol-name">delete</span><span class="signature"><span class="signature-params">(everyone)</span></span></h3>
|
||||
<p>Deletes a message from the chat</p>
|
||||
@@ -394,6 +441,15 @@
|
||||
</dd>
|
||||
</dl>
|
||||
<div class="symbol-detail-labels"><span class="label label-async">async</span></div>
|
||||
<h3 id="getOrder"><span class="symbol-name">getOrder</span><span class="signature"><span class="signature-params">()</span> → <span class="signature-returns"> Promise containing <a href="Order.html">Order</a></span></span></h3>
|
||||
<p>Gets the order associated with a given message</p>
|
||||
<dl class="dl-compact">
|
||||
<dt>Returns</dt>
|
||||
<dd>
|
||||
<p><code>Promise containing <a href="Order.html">Order</a></code> </p>
|
||||
</dd>
|
||||
</dl>
|
||||
<div class="symbol-detail-labels"><span class="label label-async">async</span></div>
|
||||
<h3 id="getQuotedMessage"><span class="symbol-name">getQuotedMessage</span><span class="signature"><span class="signature-params">()</span> → <span class="signature-returns"> Promise containing <a href="Message.html">Message</a></span></span></h3>
|
||||
<p>Returns the quoted message, if any</p>
|
||||
<dl class="dl-compact">
|
||||
@@ -487,7 +543,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.6 on February 9, 2021.
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on July 9, 2021.
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta name="generator" content="JSDoc 3.6.6">
|
||||
<meta name="generator" content="JSDoc 3.6.7">
|
||||
<meta charset="utf-8">
|
||||
<title>whatsapp-web.js 1.12.2 » Class: MessageMedia</title>
|
||||
<title>whatsapp-web.js 1.13.2 » 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>12.<wbr>2</a>
|
||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>13.<wbr>2</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
@@ -208,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.6 on February 9, 2021.
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on July 9, 2021.
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
117
docs/Order.html
Normal file
117
docs/Order.html
Normal file
@@ -0,0 +1,117 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta name="generator" content="JSDoc 3.6.7">
|
||||
<meta charset="utf-8">
|
||||
<title>whatsapp-web.js 1.13.2 » 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">
|
||||
<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>13.<wbr>2</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">Order</span></h1>
|
||||
<p class="source-link">Source: <a href="structures_Order.js.html#source-line-10">structures/<wbr>Order.<wbr>js:10</a></p>
|
||||
<div class="symbol-classdesc">
|
||||
<p>Represents a Order 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="Order.html#createdAt">createdAt</a></dt>
|
||||
<dd>
|
||||
</dd>
|
||||
<dt><a href="Order.html#currency">currency</a></dt>
|
||||
<dd>
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
<div class="summary-column">
|
||||
<dl class="dl-summary-callout">
|
||||
<dt><a href="Order.html#subtotal">subtotal</a></dt>
|
||||
<dd>
|
||||
</dd>
|
||||
<dt><a href="Order.html#total">total</a></dt>
|
||||
<dd>
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
<div class="summary-column">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<section>
|
||||
<h2 id="Order">new <span class="symbol-name">Order</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="createdAt"><span class="symbol-name">createdAt</span><small class="property-type">
|
||||
number</small></h3>
|
||||
<p>Order Created At</p>
|
||||
<dl class="dl-compact">
|
||||
</dl>
|
||||
<h3 id="currency"><span class="symbol-name">currency</span><small class="property-type">
|
||||
string</small></h3>
|
||||
<p>Order Currency</p>
|
||||
<dl class="dl-compact">
|
||||
</dl>
|
||||
<h3 id="subtotal"><span class="symbol-name">subtotal</span><small class="property-type">
|
||||
string</small></h3>
|
||||
<p>Order Subtotal</p>
|
||||
<dl class="dl-compact">
|
||||
</dl>
|
||||
<h3 id="total"><span class="symbol-name">total</span><small class="property-type">
|
||||
string</small></h3>
|
||||
<p>Order Total</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 July 9, 2021.
|
||||
</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>
|
||||
@@ -2,9 +2,9 @@
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta name="generator" content="JSDoc 3.6.6">
|
||||
<meta name="generator" content="JSDoc 3.6.7">
|
||||
<meta charset="utf-8">
|
||||
<title>whatsapp-web.js 1.12.2 » Class: PrivateChat</title>
|
||||
<title>whatsapp-web.js 1.13.2 » 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>12.<wbr>2</a>
|
||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>13.<wbr>2</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
@@ -519,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.6 on February 9, 2021.
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on July 9, 2021.
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta name="generator" content="JSDoc 3.6.6">
|
||||
<meta name="generator" content="JSDoc 3.6.7">
|
||||
<meta charset="utf-8">
|
||||
<title>whatsapp-web.js 1.12.2 » Class: PrivateContact</title>
|
||||
<title>whatsapp-web.js 1.13.2 » 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>12.<wbr>2</a>
|
||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>13.<wbr>2</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
@@ -283,7 +283,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.6 on February 9, 2021.
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on July 9, 2021.
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
142
docs/Product.html
Normal file
142
docs/Product.html
Normal file
@@ -0,0 +1,142 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta name="generator" content="JSDoc 3.6.7">
|
||||
<meta charset="utf-8">
|
||||
<title>whatsapp-web.js 1.13.2 » 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">
|
||||
<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>13.<wbr>2</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">Product</span></h1>
|
||||
<p class="source-link">Source: <a href="structures_Product.js.html#source-line-10">structures/<wbr>Product.<wbr>js:10</a></p>
|
||||
<div class="symbol-classdesc">
|
||||
<p>Represents a Product on WhatsAppBusiness</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="Product.html#currency">currency</a></dt>
|
||||
<dd>
|
||||
</dd>
|
||||
<dt><a href="Product.html#data">data</a></dt>
|
||||
<dd>
|
||||
</dd>
|
||||
<dt><a href="Product.html#id">id</a></dt>
|
||||
<dd>
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
<div class="summary-column">
|
||||
<dl class="dl-summary-callout">
|
||||
<dt><a href="Product.html#name">name</a></dt>
|
||||
<dd>
|
||||
</dd>
|
||||
<dt><a href="Product.html#price">price</a></dt>
|
||||
<dd>
|
||||
</dd>
|
||||
<dt><a href="Product.html#quantity">quantity</a></dt>
|
||||
<dd>
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
<div class="summary-column">
|
||||
<dl class="dl-summary-callout">
|
||||
<dt><a href="Product.html#thumbnailUrl">thumbnailUrl</a></dt>
|
||||
<dd>
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<section>
|
||||
<h2 id="Product">new <span class="symbol-name">Product</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="currency"><span class="symbol-name">currency</span><small class="property-type">
|
||||
string</small></h3>
|
||||
<p>Currency</p>
|
||||
<dl class="dl-compact">
|
||||
</dl>
|
||||
<h3 id="data"><span class="symbol-name">data</span></h3>
|
||||
<p>Product metadata</p>
|
||||
<dl class="dl-compact">
|
||||
</dl>
|
||||
<h3 id="id"><span class="symbol-name">id</span><small class="property-type">
|
||||
string</small></h3>
|
||||
<p>Product ID</p>
|
||||
<dl class="dl-compact">
|
||||
</dl>
|
||||
<h3 id="name"><span class="symbol-name">name</span><small class="property-type">
|
||||
string</small></h3>
|
||||
<p>Product Name</p>
|
||||
<dl class="dl-compact">
|
||||
</dl>
|
||||
<h3 id="price"><span class="symbol-name">price</span><small class="property-type">
|
||||
string</small></h3>
|
||||
<p>Price</p>
|
||||
<dl class="dl-compact">
|
||||
</dl>
|
||||
<h3 id="quantity"><span class="symbol-name">quantity</span><small class="property-type">
|
||||
number</small></h3>
|
||||
<p>Product Quantity</p>
|
||||
<dl class="dl-compact">
|
||||
</dl>
|
||||
<h3 id="thumbnailUrl"><span class="symbol-name">thumbnailUrl</span><small class="property-type">
|
||||
string</small></h3>
|
||||
<p>Product Thumbnail</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 July 9, 2021.
|
||||
</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>
|
||||
@@ -2,9 +2,9 @@
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta name="generator" content="JSDoc 3.6.6">
|
||||
<meta name="generator" content="JSDoc 3.6.7">
|
||||
<meta charset="utf-8">
|
||||
<title>whatsapp-web.js 1.12.2 » Class: Util</title>
|
||||
<title>whatsapp-web.js 1.13.2 » 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>12.<wbr>2</a>
|
||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>13.<wbr>2</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">Util</span></h1>
|
||||
<p class="source-link">Source: <a href="util_Util.js.html#source-line-15">util/<wbr>Util.<wbr>js:15</a></p>
|
||||
<p class="source-link">Source: <a href="util_Util.js.html#source-line-16">util/<wbr>Util.<wbr>js:16</a></p>
|
||||
<div class="symbol-classdesc">
|
||||
<p>Utility methods</p>
|
||||
</div>
|
||||
@@ -42,7 +42,7 @@
|
||||
<dt><a href="Util.html#.formatImageToWebpSticker">formatImageToWebpSticker(media)</a></dt>
|
||||
<dd>
|
||||
</dd>
|
||||
<dt><a href="Util.html#.formatToWebpSticker">formatToWebpSticker(media)</a></dt>
|
||||
<dt><a href="Util.html#.formatToWebpSticker">formatToWebpSticker(media, metadata)</a></dt>
|
||||
<dd>
|
||||
</dd>
|
||||
</dl>
|
||||
@@ -104,16 +104,15 @@
|
||||
<dl class="dl-compact">
|
||||
<dt>Returns</dt>
|
||||
<dd>
|
||||
<p><code>Promise containing <a href="MessageMedia.html">MessageMedia</a></code>
|
||||
<p>media in webp format</p>
|
||||
<p><code>Promise containing <a href="MessageMedia.html">MessageMedia</a></code> <p>media in webp format</p>
|
||||
</p>
|
||||
</dd>
|
||||
</dl>
|
||||
<div class="symbol-detail-labels"><span class="label label-async">async</span> <span class="label label-static">static</span></div>
|
||||
<h3 id=".formatToWebpSticker"><span class="symbol-name">formatToWebpSticker</span><span class="signature"><span class="signature-params">(media)</span> → <span class="signature-returns"> Promise containing <a href="MessageMedia.html">MessageMedia</a></span></span></h3>
|
||||
<h3 id=".formatToWebpSticker"><span class="symbol-name">formatToWebpSticker</span><span class="signature"><span class="signature-params">(media, metadata)</span> → <span class="signature-returns"> Promise containing <a href="MessageMedia.html">MessageMedia</a></span></span></h3>
|
||||
<p>Formats a media to webp</p>
|
||||
<section>
|
||||
<h4>Parameter</h4>
|
||||
<h4>Parameters</h4>
|
||||
<table class="jsdoc-details-table">
|
||||
<thead>
|
||||
<tr>
|
||||
@@ -137,14 +136,26 @@
|
||||
<td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>metadata</p>
|
||||
</td>
|
||||
<td>
|
||||
<p><a href="global.html#StickerMetadata">StickerMetadata</a></p>
|
||||
</td>
|
||||
<td>
|
||||
<p> </p>
|
||||
</td>
|
||||
<td>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
<dl class="dl-compact">
|
||||
<dt>Returns</dt>
|
||||
<dd>
|
||||
<p><code>Promise containing <a href="MessageMedia.html">MessageMedia</a></code>
|
||||
<p>media in webp format</p>
|
||||
<p><code>Promise containing <a href="MessageMedia.html">MessageMedia</a></code> <p>media in webp format</p>
|
||||
</p>
|
||||
</dd>
|
||||
</dl>
|
||||
@@ -182,8 +193,7 @@
|
||||
<dl class="dl-compact">
|
||||
<dt>Returns</dt>
|
||||
<dd>
|
||||
<p><code>Promise containing <a href="MessageMedia.html">MessageMedia</a></code>
|
||||
<p>media in webp format</p>
|
||||
<p><code>Promise containing <a href="MessageMedia.html">MessageMedia</a></code> <p>media in webp format</p>
|
||||
</p>
|
||||
</dd>
|
||||
</dl>
|
||||
@@ -230,7 +240,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.6 on February 9, 2021.
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on July 9, 2021.
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
170
docs/global.html
170
docs/global.html
@@ -2,9 +2,9 @@
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta name="generator" content="JSDoc 3.6.6">
|
||||
<meta name="generator" content="JSDoc 3.6.7">
|
||||
<meta charset="utf-8">
|
||||
<title>whatsapp-web.js 1.12.2 » Globals</title>
|
||||
<title>whatsapp-web.js 1.13.2 » 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>12.<wbr>2</a>
|
||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>13.<wbr>2</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
@@ -87,6 +87,11 @@
|
||||
</dl>
|
||||
</div>
|
||||
<div class="summary-column">
|
||||
<dl class="dl-summary-callout">
|
||||
<dt><a href="global.html#StickerMetadata">StickerMetadata</a></dt>
|
||||
<dd>
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -766,6 +771,19 @@
|
||||
<td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>ORDER</p>
|
||||
</td>
|
||||
<td>
|
||||
<p> </p>
|
||||
</td>
|
||||
<td>
|
||||
<p> </p>
|
||||
</td>
|
||||
<td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>REVOKED</p>
|
||||
@@ -779,6 +797,19 @@
|
||||
<td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>PRODUCT</p>
|
||||
</td>
|
||||
<td>
|
||||
<p> </p>
|
||||
</td>
|
||||
<td>
|
||||
<p> </p>
|
||||
</td>
|
||||
<td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>UNKNOWN</p>
|
||||
@@ -792,6 +823,19 @@
|
||||
<td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>GROUP_INVITE</p>
|
||||
</td>
|
||||
<td>
|
||||
<p> </p>
|
||||
</td>
|
||||
<td>
|
||||
<p> </p>
|
||||
</td>
|
||||
<td>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
@@ -1304,6 +1348,21 @@
|
||||
<p>Defaults to <code>false</code>.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>sendVideoAsGif</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>boolean</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>Yes</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>Send video as gif</p>
|
||||
<p>Defaults to <code>false</code>.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>sendMediaAsSticker</p>
|
||||
@@ -1406,12 +1465,54 @@
|
||||
<p>Defaults to <code>true</code>.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>stickerAuthor</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>string</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>Yes</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>Sets the author of the sticker, (if sendMediaAsSticker is true).</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>stickerName</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>string</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>Yes</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>Sets the name of the sticker, (if sendMediaAsSticker is true).</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>stickerCategories</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>Array of string</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>Yes</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>Sets the categories of the sticker, (if sendMediaAsSticker is true). Provide emoji char array, can be null.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>media</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>boolean</p>
|
||||
<p><a href="MessageMedia.html">MessageMedia</a></p>
|
||||
</td>
|
||||
<td>
|
||||
<p>Yes</p>
|
||||
@@ -1425,6 +1526,65 @@
|
||||
</section>
|
||||
<dl class="dl-compact">
|
||||
</dl>
|
||||
<h3 id="StickerMetadata"><span class="symbol-name">StickerMetadata</span><small class="property-type">
|
||||
Object</small></h3>
|
||||
<p>Sticker metadata.</p>
|
||||
<section>
|
||||
<h4>Properties</h4>
|
||||
<table class="jsdoc-details-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Type</th>
|
||||
<th>Optional</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<p>name</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>string</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>Yes</p>
|
||||
</td>
|
||||
<td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>author</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>string</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>Yes</p>
|
||||
</td>
|
||||
<td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>categories</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>Array of string</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>Yes</p>
|
||||
</td>
|
||||
<td>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
<dl class="dl-compact">
|
||||
</dl>
|
||||
</section>
|
||||
</section>
|
||||
</div>
|
||||
@@ -1435,7 +1595,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.6 on February 9, 2021.
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on July 9, 2021.
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
255
docs/index.html
255
docs/index.html
@@ -2,9 +2,9 @@
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta name="generator" content="JSDoc 3.6.6">
|
||||
<meta name="generator" content="JSDoc 3.6.7">
|
||||
<meta charset="utf-8">
|
||||
<title>whatsapp-web.js 1.12.2 » Home</title>
|
||||
<title>whatsapp-web.js 1.13.2 » 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>12.<wbr>2</a>
|
||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>13.<wbr>2</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
@@ -27,18 +27,18 @@
|
||||
<div id="jsdoc-main" role="main">
|
||||
<header class="page-header">
|
||||
<h1>
|
||||
whatsapp-web.js 1.12.2
|
||||
whatsapp-web.js 1.13.2
|
||||
</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.2104.6-brightgreen.svg" alt="WhatsApp_Web 2.2104.6"> <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.2126.10-brightgreen.svg" alt="WhatsApp_Web 2.2126.10"> <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>
|
||||
<p><strong>NOTE:</strong> 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.</p>
|
||||
<h2>Installation</h2>
|
||||
<p>The module is now available on npm! <code>npm i whatsapp-web.js</code></p>
|
||||
<p>Please note that Node v10.18.1+ is required due to Puppeteer.</p>
|
||||
<p>Please note that Node v14+ is required.</p>
|
||||
<h2>Example usage</h2>
|
||||
<pre class="prettyprint source lang-js"><code>const { Client } = require('whatsapp-web.js');
|
||||
const client = new Client();
|
||||
@@ -537,6 +537,11 @@ client.initialize();
|
||||
</dt>
|
||||
<dd>
|
||||
</dd>
|
||||
<dt class="symbol-index-name">
|
||||
<a href="Client.html#acceptGroupV4Invite" class="!symbol-index-name">Client#<wbr>acceptGroupV4Invite(inviteV4)</a>
|
||||
</dt>
|
||||
<dd>
|
||||
</dd>
|
||||
<dt class="symbol-index-name">
|
||||
<a href="Client.html#acceptInvite" class="!symbol-index-name">Client#<wbr>acceptInvite(inviteCode)</a>
|
||||
</dt>
|
||||
@@ -706,15 +711,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#info" class="!symbol-index-name">Client#<wbr>info</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#initialize" class="!symbol-index-name">Client#<wbr>initialize()</a>
|
||||
</dt>
|
||||
@@ -750,6 +755,11 @@ client.initialize();
|
||||
</dt>
|
||||
<dd>
|
||||
</dd>
|
||||
<dt class="symbol-index-name">
|
||||
<a href="Client.html#searchMessages" class="!symbol-index-name">Client#<wbr>searchMessages(query[, options])</a>
|
||||
</dt>
|
||||
<dd>
|
||||
</dd>
|
||||
<dt class="symbol-index-name">
|
||||
<a href="Client.html#sendMessage" class="!symbol-index-name">Client#<wbr>sendMessage(chatId, content[, options])</a>
|
||||
</dt>
|
||||
@@ -1450,13 +1460,18 @@ client.initialize();
|
||||
</dt>
|
||||
<dd>
|
||||
</dd>
|
||||
<dt class="symbol-index-name">
|
||||
<a href="InterfaceController.html#checkFeatureStatus" class="!symbol-index-name">InterfaceController#<wbr>checkFeatureStatus(feature)</a>
|
||||
</dt>
|
||||
<dd>
|
||||
</dd>
|
||||
<dt class="symbol-index-name">
|
||||
<a href="InterfaceController.html#closeRightDrawer" class="!symbol-index-name">InterfaceController#<wbr>closeRightDrawer()</a>
|
||||
</dt>
|
||||
<dd>
|
||||
</dd>
|
||||
<dt class="symbol-index-name">
|
||||
<a href="InterfaceController.html#openChatDrawer" class="!symbol-index-name">InterfaceController#<wbr>openChatDrawer(chatId)</a>
|
||||
<a href="InterfaceController.html#disableFeatures" class="!symbol-index-name">InterfaceController#<wbr>disableFeatures(features)</a>
|
||||
</dt>
|
||||
<dd>
|
||||
</dd>
|
||||
@@ -1464,11 +1479,30 @@ client.initialize();
|
||||
</div>
|
||||
<div class="symbol-index-column">
|
||||
<dl class="symbol-index-list">
|
||||
<dt class="symbol-index-name">
|
||||
<a href="InterfaceController.html#enableFeatures" class="!symbol-index-name">InterfaceController#<wbr>enableFeatures(features)</a>
|
||||
</dt>
|
||||
<dd>
|
||||
</dd>
|
||||
<dt class="symbol-index-name">
|
||||
<a href="InterfaceController.html#getFeatures" class="!symbol-index-name">InterfaceController#<wbr>getFeatures()</a>
|
||||
</dt>
|
||||
<dd>
|
||||
</dd>
|
||||
<dt class="symbol-index-name">
|
||||
<a href="InterfaceController.html#openChatDrawer" class="!symbol-index-name">InterfaceController#<wbr>openChatDrawer(chatId)</a>
|
||||
</dt>
|
||||
<dd>
|
||||
</dd>
|
||||
<dt class="symbol-index-name">
|
||||
<a href="InterfaceController.html#openChatSearch" class="!symbol-index-name">InterfaceController#<wbr>openChatSearch(chatId)</a>
|
||||
</dt>
|
||||
<dd>
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
<div class="symbol-index-column">
|
||||
<dl class="symbol-index-list">
|
||||
<dt class="symbol-index-name">
|
||||
<a href="InterfaceController.html#openChatWindow" class="!symbol-index-name">InterfaceController#<wbr>openChatWindow(chatId)</a>
|
||||
</dt>
|
||||
@@ -1479,10 +1513,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="InterfaceController.html#openMessageDrawer" class="!symbol-index-name">InterfaceController#<wbr>openMessageDrawer(msgId)</a>
|
||||
</dt>
|
||||
@@ -1587,6 +1617,11 @@ client.initialize();
|
||||
</dt>
|
||||
<dd>
|
||||
</dd>
|
||||
<dt class="symbol-index-name">
|
||||
<a href="Message.html#acceptGroupV4Invite" class="!symbol-index-name">Message#<wbr>acceptGroupV4Invite()</a>
|
||||
</dt>
|
||||
<dd>
|
||||
</dd>
|
||||
<dt class="symbol-index-name">
|
||||
<a href="Message.html#ack" class="!symbol-index-name">Message#<wbr>ack</a>
|
||||
</dt>
|
||||
@@ -1612,6 +1647,11 @@ client.initialize();
|
||||
</dt>
|
||||
<dd>
|
||||
</dd>
|
||||
<dt class="symbol-index-name">
|
||||
<a href="Message.html#deviceType" class="!symbol-index-name">Message#<wbr>deviceType</a>
|
||||
</dt>
|
||||
<dd>
|
||||
</dd>
|
||||
<dt class="symbol-index-name">
|
||||
<a href="Message.html#downloadMedia" class="!symbol-index-name">Message#<wbr>downloadMedia()</a>
|
||||
</dt>
|
||||
@@ -1656,6 +1696,11 @@ client.initialize();
|
||||
</dt>
|
||||
<dd>
|
||||
</dd>
|
||||
<dt class="symbol-index-name">
|
||||
<a href="Message.html#getOrder" class="!symbol-index-name">Message#<wbr>getOrder()</a>
|
||||
</dt>
|
||||
<dd>
|
||||
</dd>
|
||||
<dt class="symbol-index-name">
|
||||
<a href="Message.html#getQuotedMessage" class="!symbol-index-name">Message#<wbr>getQuotedMessage()</a>
|
||||
</dt>
|
||||
@@ -1676,6 +1721,11 @@ client.initialize();
|
||||
</dt>
|
||||
<dd>
|
||||
</dd>
|
||||
<dt class="symbol-index-name">
|
||||
<a href="Message.html#inviteV4" class="!symbol-index-name">Message#<wbr>inviteV4</a>
|
||||
</dt>
|
||||
<dd>
|
||||
</dd>
|
||||
<dt class="symbol-index-name">
|
||||
<a href="Message.html#isForwarded" class="!symbol-index-name">Message#<wbr>isForwarded</a>
|
||||
</dt>
|
||||
@@ -1715,6 +1765,11 @@ client.initialize();
|
||||
</dt>
|
||||
<dd>
|
||||
</dd>
|
||||
<dt class="symbol-index-name">
|
||||
<a href="Message.html#orderId" class="!symbol-index-name">Message#<wbr>orderId</a>
|
||||
</dt>
|
||||
<dd>
|
||||
</dd>
|
||||
<dt class="symbol-index-name">
|
||||
<a href="Message.html#reply" class="!symbol-index-name">Message#<wbr>reply(content[, chatId][, options])</a>
|
||||
</dt>
|
||||
@@ -1735,6 +1790,11 @@ client.initialize();
|
||||
</dt>
|
||||
<dd>
|
||||
</dd>
|
||||
<dt class="symbol-index-name">
|
||||
<a href="Message.html#token" class="!symbol-index-name">Message#<wbr>token</a>
|
||||
</dt>
|
||||
<dd>
|
||||
</dd>
|
||||
<dt class="symbol-index-name">
|
||||
<a href="Message.html#type" class="!symbol-index-name">Message#<wbr>type</a>
|
||||
</dt>
|
||||
@@ -1874,6 +1934,11 @@ client.initialize();
|
||||
</dt>
|
||||
<dd>
|
||||
</dd>
|
||||
<dt class="symbol-index-name">
|
||||
<a href="global.html#MessageTypes#.GROUP_INVITE" class="!symbol-index-name">MessageTypes.<wbr>GROUP_INVITE</a>
|
||||
</dt>
|
||||
<dd>
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
<div class="symbol-index-column">
|
||||
@@ -1889,12 +1954,17 @@ client.initialize();
|
||||
<dd>
|
||||
</dd>
|
||||
<dt class="symbol-index-name">
|
||||
<a href="global.html#MessageTypes#.REVOKED" class="!symbol-index-name">MessageTypes.<wbr>REVOKED</a>
|
||||
<a href="global.html#MessageTypes#.ORDER" class="!symbol-index-name">MessageTypes.<wbr>ORDER</a>
|
||||
</dt>
|
||||
<dd>
|
||||
</dd>
|
||||
<dt class="symbol-index-name">
|
||||
<a href="global.html#MessageTypes#.STICKER" class="!symbol-index-name">MessageTypes.<wbr>STICKER</a>
|
||||
<a href="global.html#MessageTypes#.PRODUCT" class="!symbol-index-name">MessageTypes.<wbr>PRODUCT</a>
|
||||
</dt>
|
||||
<dd>
|
||||
</dd>
|
||||
<dt class="symbol-index-name">
|
||||
<a href="global.html#MessageTypes#.REVOKED" class="!symbol-index-name">MessageTypes.<wbr>REVOKED</a>
|
||||
</dt>
|
||||
<dd>
|
||||
</dd>
|
||||
@@ -1902,6 +1972,11 @@ client.initialize();
|
||||
</div>
|
||||
<div class="symbol-index-column">
|
||||
<dl class="symbol-index-list">
|
||||
<dt class="symbol-index-name">
|
||||
<a href="global.html#MessageTypes#.STICKER" class="!symbol-index-name">MessageTypes.<wbr>STICKER</a>
|
||||
</dt>
|
||||
<dd>
|
||||
</dd>
|
||||
<dt class="symbol-index-name">
|
||||
<a href="global.html#MessageTypes#.TEXT" class="!symbol-index-name">MessageTypes.<wbr>TEXT</a>
|
||||
</dt>
|
||||
@@ -1927,6 +2002,50 @@ client.initialize();
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<section>
|
||||
<div class="symbol-index-content">
|
||||
<h2 id="Order">Order</h2>
|
||||
<div class="symbol-index-section">
|
||||
<div class="symbol-index-column">
|
||||
<dl class="symbol-index-list">
|
||||
<dt class="symbol-index-name">
|
||||
<a href="Order.html" class="!symbol-index-name">Order()</a>
|
||||
</dt>
|
||||
<dd>
|
||||
</dd>
|
||||
<dt class="symbol-index-name">
|
||||
<a href="Order.html#createdAt" class="!symbol-index-name">Order#<wbr>createdAt</a>
|
||||
</dt>
|
||||
<dd>
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
<div class="symbol-index-column">
|
||||
<dl class="symbol-index-list">
|
||||
<dt class="symbol-index-name">
|
||||
<a href="Order.html#currency" class="!symbol-index-name">Order#<wbr>currency</a>
|
||||
</dt>
|
||||
<dd>
|
||||
</dd>
|
||||
<dt class="symbol-index-name">
|
||||
<a href="Order.html#subtotal" class="!symbol-index-name">Order#<wbr>subtotal</a>
|
||||
</dt>
|
||||
<dd>
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
<div class="symbol-index-column">
|
||||
<dl class="symbol-index-list">
|
||||
<dt class="symbol-index-name">
|
||||
<a href="Order.html#total" class="!symbol-index-name">Order#<wbr>total</a>
|
||||
</dt>
|
||||
<dd>
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<section>
|
||||
<div class="symbol-index-content">
|
||||
<h2 id="PrivateChat">PrivateChat</h2>
|
||||
@@ -2200,6 +2319,104 @@ client.initialize();
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<section>
|
||||
<div class="symbol-index-content">
|
||||
<h2 id="Product">Product</h2>
|
||||
<div class="symbol-index-section">
|
||||
<div class="symbol-index-column">
|
||||
<dl class="symbol-index-list">
|
||||
<dt class="symbol-index-name">
|
||||
<a href="Product.html" class="!symbol-index-name">Product()</a>
|
||||
</dt>
|
||||
<dd>
|
||||
</dd>
|
||||
<dt class="symbol-index-name">
|
||||
<a href="Product.html#currency" class="!symbol-index-name">Product#<wbr>currency</a>
|
||||
</dt>
|
||||
<dd>
|
||||
</dd>
|
||||
<dt class="symbol-index-name">
|
||||
<a href="Product.html#data" class="!symbol-index-name">Product#<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="Product.html#id" class="!symbol-index-name">Product#<wbr>id</a>
|
||||
</dt>
|
||||
<dd>
|
||||
</dd>
|
||||
<dt class="symbol-index-name">
|
||||
<a href="Product.html#name" class="!symbol-index-name">Product#<wbr>name</a>
|
||||
</dt>
|
||||
<dd>
|
||||
</dd>
|
||||
<dt class="symbol-index-name">
|
||||
<a href="Product.html#price" class="!symbol-index-name">Product#<wbr>price</a>
|
||||
</dt>
|
||||
<dd>
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
<div class="symbol-index-column">
|
||||
<dl class="symbol-index-list">
|
||||
<dt class="symbol-index-name">
|
||||
<a href="Product.html#quantity" class="!symbol-index-name">Product#<wbr>quantity</a>
|
||||
</dt>
|
||||
<dd>
|
||||
</dd>
|
||||
<dt class="symbol-index-name">
|
||||
<a href="Product.html#thumbnailUrl" class="!symbol-index-name">Product#<wbr>thumbnailUrl</a>
|
||||
</dt>
|
||||
<dd>
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<section>
|
||||
<div class="symbol-index-content">
|
||||
<h2 id="ProductMetadata">ProductMetadata</h2>
|
||||
<div class="symbol-index-section">
|
||||
<div class="symbol-index-column">
|
||||
<dl class="symbol-index-list">
|
||||
<dt class="symbol-index-name">
|
||||
<a href="ProductMetadata.html#description" class="!symbol-index-name">ProductMetadata#<wbr>description</a>
|
||||
</dt>
|
||||
<dd>
|
||||
</dd>
|
||||
<dt class="symbol-index-name">
|
||||
<a href="ProductMetadata.html#id" class="!symbol-index-name">ProductMetadata#<wbr>id</a>
|
||||
</dt>
|
||||
<dd>
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
<div class="symbol-index-column">
|
||||
<dl class="symbol-index-list">
|
||||
<dt class="symbol-index-name">
|
||||
<a href="ProductMetadata.html#name" class="!symbol-index-name">ProductMetadata#<wbr>name</a>
|
||||
</dt>
|
||||
<dd>
|
||||
</dd>
|
||||
<dt class="symbol-index-name">
|
||||
<a href="ProductMetadata.html#retailer_id" class="!symbol-index-name">ProductMetadata#<wbr>retailer_id</a>
|
||||
</dt>
|
||||
<dd>
|
||||
</dd>
|
||||
</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>
|
||||
@@ -2255,7 +2472,7 @@ client.initialize();
|
||||
<div class="symbol-index-column">
|
||||
<dl class="symbol-index-list">
|
||||
<dt class="symbol-index-name">
|
||||
<a href="Util.html#.formatToWebpSticker" class="!symbol-index-name">Util.<wbr>formatToWebpSticker(media)</a>
|
||||
<a href="Util.html#.formatToWebpSticker" class="!symbol-index-name">Util.<wbr>formatToWebpSticker(media, metadata)</a>
|
||||
</dt>
|
||||
<dd>
|
||||
</dd>
|
||||
@@ -2366,7 +2583,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.6 on February 9, 2021.
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on July 9, 2021.
|
||||
</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=\"BusinessContact.html\">BusinessContact</a>","id":"BusinessContact","children":[]},{"label":"<a href=\"Chat.html\">Chat</a>","id":"Chat","children":[]},{"label":"<a href=\"Client.html\">Client</a>","id":"Client","children":[]},{"label":"<a href=\"ClientInfo.html\">ClientInfo</a>","id":"ClientInfo","children":[]},{"label":"<a href=\"Contact.html\">Contact</a>","id":"Contact","children":[]},{"label":"<a href=\"GroupChat.html\">GroupChat</a>","id":"GroupChat","children":[]},{"label":"<a href=\"GroupNotification.html\">GroupNotification</a>","id":"GroupNotification","children":[]},{"label":"<a href=\"InterfaceController.html\">InterfaceController</a>","id":"InterfaceController","children":[]},{"label":"<a href=\"Label.html\">Label</a>","id":"Label","children":[]},{"label":"<a href=\"Location.html\">Location</a>","id":"Location","children":[]},{"label":"<a href=\"Message.html\">Message</a>","id":"Message","children":[]},{"label":"<a href=\"MessageMedia.html\">MessageMedia</a>","id":"MessageMedia","children":[]},{"label":"<a href=\"PrivateChat.html\">PrivateChat</a>","id":"PrivateChat","children":[]},{"label":"<a href=\"PrivateContact.html\">PrivateContact</a>","id":"PrivateContact","children":[]},{"label":"<a href=\"Util.html\">Util</a>","id":"Util","children":[]}],
|
||||
data: [{"label":"<a href=\"global.html\">Globals</a>","id":"global","children":[]},{"label":"<a href=\"Base.html\">Base</a>","id":"Base","children":[]},{"label":"<a href=\"BusinessContact.html\">BusinessContact</a>","id":"BusinessContact","children":[]},{"label":"<a href=\"Chat.html\">Chat</a>","id":"Chat","children":[]},{"label":"<a href=\"Client.html\">Client</a>","id":"Client","children":[]},{"label":"<a href=\"ClientInfo.html\">ClientInfo</a>","id":"ClientInfo","children":[]},{"label":"<a href=\"Contact.html\">Contact</a>","id":"Contact","children":[]},{"label":"<a href=\"GroupChat.html\">GroupChat</a>","id":"GroupChat","children":[]},{"label":"<a href=\"GroupNotification.html\">GroupNotification</a>","id":"GroupNotification","children":[]},{"label":"<a href=\"InterfaceController.html\">InterfaceController</a>","id":"InterfaceController","children":[]},{"label":"<a href=\"Label.html\">Label</a>","id":"Label","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=\"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
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta name="generator" content="JSDoc 3.6.6">
|
||||
<meta name="generator" content="JSDoc 3.6.7">
|
||||
<meta charset="utf-8">
|
||||
<title>whatsapp-web.js 1.12.2 » Source: structures/Base.js</title>
|
||||
<title>whatsapp-web.js 1.13.2 » 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>12.<wbr>2</a>
|
||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>13.<wbr>2</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.6 on February 9, 2021.
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on July 9, 2021.
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta name="generator" content="JSDoc 3.6.6">
|
||||
<meta name="generator" content="JSDoc 3.6.7">
|
||||
<meta charset="utf-8">
|
||||
<title>whatsapp-web.js 1.12.2 » Source: structures/BusinessContact.js</title>
|
||||
<title>whatsapp-web.js 1.13.2 » 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>12.<wbr>2</a>
|
||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>13.<wbr>2</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.6 on February 9, 2021.
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on July 9, 2021.
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta name="generator" content="JSDoc 3.6.6">
|
||||
<meta name="generator" content="JSDoc 3.6.7">
|
||||
<meta charset="utf-8">
|
||||
<title>whatsapp-web.js 1.12.2 » Source: structures/Chat.js</title>
|
||||
<title>whatsapp-web.js 1.13.2 » 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>12.<wbr>2</a>
|
||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>13.<wbr>2</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
@@ -288,7 +288,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.6 on February 9, 2021.
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on July 9, 2021.
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta name="generator" content="JSDoc 3.6.6">
|
||||
<meta name="generator" content="JSDoc 3.6.7">
|
||||
<meta charset="utf-8">
|
||||
<title>whatsapp-web.js 1.12.2 » Source: structures/ClientInfo.js</title>
|
||||
<title>whatsapp-web.js 1.13.2 » 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>12.<wbr>2</a>
|
||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>13.<wbr>2</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
@@ -108,7 +108,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.6 on February 9, 2021.
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on July 9, 2021.
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta name="generator" content="JSDoc 3.6.6">
|
||||
<meta name="generator" content="JSDoc 3.6.7">
|
||||
<meta charset="utf-8">
|
||||
<title>whatsapp-web.js 1.12.2 » Source: structures/Contact.js</title>
|
||||
<title>whatsapp-web.js 1.13.2 » 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>12.<wbr>2</a>
|
||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>13.<wbr>2</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
@@ -219,7 +219,7 @@ module.exports = 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.6 on February 9, 2021.
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on July 9, 2021.
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta name="generator" content="JSDoc 3.6.6">
|
||||
<meta name="generator" content="JSDoc 3.6.7">
|
||||
<meta charset="utf-8">
|
||||
<title>whatsapp-web.js 1.12.2 » Source: structures/GroupChat.js</title>
|
||||
<title>whatsapp-web.js 1.13.2 » 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>12.<wbr>2</a>
|
||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>13.<wbr>2</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
@@ -239,7 +239,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.6 on February 9, 2021.
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on July 9, 2021.
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta name="generator" content="JSDoc 3.6.6">
|
||||
<meta name="generator" content="JSDoc 3.6.7">
|
||||
<meta charset="utf-8">
|
||||
<title>whatsapp-web.js 1.12.2 » Source: structures/GroupNotification.js</title>
|
||||
<title>whatsapp-web.js 1.13.2 » 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>12.<wbr>2</a>
|
||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>13.<wbr>2</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.6 on February 9, 2021.
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on July 9, 2021.
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta name="generator" content="JSDoc 3.6.6">
|
||||
<meta name="generator" content="JSDoc 3.6.7">
|
||||
<meta charset="utf-8">
|
||||
<title>whatsapp-web.js 1.12.2 » Source: structures/Label.js</title>
|
||||
<title>whatsapp-web.js 1.13.2 » 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>12.<wbr>2</a>
|
||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>13.<wbr>2</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.6 on February 9, 2021.
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on July 9, 2021.
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta name="generator" content="JSDoc 3.6.6">
|
||||
<meta name="generator" content="JSDoc 3.6.7">
|
||||
<meta charset="utf-8">
|
||||
<title>whatsapp-web.js 1.12.2 » Source: structures/Location.js</title>
|
||||
<title>whatsapp-web.js 1.13.2 » 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>12.<wbr>2</a>
|
||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>13.<wbr>2</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.6 on February 9, 2021.
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on July 9, 2021.
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta name="generator" content="JSDoc 3.6.6">
|
||||
<meta name="generator" content="JSDoc 3.6.7">
|
||||
<meta charset="utf-8">
|
||||
<title>whatsapp-web.js 1.12.2 » Source: structures/Message.js</title>
|
||||
<title>whatsapp-web.js 1.13.2 » 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>12.<wbr>2</a>
|
||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>13.<wbr>2</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
@@ -34,6 +34,7 @@
|
||||
const Base = require('./Base');
|
||||
const MessageMedia = require('./MessageMedia');
|
||||
const Location = require('./Location');
|
||||
const Order = require('./Order');
|
||||
const { MessageTypes } = require('../util/Constants');
|
||||
|
||||
/**
|
||||
@@ -71,7 +72,7 @@ class Message extends Base {
|
||||
* Indicates if the message has media available for download
|
||||
* @type {boolean}
|
||||
*/
|
||||
this.hasMedia = data.clientUrl || data.deprecatedMms3Url ? true : false;
|
||||
this.hasMedia = Boolean(data.mediaKey &amp;&amp; data.directPath);
|
||||
|
||||
/**
|
||||
* Message content
|
||||
@@ -112,6 +113,12 @@ class Message extends Base {
|
||||
*/
|
||||
this.author = (typeof (data.author) === 'object' &amp;&amp; data.author !== null) ? data.author._serialized : data.author;
|
||||
|
||||
/**
|
||||
* String that represents from which device type the message was sent
|
||||
* @type {string}
|
||||
*/
|
||||
this.deviceType = data.id.id.length > 21 ? 'android' : data.id.id.substring(0,2) =='3A' ? 'ios' : 'web';
|
||||
|
||||
/**
|
||||
* Indicates if the message was forwarded
|
||||
* @type {boolean}
|
||||
@@ -160,6 +167,19 @@ class Message extends Base {
|
||||
*/
|
||||
this.vCards = data.type === MessageTypes.CONTACT_CARD_MULTI ? data.vcardList.map((c) => c.vcard) : data.type === MessageTypes.CONTACT_CARD ? [data.body] : [];
|
||||
|
||||
/**
|
||||
* Group Invite Data
|
||||
* @type {object}
|
||||
*/
|
||||
this.inviteV4 = data.type === MessageTypes.GROUP_INVITE ? {
|
||||
inviteCode: data.inviteCode,
|
||||
inviteCodeExp: data.inviteCodeExp,
|
||||
groupId: data.inviteGrp,
|
||||
groupName: data.inviteGrpName,
|
||||
fromId: data.from._serialized,
|
||||
toId: data.to._serialized
|
||||
} : undefined;
|
||||
|
||||
/**
|
||||
* Indicates the mentions in the message body.
|
||||
* @type {Array&lt;string>}
|
||||
@@ -170,6 +190,37 @@ class Message extends Base {
|
||||
this.mentionedIds = data.mentionedJidList;
|
||||
}
|
||||
|
||||
/**
|
||||
* Order ID for message type ORDER
|
||||
* @type {string}
|
||||
*/
|
||||
this.orderId = data.orderId ? data.orderId : undefined;
|
||||
/**
|
||||
* Order Token for message type ORDER
|
||||
* @type {string}
|
||||
*/
|
||||
this.token = data.token ? data.token : undefined;
|
||||
|
||||
/** Title */
|
||||
if (data.title) {
|
||||
this.title = data.title;
|
||||
}
|
||||
|
||||
/** Description */
|
||||
if (data.description) {
|
||||
this.description = data.description;
|
||||
}
|
||||
|
||||
/** Business Owner JID */
|
||||
if (data.businessOwnerJid) {
|
||||
this.businessOwnerJid = data.businessOwnerJid;
|
||||
}
|
||||
|
||||
/** Product ID */
|
||||
if (data.productId) {
|
||||
this.productId = data.productId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Links included in the message.
|
||||
* @type {Array&lt;string>}
|
||||
@@ -245,6 +296,14 @@ class Message extends Base {
|
||||
return this.client.sendMessage(chatId, content, options);
|
||||
}
|
||||
|
||||
/**
|
||||
* Accept Group V4 Invite
|
||||
* @returns {Promise&lt;Object>}
|
||||
*/
|
||||
async acceptGroupV4Invite() {
|
||||
return await this.client.acceptGroupV4Invite(this.inviteV4);
|
||||
}
|
||||
|
||||
/**
|
||||
* Forwards this message to another chat
|
||||
*
|
||||
@@ -284,14 +343,20 @@ class Message extends Base {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
const mediaUrl = msg.clientUrl || msg.deprecatedMms3Url;
|
||||
const decryptedMedia = await window.Store.DownloadManager.downloadAndDecrypt({
|
||||
directPath: msg.directPath,
|
||||
encFilehash: msg.encFilehash,
|
||||
filehash: msg.filehash,
|
||||
mediaKey: msg.mediaKey,
|
||||
mediaKeyTimestamp: msg.mediaKeyTimestamp,
|
||||
type: msg.type,
|
||||
signal: (new AbortController).signal
|
||||
});
|
||||
|
||||
const buffer = await window.WWebJS.downloadBuffer(mediaUrl);
|
||||
const decrypted = await window.Store.CryptoLib.decryptE2EMedia(msg.type, buffer, msg.mediaKey, msg.mimetype);
|
||||
const data = await window.WWebJS.readBlobAsync(decrypted._blob);
|
||||
const data = window.WWebJS.arrayBufferToBase64(decryptedMedia);
|
||||
|
||||
return {
|
||||
data: data.split(',')[1],
|
||||
data,
|
||||
mimetype: msg.mimetype,
|
||||
filename: msg.filename
|
||||
};
|
||||
@@ -322,7 +387,7 @@ class Message extends Base {
|
||||
* Stars this message
|
||||
*/
|
||||
async star() {
|
||||
await this.pupPage.evaluate((msgId) => {
|
||||
await this.client.pupPage.evaluate((msgId) => {
|
||||
let msg = window.Store.Msg.get(msgId);
|
||||
|
||||
if (msg.canStar()) {
|
||||
@@ -335,7 +400,7 @@ class Message extends Base {
|
||||
* Unstars this message
|
||||
*/
|
||||
async unstar() {
|
||||
await this.pupPage.evaluate((msgId) => {
|
||||
await this.client.pupPage.evaluate((msgId) => {
|
||||
let msg = window.Store.Msg.get(msgId);
|
||||
|
||||
if (msg.canStar()) {
|
||||
@@ -373,6 +438,21 @@ class Message extends Base {
|
||||
|
||||
return info;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the order associated with a given message
|
||||
* @return {Promise&lt;Order>}
|
||||
*/
|
||||
async getOrder() {
|
||||
if (this.type === MessageTypes.ORDER) {
|
||||
const result = await this.client.pupPage.evaluate((orderId, token) => {
|
||||
return window.WWebJS.getOrderDetail(orderId, token);
|
||||
}, this.orderId, this.token);
|
||||
if (!result) return undefined;
|
||||
return new Order(this.client, result);
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Message;
|
||||
@@ -386,7 +466,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.6 on February 9, 2021.
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on July 9, 2021.
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta name="generator" content="JSDoc 3.6.6">
|
||||
<meta name="generator" content="JSDoc 3.6.7">
|
||||
<meta charset="utf-8">
|
||||
<title>whatsapp-web.js 1.12.2 » Source: structures/MessageMedia.js</title>
|
||||
<title>whatsapp-web.js 1.13.2 » 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>12.<wbr>2</a>
|
||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>13.<wbr>2</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
@@ -86,7 +86,7 @@ module.exports = 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.6 on February 9, 2021.
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on July 9, 2021.
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
105
docs/structures_Order.js.html
Normal file
105
docs/structures_Order.js.html
Normal file
@@ -0,0 +1,105 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta name="generator" content="JSDoc 3.6.7">
|
||||
<meta charset="utf-8">
|
||||
<title>whatsapp-web.js 1.13.2 » 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">
|
||||
<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>13.<wbr>2</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/Order.js</h1>
|
||||
</header>
|
||||
<article>
|
||||
<pre class="prettyprint linenums"><code>'use strict';
|
||||
|
||||
const Base = require('./Base');
|
||||
const Product = require('./Product');
|
||||
|
||||
/**
|
||||
* Represents a Order on WhatsApp
|
||||
* @extends {Base}
|
||||
*/
|
||||
class Order extends Base {
|
||||
constructor(client, data) {
|
||||
super(client);
|
||||
|
||||
if (data) this._patch(data);
|
||||
}
|
||||
|
||||
_patch(data) {
|
||||
/**
|
||||
* List of products
|
||||
* @type {Array&lt;Product>}
|
||||
*/
|
||||
if (data.products) {
|
||||
this.products = data.products.map(product => new Product(this.client, product));
|
||||
}
|
||||
/**
|
||||
* Order Subtotal
|
||||
* @type {string}
|
||||
*/
|
||||
this.subtotal = data.subtotal;
|
||||
/**
|
||||
* Order Total
|
||||
* @type {string}
|
||||
*/
|
||||
this.total = data.total;
|
||||
/**
|
||||
* Order Currency
|
||||
* @type {string}
|
||||
*/
|
||||
this.currency = data.currency;
|
||||
/**
|
||||
* Order Created At
|
||||
* @type {number}
|
||||
*/
|
||||
this.createdAt = data.createdAt;
|
||||
|
||||
return super._patch(data);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
module.exports = Order;</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 July 9, 2021.
|
||||
</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>
|
||||
@@ -2,9 +2,9 @@
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta name="generator" content="JSDoc 3.6.6">
|
||||
<meta name="generator" content="JSDoc 3.6.7">
|
||||
<meta charset="utf-8">
|
||||
<title>whatsapp-web.js 1.12.2 » Source: structures/PrivateChat.js</title>
|
||||
<title>whatsapp-web.js 1.13.2 » 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>12.<wbr>2</a>
|
||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>13.<wbr>2</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.6 on February 9, 2021.
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on July 9, 2021.
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta name="generator" content="JSDoc 3.6.6">
|
||||
<meta name="generator" content="JSDoc 3.6.7">
|
||||
<meta charset="utf-8">
|
||||
<title>whatsapp-web.js 1.12.2 » Source: structures/PrivateContact.js</title>
|
||||
<title>whatsapp-web.js 1.13.2 » 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>12.<wbr>2</a>
|
||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>13.<wbr>2</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.6 on February 9, 2021.
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on July 9, 2021.
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
121
docs/structures_Product.js.html
Normal file
121
docs/structures_Product.js.html
Normal file
@@ -0,0 +1,121 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta name="generator" content="JSDoc 3.6.7">
|
||||
<meta charset="utf-8">
|
||||
<title>whatsapp-web.js 1.13.2 » 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">
|
||||
<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>13.<wbr>2</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/Product.js</h1>
|
||||
</header>
|
||||
<article>
|
||||
<pre class="prettyprint linenums"><code>'use strict';
|
||||
|
||||
const Base = require('./Base');
|
||||
const ProductMetadata = require('./ProductMetadata');
|
||||
|
||||
/**
|
||||
* Represents a Product on WhatsAppBusiness
|
||||
* @extends {Base}
|
||||
*/
|
||||
class Product extends Base {
|
||||
constructor(client, data) {
|
||||
super(client);
|
||||
|
||||
if (data) this._patch(data);
|
||||
}
|
||||
|
||||
_patch(data) {
|
||||
/**
|
||||
* Product ID
|
||||
* @type {string}
|
||||
*/
|
||||
this.id = data.id;
|
||||
/**
|
||||
* Price
|
||||
* @type {string}
|
||||
*/
|
||||
this.price = data.price ? data.price : '';
|
||||
/**
|
||||
* Product Thumbnail
|
||||
* @type {string}
|
||||
*/
|
||||
this.thumbnailUrl = data.thumbnailUrl;
|
||||
/**
|
||||
* Currency
|
||||
* @type {string}
|
||||
*/
|
||||
this.currency = data.currency;
|
||||
/**
|
||||
* Product Name
|
||||
* @type {string}
|
||||
*/
|
||||
this.name = data.name;
|
||||
/**
|
||||
* Product Quantity
|
||||
* @type {number}
|
||||
*/
|
||||
this.quantity = data.quantity;
|
||||
/** Product metadata */
|
||||
this.data = null;
|
||||
return super._patch(data);
|
||||
}
|
||||
|
||||
async getData() {
|
||||
if (this.data === null) {
|
||||
let result = await this.client.pupPage.evaluate((productId) => {
|
||||
return window.WWebJS.getProductMetadata(productId);
|
||||
}, this.id);
|
||||
if (!result) {
|
||||
this.data = undefined;
|
||||
} else {
|
||||
this.data = new ProductMetadata(this.client, result);
|
||||
}
|
||||
}
|
||||
return this.data;
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Product;</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 July 9, 2021.
|
||||
</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>
|
||||
78
docs/structures_ProductMetadata.js.html
Normal file
78
docs/structures_ProductMetadata.js.html
Normal file
@@ -0,0 +1,78 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta name="generator" content="JSDoc 3.6.7">
|
||||
<meta charset="utf-8">
|
||||
<title>whatsapp-web.js 1.13.2 » 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">
|
||||
<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>13.<wbr>2</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/ProductMetadata.js</h1>
|
||||
</header>
|
||||
<article>
|
||||
<pre class="prettyprint linenums"><code>const Base = require('./Base');
|
||||
|
||||
class ProductMetadata extends Base {
|
||||
constructor(client, data) {
|
||||
super(client);
|
||||
|
||||
if (data) this._patch(data);
|
||||
}
|
||||
|
||||
_patch(data) {
|
||||
/** Product ID */
|
||||
this.id = data.id;
|
||||
/** Retailer ID */
|
||||
this.retailer_id = data.retailer_id;
|
||||
/** Product Name */
|
||||
this.name = data.name;
|
||||
/** Product Description */
|
||||
this.description = data.description;
|
||||
|
||||
return super._patch(data);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
module.exports = ProductMetadata;</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 July 9, 2021.
|
||||
</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>
|
||||
@@ -2,9 +2,9 @@
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta name="generator" content="JSDoc 3.6.6">
|
||||
<meta name="generator" content="JSDoc 3.6.7">
|
||||
<meta charset="utf-8">
|
||||
<title>whatsapp-web.js 1.12.2 » Source: util/Constants.js</title>
|
||||
<title>whatsapp-web.js 1.13.2 » 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>12.<wbr>2</a>
|
||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>13.<wbr>2</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
@@ -45,7 +45,8 @@ exports.DefaultOptions = {
|
||||
takeoverOnConflict: false,
|
||||
takeoverTimeoutMs: 0,
|
||||
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'
|
||||
ffmpegPath: 'ffmpeg',
|
||||
bypassCSP: false
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -99,8 +100,11 @@ exports.MessageTypes = {
|
||||
LOCATION: 'location',
|
||||
CONTACT_CARD: 'vcard',
|
||||
CONTACT_CARD_MULTI: 'multi_vcard',
|
||||
ORDER: 'order',
|
||||
REVOKED: 'revoked',
|
||||
UNKNOWN: 'unknown'
|
||||
PRODUCT: 'product',
|
||||
UNKNOWN: 'unknown',
|
||||
GROUP_INVITE: 'groups_v4_invite'
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -174,7 +178,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.6 on February 9, 2021.
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on July 9, 2021.
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta name="generator" content="JSDoc 3.6.6">
|
||||
<meta name="generator" content="JSDoc 3.6.7">
|
||||
<meta charset="utf-8">
|
||||
<title>whatsapp-web.js 1.12.2 » Source: util/InterfaceController.js</title>
|
||||
<title>whatsapp-web.js 1.13.2 » 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>12.<wbr>2</a>
|
||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>13.<wbr>2</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
@@ -46,7 +46,8 @@ class InterfaceController {
|
||||
*/
|
||||
async openChatWindow(chatId) {
|
||||
await this.pupPage.evaluate(async chatId => {
|
||||
let chat = await window.Store.Chat.get(chatId);
|
||||
let chatWid = window.Store.WidFactory.createWid(chatId);
|
||||
let chat = await window.Store.Chat.find(chatWid);
|
||||
await window.Store.Cmd.openChatAt(chat);
|
||||
}, chatId);
|
||||
}
|
||||
@@ -103,10 +104,53 @@ class InterfaceController {
|
||||
await window.Store.Cmd.closeDrawerRight();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get all Features
|
||||
*/
|
||||
async getFeatures() {
|
||||
return await this.pupPage.evaluate(() => {
|
||||
return window.Store.Features.F;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if Feature is enabled
|
||||
* @param {string} feature status to check
|
||||
*/
|
||||
async checkFeatureStatus(feature) {
|
||||
return await this.pupPage.evaluate((feature) => {
|
||||
return window.Store.Features.supportsFeature(feature);
|
||||
}, feature);
|
||||
}
|
||||
|
||||
/**
|
||||
* Enable Features
|
||||
* @param {string[]} features to be enabled
|
||||
*/
|
||||
async enableFeatures(features) {
|
||||
await this.pupPage.evaluate((features) => {
|
||||
for (const feature in features) {
|
||||
window.Store.Features.setFeature(features[feature], true);
|
||||
}
|
||||
}, features);
|
||||
}
|
||||
|
||||
/**
|
||||
* Disable Features
|
||||
* @param {string[]} features to be disabled
|
||||
*/
|
||||
async disableFeatures(features) {
|
||||
await this.pupPage.evaluate((features) => {
|
||||
for (const feature in features) {
|
||||
window.Store.Features.setFeature(features[feature], false);
|
||||
}
|
||||
}, features);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = InterfaceController;</code></pre>
|
||||
module.exports = InterfaceController;
|
||||
</code></pre>
|
||||
</article>
|
||||
</div>
|
||||
</div>
|
||||
@@ -116,7 +160,7 @@ module.exports = InterfaceController;</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.6 on February 9, 2021.
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on July 9, 2021.
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta name="generator" content="JSDoc 3.6.6">
|
||||
<meta name="generator" content="JSDoc 3.6.7">
|
||||
<meta charset="utf-8">
|
||||
<title>whatsapp-web.js 1.12.2 » Source: util/Util.js</title>
|
||||
<title>whatsapp-web.js 1.13.2 » 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>12.<wbr>2</a>
|
||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>13.<wbr>2</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
@@ -36,6 +36,7 @@ const path = require('path');
|
||||
const Crypto = require('crypto');
|
||||
const { tmpdir } = require('os');
|
||||
const ffmpeg = require('fluent-ffmpeg');
|
||||
const webp = require('node-webpmux');
|
||||
const fs = require('fs').promises;
|
||||
|
||||
const has = (o, k) => Object.prototype.hasOwnProperty.call(o, k);
|
||||
@@ -49,6 +50,16 @@ class Util {
|
||||
throw new Error(`The ${this.constructor.name} class may not be instantiated.`);
|
||||
}
|
||||
|
||||
static generateHash(length) {
|
||||
var result = '';
|
||||
var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
|
||||
var charactersLength = characters.length;
|
||||
for ( var i = 0; i &lt; length; i++ ) {
|
||||
result += characters.charAt(Math.floor(Math.random() * charactersLength));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets default properties on an object that aren't already specified.
|
||||
* @param {Object} def Default properties
|
||||
@@ -166,16 +177,49 @@ class Util {
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Sticker metadata.
|
||||
* @typedef {Object} StickerMetadata
|
||||
* @property {string} [name]
|
||||
* @property {string} [author]
|
||||
* @property {string[]} [categories]
|
||||
*/
|
||||
|
||||
/**
|
||||
* Formats a media to webp
|
||||
* @param {MessageMedia} media
|
||||
* @param {StickerMetadata} metadata
|
||||
*
|
||||
* @returns {Promise&lt;MessageMedia>} media in webp format
|
||||
*/
|
||||
static async formatToWebpSticker(media) {
|
||||
if (media.mimetype.includes('image')) return this.formatImageToWebpSticker(media);
|
||||
else if (media.mimetype.includes('video')) return this.formatVideoToWebpSticker(media);
|
||||
else throw new Error('Invalid media format');
|
||||
static async formatToWebpSticker(media, metadata) {
|
||||
let webpMedia;
|
||||
|
||||
if (media.mimetype.includes('image'))
|
||||
webpMedia = await this.formatImageToWebpSticker(media);
|
||||
else if (media.mimetype.includes('video'))
|
||||
webpMedia = await this.formatVideoToWebpSticker(media);
|
||||
else
|
||||
throw new Error('Invalid media format');
|
||||
|
||||
if (metadata.name || metadata.author) {
|
||||
const img = new webp.Image();
|
||||
const hash = this.generateHash(32);
|
||||
const stickerPackId = hash;
|
||||
const packname = metadata.name;
|
||||
const author = metadata.author;
|
||||
const categories = metadata.categories || [''];
|
||||
const json = { 'sticker-pack-id': stickerPackId, 'sticker-pack-name': packname, 'sticker-pack-publisher': author, 'emojis': categories };
|
||||
let exifAttr = Buffer.from([0x49, 0x49, 0x2A, 0x00, 0x08, 0x00, 0x00, 0x00, 0x01, 0x00, 0x41, 0x57, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00]);
|
||||
let jsonBuffer = Buffer.from(JSON.stringify(json), 'utf8');
|
||||
let exif = Buffer.concat([exifAttr, jsonBuffer]);
|
||||
exif.writeUIntLE(jsonBuffer.length, 14, 4);
|
||||
await img.loadBuffer(Buffer.from(webpMedia.data, 'base64'));
|
||||
img.exif = exif;
|
||||
webpMedia.data = (await img.saveBuffer()).toString('base64');
|
||||
}
|
||||
|
||||
return webpMedia;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -187,7 +231,8 @@ class Util {
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Util;</code></pre>
|
||||
module.exports = Util;
|
||||
</code></pre>
|
||||
</article>
|
||||
</div>
|
||||
</div>
|
||||
@@ -197,7 +242,7 @@ module.exports = 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.6 on February 9, 2021.
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on July 9, 2021.
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
@@ -192,7 +192,7 @@ client.on('message', async msg => {
|
||||
const chat = await msg.getChat();
|
||||
// stops typing or recording in the chat
|
||||
chat.clearState();
|
||||
} else if (msg.body === 'jumpto') {
|
||||
} else if (msg.body === '!jumpto') {
|
||||
if (msg.hasQuotedMsg) {
|
||||
const quotedMsg = await msg.getQuotedMessage();
|
||||
client.interface.openChatWindowAt(quotedMsg.id._serialized);
|
||||
@@ -259,6 +259,10 @@ client.on('change_battery', (batteryInfo) => {
|
||||
console.log(`Battery: ${battery}% - Charging? ${plugged}`);
|
||||
});
|
||||
|
||||
client.on('change_state', state => {
|
||||
console.log('CHANGE STATE', state );
|
||||
});
|
||||
|
||||
client.on('disconnected', (reason) => {
|
||||
console.log('Client was logged out', reason);
|
||||
});
|
||||
|
||||
136
index.d.ts
vendored
136
index.d.ts
vendored
@@ -19,6 +19,9 @@ declare namespace WAWebJS {
|
||||
/**Accepts an invitation to join a group */
|
||||
acceptInvite(inviteCode: string): Promise<string>
|
||||
|
||||
/** Accepts a private invitation to join a group (v4 invite) */
|
||||
acceptGroupV4Invite: (inviteV4: InviteV4Data) => Promise<{status: number}>
|
||||
|
||||
/**Returns an object with information about the invite code's group */
|
||||
getInviteInfo(inviteCode: string): Promise<object>
|
||||
|
||||
@@ -84,7 +87,7 @@ declare namespace WAWebJS {
|
||||
isRegisteredUser(contactId: string): Promise<boolean>
|
||||
|
||||
/** Get the registered WhatsApp ID for a number. Returns null if the number is not registered on WhatsApp. */
|
||||
getNumberId(number: string): Promise<ContactId?>
|
||||
getNumberId(number: string): Promise<ContactId | null>
|
||||
|
||||
/**
|
||||
* Mutes the Chat until a specified date
|
||||
@@ -99,6 +102,9 @@ declare namespace WAWebJS {
|
||||
/** Send a message to a specific chatId */
|
||||
sendMessage(chatId: string, content: MessageContent, options?: MessageSendOptions): Promise<Message>
|
||||
|
||||
/** Searches for messages */
|
||||
searchMessages(query: string, options?: { chatId?: string, page?: number, limit?: number }): Promise<Message[]>
|
||||
|
||||
/** Marks the client as online */
|
||||
sendPresenceAvailable(): Promise<void>
|
||||
|
||||
@@ -149,8 +155,8 @@ declare namespace WAWebJS {
|
||||
|
||||
/** Emitted when the client has been disconnected */
|
||||
on(event: 'disconnected', listener: (
|
||||
/** state that caused the disconnect */
|
||||
reason: WAState
|
||||
/** reason that caused the disconnect */
|
||||
reason: WAState | "NAVIGATED"
|
||||
) => void): this
|
||||
|
||||
/** Emitted when a user joins the chat via invite link or is added by an admin */
|
||||
@@ -413,7 +419,10 @@ declare namespace WAWebJS {
|
||||
CONTACT_CARD = 'vcard',
|
||||
CONTACT_CARD_MULTI = 'multi_vcard',
|
||||
REVOKED = 'revoked',
|
||||
ORDER = 'order',
|
||||
PRODUCT = 'product',
|
||||
UNKNOWN = 'unknown',
|
||||
GROUP_INVITE = 'groups_v4_invite',
|
||||
}
|
||||
|
||||
/** Client status */
|
||||
@@ -448,6 +457,15 @@ declare namespace WAWebJS {
|
||||
readRemaining: number
|
||||
}
|
||||
|
||||
export type InviteV4Data = {
|
||||
inviteCode: string,
|
||||
inviteCodeExp: number,
|
||||
groupId: string,
|
||||
groupName?: string,
|
||||
fromId: string,
|
||||
toId: string
|
||||
}
|
||||
|
||||
/**
|
||||
* Represents a Message on WhatsApp
|
||||
*
|
||||
@@ -505,6 +523,8 @@ declare namespace WAWebJS {
|
||||
location: Location,
|
||||
/** List of vCards contained in the message */
|
||||
vCards: string[],
|
||||
/** Invite v4 info */
|
||||
inviteV4?: InviteV4Data,
|
||||
/** MediaKey that represents the sticker 'ID' */
|
||||
mediaKey?: string,
|
||||
/** Indicates the mentions in the message body. */
|
||||
@@ -521,7 +541,18 @@ declare namespace WAWebJS {
|
||||
type: MessageTypes,
|
||||
/** Links included in the message. */
|
||||
links: string[],
|
||||
|
||||
/** Order ID */
|
||||
orderId: string,
|
||||
/** title */
|
||||
title?: string,
|
||||
/** description*/
|
||||
description?: string,
|
||||
/** Business Owner JID */
|
||||
businessOwnerJid?: string,
|
||||
/** Product JID */
|
||||
productId?: string,
|
||||
/** Accept the Group V4 Invite in message */
|
||||
acceptGroupV4Invite: () => Promise<{status: number}>,
|
||||
/** Deletes the message from the chat */
|
||||
delete: (everyone?: boolean) => Promise<void>,
|
||||
/** Downloads and returns the attatched message media */
|
||||
@@ -549,7 +580,11 @@ declare namespace WAWebJS {
|
||||
/** Unstar this message */
|
||||
unstar: () => Promise<void>,
|
||||
/** Get information about message delivery statuso */
|
||||
getInfo: () => Promise<MessageInfo | null>
|
||||
getInfo: () => Promise<MessageInfo | null>,
|
||||
/**
|
||||
* Gets the order associated with a given message
|
||||
*/
|
||||
getOrder: () => Order,
|
||||
}
|
||||
|
||||
/** ID that represents a message */
|
||||
@@ -584,6 +619,8 @@ declare namespace WAWebJS {
|
||||
linkPreview?: boolean
|
||||
/** Send audio as voice message */
|
||||
sendAudioAsVoice?: boolean
|
||||
/** Send video as gif */
|
||||
sendVideoAsGif?: boolean
|
||||
/** Send media as sticker */
|
||||
sendMediaAsSticker?: boolean
|
||||
/** Send media as document */
|
||||
@@ -600,6 +637,14 @@ declare namespace WAWebJS {
|
||||
sendSeen?: boolean
|
||||
/** Media to be sent */
|
||||
media?: MessageMedia
|
||||
/** Extra options */
|
||||
extra?: any
|
||||
/** Sticker name, if sendMediaAsSticker is true */
|
||||
stickerName?: string
|
||||
/** Sticker author, if sendMediaAsSticker is true */
|
||||
stickerAuthor?: string
|
||||
/** Sticker categories, if sendMediaAsSticker is true */
|
||||
stickerCategories?: string[]
|
||||
}
|
||||
|
||||
/** Media attached to a message */
|
||||
@@ -907,6 +952,87 @@ declare namespace WAWebJS {
|
||||
/** Makes the bot leave the group */
|
||||
leave: () => Promise<void>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Represents the metadata associated with a given product
|
||||
*
|
||||
*/
|
||||
export interface ProductMetadata {
|
||||
/** Product Id */
|
||||
id: string,
|
||||
/** Product Name */
|
||||
name: string,
|
||||
/** Product Description */
|
||||
description: string,
|
||||
/** Retailer ID */
|
||||
retailer_id?: string
|
||||
}
|
||||
|
||||
/**
|
||||
* Represents a Product on Whatsapp
|
||||
* @example
|
||||
* {
|
||||
* "id": "123456789",
|
||||
* "price": "150000",
|
||||
* "thumbnailId": "123456789",
|
||||
* "thumbnailUrl": "https://mmg.whatsapp.net",
|
||||
* "currency": "GTQ",
|
||||
* "name": "Store Name",
|
||||
* "quantity": 1
|
||||
* }
|
||||
*/
|
||||
export interface Product {
|
||||
/** Product Id */
|
||||
id: string,
|
||||
/** Price */
|
||||
price?: string,
|
||||
/** Product Thumbnail*/
|
||||
thumbnailUrl: string,
|
||||
/** Currency */
|
||||
currency: string,
|
||||
/** Product Name */
|
||||
name: string,
|
||||
/** Product Quantity*/
|
||||
quantity: number,
|
||||
/** Gets the Product metadata */
|
||||
getData: () => Promise<ProductMetadata>
|
||||
}
|
||||
|
||||
/**
|
||||
* Represents a Order on WhatsApp
|
||||
*
|
||||
* @example
|
||||
* {
|
||||
* "products": [
|
||||
* {
|
||||
* "id": "123456789",
|
||||
* "price": "150000",
|
||||
* "thumbnailId": "123456789",
|
||||
* "thumbnailUrl": "https://mmg.whatsapp.net",
|
||||
* "currency": "GTQ",
|
||||
* "name": "Store Name",
|
||||
* "quantity": 1
|
||||
* }
|
||||
* ],
|
||||
* "subtotal": "150000",
|
||||
* "total": "150000",
|
||||
* "currency": "GTQ",
|
||||
* "createdAt": 1610136796,
|
||||
* "sellerJid": "55555555@s.whatsapp.net"
|
||||
* }
|
||||
*/
|
||||
export interface Order {
|
||||
/** List of products*/
|
||||
products: Array<Product>,
|
||||
/** Order Subtotal */
|
||||
subtotal: string,
|
||||
/** Order Total */
|
||||
total: string,
|
||||
/** Order Currency */
|
||||
currency: string,
|
||||
/** Order Created At*/
|
||||
createdAt: number;
|
||||
}
|
||||
}
|
||||
|
||||
export = WAWebJS
|
||||
|
||||
2
index.js
2
index.js
@@ -18,6 +18,6 @@ module.exports = {
|
||||
BusinessContact: require('./src/structures/BusinessContact'),
|
||||
ClientInfo: require('./src/structures/ClientInfo'),
|
||||
Location: require('./src/structures/Location'),
|
||||
|
||||
ProductMetadata: require('./src/structures/ProductMetadata'),
|
||||
...Constants
|
||||
};
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "whatsapp-web.js",
|
||||
"version": "1.12.2",
|
||||
"version": "1.13.2",
|
||||
"description": "Library for interacting with the WhatsApp Web API ",
|
||||
"main": "./index.js",
|
||||
"typings": "./index.d.ts",
|
||||
@@ -28,15 +28,16 @@
|
||||
},
|
||||
"homepage": "https://waguide.pedroslopez.me/",
|
||||
"dependencies": {
|
||||
"@pedroslopez/moduleraid": "^4.1.0",
|
||||
"@pedroslopez/moduleraid": "^5.0.1",
|
||||
"fluent-ffmpeg": "^2.1.2",
|
||||
"jsqr": "^1.3.1",
|
||||
"mime": "^2.4.5",
|
||||
"node-webpmux": "^2.0.0",
|
||||
"puppeteer": "^5.2.1",
|
||||
"sharp": "^0.26.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"eslint": "^6.8.0",
|
||||
"eslint": "^7.27.0",
|
||||
"jsdoc": "^3.6.4",
|
||||
"jsdoc-baseline": "^0.1.5"
|
||||
}
|
||||
|
||||
@@ -30,6 +30,7 @@ const { ClientInfo, Message, MessageMedia, Contact, Location, GroupNotification
|
||||
* @param {number} options.takeoverTimeoutMs - How much time to wait before taking over the session
|
||||
* @param {string} options.userAgent - User agent to use in puppeteer
|
||||
* @param {string} options.ffmpegPath - Ffmpeg path to use when formating videos to webp while sending stickers
|
||||
* @param {boolean} options.bypassCSP - Sets bypassing of page's Content-Security-Policy.
|
||||
*
|
||||
* @fires Client#qr
|
||||
* @fires Client#authenticated
|
||||
@@ -82,6 +83,10 @@ class Client extends EventEmitter {
|
||||
}, this.options.session);
|
||||
}
|
||||
|
||||
if(this.options.bypassCSP) {
|
||||
await page.setBypassCSP(true);
|
||||
}
|
||||
|
||||
await page.goto(WhatsWebURL, {
|
||||
waitUntil: 'load',
|
||||
timeout: 0,
|
||||
@@ -116,18 +121,18 @@ class Client extends EventEmitter {
|
||||
} else {
|
||||
const getQrCode = async () => {
|
||||
// Check if retry button is present
|
||||
var QR_RETRY_SELECTOR = 'div[data-ref] > span > div';
|
||||
var QR_RETRY_SELECTOR = 'div[data-ref] > span > button';
|
||||
var qrRetry = await page.$(QR_RETRY_SELECTOR);
|
||||
if (qrRetry) {
|
||||
await qrRetry.click();
|
||||
}
|
||||
|
||||
// Wait for QR Code
|
||||
|
||||
const QR_CANVAS_SELECTOR = 'canvas';
|
||||
await page.waitForSelector(QR_CANVAS_SELECTOR, { timeout: this.options.qrTimeoutMs });
|
||||
const qrImgData = await page.$eval(QR_CANVAS_SELECTOR, canvas => [].slice.call(canvas.getContext('2d').getImageData(0, 0, 264, 264).data));
|
||||
const qr = jsQR(qrImgData, 264, 264).data;
|
||||
|
||||
/**
|
||||
* Emitted when the QR code is received
|
||||
* @event Client#qr
|
||||
@@ -335,7 +340,7 @@ class Client extends EventEmitter {
|
||||
/**
|
||||
* Emitted when the client has been disconnected
|
||||
* @event Client#disconnected
|
||||
* @param {WAState} reason state that caused the disconnect
|
||||
* @param {WAState|"NAVIGATION"} reason reason that caused the disconnect
|
||||
*/
|
||||
this.emit(Events.DISCONNECTED, state);
|
||||
this.destroy();
|
||||
@@ -373,6 +378,13 @@ class Client extends EventEmitter {
|
||||
* @event Client#ready
|
||||
*/
|
||||
this.emit(Events.READY);
|
||||
|
||||
// Disconnect when navigating away
|
||||
// Because WhatsApp Web now reloads when logging out from the device, this also covers that case
|
||||
this.pupPage.on('framenavigated', async () => {
|
||||
this.emit(Events.DISCONNECTED, 'NAVIGATION');
|
||||
await this.destroy();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -423,6 +435,7 @@ class Client extends EventEmitter {
|
||||
* @typedef {Object} MessageSendOptions
|
||||
* @property {boolean} [linkPreview=true] - Show links preview
|
||||
* @property {boolean} [sendAudioAsVoice=false] - Send audio as voice message
|
||||
* @property {boolean} [sendVideoAsGif=false] - Send video as gif
|
||||
* @property {boolean} [sendMediaAsSticker=false] - Send media as a sticker
|
||||
* @property {boolean} [sendMediaAsDocument=false] - Send media as a document
|
||||
* @property {boolean} [parseVCards=true] - Automatically parse vCards and send them as contacts
|
||||
@@ -430,7 +443,10 @@ class Client extends EventEmitter {
|
||||
* @property {string} [quotedMessageId] - Id of the message that is being quoted (or replied to)
|
||||
* @property {Contact[]} [mentions] - Contacts that are being mentioned in the message
|
||||
* @property {boolean} [sendSeen=true] - Mark the conversation as seen after sending the message
|
||||
* @property {boolean} [media] - Media to be sent
|
||||
* @property {string} [stickerAuthor=undefined] - Sets the author of the sticker, (if sendMediaAsSticker is true).
|
||||
* @property {string} [stickerName=undefined] - Sets the name of the sticker, (if sendMediaAsSticker is true).
|
||||
* @property {string[]} [stickerCategories=undefined] - Sets the categories of the sticker, (if sendMediaAsSticker is true). Provide emoji char array, can be null.
|
||||
* @property {MessageMedia} [media] - Media to be sent
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -445,12 +461,14 @@ class Client extends EventEmitter {
|
||||
let internalOptions = {
|
||||
linkPreview: options.linkPreview === false ? undefined : true,
|
||||
sendAudioAsVoice: options.sendAudioAsVoice,
|
||||
sendVideoAsGif: options.sendVideoAsGif,
|
||||
sendMediaAsSticker: options.sendMediaAsSticker,
|
||||
sendMediaAsDocument: options.sendMediaAsDocument,
|
||||
caption: options.caption,
|
||||
quotedMessageId: options.quotedMessageId,
|
||||
parseVCards: options.parseVCards === false ? false : true,
|
||||
mentionedJidList: Array.isArray(options.mentions) ? options.mentions.map(contact => contact.id._serialized) : []
|
||||
mentionedJidList: Array.isArray(options.mentions) ? options.mentions.map(contact => contact.id._serialized) : [],
|
||||
...options.extra
|
||||
};
|
||||
|
||||
const sendSeen = typeof options.sendSeen === 'undefined' ? true : options.sendSeen;
|
||||
@@ -474,7 +492,12 @@ class Client extends EventEmitter {
|
||||
}
|
||||
|
||||
if (internalOptions.sendMediaAsSticker && internalOptions.attachment) {
|
||||
internalOptions.attachment = await Util.formatToWebpSticker(internalOptions.attachment);
|
||||
internalOptions.attachment =
|
||||
await Util.formatToWebpSticker(internalOptions.attachment, {
|
||||
name: options.stickerName,
|
||||
author: options.stickerAuthor,
|
||||
categories: options.stickerCategories
|
||||
});
|
||||
}
|
||||
|
||||
const newMessage = await this.pupPage.evaluate(async (chatId, message, options, sendSeen) => {
|
||||
@@ -492,6 +515,24 @@ class Client extends EventEmitter {
|
||||
return new Message(this, newMessage);
|
||||
}
|
||||
|
||||
/**
|
||||
* Searches for messages
|
||||
* @param {string} query
|
||||
* @param {Object} [options]
|
||||
* @param {number} [options.page]
|
||||
* @param {number} [options.limit]
|
||||
* @param {string} [options.chatId]
|
||||
* @returns {Promise<Message[]>}
|
||||
*/
|
||||
async searchMessages(query, options = {}) {
|
||||
const messages = await this.pupPage.evaluate(async (query, page, count, remote) => {
|
||||
const { messages } = await window.Store.Msg.search(query, page, count, remote);
|
||||
return messages.map(msg => window.WWebJS.getMessageModel(msg));
|
||||
}, query, options.page, options.limit, options.chatId);
|
||||
|
||||
return messages.map(msg => new Message(this, msg));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all current chat instances
|
||||
* @returns {Promise<Array<Chat>>}
|
||||
@@ -566,6 +607,20 @@ class Client extends EventEmitter {
|
||||
return chatId._serialized;
|
||||
}
|
||||
|
||||
/**
|
||||
* Accepts a private invitation to join a group
|
||||
* @param {object} inviteV4 Invite V4 Info
|
||||
* @returns {Promise<Object>}
|
||||
*/
|
||||
async acceptGroupV4Invite(inviteInfo) {
|
||||
if(!inviteInfo.inviteCode) throw 'Invalid invite code, try passing the message.inviteV4 object';
|
||||
if (inviteInfo.inviteCodeExp == 0) throw 'Expired invite code';
|
||||
return await this.pupPage.evaluate(async inviteInfo => {
|
||||
let { groupId, fromId, inviteCode, inviteCodeExp, toId } = inviteInfo;
|
||||
return await window.Store.Wap.acceptGroupV4Invite(groupId, fromId, inviteCode, String(inviteCodeExp), toId);
|
||||
}, inviteInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the current user's status message
|
||||
* @param {string} status New status message
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
const Base = require('./Base');
|
||||
const MessageMedia = require('./MessageMedia');
|
||||
const Location = require('./Location');
|
||||
const Order = require('./Order');
|
||||
const { MessageTypes } = require('../util/Constants');
|
||||
|
||||
/**
|
||||
@@ -40,7 +41,7 @@ class Message extends Base {
|
||||
* Indicates if the message has media available for download
|
||||
* @type {boolean}
|
||||
*/
|
||||
this.hasMedia = data.clientUrl || data.deprecatedMms3Url ? true : false;
|
||||
this.hasMedia = Boolean(data.mediaKey && data.directPath);
|
||||
|
||||
/**
|
||||
* Message content
|
||||
@@ -81,6 +82,12 @@ class Message extends Base {
|
||||
*/
|
||||
this.author = (typeof (data.author) === 'object' && data.author !== null) ? data.author._serialized : data.author;
|
||||
|
||||
/**
|
||||
* String that represents from which device type the message was sent
|
||||
* @type {string}
|
||||
*/
|
||||
this.deviceType = data.id.id.length > 21 ? 'android' : data.id.id.substring(0,2) =='3A' ? 'ios' : 'web';
|
||||
|
||||
/**
|
||||
* Indicates if the message was forwarded
|
||||
* @type {boolean}
|
||||
@@ -129,6 +136,19 @@ class Message extends Base {
|
||||
*/
|
||||
this.vCards = data.type === MessageTypes.CONTACT_CARD_MULTI ? data.vcardList.map((c) => c.vcard) : data.type === MessageTypes.CONTACT_CARD ? [data.body] : [];
|
||||
|
||||
/**
|
||||
* Group Invite Data
|
||||
* @type {object}
|
||||
*/
|
||||
this.inviteV4 = data.type === MessageTypes.GROUP_INVITE ? {
|
||||
inviteCode: data.inviteCode,
|
||||
inviteCodeExp: data.inviteCodeExp,
|
||||
groupId: data.inviteGrp,
|
||||
groupName: data.inviteGrpName,
|
||||
fromId: data.from._serialized,
|
||||
toId: data.to._serialized
|
||||
} : undefined;
|
||||
|
||||
/**
|
||||
* Indicates the mentions in the message body.
|
||||
* @type {Array<string>}
|
||||
@@ -139,6 +159,37 @@ class Message extends Base {
|
||||
this.mentionedIds = data.mentionedJidList;
|
||||
}
|
||||
|
||||
/**
|
||||
* Order ID for message type ORDER
|
||||
* @type {string}
|
||||
*/
|
||||
this.orderId = data.orderId ? data.orderId : undefined;
|
||||
/**
|
||||
* Order Token for message type ORDER
|
||||
* @type {string}
|
||||
*/
|
||||
this.token = data.token ? data.token : undefined;
|
||||
|
||||
/** Title */
|
||||
if (data.title) {
|
||||
this.title = data.title;
|
||||
}
|
||||
|
||||
/** Description */
|
||||
if (data.description) {
|
||||
this.description = data.description;
|
||||
}
|
||||
|
||||
/** Business Owner JID */
|
||||
if (data.businessOwnerJid) {
|
||||
this.businessOwnerJid = data.businessOwnerJid;
|
||||
}
|
||||
|
||||
/** Product ID */
|
||||
if (data.productId) {
|
||||
this.productId = data.productId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Links included in the message.
|
||||
* @type {Array<string>}
|
||||
@@ -214,6 +265,14 @@ class Message extends Base {
|
||||
return this.client.sendMessage(chatId, content, options);
|
||||
}
|
||||
|
||||
/**
|
||||
* Accept Group V4 Invite
|
||||
* @returns {Promise<Object>}
|
||||
*/
|
||||
async acceptGroupV4Invite() {
|
||||
return await this.client.acceptGroupV4Invite(this.inviteV4);
|
||||
}
|
||||
|
||||
/**
|
||||
* Forwards this message to another chat
|
||||
*
|
||||
@@ -253,14 +312,20 @@ class Message extends Base {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
const mediaUrl = msg.clientUrl || msg.deprecatedMms3Url;
|
||||
const decryptedMedia = await window.Store.DownloadManager.downloadAndDecrypt({
|
||||
directPath: msg.directPath,
|
||||
encFilehash: msg.encFilehash,
|
||||
filehash: msg.filehash,
|
||||
mediaKey: msg.mediaKey,
|
||||
mediaKeyTimestamp: msg.mediaKeyTimestamp,
|
||||
type: msg.type,
|
||||
signal: (new AbortController).signal
|
||||
});
|
||||
|
||||
const buffer = await window.WWebJS.downloadBuffer(mediaUrl);
|
||||
const decrypted = await window.Store.CryptoLib.decryptE2EMedia(msg.type, buffer, msg.mediaKey, msg.mimetype);
|
||||
const data = await window.WWebJS.readBlobAsync(decrypted._blob);
|
||||
const data = window.WWebJS.arrayBufferToBase64(decryptedMedia);
|
||||
|
||||
return {
|
||||
data: data.split(',')[1],
|
||||
data,
|
||||
mimetype: msg.mimetype,
|
||||
filename: msg.filename
|
||||
};
|
||||
@@ -291,7 +356,7 @@ class Message extends Base {
|
||||
* Stars this message
|
||||
*/
|
||||
async star() {
|
||||
await this.pupPage.evaluate((msgId) => {
|
||||
await this.client.pupPage.evaluate((msgId) => {
|
||||
let msg = window.Store.Msg.get(msgId);
|
||||
|
||||
if (msg.canStar()) {
|
||||
@@ -304,7 +369,7 @@ class Message extends Base {
|
||||
* Unstars this message
|
||||
*/
|
||||
async unstar() {
|
||||
await this.pupPage.evaluate((msgId) => {
|
||||
await this.client.pupPage.evaluate((msgId) => {
|
||||
let msg = window.Store.Msg.get(msgId);
|
||||
|
||||
if (msg.canStar()) {
|
||||
@@ -342,6 +407,21 @@ class Message extends Base {
|
||||
|
||||
return info;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the order associated with a given message
|
||||
* @return {Promise<Order>}
|
||||
*/
|
||||
async getOrder() {
|
||||
if (this.type === MessageTypes.ORDER) {
|
||||
const result = await this.client.pupPage.evaluate((orderId, token) => {
|
||||
return window.WWebJS.getOrderDetail(orderId, token);
|
||||
}, this.orderId, this.token);
|
||||
if (!result) return undefined;
|
||||
return new Order(this.client, result);
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Message;
|
||||
|
||||
52
src/structures/Order.js
Normal file
52
src/structures/Order.js
Normal file
@@ -0,0 +1,52 @@
|
||||
'use strict';
|
||||
|
||||
const Base = require('./Base');
|
||||
const Product = require('./Product');
|
||||
|
||||
/**
|
||||
* Represents a Order on WhatsApp
|
||||
* @extends {Base}
|
||||
*/
|
||||
class Order extends Base {
|
||||
constructor(client, data) {
|
||||
super(client);
|
||||
|
||||
if (data) this._patch(data);
|
||||
}
|
||||
|
||||
_patch(data) {
|
||||
/**
|
||||
* List of products
|
||||
* @type {Array<Product>}
|
||||
*/
|
||||
if (data.products) {
|
||||
this.products = data.products.map(product => new Product(this.client, product));
|
||||
}
|
||||
/**
|
||||
* Order Subtotal
|
||||
* @type {string}
|
||||
*/
|
||||
this.subtotal = data.subtotal;
|
||||
/**
|
||||
* Order Total
|
||||
* @type {string}
|
||||
*/
|
||||
this.total = data.total;
|
||||
/**
|
||||
* Order Currency
|
||||
* @type {string}
|
||||
*/
|
||||
this.currency = data.currency;
|
||||
/**
|
||||
* Order Created At
|
||||
* @type {number}
|
||||
*/
|
||||
this.createdAt = data.createdAt;
|
||||
|
||||
return super._patch(data);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
module.exports = Order;
|
||||
68
src/structures/Product.js
Normal file
68
src/structures/Product.js
Normal file
@@ -0,0 +1,68 @@
|
||||
'use strict';
|
||||
|
||||
const Base = require('./Base');
|
||||
const ProductMetadata = require('./ProductMetadata');
|
||||
|
||||
/**
|
||||
* Represents a Product on WhatsAppBusiness
|
||||
* @extends {Base}
|
||||
*/
|
||||
class Product extends Base {
|
||||
constructor(client, data) {
|
||||
super(client);
|
||||
|
||||
if (data) this._patch(data);
|
||||
}
|
||||
|
||||
_patch(data) {
|
||||
/**
|
||||
* Product ID
|
||||
* @type {string}
|
||||
*/
|
||||
this.id = data.id;
|
||||
/**
|
||||
* Price
|
||||
* @type {string}
|
||||
*/
|
||||
this.price = data.price ? data.price : '';
|
||||
/**
|
||||
* Product Thumbnail
|
||||
* @type {string}
|
||||
*/
|
||||
this.thumbnailUrl = data.thumbnailUrl;
|
||||
/**
|
||||
* Currency
|
||||
* @type {string}
|
||||
*/
|
||||
this.currency = data.currency;
|
||||
/**
|
||||
* Product Name
|
||||
* @type {string}
|
||||
*/
|
||||
this.name = data.name;
|
||||
/**
|
||||
* Product Quantity
|
||||
* @type {number}
|
||||
*/
|
||||
this.quantity = data.quantity;
|
||||
/** Product metadata */
|
||||
this.data = null;
|
||||
return super._patch(data);
|
||||
}
|
||||
|
||||
async getData() {
|
||||
if (this.data === null) {
|
||||
let result = await this.client.pupPage.evaluate((productId) => {
|
||||
return window.WWebJS.getProductMetadata(productId);
|
||||
}, this.id);
|
||||
if (!result) {
|
||||
this.data = undefined;
|
||||
} else {
|
||||
this.data = new ProductMetadata(this.client, result);
|
||||
}
|
||||
}
|
||||
return this.data;
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Product;
|
||||
25
src/structures/ProductMetadata.js
Normal file
25
src/structures/ProductMetadata.js
Normal file
@@ -0,0 +1,25 @@
|
||||
const Base = require('./Base');
|
||||
|
||||
class ProductMetadata extends Base {
|
||||
constructor(client, data) {
|
||||
super(client);
|
||||
|
||||
if (data) this._patch(data);
|
||||
}
|
||||
|
||||
_patch(data) {
|
||||
/** Product ID */
|
||||
this.id = data.id;
|
||||
/** Retailer ID */
|
||||
this.retailer_id = data.retailer_id;
|
||||
/** Product Name */
|
||||
this.name = data.name;
|
||||
/** Product Description */
|
||||
this.description = data.description;
|
||||
|
||||
return super._patch(data);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
module.exports = ProductMetadata;
|
||||
@@ -11,5 +11,7 @@ module.exports = {
|
||||
PrivateChat: require('./PrivateChat'),
|
||||
PrivateContact: require('./PrivateContact'),
|
||||
GroupNotification: require('./GroupNotification'),
|
||||
Label: require('./Label.js')
|
||||
Label: require('./Label.js'),
|
||||
Order: require('./Order'),
|
||||
Product: require('./Product')
|
||||
};
|
||||
@@ -14,7 +14,8 @@ exports.DefaultOptions = {
|
||||
takeoverOnConflict: false,
|
||||
takeoverTimeoutMs: 0,
|
||||
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'
|
||||
ffmpegPath: 'ffmpeg',
|
||||
bypassCSP: false
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -68,8 +69,11 @@ exports.MessageTypes = {
|
||||
LOCATION: 'location',
|
||||
CONTACT_CARD: 'vcard',
|
||||
CONTACT_CARD_MULTI: 'multi_vcard',
|
||||
ORDER: 'order',
|
||||
REVOKED: 'revoked',
|
||||
UNKNOWN: 'unknown'
|
||||
PRODUCT: 'product',
|
||||
UNKNOWN: 'unknown',
|
||||
GROUP_INVITE: 'groups_v4_invite'
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -13,7 +13,7 @@ exports.ExposeStore = (moduleRaidStr) => {
|
||||
window.Store.SendSeen = window.mR.findModule('sendSeen')[0];
|
||||
window.Store.SendClear = window.mR.findModule('sendClear')[0];
|
||||
window.Store.SendDelete = window.mR.findModule('sendDelete')[0];
|
||||
window.Store.genId = window.mR.findModule((module) => module.default && typeof module.default === 'function' && module.default.toString().match(/crypto/))[0].default;
|
||||
window.Store.genId = window.mR.findModule('randomId')[0].default;
|
||||
window.Store.SendMessage = window.mR.findModule('addAndSendMsgToChat')[0];
|
||||
window.Store.MsgKey = window.mR.findModule((module) => module.default && module.default.fromString)[0].default;
|
||||
window.Store.Invite = window.mR.findModule('sendJoinGroupViaInvite')[0];
|
||||
@@ -32,6 +32,10 @@ exports.ExposeStore = (moduleRaidStr) => {
|
||||
window.Store.Sticker = window.mR.findModule('Sticker')[0].default.Sticker;
|
||||
window.Store.UploadUtils = window.mR.findModule((module) => (module.default && module.default.encryptAndUpload) ? module.default : null)[0].default;
|
||||
window.Store.Label = window.mR.findModule('LabelCollection')[0].default;
|
||||
window.Store.Features = window.mR.findModule('FEATURE_CHANGE_EVENT')[0].default;
|
||||
window.Store.QueryOrder = window.mR.findModule('queryOrder')[0];
|
||||
window.Store.QueryProduct = window.mR.findModule('queryProduct')[0];
|
||||
window.Store.DownloadManager = window.mR.findModule('DownloadManager')[0].default;
|
||||
};
|
||||
|
||||
exports.LoadUtils = () => {
|
||||
@@ -62,7 +66,8 @@ exports.LoadUtils = () => {
|
||||
? await window.WWebJS.processStickerData(options.attachment)
|
||||
: await window.WWebJS.processMediaData(options.attachment, {
|
||||
forceVoice: options.sendAudioAsVoice,
|
||||
forceDocument: options.sendMediaAsDocument
|
||||
forceDocument: options.sendMediaAsDocument,
|
||||
forceGif: options.sendVideoAsGif
|
||||
});
|
||||
|
||||
content = options.sendMediaAsSticker ? undefined : attOptions.preview;
|
||||
@@ -185,6 +190,7 @@ exports.LoadUtils = () => {
|
||||
const stickerInfo = {
|
||||
...uploadedInfo,
|
||||
clientUrl: uploadedInfo.url,
|
||||
deprecatedMms3Url: uploadedInfo.url,
|
||||
uploadhash: uploadedInfo.encFilehash,
|
||||
size: file.size,
|
||||
type: 'sticker',
|
||||
@@ -194,7 +200,7 @@ exports.LoadUtils = () => {
|
||||
return stickerInfo;
|
||||
};
|
||||
|
||||
window.WWebJS.processMediaData = async (mediaInfo, { forceVoice, forceDocument }) => {
|
||||
window.WWebJS.processMediaData = async (mediaInfo, { forceVoice, forceDocument, forceGif }) => {
|
||||
const file = window.WWebJS.mediaInfoToFile(mediaInfo);
|
||||
const mData = await window.Store.OpaqueData.createFromData(file, file.type);
|
||||
const mediaPrep = window.Store.MediaPrep.prepRawMedia(mData, { asDocument: forceDocument });
|
||||
@@ -210,6 +216,10 @@ exports.LoadUtils = () => {
|
||||
mediaData.type = 'ptt';
|
||||
}
|
||||
|
||||
if (forceGif && mediaData.type === 'video') {
|
||||
mediaData.isGif = true;
|
||||
}
|
||||
|
||||
if (forceDocument) {
|
||||
mediaData.type = 'document';
|
||||
}
|
||||
@@ -340,43 +350,14 @@ exports.LoadUtils = () => {
|
||||
});
|
||||
};
|
||||
|
||||
window.WWebJS.downloadBuffer = (url) => {
|
||||
return new Promise(function (resolve, reject) {
|
||||
let xhr = new XMLHttpRequest();
|
||||
xhr.open('GET', url);
|
||||
xhr.responseType = 'arraybuffer';
|
||||
xhr.onload = function () {
|
||||
if (xhr.status == 200) {
|
||||
resolve(xhr.response);
|
||||
} else {
|
||||
reject({
|
||||
status: this.status,
|
||||
statusText: xhr.statusText
|
||||
});
|
||||
}
|
||||
};
|
||||
xhr.onerror = function () {
|
||||
reject({
|
||||
status: this.status,
|
||||
statusText: xhr.statusText
|
||||
});
|
||||
};
|
||||
xhr.send(null);
|
||||
});
|
||||
};
|
||||
|
||||
window.WWebJS.readBlobAsync = (blob) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
let reader = new FileReader();
|
||||
|
||||
reader.onload = () => {
|
||||
resolve(reader.result);
|
||||
};
|
||||
|
||||
reader.onerror = reject;
|
||||
|
||||
reader.readAsDataURL(blob);
|
||||
});
|
||||
window.WWebJS.arrayBufferToBase64 = (arrayBuffer) => {
|
||||
let binary = '';
|
||||
const bytes = new Uint8Array( arrayBuffer );
|
||||
const len = bytes.byteLength;
|
||||
for (let i = 0; i < len; i++) {
|
||||
binary += String.fromCharCode( bytes[ i ] );
|
||||
}
|
||||
return window.btoa( binary );
|
||||
};
|
||||
|
||||
window.WWebJS.getFileHash = async (data) => {
|
||||
@@ -452,6 +433,20 @@ exports.LoadUtils = () => {
|
||||
const chat = await window.WWebJS.getChat(chatId);
|
||||
return (chat.labels || []).map(id => window.WWebJS.getLabel(id));
|
||||
};
|
||||
|
||||
window.WWebJS.getOrderDetail = async (orderId, token) => {
|
||||
return window.Store.QueryOrder.queryOrder(orderId, 80, 80, token);
|
||||
};
|
||||
|
||||
window.WWebJS.getProductMetadata = async (productId) => {
|
||||
let sellerId = window.Store.Conn.wid;
|
||||
let product = await window.Store.QueryProduct.queryProduct(sellerId, productId);
|
||||
if (product && product.data) {
|
||||
return product.data;
|
||||
}
|
||||
|
||||
return undefined;
|
||||
};
|
||||
};
|
||||
|
||||
exports.MarkAllRead = () => {
|
||||
|
||||
@@ -15,7 +15,8 @@ class InterfaceController {
|
||||
*/
|
||||
async openChatWindow(chatId) {
|
||||
await this.pupPage.evaluate(async chatId => {
|
||||
let chat = await window.Store.Chat.get(chatId);
|
||||
let chatWid = window.Store.WidFactory.createWid(chatId);
|
||||
let chat = await window.Store.Chat.find(chatWid);
|
||||
await window.Store.Cmd.openChatAt(chat);
|
||||
}, chatId);
|
||||
}
|
||||
@@ -72,7 +73,49 @@ class InterfaceController {
|
||||
await window.Store.Cmd.closeDrawerRight();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get all Features
|
||||
*/
|
||||
async getFeatures() {
|
||||
return await this.pupPage.evaluate(() => {
|
||||
return window.Store.Features.F;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if Feature is enabled
|
||||
* @param {string} feature status to check
|
||||
*/
|
||||
async checkFeatureStatus(feature) {
|
||||
return await this.pupPage.evaluate((feature) => {
|
||||
return window.Store.Features.supportsFeature(feature);
|
||||
}, feature);
|
||||
}
|
||||
|
||||
/**
|
||||
* Enable Features
|
||||
* @param {string[]} features to be enabled
|
||||
*/
|
||||
async enableFeatures(features) {
|
||||
await this.pupPage.evaluate((features) => {
|
||||
for (const feature in features) {
|
||||
window.Store.Features.setFeature(features[feature], true);
|
||||
}
|
||||
}, features);
|
||||
}
|
||||
|
||||
/**
|
||||
* Disable Features
|
||||
* @param {string[]} features to be disabled
|
||||
*/
|
||||
async disableFeatures(features) {
|
||||
await this.pupPage.evaluate((features) => {
|
||||
for (const feature in features) {
|
||||
window.Store.Features.setFeature(features[feature], false);
|
||||
}
|
||||
}, features);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = InterfaceController;
|
||||
module.exports = InterfaceController;
|
||||
|
||||
@@ -5,6 +5,7 @@ const path = require('path');
|
||||
const Crypto = require('crypto');
|
||||
const { tmpdir } = require('os');
|
||||
const ffmpeg = require('fluent-ffmpeg');
|
||||
const webp = require('node-webpmux');
|
||||
const fs = require('fs').promises;
|
||||
|
||||
const has = (o, k) => Object.prototype.hasOwnProperty.call(o, k);
|
||||
@@ -18,6 +19,16 @@ class Util {
|
||||
throw new Error(`The ${this.constructor.name} class may not be instantiated.`);
|
||||
}
|
||||
|
||||
static generateHash(length) {
|
||||
var result = '';
|
||||
var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
|
||||
var charactersLength = characters.length;
|
||||
for ( var i = 0; i < length; i++ ) {
|
||||
result += characters.charAt(Math.floor(Math.random() * charactersLength));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets default properties on an object that aren't already specified.
|
||||
* @param {Object} def Default properties
|
||||
@@ -135,16 +146,49 @@ class Util {
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Sticker metadata.
|
||||
* @typedef {Object} StickerMetadata
|
||||
* @property {string} [name]
|
||||
* @property {string} [author]
|
||||
* @property {string[]} [categories]
|
||||
*/
|
||||
|
||||
/**
|
||||
* Formats a media to webp
|
||||
* @param {MessageMedia} media
|
||||
* @param {StickerMetadata} metadata
|
||||
*
|
||||
* @returns {Promise<MessageMedia>} media in webp format
|
||||
*/
|
||||
static async formatToWebpSticker(media) {
|
||||
if (media.mimetype.includes('image')) return this.formatImageToWebpSticker(media);
|
||||
else if (media.mimetype.includes('video')) return this.formatVideoToWebpSticker(media);
|
||||
else throw new Error('Invalid media format');
|
||||
static async formatToWebpSticker(media, metadata) {
|
||||
let webpMedia;
|
||||
|
||||
if (media.mimetype.includes('image'))
|
||||
webpMedia = await this.formatImageToWebpSticker(media);
|
||||
else if (media.mimetype.includes('video'))
|
||||
webpMedia = await this.formatVideoToWebpSticker(media);
|
||||
else
|
||||
throw new Error('Invalid media format');
|
||||
|
||||
if (metadata.name || metadata.author) {
|
||||
const img = new webp.Image();
|
||||
const hash = this.generateHash(32);
|
||||
const stickerPackId = hash;
|
||||
const packname = metadata.name;
|
||||
const author = metadata.author;
|
||||
const categories = metadata.categories || [''];
|
||||
const json = { 'sticker-pack-id': stickerPackId, 'sticker-pack-name': packname, 'sticker-pack-publisher': author, 'emojis': categories };
|
||||
let exifAttr = Buffer.from([0x49, 0x49, 0x2A, 0x00, 0x08, 0x00, 0x00, 0x00, 0x01, 0x00, 0x41, 0x57, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00]);
|
||||
let jsonBuffer = Buffer.from(JSON.stringify(json), 'utf8');
|
||||
let exif = Buffer.concat([exifAttr, jsonBuffer]);
|
||||
exif.writeUIntLE(jsonBuffer.length, 14, 4);
|
||||
await img.loadBuffer(Buffer.from(webpMedia.data, 'base64'));
|
||||
img.exif = exif;
|
||||
webpMedia.data = (await img.saveBuffer()).toString('base64');
|
||||
}
|
||||
|
||||
return webpMedia;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -156,4 +200,4 @@ class Util {
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Util;
|
||||
module.exports = Util;
|
||||
|
||||
Reference in New Issue
Block a user