mirror of
https://github.com/cheveguerra/whatsapp-web.js.git
synced 2026-04-18 11:39:14 +00:00
Compare commits
55 Commits
v1.16.6
...
pedroslope
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8afe71d959 | ||
|
|
afb0b5d7d3 | ||
|
|
6fe1017bd3 | ||
|
|
a15f1b8428 | ||
|
|
dc91562f3c | ||
|
|
db55d869f8 | ||
|
|
d9f9c28276 | ||
|
|
a60f5ebf40 | ||
|
|
e8bae22b03 | ||
|
|
82120f0446 | ||
|
|
6f7c5c2dd9 | ||
|
|
9981723505 | ||
|
|
7bb7f13f07 | ||
|
|
7d672078cd | ||
|
|
088ec32b7b | ||
|
|
ef3eadc6e5 | ||
|
|
ab87fecfd9 | ||
|
|
36aa37f1ac | ||
|
|
45972fb47e | ||
|
|
55f75b8f69 | ||
|
|
b1e0fce504 | ||
|
|
62623347e8 | ||
|
|
705d4d31fd | ||
|
|
bd4df4cf75 | ||
|
|
7fe3574730 | ||
|
|
09a81d0e1e | ||
|
|
c09a22c533 | ||
|
|
bb09bb74e7 | ||
|
|
694a52bf26 | ||
|
|
c459eca799 | ||
|
|
b74246d69a | ||
|
|
ab7ee0eb4f | ||
|
|
537e843a49 | ||
|
|
76f7a6e279 | ||
|
|
f2ec77f969 | ||
|
|
fd368361df | ||
|
|
bd553f75d3 | ||
|
|
c5c705a553 | ||
|
|
6e047cb9be | ||
|
|
56343497e9 | ||
|
|
6a4fca0a77 | ||
|
|
e91077a615 | ||
|
|
0e5bd9f38e | ||
|
|
75d3c635f0 | ||
|
|
8497a3d7e5 | ||
|
|
e7025ceca1 | ||
|
|
b8b41920e3 | ||
|
|
73e4b3b6e0 | ||
|
|
af431df1c9 | ||
|
|
61c0a6be56 | ||
|
|
a0b18fb685 | ||
|
|
98ff761cfb | ||
|
|
c0ef9223ed | ||
|
|
294e5027b0 | ||
|
|
ebc56bc280 |
41
.github/pull_request_template.md
vendored
Normal file
41
.github/pull_request_template.md
vendored
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
# PR Details
|
||||||
|
|
||||||
|
<!--- Provide a general summary of your changes in the Title above -->
|
||||||
|
|
||||||
|
## Description
|
||||||
|
|
||||||
|
<!--- Describe your changes in detail -->
|
||||||
|
|
||||||
|
## Related Issue
|
||||||
|
|
||||||
|
<!--- Optional --->
|
||||||
|
<!--- If there is an issue link it here: -->
|
||||||
|
|
||||||
|
## Motivation and Context
|
||||||
|
|
||||||
|
<!--- Optional --->
|
||||||
|
<!--- Why is this change required? What problem does it solve? -->
|
||||||
|
|
||||||
|
## How Has This Been Tested
|
||||||
|
|
||||||
|
<!--- Please describe in detail how you tested your changes. -->
|
||||||
|
<!--- Include details of your testing environment, and the tests you ran to -->
|
||||||
|
|
||||||
|
## Types of changes
|
||||||
|
|
||||||
|
<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->
|
||||||
|
|
||||||
|
- [ ] Dependency change
|
||||||
|
- [ ] Bug fix (non-breaking change which fixes an issue)
|
||||||
|
- [ ] New feature (non-breaking change which adds functionality)
|
||||||
|
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
|
||||||
|
|
||||||
|
## Checklist
|
||||||
|
|
||||||
|
<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
|
||||||
|
|
||||||
|
- [ ] My code follows the code style of this project.
|
||||||
|
- [ ] I have updated the documentation accordingly (index.d.ts).
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
32
.github/workflows/release.yml
vendored
Normal file
32
.github/workflows/release.yml
vendored
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
name: release
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
release_type:
|
||||||
|
description: "`alpha`, `alpha-minor`, `alpha-major` release?"
|
||||||
|
required: true
|
||||||
|
default: "alpha"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
release:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: ${{ github.repository == 'pedroslopez/whatsapp-web.js' }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.RELEASE_GITHUB_TOKEN }}
|
||||||
|
- run: git config --global user.email "hello@wwebjs.dev"
|
||||||
|
- run: git config --global user.name "WWebJS Bot"
|
||||||
|
- name: Bump version and publish to NPM
|
||||||
|
id: publish
|
||||||
|
run: ./tools/publish ${{ github.event.inputs.release_type }}
|
||||||
|
env:
|
||||||
|
NPM_TOKEN: ${{ secrets.RELEASE_NPM_TOKEN }}
|
||||||
|
- name: Create GitHub Release
|
||||||
|
id: create_release
|
||||||
|
uses: ncipollo/release-action@v1
|
||||||
|
with:
|
||||||
|
prerelease: ${{ steps.publish.outputs.PRERELEASE }}
|
||||||
|
generateReleaseNotes: true
|
||||||
|
tag: v${{ steps.publish.outputs.NEW_VERSION }}
|
||||||
@@ -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
|
# whatsapp-web.js
|
||||||
A WhatsApp API client that connects through the WhatsApp Web browser app
|
A WhatsApp API client that connects through the WhatsApp Web browser app
|
||||||
@@ -80,6 +80,7 @@ For more information on saving and restoring sessions, check out the available [
|
|||||||
| Get contact info | ✅ |
|
| Get contact info | ✅ |
|
||||||
| Get profile pictures | ✅ |
|
| Get profile pictures | ✅ |
|
||||||
| Set user status message | ✅ |
|
| Set user status message | ✅ |
|
||||||
|
| React to messages | ✅ |
|
||||||
|
|
||||||
Something missing? Make an issue and let us know!
|
Something missing? Make an issue and let us know!
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta name="generator" content="JSDoc 3.6.7">
|
<meta name="generator" content="JSDoc 3.6.7">
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>whatsapp-web.js 1.16.6 » Class: Base</title>
|
<title>whatsapp-web.js 1.18.4 » Class: Base</title>
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
||||||
<div id="jsdoc-navbar-container">
|
<div id="jsdoc-navbar-container">
|
||||||
<div id="jsdoc-navbar-content">
|
<div id="jsdoc-navbar-content">
|
||||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>16.<wbr>6</a>
|
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>18.<wbr>4</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
@@ -50,7 +50,7 @@
|
|||||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||||
<div id="jsdoc-footer-container">
|
<div id="jsdoc-footer-container">
|
||||||
<p>
|
<p>
|
||||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on April 21, 2022.
|
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on November 26, 2022.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta name="generator" content="JSDoc 3.6.7">
|
<meta name="generator" content="JSDoc 3.6.7">
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>whatsapp-web.js 1.16.6 » Class: BaseAuthStrategy</title>
|
<title>whatsapp-web.js 1.18.4 » Class: BaseAuthStrategy</title>
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
||||||
<div id="jsdoc-navbar-container">
|
<div id="jsdoc-navbar-container">
|
||||||
<div id="jsdoc-navbar-content">
|
<div id="jsdoc-navbar-content">
|
||||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>16.<wbr>6</a>
|
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>18.<wbr>4</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
@@ -50,7 +50,7 @@
|
|||||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||||
<div id="jsdoc-footer-container">
|
<div id="jsdoc-footer-container">
|
||||||
<p>
|
<p>
|
||||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on April 21, 2022.
|
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on November 26, 2022.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta name="generator" content="JSDoc 3.6.7">
|
<meta name="generator" content="JSDoc 3.6.7">
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>whatsapp-web.js 1.16.6 » Class: BusinessContact</title>
|
<title>whatsapp-web.js 1.18.4 » Class: BusinessContact</title>
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
||||||
<div id="jsdoc-navbar-container">
|
<div id="jsdoc-navbar-container">
|
||||||
<div id="jsdoc-navbar-content">
|
<div id="jsdoc-navbar-content">
|
||||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>16.<wbr>6</a>
|
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>18.<wbr>4</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
@@ -326,7 +326,7 @@
|
|||||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||||
<div id="jsdoc-footer-container">
|
<div id="jsdoc-footer-container">
|
||||||
<p>
|
<p>
|
||||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on April 21, 2022.
|
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on November 26, 2022.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta name="generator" content="JSDoc 3.6.7">
|
<meta name="generator" content="JSDoc 3.6.7">
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>whatsapp-web.js 1.16.6 » Class: Buttons</title>
|
<title>whatsapp-web.js 1.18.4 » Class: Buttons</title>
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
||||||
<div id="jsdoc-navbar-container">
|
<div id="jsdoc-navbar-container">
|
||||||
<div id="jsdoc-navbar-content">
|
<div id="jsdoc-navbar-content">
|
||||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>16.<wbr>6</a>
|
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>18.<wbr>4</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
@@ -234,7 +234,7 @@ Returns: [{ buttonId:'customId',buttonText:{'displayText':&#
|
|||||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||||
<div id="jsdoc-footer-container">
|
<div id="jsdoc-footer-container">
|
||||||
<p>
|
<p>
|
||||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on April 21, 2022.
|
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on November 26, 2022.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta name="generator" content="JSDoc 3.6.7">
|
<meta name="generator" content="JSDoc 3.6.7">
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>whatsapp-web.js 1.16.6 » Class: Call</title>
|
<title>whatsapp-web.js 1.18.4 » Class: Call</title>
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
||||||
<div id="jsdoc-navbar-container">
|
<div id="jsdoc-navbar-container">
|
||||||
<div id="jsdoc-navbar-content">
|
<div id="jsdoc-navbar-content">
|
||||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>16.<wbr>6</a>
|
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>18.<wbr>4</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
@@ -144,7 +144,7 @@
|
|||||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||||
<div id="jsdoc-footer-container">
|
<div id="jsdoc-footer-container">
|
||||||
<p>
|
<p>
|
||||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on April 21, 2022.
|
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on November 26, 2022.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta name="generator" content="JSDoc 3.6.7">
|
<meta name="generator" content="JSDoc 3.6.7">
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>whatsapp-web.js 1.16.6 » Class: Chat</title>
|
<title>whatsapp-web.js 1.18.4 » Class: Chat</title>
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
||||||
<div id="jsdoc-navbar-container">
|
<div id="jsdoc-navbar-container">
|
||||||
<div id="jsdoc-navbar-content">
|
<div id="jsdoc-navbar-content">
|
||||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>16.<wbr>6</a>
|
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>18.<wbr>4</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
@@ -271,7 +271,7 @@
|
|||||||
<p> </p>
|
<p> </p>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<p>Options for searching messages. Right now only limit is supported.</p>
|
<p>Options for searching messages. Right now only limit and fromMe is supported.</p>
|
||||||
<p>Values in <code>searchOptions</code> have the following properties:</p>
|
<p>Values in <code>searchOptions</code> have the following properties:</p>
|
||||||
<table class="jsdoc-details-table">
|
<table class="jsdoc-details-table">
|
||||||
<thead>
|
<thead>
|
||||||
@@ -297,6 +297,20 @@
|
|||||||
<p>The amount of messages to return. If no limit is specified, the available messages will be returned. Note that the actual number of returned messages may be smaller if there aren't enough messages in the conversation. Set this to Infinity to load all messages.</p>
|
<p>The amount of messages to return. If no limit is specified, the available messages will be returned. Note that the actual number of returned messages may be smaller if there aren't enough messages in the conversation. Set this to Infinity to load all messages.</p>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<p>fromMe</p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p>Boolean</p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p>Yes</p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p>Return only messages from the bot number or vise versa. To get all messages, leave the option undefined.</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</td>
|
</td>
|
||||||
@@ -483,7 +497,7 @@
|
|||||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||||
<div id="jsdoc-footer-container">
|
<div id="jsdoc-footer-container">
|
||||||
<p>
|
<p>
|
||||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on April 21, 2022.
|
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on November 26, 2022.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
182
docs/Client.html
182
docs/Client.html
@@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta name="generator" content="JSDoc 3.6.7">
|
<meta name="generator" content="JSDoc 3.6.7">
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>whatsapp-web.js 1.16.6 » Class: Client</title>
|
<title>whatsapp-web.js 1.18.4 » Class: Client</title>
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
||||||
<div id="jsdoc-navbar-container">
|
<div id="jsdoc-navbar-container">
|
||||||
<div id="jsdoc-navbar-content">
|
<div id="jsdoc-navbar-content">
|
||||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>16.<wbr>6</a>
|
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>18.<wbr>4</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
@@ -236,6 +236,9 @@
|
|||||||
<dt><a href="Client.html#event:message_create">message_create</a></dt>
|
<dt><a href="Client.html#event:message_create">message_create</a></dt>
|
||||||
<dd>
|
<dd>
|
||||||
</dd>
|
</dd>
|
||||||
|
<dt><a href="Client.html#event:message_reaction">message_reaction</a></dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
<dt><a href="Client.html#event:message_revoke_everyone">message_revoke_everyone</a></dt>
|
<dt><a href="Client.html#event:message_revoke_everyone">message_revoke_everyone</a></dt>
|
||||||
<dd>
|
<dd>
|
||||||
</dd>
|
</dd>
|
||||||
@@ -2181,6 +2184,179 @@
|
|||||||
</section>
|
</section>
|
||||||
<dl class="dl-compact">
|
<dl class="dl-compact">
|
||||||
</dl>
|
</dl>
|
||||||
|
<h3 id="event:message_reaction"><span class="symbol-name">message_reaction</span></h3>
|
||||||
|
<p>Emitted when a reaction is sent, received, updated or removed</p>
|
||||||
|
<section>
|
||||||
|
<h4>Parameters</h4>
|
||||||
|
<table class="jsdoc-details-table">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Name</th>
|
||||||
|
<th>Type</th>
|
||||||
|
<th>Optional</th>
|
||||||
|
<th>Description</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<p>reaction</p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p>object</p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p> </p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p>Values in <code>reaction</code> have the following properties:</p>
|
||||||
|
<table class="jsdoc-details-table">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Name</th>
|
||||||
|
<th>Type</th>
|
||||||
|
<th>Optional</th>
|
||||||
|
<th>Description</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<p>id</p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p>object</p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p> </p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p>Reaction id</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<p>orphan</p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p>number</p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p> </p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p>Orphan</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<p>orphanReason</p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p>string</p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p> </p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p>Orphan reason</p>
|
||||||
|
<p>Value can be null.</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<p>timestamp</p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p>number</p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p> </p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p>Timestamp</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<p>reaction</p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p>string</p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p> </p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p>Reaction</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<p>read</p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p>boolean</p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p> </p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p>Read</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<p>msgId</p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p>object</p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p> </p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p>Parent message id</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<p>senderId</p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p>string</p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p> </p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p>Sender id</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<p>ack</p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p>number</p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p> </p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p>Ack</p>
|
||||||
|
<p>Value can be null.</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</section>
|
||||||
|
<dl class="dl-compact">
|
||||||
|
</dl>
|
||||||
<h3 id="event:message_revoke_everyone"><span class="symbol-name">message_revoke_everyone</span></h3>
|
<h3 id="event:message_revoke_everyone"><span class="symbol-name">message_revoke_everyone</span></h3>
|
||||||
<p>Emitted when a message is deleted for everyone in the chat.</p>
|
<p>Emitted when a message is deleted for everyone in the chat.</p>
|
||||||
<section>
|
<section>
|
||||||
@@ -2310,7 +2486,7 @@
|
|||||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||||
<div id="jsdoc-footer-container">
|
<div id="jsdoc-footer-container">
|
||||||
<p>
|
<p>
|
||||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on April 21, 2022.
|
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on November 26, 2022.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta name="generator" content="JSDoc 3.6.7">
|
<meta name="generator" content="JSDoc 3.6.7">
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>whatsapp-web.js 1.16.6 » Source: Client.js</title>
|
<title>whatsapp-web.js 1.18.4 » Source: Client.js</title>
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
||||||
<div id="jsdoc-navbar-container">
|
<div id="jsdoc-navbar-container">
|
||||||
<div id="jsdoc-navbar-content">
|
<div id="jsdoc-navbar-content">
|
||||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>16.<wbr>6</a>
|
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>18.<wbr>4</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
@@ -41,7 +41,7 @@ const { WhatsWebURL, DefaultOptions, Events, WAState } = require('./ut
|
|||||||
const { ExposeStore, LoadUtils } = require('./util/Injected');
|
const { ExposeStore, LoadUtils } = require('./util/Injected');
|
||||||
const ChatFactory = require('./factories/ChatFactory');
|
const ChatFactory = require('./factories/ChatFactory');
|
||||||
const ContactFactory = require('./factories/ContactFactory');
|
const ContactFactory = require('./factories/ContactFactory');
|
||||||
const { ClientInfo, Message, MessageMedia, Contact, Location, GroupNotification, Label, Call, Buttons, List } = require('./structures');
|
const { ClientInfo, Message, MessageMedia, Contact, Location, GroupNotification, Label, Call, Buttons, List, Reaction } = require('./structures');
|
||||||
const LegacySessionAuth = require('./authStrategies/LegacySessionAuth');
|
const LegacySessionAuth = require('./authStrategies/LegacySessionAuth');
|
||||||
const NoAuth = require('./authStrategies/NoAuth');
|
const NoAuth = require('./authStrategies/NoAuth');
|
||||||
|
|
||||||
@@ -123,7 +123,12 @@ class Client extends EventEmitter {
|
|||||||
browser = await puppeteer.connect(puppeteerOpts);
|
browser = await puppeteer.connect(puppeteerOpts);
|
||||||
page = await browser.newPage();
|
page = await browser.newPage();
|
||||||
} else {
|
} else {
|
||||||
browser = await puppeteer.launch(puppeteerOpts);
|
const browserArgs = [...(puppeteerOpts.args || [])];
|
||||||
|
if(!browserArgs.find(arg => arg.includes('--user-agent'))) {
|
||||||
|
browserArgs.push(`--user-agent=${this.options.userAgent}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
browser = await puppeteer.launch({...puppeteerOpts, args: browserArgs});
|
||||||
page = (await browser.pages())[0];
|
page = (await browser.pages())[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -141,6 +146,52 @@ class Client extends EventEmitter {
|
|||||||
referer: 'https://whatsapp.com/'
|
referer: 'https://whatsapp.com/'
|
||||||
});
|
});
|
||||||
|
|
||||||
|
await page.evaluate(`function getElementByXpath(path) {
|
||||||
|
return document.evaluate(path, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
|
||||||
|
}`);
|
||||||
|
|
||||||
|
let lastPercent = null,
|
||||||
|
lastPercentMessage = null;
|
||||||
|
|
||||||
|
await page.exposeFunction('loadingScreen', async (percent, message) => {
|
||||||
|
if (lastPercent !== percent || lastPercentMessage !== message) {
|
||||||
|
this.emit(Events.LOADING_SCREEN, percent, message);
|
||||||
|
lastPercent = percent;
|
||||||
|
lastPercentMessage = message;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
await page.evaluate(
|
||||||
|
async function (selectors) {
|
||||||
|
var observer = new MutationObserver(function () {
|
||||||
|
let progressBar = window.getElementByXpath(
|
||||||
|
selectors.PROGRESS
|
||||||
|
);
|
||||||
|
let progressMessage = window.getElementByXpath(
|
||||||
|
selectors.PROGRESS_MESSAGE
|
||||||
|
);
|
||||||
|
|
||||||
|
if (progressBar) {
|
||||||
|
window.loadingScreen(
|
||||||
|
progressBar.value,
|
||||||
|
progressMessage.innerText
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
observer.observe(document, {
|
||||||
|
attributes: true,
|
||||||
|
childList: true,
|
||||||
|
characterData: true,
|
||||||
|
subtree: true,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
{
|
||||||
|
PROGRESS: '//*[@id=\'app\']/div/div/div[2]/progress',
|
||||||
|
PROGRESS_MESSAGE: '//*[@id=\'app\']/div/div/div[3]',
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
const INTRO_IMG_SELECTOR = '[data-testid="intro-md-beta-logo-dark"], [data-testid="intro-md-beta-logo-light"], [data-asset-intro-image-light="true"], [data-asset-intro-image-dark="true"]';
|
const INTRO_IMG_SELECTOR = '[data-testid="intro-md-beta-logo-dark"], [data-testid="intro-md-beta-logo-light"], [data-asset-intro-image-light="true"], [data-asset-intro-image-dark="true"]';
|
||||||
const INTRO_QRCODE_SELECTOR = 'div[data-ref] canvas';
|
const INTRO_QRCODE_SELECTOR = 'div[data-ref] canvas';
|
||||||
|
|
||||||
@@ -158,7 +209,7 @@ class Client extends EventEmitter {
|
|||||||
})
|
})
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// Checks if an error ocurred on the first found selector. The second will be discarded and ignored by .race;
|
// Checks if an error occurred on the first found selector. The second will be discarded and ignored by .race;
|
||||||
if (needAuthentication instanceof Error) throw needAuthentication;
|
if (needAuthentication instanceof Error) throw needAuthentication;
|
||||||
|
|
||||||
// Scan-qrcode selector was found. Needs authentication
|
// Scan-qrcode selector was found. Needs authentication
|
||||||
@@ -399,7 +450,7 @@ class Client extends EventEmitter {
|
|||||||
this.emit(Events.MEDIA_UPLOADED, message);
|
this.emit(Events.MEDIA_UPLOADED, message);
|
||||||
});
|
});
|
||||||
|
|
||||||
await page.exposeFunction('onAppStateChangedEvent', (state) => {
|
await page.exposeFunction('onAppStateChangedEvent', async (state) => {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Emitted when the connection state changes
|
* Emitted when the connection state changes
|
||||||
@@ -426,6 +477,7 @@ class Client extends EventEmitter {
|
|||||||
* @event Client#disconnected
|
* @event Client#disconnected
|
||||||
* @param {WAState|"NAVIGATION"} reason reason that caused the disconnect
|
* @param {WAState|"NAVIGATION"} reason reason that caused the disconnect
|
||||||
*/
|
*/
|
||||||
|
await this.authStrategy.disconnect();
|
||||||
this.emit(Events.DISCONNECTED, state);
|
this.emit(Events.DISCONNECTED, state);
|
||||||
this.destroy();
|
this.destroy();
|
||||||
}
|
}
|
||||||
@@ -465,6 +517,27 @@ class Client extends EventEmitter {
|
|||||||
this.emit(Events.INCOMING_CALL, cll);
|
this.emit(Events.INCOMING_CALL, cll);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
await page.exposeFunction('onReaction', (reactions) => {
|
||||||
|
for (const reaction of reactions) {
|
||||||
|
/**
|
||||||
|
* Emitted when a reaction is sent, received, updated or removed
|
||||||
|
* @event Client#message_reaction
|
||||||
|
* @param {object} reaction
|
||||||
|
* @param {object} reaction.id - Reaction id
|
||||||
|
* @param {number} reaction.orphan - Orphan
|
||||||
|
* @param {?string} reaction.orphanReason - Orphan reason
|
||||||
|
* @param {number} reaction.timestamp - Timestamp
|
||||||
|
* @param {string} reaction.reaction - Reaction
|
||||||
|
* @param {boolean} reaction.read - Read
|
||||||
|
* @param {object} reaction.msgId - Parent message id
|
||||||
|
* @param {string} reaction.senderId - Sender id
|
||||||
|
* @param {?number} reaction.ack - Ack
|
||||||
|
*/
|
||||||
|
|
||||||
|
this.emit(Events.MESSAGE_REACTION, new Reaction(this, reaction));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
await page.evaluate(() => {
|
await page.evaluate(() => {
|
||||||
window.Store.Msg.on('change', (msg) => { window.onChangeMessageEvent(window.WWebJS.getMessageModel(msg)); });
|
window.Store.Msg.on('change', (msg) => { window.onChangeMessageEvent(window.WWebJS.getMessageModel(msg)); });
|
||||||
window.Store.Msg.on('change:type', (msg) => { window.onChangeMessageTypeEvent(window.WWebJS.getMessageModel(msg)); });
|
window.Store.Msg.on('change:type', (msg) => { window.onChangeMessageTypeEvent(window.WWebJS.getMessageModel(msg)); });
|
||||||
@@ -484,6 +557,22 @@ class Client extends EventEmitter {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
{
|
||||||
|
const module = window.Store.createOrUpdateReactionsModule;
|
||||||
|
const ogMethod = module.createOrUpdateReactions;
|
||||||
|
module.createOrUpdateReactions = ((...args) => {
|
||||||
|
window.onReaction(args[0].map(reaction => {
|
||||||
|
const msgKey = window.Store.MsgKey.fromString(reaction.msgKey);
|
||||||
|
const parentMsgKey = window.Store.MsgKey.fromString(reaction.parentMsgKey);
|
||||||
|
const timestamp = reaction.timestamp / 1000;
|
||||||
|
|
||||||
|
return {...reaction, msgKey, parentMsgKey, timestamp };
|
||||||
|
}));
|
||||||
|
|
||||||
|
return ogMethod(...args);
|
||||||
|
}).bind(module);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -491,11 +580,13 @@ class Client extends EventEmitter {
|
|||||||
* @event Client#ready
|
* @event Client#ready
|
||||||
*/
|
*/
|
||||||
this.emit(Events.READY);
|
this.emit(Events.READY);
|
||||||
|
this.authStrategy.afterAuthReady();
|
||||||
|
|
||||||
// Disconnect when navigating away when in PAIRING state (detect logout)
|
// Disconnect when navigating away when in PAIRING state (detect logout)
|
||||||
this.pupPage.on('framenavigated', async () => {
|
this.pupPage.on('framenavigated', async () => {
|
||||||
const appState = await this.getState();
|
const appState = await this.getState();
|
||||||
if(!appState || appState === WAState.PAIRING) {
|
if(!appState || appState === WAState.PAIRING) {
|
||||||
|
await this.authStrategy.disconnect();
|
||||||
this.emit(Events.DISCONNECTED, 'NAVIGATION');
|
this.emit(Events.DISCONNECTED, 'NAVIGATION');
|
||||||
await this.destroy();
|
await this.destroy();
|
||||||
}
|
}
|
||||||
@@ -507,6 +598,7 @@ class Client extends EventEmitter {
|
|||||||
*/
|
*/
|
||||||
async destroy() {
|
async destroy() {
|
||||||
await this.pupBrowser.close();
|
await this.pupBrowser.close();
|
||||||
|
await this.authStrategy.destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -840,8 +932,9 @@ class Client extends EventEmitter {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
const MAX_PIN_COUNT = 3;
|
const MAX_PIN_COUNT = 3;
|
||||||
if (window.Store.Chat.models.length > MAX_PIN_COUNT) {
|
const chatModels = window.Store.Chat.getModelsArray();
|
||||||
let maxPinned = window.Store.Chat.models[MAX_PIN_COUNT - 1].pin;
|
if (chatModels.length > MAX_PIN_COUNT) {
|
||||||
|
let maxPinned = chatModels[MAX_PIN_COUNT - 1].pin;
|
||||||
if (maxPinned) {
|
if (maxPinned) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -927,7 +1020,13 @@ class Client extends EventEmitter {
|
|||||||
*/
|
*/
|
||||||
async getCommonGroups(contactId) {
|
async getCommonGroups(contactId) {
|
||||||
const commonGroups = await this.pupPage.evaluate(async (contactId) => {
|
const commonGroups = await this.pupPage.evaluate(async (contactId) => {
|
||||||
const contact = window.Store.Contact.get(contactId);
|
let contact = window.Store.Contact.get(contactId);
|
||||||
|
if (!contact) {
|
||||||
|
const wid = window.Store.WidFactory.createUserWid(contactId);
|
||||||
|
const chatConstructor = window.Store.Contact.getModelsArray().find(c=>!c.isGroup).constructor;
|
||||||
|
contact = new chatConstructor({id: wid});
|
||||||
|
}
|
||||||
|
|
||||||
if (contact.commonGroups) {
|
if (contact.commonGroups) {
|
||||||
return contact.commonGroups.serialize();
|
return contact.commonGroups.serialize();
|
||||||
}
|
}
|
||||||
@@ -974,7 +1073,8 @@ class Client extends EventEmitter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return await this.pupPage.evaluate(async number => {
|
return await this.pupPage.evaluate(async number => {
|
||||||
const result = await window.Store.QueryExist(number);
|
const wid = window.Store.WidFactory.createWid(number);
|
||||||
|
const result = await window.Store.QueryExist(wid);
|
||||||
if (!result || result.wid === undefined) return null;
|
if (!result || result.wid === undefined) return null;
|
||||||
return result.wid;
|
return result.wid;
|
||||||
}, number);
|
}, number);
|
||||||
@@ -1087,7 +1187,7 @@ class Client extends EventEmitter {
|
|||||||
async getChatsByLabelId(labelId) {
|
async getChatsByLabelId(labelId) {
|
||||||
const chatIds = await this.pupPage.evaluate(async (labelId) => {
|
const chatIds = await this.pupPage.evaluate(async (labelId) => {
|
||||||
const label = window.Store.Label.get(labelId);
|
const label = window.Store.Label.get(labelId);
|
||||||
const labelItems = label.labelItemCollection.models;
|
const labelItems = label.labelItemCollection.getModelsArray();
|
||||||
return labelItems.reduce((result, item) => {
|
return labelItems.reduce((result, item) => {
|
||||||
if (item.parentType === 'Chat') {
|
if (item.parentType === 'Chat') {
|
||||||
result.push(item.parentId);
|
result.push(item.parentId);
|
||||||
@@ -1105,7 +1205,7 @@ class Client extends EventEmitter {
|
|||||||
*/
|
*/
|
||||||
async getBlockedContacts() {
|
async getBlockedContacts() {
|
||||||
const blockedContacts = await this.pupPage.evaluate(() => {
|
const blockedContacts = await this.pupPage.evaluate(() => {
|
||||||
let chatIds = window.Store.Blocklist.models.map(a => a.id._serialized);
|
let chatIds = window.Store.Blocklist.getModelsArray().map(a => a.id._serialized);
|
||||||
return Promise.all(chatIds.map(id => window.WWebJS.getContact(id)));
|
return Promise.all(chatIds.map(id => window.WWebJS.getContact(id)));
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -1124,7 +1224,7 @@ module.exports = Client;
|
|||||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||||
<div id="jsdoc-footer-container">
|
<div id="jsdoc-footer-container">
|
||||||
<p>
|
<p>
|
||||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on April 21, 2022.
|
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on November 26, 2022.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta name="generator" content="JSDoc 3.6.7">
|
<meta name="generator" content="JSDoc 3.6.7">
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>whatsapp-web.js 1.16.6 » Class: ClientInfo</title>
|
<title>whatsapp-web.js 1.18.4 » Class: ClientInfo</title>
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
||||||
<div id="jsdoc-navbar-container">
|
<div id="jsdoc-navbar-container">
|
||||||
<div id="jsdoc-navbar-content">
|
<div id="jsdoc-navbar-content">
|
||||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>16.<wbr>6</a>
|
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>18.<wbr>4</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
@@ -242,7 +242,7 @@
|
|||||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||||
<div id="jsdoc-footer-container">
|
<div id="jsdoc-footer-container">
|
||||||
<p>
|
<p>
|
||||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on April 21, 2022.
|
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on November 26, 2022.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta name="generator" content="JSDoc 3.6.7">
|
<meta name="generator" content="JSDoc 3.6.7">
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>whatsapp-web.js 1.16.6 » Class: Contact</title>
|
<title>whatsapp-web.js 1.18.4 » Class: Contact</title>
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
||||||
<div id="jsdoc-navbar-container">
|
<div id="jsdoc-navbar-container">
|
||||||
<div id="jsdoc-navbar-content">
|
<div id="jsdoc-navbar-content">
|
||||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>16.<wbr>6</a>
|
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>18.<wbr>4</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
@@ -293,7 +293,7 @@
|
|||||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||||
<div id="jsdoc-footer-container">
|
<div id="jsdoc-footer-container">
|
||||||
<p>
|
<p>
|
||||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on April 21, 2022.
|
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on November 26, 2022.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta name="generator" content="JSDoc 3.6.7">
|
<meta name="generator" content="JSDoc 3.6.7">
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>whatsapp-web.js 1.16.6 » Class: GroupChat</title>
|
<title>whatsapp-web.js 1.18.4 » Class: GroupChat</title>
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
||||||
<div id="jsdoc-navbar-container">
|
<div id="jsdoc-navbar-container">
|
||||||
<div id="jsdoc-navbar-content">
|
<div id="jsdoc-navbar-content">
|
||||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>16.<wbr>6</a>
|
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>18.<wbr>4</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
@@ -436,7 +436,7 @@
|
|||||||
<p> </p>
|
<p> </p>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<p>Options for searching messages. Right now only limit is supported.</p>
|
<p>Options for searching messages. Right now only limit and fromMe is supported.</p>
|
||||||
<p>Values in <code>searchOptions</code> have the following properties:</p>
|
<p>Values in <code>searchOptions</code> have the following properties:</p>
|
||||||
<table class="jsdoc-details-table">
|
<table class="jsdoc-details-table">
|
||||||
<thead>
|
<thead>
|
||||||
@@ -462,6 +462,20 @@
|
|||||||
<p>The amount of messages to return. If no limit is specified, the available messages will be returned. Note that the actual number of returned messages may be smaller if there aren't enough messages in the conversation. Set this to Infinity to load all messages.</p>
|
<p>The amount of messages to return. If no limit is specified, the available messages will be returned. Note that the actual number of returned messages may be smaller if there aren't enough messages in the conversation. Set this to Infinity to load all messages.</p>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<p>fromMe</p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p> </p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p>Yes</p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p>Return only messages from the bot number or vise versa. To get all messages, leave the option undefined.</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</td>
|
</td>
|
||||||
@@ -927,7 +941,7 @@
|
|||||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||||
<div id="jsdoc-footer-container">
|
<div id="jsdoc-footer-container">
|
||||||
<p>
|
<p>
|
||||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on April 21, 2022.
|
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on November 26, 2022.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta name="generator" content="JSDoc 3.6.7">
|
<meta name="generator" content="JSDoc 3.6.7">
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>whatsapp-web.js 1.16.6 » Class: GroupNotification</title>
|
<title>whatsapp-web.js 1.18.4 » Class: GroupNotification</title>
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
||||||
<div id="jsdoc-navbar-container">
|
<div id="jsdoc-navbar-container">
|
||||||
<div id="jsdoc-navbar-content">
|
<div id="jsdoc-navbar-content">
|
||||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>16.<wbr>6</a>
|
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>18.<wbr>4</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
@@ -233,7 +233,7 @@
|
|||||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||||
<div id="jsdoc-footer-container">
|
<div id="jsdoc-footer-container">
|
||||||
<p>
|
<p>
|
||||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on April 21, 2022.
|
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on November 26, 2022.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta name="generator" content="JSDoc 3.6.7">
|
<meta name="generator" content="JSDoc 3.6.7">
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>whatsapp-web.js 1.16.6 » Class: InterfaceController</title>
|
<title>whatsapp-web.js 1.18.4 » 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/Karla:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
||||||
<div id="jsdoc-navbar-container">
|
<div id="jsdoc-navbar-container">
|
||||||
<div id="jsdoc-navbar-content">
|
<div id="jsdoc-navbar-content">
|
||||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>16.<wbr>6</a>
|
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>18.<wbr>4</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
@@ -382,7 +382,7 @@
|
|||||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||||
<div id="jsdoc-footer-container">
|
<div id="jsdoc-footer-container">
|
||||||
<p>
|
<p>
|
||||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on April 21, 2022.
|
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on November 26, 2022.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta name="generator" content="JSDoc 3.6.7">
|
<meta name="generator" content="JSDoc 3.6.7">
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>whatsapp-web.js 1.16.6 » Class: Label</title>
|
<title>whatsapp-web.js 1.18.4 » 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/Karla:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
||||||
<div id="jsdoc-navbar-container">
|
<div id="jsdoc-navbar-container">
|
||||||
<div id="jsdoc-navbar-content">
|
<div id="jsdoc-navbar-content">
|
||||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>16.<wbr>6</a>
|
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>18.<wbr>4</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
@@ -163,7 +163,7 @@
|
|||||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||||
<div id="jsdoc-footer-container">
|
<div id="jsdoc-footer-container">
|
||||||
<p>
|
<p>
|
||||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on April 21, 2022.
|
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on November 26, 2022.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta name="generator" content="JSDoc 3.6.7">
|
<meta name="generator" content="JSDoc 3.6.7">
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>whatsapp-web.js 1.16.6 » Class: LegacySessionAuth</title>
|
<title>whatsapp-web.js 1.18.4 » Class: LegacySessionAuth</title>
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
||||||
<div id="jsdoc-navbar-container">
|
<div id="jsdoc-navbar-container">
|
||||||
<div id="jsdoc-navbar-content">
|
<div id="jsdoc-navbar-content">
|
||||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>16.<wbr>6</a>
|
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>18.<wbr>4</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
@@ -173,7 +173,7 @@
|
|||||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||||
<div id="jsdoc-footer-container">
|
<div id="jsdoc-footer-container">
|
||||||
<p>
|
<p>
|
||||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on April 21, 2022.
|
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on November 26, 2022.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta name="generator" content="JSDoc 3.6.7">
|
<meta name="generator" content="JSDoc 3.6.7">
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>whatsapp-web.js 1.16.6 » Class: List</title>
|
<title>whatsapp-web.js 1.18.4 » Class: List</title>
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
||||||
<div id="jsdoc-navbar-container">
|
<div id="jsdoc-navbar-container">
|
||||||
<div id="jsdoc-navbar-content">
|
<div id="jsdoc-navbar-content">
|
||||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>16.<wbr>6</a>
|
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>18.<wbr>4</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
@@ -256,7 +256,7 @@ Returns: [{'title':'sectionTitle','rows':[{'r
|
|||||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||||
<div id="jsdoc-footer-container">
|
<div id="jsdoc-footer-container">
|
||||||
<p>
|
<p>
|
||||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on April 21, 2022.
|
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on November 26, 2022.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta name="generator" content="JSDoc 3.6.7">
|
<meta name="generator" content="JSDoc 3.6.7">
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>whatsapp-web.js 1.16.6 » Class: LocalAuth</title>
|
<title>whatsapp-web.js 1.18.4 » Class: LocalAuth</title>
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
||||||
<div id="jsdoc-navbar-container">
|
<div id="jsdoc-navbar-container">
|
||||||
<div id="jsdoc-navbar-content">
|
<div id="jsdoc-navbar-content">
|
||||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>16.<wbr>6</a>
|
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>18.<wbr>4</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
@@ -120,7 +120,7 @@
|
|||||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||||
<div id="jsdoc-footer-container">
|
<div id="jsdoc-footer-container">
|
||||||
<p>
|
<p>
|
||||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on April 21, 2022.
|
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on November 26, 2022.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta name="generator" content="JSDoc 3.6.7">
|
<meta name="generator" content="JSDoc 3.6.7">
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>whatsapp-web.js 1.16.6 » Class: Location</title>
|
<title>whatsapp-web.js 1.18.4 » Class: Location</title>
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
||||||
<div id="jsdoc-navbar-container">
|
<div id="jsdoc-navbar-container">
|
||||||
<div id="jsdoc-navbar-content">
|
<div id="jsdoc-navbar-content">
|
||||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>16.<wbr>6</a>
|
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>18.<wbr>4</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
@@ -149,7 +149,7 @@
|
|||||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||||
<div id="jsdoc-footer-container">
|
<div id="jsdoc-footer-container">
|
||||||
<p>
|
<p>
|
||||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on April 21, 2022.
|
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on November 26, 2022.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta name="generator" content="JSDoc 3.6.7">
|
<meta name="generator" content="JSDoc 3.6.7">
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>whatsapp-web.js 1.16.6 » Class: Message</title>
|
<title>whatsapp-web.js 1.18.4 » Class: Message</title>
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
||||||
<div id="jsdoc-navbar-container">
|
<div id="jsdoc-navbar-container">
|
||||||
<div id="jsdoc-navbar-content">
|
<div id="jsdoc-navbar-content">
|
||||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>16.<wbr>6</a>
|
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>18.<wbr>4</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
@@ -158,13 +158,13 @@
|
|||||||
<dt><a href="Message.html#getChat">getChat()</a></dt>
|
<dt><a href="Message.html#getChat">getChat()</a></dt>
|
||||||
<dd>
|
<dd>
|
||||||
</dd>
|
</dd>
|
||||||
|
<dt><a href="Message.html#getContact">getContact()</a></dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
</div>
|
</div>
|
||||||
<div class="summary-column">
|
<div class="summary-column">
|
||||||
<dl class="dl-summary-callout">
|
<dl class="dl-summary-callout">
|
||||||
<dt><a href="Message.html#getContact">getContact()</a></dt>
|
|
||||||
<dd>
|
|
||||||
</dd>
|
|
||||||
<dt><a href="Message.html#getInfo">getInfo()</a></dt>
|
<dt><a href="Message.html#getInfo">getInfo()</a></dt>
|
||||||
<dd>
|
<dd>
|
||||||
</dd>
|
</dd>
|
||||||
@@ -177,13 +177,16 @@
|
|||||||
<dt><a href="Message.html#getPayment">getPayment()</a></dt>
|
<dt><a href="Message.html#getPayment">getPayment()</a></dt>
|
||||||
<dd>
|
<dd>
|
||||||
</dd>
|
</dd>
|
||||||
|
<dt><a href="Message.html#getQuotedMessage">getQuotedMessage()</a></dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
<dt><a href="Message.html#react">react(reaction)</a></dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
</div>
|
</div>
|
||||||
<div class="summary-column">
|
<div class="summary-column">
|
||||||
<dl class="dl-summary-callout">
|
<dl class="dl-summary-callout">
|
||||||
<dt><a href="Message.html#getQuotedMessage">getQuotedMessage()</a></dt>
|
|
||||||
<dd>
|
|
||||||
</dd>
|
|
||||||
<dt><a href="Message.html#reload">reload()</a></dt>
|
<dt><a href="Message.html#reload">reload()</a></dt>
|
||||||
<dd>
|
<dd>
|
||||||
</dd>
|
</dd>
|
||||||
@@ -397,7 +400,7 @@
|
|||||||
<p> </p>
|
<p> </p>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<p>If true and the message is sent by the current user, will delete it for everyone in the chat.</p>
|
<p>If true and the message is sent by the current user or the user is an admin, will delete it for everyone in the chat.</p>
|
||||||
<p>Value can be null.</p>
|
<p>Value can be null.</p>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -417,7 +420,7 @@
|
|||||||
</dl>
|
</dl>
|
||||||
<div class="symbol-detail-labels"><span class="label label-async">async</span></div>
|
<div class="symbol-detail-labels"><span class="label label-async">async</span></div>
|
||||||
<h3 id="forward"><span class="symbol-name">forward</span><span class="signature"><span class="signature-params">(chat)</span> → <span class="signature-returns"> Promise</span></span></h3>
|
<h3 id="forward"><span class="symbol-name">forward</span><span class="signature"><span class="signature-params">(chat)</span> → <span class="signature-returns"> Promise</span></span></h3>
|
||||||
<p>Forwards this message to another chat</p>
|
<p>Forwards this message to another chat (that you chatted before, otherwise it will fail)</p>
|
||||||
<section>
|
<section>
|
||||||
<h4>Parameter</h4>
|
<h4>Parameter</h4>
|
||||||
<table class="jsdoc-details-table">
|
<table class="jsdoc-details-table">
|
||||||
@@ -515,6 +518,44 @@
|
|||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
<div class="symbol-detail-labels"><span class="label label-async">async</span></div>
|
<div class="symbol-detail-labels"><span class="label label-async">async</span></div>
|
||||||
|
<h3 id="react"><span class="symbol-name">react</span><span class="signature"><span class="signature-params">(reaction)</span> → <span class="signature-returns"> Promise</span></span></h3>
|
||||||
|
<p>React to this message with an emoji</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>reaction</p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p>string</p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p> </p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p>Emoji to react with. Send an empty string to remove the reaction.</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</section>
|
||||||
|
<dl class="dl-compact">
|
||||||
|
<dt>Returns</dt>
|
||||||
|
<dd>
|
||||||
|
<p><code>Promise</code> </p>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
<div class="symbol-detail-labels"><span class="label label-async">async</span></div>
|
||||||
<h3 id="reload"><span class="symbol-name">reload</span><span class="signature"><span class="signature-params">()</span> → <span class="signature-returns"> Promise containing <a href="Message.html">Message</a></span></span></h3>
|
<h3 id="reload"><span class="symbol-name">reload</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>Reloads this Message object's data in-place with the latest values from WhatsApp Web.
|
<p>Reloads this Message object's data in-place with the latest values from WhatsApp Web.
|
||||||
Note that the Message must still be in the web app cache for this to work, otherwise will return null.</p>
|
Note that the Message must still be in the web app cache for this to work, otherwise will return null.</p>
|
||||||
@@ -609,7 +650,7 @@
|
|||||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||||
<div id="jsdoc-footer-container">
|
<div id="jsdoc-footer-container">
|
||||||
<p>
|
<p>
|
||||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on April 21, 2022.
|
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on November 26, 2022.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta name="generator" content="JSDoc 3.6.7">
|
<meta name="generator" content="JSDoc 3.6.7">
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>whatsapp-web.js 1.16.6 » Class: MessageMedia</title>
|
<title>whatsapp-web.js 1.18.4 » Class: MessageMedia</title>
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
||||||
<div id="jsdoc-navbar-container">
|
<div id="jsdoc-navbar-container">
|
||||||
<div id="jsdoc-navbar-content">
|
<div id="jsdoc-navbar-content">
|
||||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>16.<wbr>6</a>
|
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>18.<wbr>4</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
@@ -26,7 +26,7 @@
|
|||||||
<header class="page-header">
|
<header class="page-header">
|
||||||
<div class="symbol-detail-labels"><span class="label label-kind">class</span></div>
|
<div class="symbol-detail-labels"><span class="label label-kind">class</span></div>
|
||||||
<h1><small></small><span class="symbol-name">MessageMedia</span></h1>
|
<h1><small></small><span class="symbol-name">MessageMedia</span></h1>
|
||||||
<p class="source-link">Source: <a href="structures_MessageMedia.js.html#source-line-15">structures/<wbr>MessageMedia.<wbr>js:15</a></p>
|
<p class="source-link">Source: <a href="structures_MessageMedia.js.html#source-line-16">structures/<wbr>MessageMedia.<wbr>js:16</a></p>
|
||||||
<div class="symbol-classdesc">
|
<div class="symbol-classdesc">
|
||||||
<p>Media attached to a message</p>
|
<p>Media attached to a message</p>
|
||||||
</div>
|
</div>
|
||||||
@@ -42,10 +42,6 @@
|
|||||||
<dt><a href="MessageMedia.html#data">data</a></dt>
|
<dt><a href="MessageMedia.html#data">data</a></dt>
|
||||||
<dd>
|
<dd>
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
|
||||||
</div>
|
|
||||||
<div class="summary-column">
|
|
||||||
<dl class="dl-summary-callout">
|
|
||||||
<dt><a href="MessageMedia.html#filename">filename</a></dt>
|
<dt><a href="MessageMedia.html#filename">filename</a></dt>
|
||||||
<dd>
|
<dd>
|
||||||
</dd>
|
</dd>
|
||||||
@@ -53,11 +49,16 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="summary-column">
|
<div class="summary-column">
|
||||||
<dl class="dl-summary-callout">
|
<dl class="dl-summary-callout">
|
||||||
|
<dt><a href="MessageMedia.html#filesize">filesize</a></dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
<dt><a href="MessageMedia.html#mimetype">mimetype</a></dt>
|
<dt><a href="MessageMedia.html#mimetype">mimetype</a></dt>
|
||||||
<dd>
|
<dd>
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="summary-column">
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="summary-callout">
|
<div class="summary-callout">
|
||||||
@@ -83,7 +84,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
<section>
|
<section>
|
||||||
<h2 id="MessageMedia">new <span class="symbol-name">MessageMedia</span><span class="signature"><span class="signature-params">(mimetype, data, filename)</span></span></h2>
|
<h2 id="MessageMedia">new <span class="symbol-name">MessageMedia</span><span class="signature"><span class="signature-params">(mimetype, data, filename, filesize)</span></span></h2>
|
||||||
<section>
|
<section>
|
||||||
<h3>Parameters</h3>
|
<h3>Parameters</h3>
|
||||||
<table class="jsdoc-details-table">
|
<table class="jsdoc-details-table">
|
||||||
@@ -135,7 +136,22 @@
|
|||||||
<p> </p>
|
<p> </p>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<p>Document file name</p>
|
<p>Document file name. Value can be null</p>
|
||||||
|
<p>Value can be null.</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<p>filesize</p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p> </p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p> </p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p>Document file size in bytes. Value can be null</p>
|
||||||
<p>Value can be null.</p>
|
<p>Value can be null.</p>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -155,7 +171,12 @@
|
|||||||
</dl>
|
</dl>
|
||||||
<h3 id="filename"><span class="symbol-name">filename</span><small class="property-type">
|
<h3 id="filename"><span class="symbol-name">filename</span><small class="property-type">
|
||||||
nullable string</small></h3>
|
nullable string</small></h3>
|
||||||
<p>Name of the file (for documents)</p>
|
<p>Document file name. Value can be null</p>
|
||||||
|
<dl class="dl-compact">
|
||||||
|
</dl>
|
||||||
|
<h3 id="filesize"><span class="symbol-name">filesize</span><small class="property-type">
|
||||||
|
nullable number</small></h3>
|
||||||
|
<p>Document file size in bytes. Value can be null</p>
|
||||||
<dl class="dl-compact">
|
<dl class="dl-compact">
|
||||||
</dl>
|
</dl>
|
||||||
<h3 id="mimetype"><span class="symbol-name">mimetype</span><small class="property-type">
|
<h3 id="mimetype"><span class="symbol-name">mimetype</span><small class="property-type">
|
||||||
@@ -343,7 +364,7 @@
|
|||||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||||
<div id="jsdoc-footer-container">
|
<div id="jsdoc-footer-container">
|
||||||
<p>
|
<p>
|
||||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on April 21, 2022.
|
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on November 26, 2022.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta name="generator" content="JSDoc 3.6.7">
|
<meta name="generator" content="JSDoc 3.6.7">
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>whatsapp-web.js 1.16.6 » Class: NoAuth</title>
|
<title>whatsapp-web.js 1.18.4 » Class: NoAuth</title>
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
||||||
<div id="jsdoc-navbar-container">
|
<div id="jsdoc-navbar-container">
|
||||||
<div id="jsdoc-navbar-content">
|
<div id="jsdoc-navbar-content">
|
||||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>16.<wbr>6</a>
|
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>18.<wbr>4</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
@@ -51,7 +51,7 @@
|
|||||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||||
<div id="jsdoc-footer-container">
|
<div id="jsdoc-footer-container">
|
||||||
<p>
|
<p>
|
||||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on April 21, 2022.
|
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on November 26, 2022.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta name="generator" content="JSDoc 3.6.7">
|
<meta name="generator" content="JSDoc 3.6.7">
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>whatsapp-web.js 1.16.6 » Class: Order</title>
|
<title>whatsapp-web.js 1.18.4 » 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/Karla:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
||||||
<div id="jsdoc-navbar-container">
|
<div id="jsdoc-navbar-container">
|
||||||
<div id="jsdoc-navbar-content">
|
<div id="jsdoc-navbar-content">
|
||||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>16.<wbr>6</a>
|
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>18.<wbr>4</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
@@ -102,7 +102,7 @@
|
|||||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||||
<div id="jsdoc-footer-container">
|
<div id="jsdoc-footer-container">
|
||||||
<p>
|
<p>
|
||||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on April 21, 2022.
|
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on November 26, 2022.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta name="generator" content="JSDoc 3.6.7">
|
<meta name="generator" content="JSDoc 3.6.7">
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>whatsapp-web.js 1.16.6 » Class: PrivateChat</title>
|
<title>whatsapp-web.js 1.18.4 » Class: PrivateChat</title>
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
||||||
<div id="jsdoc-navbar-container">
|
<div id="jsdoc-navbar-container">
|
||||||
<div id="jsdoc-navbar-content">
|
<div id="jsdoc-navbar-content">
|
||||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>16.<wbr>6</a>
|
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>18.<wbr>4</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
@@ -295,7 +295,7 @@
|
|||||||
<p> </p>
|
<p> </p>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<p>Options for searching messages. Right now only limit is supported.</p>
|
<p>Options for searching messages. Right now only limit and fromMe is supported.</p>
|
||||||
<p>Values in <code>searchOptions</code> have the following properties:</p>
|
<p>Values in <code>searchOptions</code> have the following properties:</p>
|
||||||
<table class="jsdoc-details-table">
|
<table class="jsdoc-details-table">
|
||||||
<thead>
|
<thead>
|
||||||
@@ -321,6 +321,20 @@
|
|||||||
<p>The amount of messages to return. If no limit is specified, the available messages will be returned. Note that the actual number of returned messages may be smaller if there aren't enough messages in the conversation. Set this to Infinity to load all messages.</p>
|
<p>The amount of messages to return. If no limit is specified, the available messages will be returned. Note that the actual number of returned messages may be smaller if there aren't enough messages in the conversation. Set this to Infinity to load all messages.</p>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<p>fromMe</p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p> </p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p>Yes</p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p>Return only messages from the bot number or vise versa. To get all messages, leave the option undefined.</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</td>
|
</td>
|
||||||
@@ -519,7 +533,7 @@
|
|||||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||||
<div id="jsdoc-footer-container">
|
<div id="jsdoc-footer-container">
|
||||||
<p>
|
<p>
|
||||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on April 21, 2022.
|
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on November 26, 2022.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta name="generator" content="JSDoc 3.6.7">
|
<meta name="generator" content="JSDoc 3.6.7">
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>whatsapp-web.js 1.16.6 » Class: PrivateContact</title>
|
<title>whatsapp-web.js 1.18.4 » Class: PrivateContact</title>
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
||||||
<div id="jsdoc-navbar-container">
|
<div id="jsdoc-navbar-container">
|
||||||
<div id="jsdoc-navbar-content">
|
<div id="jsdoc-navbar-content">
|
||||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>16.<wbr>6</a>
|
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>18.<wbr>4</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
@@ -319,7 +319,7 @@
|
|||||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||||
<div id="jsdoc-footer-container">
|
<div id="jsdoc-footer-container">
|
||||||
<p>
|
<p>
|
||||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on April 21, 2022.
|
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on November 26, 2022.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta name="generator" content="JSDoc 3.6.7">
|
<meta name="generator" content="JSDoc 3.6.7">
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>whatsapp-web.js 1.16.6 » Class: Product</title>
|
<title>whatsapp-web.js 1.18.4 » 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/Karla:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
||||||
<div id="jsdoc-navbar-container">
|
<div id="jsdoc-navbar-container">
|
||||||
<div id="jsdoc-navbar-content">
|
<div id="jsdoc-navbar-content">
|
||||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>16.<wbr>6</a>
|
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>18.<wbr>4</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
@@ -127,7 +127,7 @@
|
|||||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||||
<div id="jsdoc-footer-container">
|
<div id="jsdoc-footer-container">
|
||||||
<p>
|
<p>
|
||||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on April 21, 2022.
|
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on November 26, 2022.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
159
docs/Reaction.html
Normal file
159
docs/Reaction.html
Normal file
@@ -0,0 +1,159 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html>
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta name="generator" content="JSDoc 3.6.7">
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>whatsapp-web.js 1.18.4 » Class: Reaction</title>
|
||||||
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
|
||||||
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
||||||
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
||||||
|
<link href="css/baseline.css" rel="stylesheet">
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body onload="prettyPrint()">
|
||||||
|
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
||||||
|
<div id="jsdoc-navbar-container">
|
||||||
|
<div id="jsdoc-navbar-content">
|
||||||
|
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>18.<wbr>4</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</nav>
|
||||||
|
<div id="jsdoc-body-container">
|
||||||
|
<div id="jsdoc-content">
|
||||||
|
<div id="jsdoc-content-container">
|
||||||
|
<div id="jsdoc-main" role="main">
|
||||||
|
<header class="page-header">
|
||||||
|
<div class="symbol-detail-labels"><span class="label label-kind">class</span></div>
|
||||||
|
<h1><small></small><span class="symbol-name">Reaction</span></h1>
|
||||||
|
<p class="source-link">Source: <a href="structures_Reaction.js.html#source-line-9">structures/<wbr>Reaction.<wbr>js:9</a></p>
|
||||||
|
<div class="symbol-classdesc">
|
||||||
|
<p>Represents a Reaction on WhatsApp</p>
|
||||||
|
</div>
|
||||||
|
<dl class="dl-compact">
|
||||||
|
</dl>
|
||||||
|
</header>
|
||||||
|
<section id="summary">
|
||||||
|
<div class="summary-callout">
|
||||||
|
<h2 class="summary-callout-heading">Properties</h2>
|
||||||
|
<div class="summary-content">
|
||||||
|
<div class="summary-column">
|
||||||
|
<dl class="dl-summary-callout">
|
||||||
|
<dt><a href="Reaction.html#ack">ack</a></dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
<dt><a href="Reaction.html#id">id</a></dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
<dt><a href="Reaction.html#msgId">msgId</a></dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
</div>
|
||||||
|
<div class="summary-column">
|
||||||
|
<dl class="dl-summary-callout">
|
||||||
|
<dt><a href="Reaction.html#orphan">orphan</a></dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
<dt><a href="Reaction.html#orphanReason">orphanReason</a></dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
<dt><a href="Reaction.html#reaction">reaction</a></dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
</div>
|
||||||
|
<div class="summary-column">
|
||||||
|
<dl class="dl-summary-callout">
|
||||||
|
<dt><a href="Reaction.html#read">read</a></dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
<dt><a href="Reaction.html#senderId">senderId</a></dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
<dt><a href="Reaction.html#timestamp">timestamp</a></dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
<section>
|
||||||
|
<h2 id="Reaction">new <span class="symbol-name">Reaction</span><span class="signature"><span class="signature-params">()</span></span></h2>
|
||||||
|
<dl class="dl-compact">
|
||||||
|
<dt>Extends</dt>
|
||||||
|
<dd><a href="Base.html">Base</a></dd>
|
||||||
|
</dl>
|
||||||
|
</section>
|
||||||
|
<section>
|
||||||
|
<h2>Properties</h2>
|
||||||
|
<section>
|
||||||
|
<h3 id="ack"><span class="symbol-name">ack</span><small class="property-type">
|
||||||
|
nullable number</small></h3>
|
||||||
|
<p>ACK</p>
|
||||||
|
<dl class="dl-compact">
|
||||||
|
</dl>
|
||||||
|
<h3 id="id"><span class="symbol-name">id</span><small class="property-type">
|
||||||
|
object</small></h3>
|
||||||
|
<p>Reaction ID</p>
|
||||||
|
<dl class="dl-compact">
|
||||||
|
</dl>
|
||||||
|
<h3 id="msgId"><span class="symbol-name">msgId</span><small class="property-type">
|
||||||
|
object</small></h3>
|
||||||
|
<p>Message ID</p>
|
||||||
|
<dl class="dl-compact">
|
||||||
|
</dl>
|
||||||
|
<h3 id="orphan"><span class="symbol-name">orphan</span><small class="property-type">
|
||||||
|
number</small></h3>
|
||||||
|
<p>Orphan</p>
|
||||||
|
<dl class="dl-compact">
|
||||||
|
</dl>
|
||||||
|
<h3 id="orphanReason"><span class="symbol-name">orphanReason</span><small class="property-type">
|
||||||
|
nullable string</small></h3>
|
||||||
|
<p>Orphan reason</p>
|
||||||
|
<dl class="dl-compact">
|
||||||
|
</dl>
|
||||||
|
<h3 id="reaction"><span class="symbol-name">reaction</span><small class="property-type">
|
||||||
|
string</small></h3>
|
||||||
|
<p>Reaction</p>
|
||||||
|
<dl class="dl-compact">
|
||||||
|
</dl>
|
||||||
|
<h3 id="read"><span class="symbol-name">read</span><small class="property-type">
|
||||||
|
boolean</small></h3>
|
||||||
|
<p>Read</p>
|
||||||
|
<dl class="dl-compact">
|
||||||
|
</dl>
|
||||||
|
<h3 id="senderId"><span class="symbol-name">senderId</span><small class="property-type">
|
||||||
|
string</small></h3>
|
||||||
|
<p>Sender ID</p>
|
||||||
|
<dl class="dl-compact">
|
||||||
|
</dl>
|
||||||
|
<h3 id="timestamp"><span class="symbol-name">timestamp</span><small class="property-type">
|
||||||
|
number</small></h3>
|
||||||
|
<p>Unix timestamp for when the reaction was created</p>
|
||||||
|
<dl class="dl-compact">
|
||||||
|
</dl>
|
||||||
|
</section>
|
||||||
|
</section>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<nav id="jsdoc-toc-nav" role="navigation"></nav>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||||
|
<div id="jsdoc-footer-container">
|
||||||
|
<p>
|
||||||
|
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on November 26, 2022.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</footer>
|
||||||
|
<script src="scripts/jquery.min.js"></script>
|
||||||
|
<script src="scripts/tree.jquery.js"></script>
|
||||||
|
<script src="scripts/prettify.js"></script>
|
||||||
|
<script src="scripts/jsdoc-toc.js"></script>
|
||||||
|
<script src="scripts/linenumber.js"></script>
|
||||||
|
<script src="scripts/scrollanchor.js"></script>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
||||||
163
docs/RemoteAuth.html
Normal file
163
docs/RemoteAuth.html
Normal file
@@ -0,0 +1,163 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html>
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta name="generator" content="JSDoc 3.6.7">
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>whatsapp-web.js 1.18.4 » Class: RemoteAuth</title>
|
||||||
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
|
||||||
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
||||||
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
||||||
|
<link href="css/baseline.css" rel="stylesheet">
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body onload="prettyPrint()">
|
||||||
|
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
||||||
|
<div id="jsdoc-navbar-container">
|
||||||
|
<div id="jsdoc-navbar-content">
|
||||||
|
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>18.<wbr>4</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</nav>
|
||||||
|
<div id="jsdoc-body-container">
|
||||||
|
<div id="jsdoc-content">
|
||||||
|
<div id="jsdoc-content-container">
|
||||||
|
<div id="jsdoc-main" role="main">
|
||||||
|
<header class="page-header">
|
||||||
|
<div class="symbol-detail-labels"><span class="label label-kind">class</span></div>
|
||||||
|
<h1><small></small><span class="symbol-name">RemoteAuth</span></h1>
|
||||||
|
<p class="source-link">Source: <a href="authStrategies_RemoteAuth.js.html#source-line-26">authStrategies/<wbr>RemoteAuth.<wbr>js:26</a></p>
|
||||||
|
<div class="symbol-classdesc">
|
||||||
|
<p>Remote-based authentication</p>
|
||||||
|
</div>
|
||||||
|
<dl class="dl-compact">
|
||||||
|
</dl>
|
||||||
|
</header>
|
||||||
|
<section id="summary">
|
||||||
|
</section>
|
||||||
|
<section>
|
||||||
|
<h2 id="RemoteAuth">new <span class="symbol-name">RemoteAuth</span><span class="signature"><span class="signature-params">(options)</span></span></h2>
|
||||||
|
<section>
|
||||||
|
<h3>Parameters</h3>
|
||||||
|
<table class="jsdoc-details-table">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Name</th>
|
||||||
|
<th>Type</th>
|
||||||
|
<th>Optional</th>
|
||||||
|
<th>Description</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<p>options</p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p> </p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p> </p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p>options</p>
|
||||||
|
<p>Values in <code>options</code> have the following properties:</p>
|
||||||
|
<table class="jsdoc-details-table">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Name</th>
|
||||||
|
<th>Type</th>
|
||||||
|
<th>Optional</th>
|
||||||
|
<th>Description</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<p>store</p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p> </p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p> </p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p>Remote database store instance</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<p>clientId</p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p> </p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p> </p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p>Client id to distinguish instances if you are using multiple, otherwise keep null if you are using only one instance</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<p>dataPath</p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p> </p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p> </p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p>Change the default path for saving session files, default is: "./.wwebjs_auth/"</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<p>backupSyncIntervalMs</p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p> </p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p> </p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p>Sets the time interval for periodic session backups. Accepts values starting from 60000ms {1 minute}</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</section>
|
||||||
|
<dl class="dl-compact">
|
||||||
|
</dl>
|
||||||
|
</section>
|
||||||
|
<section>
|
||||||
|
</section>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<nav id="jsdoc-toc-nav" role="navigation"></nav>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||||
|
<div id="jsdoc-footer-container">
|
||||||
|
<p>
|
||||||
|
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on November 26, 2022.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</footer>
|
||||||
|
<script src="scripts/jquery.min.js"></script>
|
||||||
|
<script src="scripts/tree.jquery.js"></script>
|
||||||
|
<script src="scripts/prettify.js"></script>
|
||||||
|
<script src="scripts/jsdoc-toc.js"></script>
|
||||||
|
<script src="scripts/linenumber.js"></script>
|
||||||
|
<script src="scripts/scrollanchor.js"></script>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
||||||
@@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta name="generator" content="JSDoc 3.6.7">
|
<meta name="generator" content="JSDoc 3.6.7">
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>whatsapp-web.js 1.16.6 » Class: Util</title>
|
<title>whatsapp-web.js 1.18.4 » Class: Util</title>
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
||||||
<div id="jsdoc-navbar-container">
|
<div id="jsdoc-navbar-container">
|
||||||
<div id="jsdoc-navbar-content">
|
<div id="jsdoc-navbar-content">
|
||||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>16.<wbr>6</a>
|
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>18.<wbr>4</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
@@ -26,7 +26,7 @@
|
|||||||
<header class="page-header">
|
<header class="page-header">
|
||||||
<div class="symbol-detail-labels"><span class="label label-kind">class</span></div>
|
<div class="symbol-detail-labels"><span class="label label-kind">class</span></div>
|
||||||
<h1><small></small><span class="symbol-name">Util</span></h1>
|
<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-14">util/<wbr>Util.<wbr>js:14</a></p>
|
||||||
<div class="symbol-classdesc">
|
<div class="symbol-classdesc">
|
||||||
<p>Utility methods</p>
|
<p>Utility methods</p>
|
||||||
</div>
|
</div>
|
||||||
@@ -243,7 +243,7 @@
|
|||||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||||
<div id="jsdoc-footer-container">
|
<div id="jsdoc-footer-container">
|
||||||
<p>
|
<p>
|
||||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on April 21, 2022.
|
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on November 26, 2022.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta name="generator" content="JSDoc 3.6.7">
|
<meta name="generator" content="JSDoc 3.6.7">
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>whatsapp-web.js 1.16.6 » Source: authStrategies/BaseAuthStrategy.js</title>
|
<title>whatsapp-web.js 1.18.4 » Source: authStrategies/BaseAuthStrategy.js</title>
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
||||||
<div id="jsdoc-navbar-container">
|
<div id="jsdoc-navbar-container">
|
||||||
<div id="jsdoc-navbar-content">
|
<div id="jsdoc-navbar-content">
|
||||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>16.<wbr>6</a>
|
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>18.<wbr>4</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
@@ -49,6 +49,9 @@ class BaseAuthStrategy {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
async getAuthEventPayload() {}
|
async getAuthEventPayload() {}
|
||||||
|
async afterAuthReady() {}
|
||||||
|
async disconnect() {}
|
||||||
|
async destroy() {}
|
||||||
async logout() {}
|
async logout() {}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -62,7 +65,7 @@ module.exports = BaseAuthStrategy;</code></pre>
|
|||||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||||
<div id="jsdoc-footer-container">
|
<div id="jsdoc-footer-container">
|
||||||
<p>
|
<p>
|
||||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on April 21, 2022.
|
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on November 26, 2022.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta name="generator" content="JSDoc 3.6.7">
|
<meta name="generator" content="JSDoc 3.6.7">
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>whatsapp-web.js 1.16.6 » Source: authStrategies/LegacySessionAuth.js</title>
|
<title>whatsapp-web.js 1.18.4 » Source: authStrategies/LegacySessionAuth.js</title>
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
||||||
<div id="jsdoc-navbar-container">
|
<div id="jsdoc-navbar-container">
|
||||||
<div id="jsdoc-navbar-content">
|
<div id="jsdoc-navbar-content">
|
||||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>16.<wbr>6</a>
|
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>18.<wbr>4</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
@@ -111,7 +111,7 @@ module.exports = LegacySessionAuth;
|
|||||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||||
<div id="jsdoc-footer-container">
|
<div id="jsdoc-footer-container">
|
||||||
<p>
|
<p>
|
||||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on April 21, 2022.
|
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on November 26, 2022.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta name="generator" content="JSDoc 3.6.7">
|
<meta name="generator" content="JSDoc 3.6.7">
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>whatsapp-web.js 1.16.6 » Source: authStrategies/LocalAuth.js</title>
|
<title>whatsapp-web.js 1.18.4 » Source: authStrategies/LocalAuth.js</title>
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
||||||
<div id="jsdoc-navbar-container">
|
<div id="jsdoc-navbar-container">
|
||||||
<div id="jsdoc-navbar-content">
|
<div id="jsdoc-navbar-content">
|
||||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>16.<wbr>6</a>
|
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>18.<wbr>4</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
@@ -91,7 +91,7 @@ module.exports = LocalAuth;</code></pre>
|
|||||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||||
<div id="jsdoc-footer-container">
|
<div id="jsdoc-footer-container">
|
||||||
<p>
|
<p>
|
||||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on April 21, 2022.
|
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on November 26, 2022.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta name="generator" content="JSDoc 3.6.7">
|
<meta name="generator" content="JSDoc 3.6.7">
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>whatsapp-web.js 1.16.6 » Source: authStrategies/NoAuth.js</title>
|
<title>whatsapp-web.js 1.18.4 » Source: authStrategies/NoAuth.js</title>
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
||||||
<div id="jsdoc-navbar-container">
|
<div id="jsdoc-navbar-container">
|
||||||
<div id="jsdoc-navbar-content">
|
<div id="jsdoc-navbar-content">
|
||||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>16.<wbr>6</a>
|
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>18.<wbr>4</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
@@ -50,7 +50,7 @@ module.exports = NoAuth;</code></pre>
|
|||||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||||
<div id="jsdoc-footer-container">
|
<div id="jsdoc-footer-container">
|
||||||
<p>
|
<p>
|
||||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on April 21, 2022.
|
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on November 26, 2022.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
258
docs/authStrategies_RemoteAuth.js.html
Normal file
258
docs/authStrategies_RemoteAuth.js.html
Normal file
@@ -0,0 +1,258 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html>
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta name="generator" content="JSDoc 3.6.7">
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>whatsapp-web.js 1.18.4 » Source: authStrategies/RemoteAuth.js</title>
|
||||||
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
|
||||||
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
||||||
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
||||||
|
<link href="css/baseline.css" rel="stylesheet">
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body onload="prettyPrint()">
|
||||||
|
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
||||||
|
<div id="jsdoc-navbar-container">
|
||||||
|
<div id="jsdoc-navbar-content">
|
||||||
|
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>18.<wbr>4</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</nav>
|
||||||
|
<div id="jsdoc-body-container">
|
||||||
|
<div id="jsdoc-content">
|
||||||
|
<div id="jsdoc-content-container">
|
||||||
|
<div id="jsdoc-banner" role="banner">
|
||||||
|
</div>
|
||||||
|
<div id="jsdoc-main" role="main">
|
||||||
|
<header class="page-header">
|
||||||
|
<h1>Source: authStrategies/RemoteAuth.js</h1>
|
||||||
|
</header>
|
||||||
|
<article>
|
||||||
|
<pre class="prettyprint linenums"><code>'use strict';
|
||||||
|
|
||||||
|
/* Require Optional Dependencies */
|
||||||
|
try {
|
||||||
|
var fs = require('fs-extra');
|
||||||
|
var unzipper = require('unzipper');
|
||||||
|
var archiver = require('archiver');
|
||||||
|
} catch {
|
||||||
|
fs = undefined;
|
||||||
|
unzipper = undefined;
|
||||||
|
archiver = undefined;
|
||||||
|
}
|
||||||
|
|
||||||
|
const path = require('path');
|
||||||
|
const { Events } = require('./../util/Constants');
|
||||||
|
const BaseAuthStrategy = require('./BaseAuthStrategy');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remote-based authentication
|
||||||
|
* @param {object} options - options
|
||||||
|
* @param {object} options.store - Remote database store instance
|
||||||
|
* @param {string} options.clientId - Client id to distinguish instances if you are using multiple, otherwise keep null if you are using only one instance
|
||||||
|
* @param {string} options.dataPath - Change the default path for saving session files, default is: "./.wwebjs_auth/"
|
||||||
|
* @param {number} options.backupSyncIntervalMs - Sets the time interval for periodic session backups. Accepts values starting from 60000ms {1 minute}
|
||||||
|
*/
|
||||||
|
class RemoteAuth extends BaseAuthStrategy {
|
||||||
|
constructor({ clientId, dataPath, store, backupSyncIntervalMs } = {}) {
|
||||||
|
if (!fs &amp;&amp; !unzipper &amp;&amp; !archiver) throw new Error('Optional Dependencies [fs-extra, unzipper, archiver] are required to use RemoteAuth. Make sure to run npm install correctly and remove the --no-optional flag');
|
||||||
|
super();
|
||||||
|
|
||||||
|
const idRegex = /^[-_\w]+$/i;
|
||||||
|
if (clientId &amp;&amp; !idRegex.test(clientId)) {
|
||||||
|
throw new Error('Invalid clientId. Only alphanumeric characters, underscores and hyphens are allowed.');
|
||||||
|
}
|
||||||
|
if (!backupSyncIntervalMs || backupSyncIntervalMs &lt; 60000) {
|
||||||
|
throw new Error('Invalid backupSyncIntervalMs. Accepts values starting from 60000ms {1 minute}.');
|
||||||
|
}
|
||||||
|
if(!store) throw new Error('Remote database store is required.');
|
||||||
|
|
||||||
|
this.store = store;
|
||||||
|
this.clientId = clientId;
|
||||||
|
this.backupSyncIntervalMs = backupSyncIntervalMs;
|
||||||
|
this.dataPath = path.resolve(dataPath || './.wwebjs_auth/');
|
||||||
|
this.tempDir = `${this.dataPath}/wwebjs_temp_session`;
|
||||||
|
this.requiredDirs = ['Default', 'IndexedDB', 'Local Storage']; /* => Required Files &amp; Dirs in WWebJS to restore session */
|
||||||
|
}
|
||||||
|
|
||||||
|
async beforeBrowserInitialized() {
|
||||||
|
const puppeteerOpts = this.client.options.puppeteer;
|
||||||
|
const sessionDirName = this.clientId ? `RemoteAuth-${this.clientId}` : 'RemoteAuth';
|
||||||
|
const dirPath = path.join(this.dataPath, sessionDirName);
|
||||||
|
|
||||||
|
if (puppeteerOpts.userDataDir &amp;&amp; puppeteerOpts.userDataDir !== dirPath) {
|
||||||
|
throw new Error('RemoteAuth is not compatible with a user-supplied userDataDir.');
|
||||||
|
}
|
||||||
|
|
||||||
|
this.userDataDir = dirPath;
|
||||||
|
this.sessionName = sessionDirName;
|
||||||
|
|
||||||
|
await this.extractRemoteSession();
|
||||||
|
|
||||||
|
this.client.options.puppeteer = {
|
||||||
|
...puppeteerOpts,
|
||||||
|
userDataDir: dirPath
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
async logout() {
|
||||||
|
await this.disconnect();
|
||||||
|
}
|
||||||
|
|
||||||
|
async destroy() {
|
||||||
|
clearInterval(this.backupSync);
|
||||||
|
}
|
||||||
|
|
||||||
|
async disconnect() {
|
||||||
|
await this.deleteRemoteSession();
|
||||||
|
|
||||||
|
let pathExists = await this.isValidPath(this.userDataDir);
|
||||||
|
if (pathExists) {
|
||||||
|
await fs.promises.rm(this.userDataDir, {
|
||||||
|
recursive: true,
|
||||||
|
force: true
|
||||||
|
}).catch(() => {});
|
||||||
|
}
|
||||||
|
clearInterval(this.backupSync);
|
||||||
|
}
|
||||||
|
|
||||||
|
async afterAuthReady() {
|
||||||
|
const sessionExists = await this.store.sessionExists({session: this.sessionName});
|
||||||
|
if(!sessionExists) {
|
||||||
|
await this.delay(60000); /* Initial delay sync required for session to be stable enough to recover */
|
||||||
|
await this.storeRemoteSession({emit: true});
|
||||||
|
}
|
||||||
|
var self = this;
|
||||||
|
this.backupSync = setInterval(async function () {
|
||||||
|
await self.storeRemoteSession();
|
||||||
|
}, this.backupSyncIntervalMs);
|
||||||
|
}
|
||||||
|
|
||||||
|
async storeRemoteSession(options) {
|
||||||
|
/* Compress &amp; Store Session */
|
||||||
|
const pathExists = await this.isValidPath(this.userDataDir);
|
||||||
|
if (pathExists) {
|
||||||
|
await this.compressSession();
|
||||||
|
await this.store.save({session: this.sessionName});
|
||||||
|
await fs.promises.unlink(`${this.sessionName}.zip`);
|
||||||
|
await fs.promises.rm(`${this.tempDir}`, {
|
||||||
|
recursive: true,
|
||||||
|
force: true
|
||||||
|
}).catch(() => {});
|
||||||
|
if(options &amp;&amp; options.emit) this.client.emit(Events.REMOTE_SESSION_SAVED);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async extractRemoteSession() {
|
||||||
|
const pathExists = await this.isValidPath(this.userDataDir);
|
||||||
|
const compressedSessionPath = `${this.sessionName}.zip`;
|
||||||
|
const sessionExists = await this.store.sessionExists({session: this.sessionName});
|
||||||
|
if (pathExists) {
|
||||||
|
await fs.promises.rm(this.userDataDir, {
|
||||||
|
recursive: true,
|
||||||
|
force: true
|
||||||
|
}).catch(() => {});
|
||||||
|
}
|
||||||
|
if (sessionExists) {
|
||||||
|
await this.store.extract({session: this.sessionName, path: compressedSessionPath});
|
||||||
|
await this.unCompressSession(compressedSessionPath);
|
||||||
|
} else {
|
||||||
|
fs.mkdirSync(this.userDataDir, { recursive: true });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async deleteRemoteSession() {
|
||||||
|
const sessionExists = await this.store.sessionExists({session: this.sessionName});
|
||||||
|
if (sessionExists) await this.store.delete({session: this.sessionName});
|
||||||
|
}
|
||||||
|
|
||||||
|
async compressSession() {
|
||||||
|
const archive = archiver('zip');
|
||||||
|
const stream = fs.createWriteStream(`${this.sessionName}.zip`);
|
||||||
|
|
||||||
|
await fs.copy(this.userDataDir, this.tempDir).catch(() => {});
|
||||||
|
await this.deleteMetadata();
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
archive
|
||||||
|
.directory(this.tempDir, false)
|
||||||
|
.on('error', err => reject(err))
|
||||||
|
.pipe(stream);
|
||||||
|
|
||||||
|
stream.on('close', () => resolve());
|
||||||
|
archive.finalize();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async unCompressSession(compressedSessionPath) {
|
||||||
|
var stream = fs.createReadStream(compressedSessionPath);
|
||||||
|
await new Promise((resolve, reject) => {
|
||||||
|
stream.pipe(unzipper.Extract({
|
||||||
|
path: this.userDataDir
|
||||||
|
}))
|
||||||
|
.on('error', err => reject(err))
|
||||||
|
.on('finish', () => resolve());
|
||||||
|
});
|
||||||
|
await fs.promises.unlink(compressedSessionPath);
|
||||||
|
}
|
||||||
|
|
||||||
|
async deleteMetadata() {
|
||||||
|
const sessionDirs = [this.tempDir, path.join(this.tempDir, 'Default')];
|
||||||
|
for (const dir of sessionDirs) {
|
||||||
|
const sessionFiles = await fs.promises.readdir(dir);
|
||||||
|
for (const element of sessionFiles) {
|
||||||
|
if (!this.requiredDirs.includes(element)) {
|
||||||
|
const dirElement = path.join(dir, element);
|
||||||
|
const stats = await fs.promises.lstat(dirElement);
|
||||||
|
|
||||||
|
if (stats.isDirectory()) {
|
||||||
|
await fs.promises.rm(dirElement, {
|
||||||
|
recursive: true,
|
||||||
|
force: true
|
||||||
|
}).catch(() => {});
|
||||||
|
} else {
|
||||||
|
await fs.promises.unlink(dirElement).catch(() => {});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async isValidPath(path) {
|
||||||
|
try {
|
||||||
|
await fs.promises.access(path);
|
||||||
|
return true;
|
||||||
|
} catch {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async delay(ms) {
|
||||||
|
return new Promise(resolve => setTimeout(resolve, ms));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = RemoteAuth;
|
||||||
|
</code></pre>
|
||||||
|
</article>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<nav id="jsdoc-toc-nav" role="navigation"></nav>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||||
|
<div id="jsdoc-footer-container">
|
||||||
|
<p>
|
||||||
|
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on November 26, 2022.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</footer>
|
||||||
|
<script src="scripts/jquery.min.js"></script>
|
||||||
|
<script src="scripts/tree.jquery.js"></script>
|
||||||
|
<script src="scripts/prettify.js"></script>
|
||||||
|
<script src="scripts/jsdoc-toc.js"></script>
|
||||||
|
<script src="scripts/linenumber.js"></script>
|
||||||
|
<script src="scripts/scrollanchor.js"></script>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
||||||
@@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta name="generator" content="JSDoc 3.6.7">
|
<meta name="generator" content="JSDoc 3.6.7">
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>whatsapp-web.js 1.16.6 » Globals</title>
|
<title>whatsapp-web.js 1.18.4 » Globals</title>
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
||||||
<div id="jsdoc-navbar-container">
|
<div id="jsdoc-navbar-container">
|
||||||
<div id="jsdoc-navbar-content">
|
<div id="jsdoc-navbar-content">
|
||||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>16.<wbr>6</a>
|
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>18.<wbr>4</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
@@ -285,6 +285,19 @@
|
|||||||
<td>
|
<td>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<p>MESSAGE_REACTION</p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p> </p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p> </p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<p>MEDIA_UPLOADED</p>
|
<p>MEDIA_UPLOADED</p>
|
||||||
@@ -350,6 +363,19 @@
|
|||||||
<td>
|
<td>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<p>LOADING_SCREEN</p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p> </p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p> </p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<p>DISCONNECTED</p>
|
<p>DISCONNECTED</p>
|
||||||
@@ -402,6 +428,19 @@
|
|||||||
<td>
|
<td>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<p>REMOTE_SESSION_SAVED</p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p> </p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p> </p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</section>
|
</section>
|
||||||
@@ -1980,7 +2019,7 @@
|
|||||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||||
<div id="jsdoc-footer-container">
|
<div id="jsdoc-footer-container">
|
||||||
<p>
|
<p>
|
||||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on April 21, 2022.
|
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on November 26, 2022.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
191
docs/index.html
191
docs/index.html
@@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta name="generator" content="JSDoc 3.6.7">
|
<meta name="generator" content="JSDoc 3.6.7">
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>whatsapp-web.js 1.16.6 » Home</title>
|
<title>whatsapp-web.js 1.18.4 » Home</title>
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
||||||
<div id="jsdoc-navbar-container">
|
<div id="jsdoc-navbar-container">
|
||||||
<div id="jsdoc-navbar-content">
|
<div id="jsdoc-navbar-content">
|
||||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>16.<wbr>6</a>
|
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>18.<wbr>4</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
@@ -27,11 +27,11 @@
|
|||||||
<div id="jsdoc-main" role="main">
|
<div id="jsdoc-main" role="main">
|
||||||
<header class="page-header">
|
<header class="page-header">
|
||||||
<h1>
|
<h1>
|
||||||
whatsapp-web.js 1.16.6
|
whatsapp-web.js 1.18.4
|
||||||
</h1>
|
</h1>
|
||||||
</header>
|
</header>
|
||||||
<article>
|
<article>
|
||||||
<p><a href="https://www.npmjs.com/package/whatsapp-web.js"><img src="https://img.shields.io/npm/v/whatsapp-web.js.svg" alt="npm"></a> <a href="https://depfu.com/github/pedroslopez/whatsapp-web.js?project_id=9765"><img src="https://badges.depfu.com/badges/4a65a0de96ece65fdf39e294e0c8dcba/overview.svg" alt="Depfu"></a> <img src="https://img.shields.io/badge/WhatsApp_Web-2.2212.8-brightgreen.svg" alt="WhatsApp_Web 2.2212.8"> <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.2245.9-brightgreen.svg" alt="WhatsApp_Web 2.2245.9"> <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>
|
<h1>whatsapp-web.js</h1>
|
||||||
<p>A WhatsApp API client that connects through the WhatsApp Web browser app</p>
|
<p>A WhatsApp API client that connects through the WhatsApp Web browser app</p>
|
||||||
<p>It uses Puppeteer to run a real instance of Whatsapp Web to avoid getting blocked.</p>
|
<p>It uses Puppeteer to run a real instance of Whatsapp Web to avoid getting blocked.</p>
|
||||||
@@ -183,6 +183,10 @@ client.initialize();
|
|||||||
<td>Set user status message</td>
|
<td>Set user status message</td>
|
||||||
<td>✅</td>
|
<td>✅</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>React to messages</td>
|
||||||
|
<td>✅</td>
|
||||||
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<p>Something missing? Make an issue and let us know!</p>
|
<p>Something missing? Make an issue and let us know!</p>
|
||||||
@@ -804,7 +808,7 @@ client.initialize();
|
|||||||
<dd>
|
<dd>
|
||||||
</dd>
|
</dd>
|
||||||
<dt class="symbol-index-name">
|
<dt class="symbol-index-name">
|
||||||
<a href="Client.html#event:message_revoke_everyone" class="!symbol-index-name">Client#<wbr>event:message_revoke_everyone</a>
|
<a href="Client.html#event:message_reaction" class="!symbol-index-name">Client#<wbr>event:message_reaction</a>
|
||||||
</dt>
|
</dt>
|
||||||
<dd>
|
<dd>
|
||||||
</dd>
|
</dd>
|
||||||
@@ -812,6 +816,11 @@ client.initialize();
|
|||||||
</div>
|
</div>
|
||||||
<div class="symbol-index-column">
|
<div class="symbol-index-column">
|
||||||
<dl class="symbol-index-list">
|
<dl class="symbol-index-list">
|
||||||
|
<dt class="symbol-index-name">
|
||||||
|
<a href="Client.html#event:message_revoke_everyone" class="!symbol-index-name">Client#<wbr>event:message_revoke_everyone</a>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
<dt class="symbol-index-name">
|
<dt class="symbol-index-name">
|
||||||
<a href="Client.html#event:message_revoke_me" class="!symbol-index-name">Client#<wbr>event:message_revoke_me</a>
|
<a href="Client.html#event:message_revoke_me" class="!symbol-index-name">Client#<wbr>event:message_revoke_me</a>
|
||||||
</dt>
|
</dt>
|
||||||
@@ -907,15 +916,15 @@ client.initialize();
|
|||||||
</dt>
|
</dt>
|
||||||
<dd>
|
<dd>
|
||||||
</dd>
|
</dd>
|
||||||
|
</dl>
|
||||||
|
</div>
|
||||||
|
<div class="symbol-index-column">
|
||||||
|
<dl class="symbol-index-list">
|
||||||
<dt class="symbol-index-name">
|
<dt class="symbol-index-name">
|
||||||
<a href="Client.html#getWWebVersion" class="!symbol-index-name">Client#<wbr>getWWebVersion()</a>
|
<a href="Client.html#getWWebVersion" class="!symbol-index-name">Client#<wbr>getWWebVersion()</a>
|
||||||
</dt>
|
</dt>
|
||||||
<dd>
|
<dd>
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
|
||||||
</div>
|
|
||||||
<div class="symbol-index-column">
|
|
||||||
<dl class="symbol-index-list">
|
|
||||||
<dt class="symbol-index-name">
|
<dt class="symbol-index-name">
|
||||||
<a href="Client.html#info" class="!symbol-index-name">Client#<wbr>info</a>
|
<a href="Client.html#info" class="!symbol-index-name">Client#<wbr>info</a>
|
||||||
</dt>
|
</dt>
|
||||||
@@ -1230,20 +1239,25 @@ client.initialize();
|
|||||||
</dt>
|
</dt>
|
||||||
<dd>
|
<dd>
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
|
||||||
</div>
|
|
||||||
<div class="symbol-index-column">
|
|
||||||
<dl class="symbol-index-list">
|
|
||||||
<dt class="symbol-index-name">
|
<dt class="symbol-index-name">
|
||||||
<a href="global.html#Events#.GROUP_UPDATE" class="!symbol-index-name">Events.<wbr>GROUP_UPDATE</a>
|
<a href="global.html#Events#.GROUP_UPDATE" class="!symbol-index-name">Events.<wbr>GROUP_UPDATE</a>
|
||||||
</dt>
|
</dt>
|
||||||
<dd>
|
<dd>
|
||||||
</dd>
|
</dd>
|
||||||
|
</dl>
|
||||||
|
</div>
|
||||||
|
<div class="symbol-index-column">
|
||||||
|
<dl class="symbol-index-list">
|
||||||
<dt class="symbol-index-name">
|
<dt class="symbol-index-name">
|
||||||
<a href="global.html#Events#.INCOMING_CALL" class="!symbol-index-name">Events.<wbr>INCOMING_CALL</a>
|
<a href="global.html#Events#.INCOMING_CALL" class="!symbol-index-name">Events.<wbr>INCOMING_CALL</a>
|
||||||
</dt>
|
</dt>
|
||||||
<dd>
|
<dd>
|
||||||
</dd>
|
</dd>
|
||||||
|
<dt class="symbol-index-name">
|
||||||
|
<a href="global.html#Events#.LOADING_SCREEN" class="!symbol-index-name">Events.<wbr>LOADING_SCREEN</a>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
<dt class="symbol-index-name">
|
<dt class="symbol-index-name">
|
||||||
<a href="global.html#Events#.MEDIA_UPLOADED" class="!symbol-index-name">Events.<wbr>MEDIA_UPLOADED</a>
|
<a href="global.html#Events#.MEDIA_UPLOADED" class="!symbol-index-name">Events.<wbr>MEDIA_UPLOADED</a>
|
||||||
</dt>
|
</dt>
|
||||||
@@ -1259,6 +1273,11 @@ client.initialize();
|
|||||||
</dt>
|
</dt>
|
||||||
<dd>
|
<dd>
|
||||||
</dd>
|
</dd>
|
||||||
|
<dt class="symbol-index-name">
|
||||||
|
<a href="global.html#Events#.MESSAGE_REACTION" class="!symbol-index-name">Events.<wbr>MESSAGE_REACTION</a>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
<dt class="symbol-index-name">
|
<dt class="symbol-index-name">
|
||||||
<a href="global.html#Events#.MESSAGE_RECEIVED" class="!symbol-index-name">Events.<wbr>MESSAGE_RECEIVED</a>
|
<a href="global.html#Events#.MESSAGE_RECEIVED" class="!symbol-index-name">Events.<wbr>MESSAGE_RECEIVED</a>
|
||||||
</dt>
|
</dt>
|
||||||
@@ -1288,6 +1307,11 @@ client.initialize();
|
|||||||
</dt>
|
</dt>
|
||||||
<dd>
|
<dd>
|
||||||
</dd>
|
</dd>
|
||||||
|
<dt class="symbol-index-name">
|
||||||
|
<a href="global.html#Events#.REMOTE_SESSION_SAVED" class="!symbol-index-name">Events.<wbr>REMOTE_SESSION_SAVED</a>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
<dt class="symbol-index-name">
|
<dt class="symbol-index-name">
|
||||||
<a href="global.html#Events#.STATE_CHANGED" class="!symbol-index-name">Events.<wbr>STATE_CHANGED</a>
|
<a href="global.html#Events#.STATE_CHANGED" class="!symbol-index-name">Events.<wbr>STATE_CHANGED</a>
|
||||||
</dt>
|
</dt>
|
||||||
@@ -2015,15 +2039,15 @@ client.initialize();
|
|||||||
</dt>
|
</dt>
|
||||||
<dd>
|
<dd>
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
|
||||||
</div>
|
|
||||||
<div class="symbol-index-column">
|
|
||||||
<dl class="symbol-index-list">
|
|
||||||
<dt class="symbol-index-name">
|
<dt class="symbol-index-name">
|
||||||
<a href="Message.html#getContact" class="!symbol-index-name">Message#<wbr>getContact()</a>
|
<a href="Message.html#getContact" class="!symbol-index-name">Message#<wbr>getContact()</a>
|
||||||
</dt>
|
</dt>
|
||||||
<dd>
|
<dd>
|
||||||
</dd>
|
</dd>
|
||||||
|
</dl>
|
||||||
|
</div>
|
||||||
|
<div class="symbol-index-column">
|
||||||
|
<dl class="symbol-index-list">
|
||||||
<dt class="symbol-index-name">
|
<dt class="symbol-index-name">
|
||||||
<a href="Message.html#getInfo" class="!symbol-index-name">Message#<wbr>getInfo()</a>
|
<a href="Message.html#getInfo" class="!symbol-index-name">Message#<wbr>getInfo()</a>
|
||||||
</dt>
|
</dt>
|
||||||
@@ -2094,10 +2118,6 @@ client.initialize();
|
|||||||
</dt>
|
</dt>
|
||||||
<dd>
|
<dd>
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
|
||||||
</div>
|
|
||||||
<div class="symbol-index-column">
|
|
||||||
<dl class="symbol-index-list">
|
|
||||||
<dt class="symbol-index-name">
|
<dt class="symbol-index-name">
|
||||||
<a href="Message.html#links" class="!symbol-index-name">Message#<wbr>links</a>
|
<a href="Message.html#links" class="!symbol-index-name">Message#<wbr>links</a>
|
||||||
</dt>
|
</dt>
|
||||||
@@ -2108,6 +2128,10 @@ client.initialize();
|
|||||||
</dt>
|
</dt>
|
||||||
<dd>
|
<dd>
|
||||||
</dd>
|
</dd>
|
||||||
|
</dl>
|
||||||
|
</div>
|
||||||
|
<div class="symbol-index-column">
|
||||||
|
<dl class="symbol-index-list">
|
||||||
<dt class="symbol-index-name">
|
<dt class="symbol-index-name">
|
||||||
<a href="Message.html#mediaKey" class="!symbol-index-name">Message#<wbr>mediaKey</a>
|
<a href="Message.html#mediaKey" class="!symbol-index-name">Message#<wbr>mediaKey</a>
|
||||||
</dt>
|
</dt>
|
||||||
@@ -2128,6 +2152,11 @@ client.initialize();
|
|||||||
</dt>
|
</dt>
|
||||||
<dd>
|
<dd>
|
||||||
</dd>
|
</dd>
|
||||||
|
<dt class="symbol-index-name">
|
||||||
|
<a href="Message.html#react" class="!symbol-index-name">Message#<wbr>react(reaction)</a>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
<dt class="symbol-index-name">
|
<dt class="symbol-index-name">
|
||||||
<a href="Message.html#reload" class="!symbol-index-name">Message#<wbr>reload()</a>
|
<a href="Message.html#reload" class="!symbol-index-name">Message#<wbr>reload()</a>
|
||||||
</dt>
|
</dt>
|
||||||
@@ -2234,7 +2263,7 @@ client.initialize();
|
|||||||
<div class="symbol-index-column">
|
<div class="symbol-index-column">
|
||||||
<dl class="symbol-index-list">
|
<dl class="symbol-index-list">
|
||||||
<dt class="symbol-index-name">
|
<dt class="symbol-index-name">
|
||||||
<a href="MessageMedia.html" class="!symbol-index-name">MessageMedia(mimetype, data, filename)</a>
|
<a href="MessageMedia.html" class="!symbol-index-name">MessageMedia(mimetype, data, filename, filesize)</a>
|
||||||
</dt>
|
</dt>
|
||||||
<dd>
|
<dd>
|
||||||
</dd>
|
</dd>
|
||||||
@@ -2243,29 +2272,34 @@ client.initialize();
|
|||||||
</dt>
|
</dt>
|
||||||
<dd>
|
<dd>
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
|
||||||
</div>
|
|
||||||
<div class="symbol-index-column">
|
|
||||||
<dl class="symbol-index-list">
|
|
||||||
<dt class="symbol-index-name">
|
<dt class="symbol-index-name">
|
||||||
<a href="MessageMedia.html#.fromUrl" class="!symbol-index-name">MessageMedia.<wbr>fromUrl(url[, options])</a>
|
<a href="MessageMedia.html#.fromUrl" class="!symbol-index-name">MessageMedia.<wbr>fromUrl(url[, options])</a>
|
||||||
</dt>
|
</dt>
|
||||||
<dd>
|
<dd>
|
||||||
</dd>
|
</dd>
|
||||||
|
</dl>
|
||||||
|
</div>
|
||||||
|
<div class="symbol-index-column">
|
||||||
|
<dl class="symbol-index-list">
|
||||||
<dt class="symbol-index-name">
|
<dt class="symbol-index-name">
|
||||||
<a href="MessageMedia.html#data" class="!symbol-index-name">MessageMedia#<wbr>data</a>
|
<a href="MessageMedia.html#data" class="!symbol-index-name">MessageMedia#<wbr>data</a>
|
||||||
</dt>
|
</dt>
|
||||||
<dd>
|
<dd>
|
||||||
</dd>
|
</dd>
|
||||||
|
<dt class="symbol-index-name">
|
||||||
|
<a href="MessageMedia.html#filename" class="!symbol-index-name">MessageMedia#<wbr>filename</a>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
<dt class="symbol-index-name">
|
||||||
|
<a href="MessageMedia.html#filesize" class="!symbol-index-name">MessageMedia#<wbr>filesize</a>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
</div>
|
</div>
|
||||||
<div class="symbol-index-column">
|
<div class="symbol-index-column">
|
||||||
<dl class="symbol-index-list">
|
<dl class="symbol-index-list">
|
||||||
<dt class="symbol-index-name">
|
|
||||||
<a href="MessageMedia.html#filename" class="!symbol-index-name">MessageMedia#<wbr>filename</a>
|
|
||||||
</dt>
|
|
||||||
<dd>
|
|
||||||
</dd>
|
|
||||||
<dt class="symbol-index-name">
|
<dt class="symbol-index-name">
|
||||||
<a href="MessageMedia.html#mimetype" class="!symbol-index-name">MessageMedia#<wbr>mimetype</a>
|
<a href="MessageMedia.html#mimetype" class="!symbol-index-name">MessageMedia#<wbr>mimetype</a>
|
||||||
</dt>
|
</dt>
|
||||||
@@ -2983,6 +3017,99 @@ client.initialize();
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
<section>
|
||||||
|
<div class="symbol-index-content">
|
||||||
|
<h2 id="Reaction">Reaction</h2>
|
||||||
|
<div class="symbol-index-section">
|
||||||
|
<div class="symbol-index-column">
|
||||||
|
<dl class="symbol-index-list">
|
||||||
|
<dt class="symbol-index-name">
|
||||||
|
<a href="Reaction.html" class="!symbol-index-name">Reaction()</a>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
<dt class="symbol-index-name">
|
||||||
|
<a href="Reaction.html#ack" class="!symbol-index-name">Reaction#<wbr>ack</a>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
<dt class="symbol-index-name">
|
||||||
|
<a href="Reaction.html#id" class="!symbol-index-name">Reaction#<wbr>id</a>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
<dt class="symbol-index-name">
|
||||||
|
<a href="Reaction.html#msgId" class="!symbol-index-name">Reaction#<wbr>msgId</a>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
</div>
|
||||||
|
<div class="symbol-index-column">
|
||||||
|
<dl class="symbol-index-list">
|
||||||
|
<dt class="symbol-index-name">
|
||||||
|
<a href="Reaction.html#orphan" class="!symbol-index-name">Reaction#<wbr>orphan</a>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
<dt class="symbol-index-name">
|
||||||
|
<a href="Reaction.html#orphanReason" class="!symbol-index-name">Reaction#<wbr>orphanReason</a>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
<dt class="symbol-index-name">
|
||||||
|
<a href="Reaction.html#reaction" class="!symbol-index-name">Reaction#<wbr>reaction</a>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
<dt class="symbol-index-name">
|
||||||
|
<a href="Reaction.html#read" class="!symbol-index-name">Reaction#<wbr>read</a>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
</div>
|
||||||
|
<div class="symbol-index-column">
|
||||||
|
<dl class="symbol-index-list">
|
||||||
|
<dt class="symbol-index-name">
|
||||||
|
<a href="Reaction.html#senderId" class="!symbol-index-name">Reaction#<wbr>senderId</a>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
<dt class="symbol-index-name">
|
||||||
|
<a href="Reaction.html#timestamp" class="!symbol-index-name">Reaction#<wbr>timestamp</a>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
<section>
|
||||||
|
<div class="symbol-index-content">
|
||||||
|
<h2 id="RemoteAuth">RemoteAuth</h2>
|
||||||
|
<div class="symbol-index-section">
|
||||||
|
<div class="symbol-index-column">
|
||||||
|
<dl class="symbol-index-list">
|
||||||
|
<dt class="symbol-index-name">
|
||||||
|
<a href="RemoteAuth.html" class="!symbol-index-name">RemoteAuth(options)</a>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
</div>
|
||||||
|
<div class="symbol-index-column">
|
||||||
|
<dl class="symbol-index-list">
|
||||||
|
</dl>
|
||||||
|
</div>
|
||||||
|
<div class="symbol-index-column">
|
||||||
|
<dl class="symbol-index-list">
|
||||||
|
</dl>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
<section>
|
<section>
|
||||||
<div class="symbol-index-content">
|
<div class="symbol-index-content">
|
||||||
<h2 id="Status">Status</h2>
|
<h2 id="Status">Status</h2>
|
||||||
@@ -3149,7 +3276,7 @@ client.initialize();
|
|||||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||||
<div id="jsdoc-footer-container">
|
<div id="jsdoc-footer-container">
|
||||||
<p>
|
<p>
|
||||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on April 21, 2022.
|
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on November 26, 2022.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
treeNode.tree({
|
treeNode.tree({
|
||||||
autoEscape: false,
|
autoEscape: false,
|
||||||
closedIcon: '⇢',
|
closedIcon: '⇢',
|
||||||
data: [{"label":"<a href=\"global.html\">Globals</a>","id":"global","children":[]},{"label":"<a href=\"Base.html\">Base</a>","id":"Base","children":[]},{"label":"<a href=\"BaseAuthStrategy.html\">BaseAuthStrategy</a>","id":"BaseAuthStrategy","children":[]},{"label":"<a href=\"BusinessContact.html\">BusinessContact</a>","id":"BusinessContact","children":[]},{"label":"<a href=\"Buttons.html\">Buttons</a>","id":"Buttons","children":[]},{"label":"<a href=\"Call.html\">Call</a>","id":"Call","children":[]},{"label":"<a href=\"Chat.html\">Chat</a>","id":"Chat","children":[]},{"label":"<a href=\"Client.html\">Client</a>","id":"Client","children":[]},{"label":"<a href=\"ClientInfo.html\">ClientInfo</a>","id":"ClientInfo","children":[]},{"label":"<a href=\"Contact.html\">Contact</a>","id":"Contact","children":[]},{"label":"<a href=\"GroupChat.html\">GroupChat</a>","id":"GroupChat","children":[]},{"label":"<a href=\"GroupNotification.html\">GroupNotification</a>","id":"GroupNotification","children":[]},{"label":"<a href=\"InterfaceController.html\">InterfaceController</a>","id":"InterfaceController","children":[]},{"label":"<a href=\"Label.html\">Label</a>","id":"Label","children":[]},{"label":"<a href=\"LegacySessionAuth.html\">LegacySessionAuth</a>","id":"LegacySessionAuth","children":[]},{"label":"<a href=\"List.html\">List</a>","id":"List","children":[]},{"label":"<a href=\"LocalAuth.html\">LocalAuth</a>","id":"LocalAuth","children":[]},{"label":"<a href=\"Location.html\">Location</a>","id":"Location","children":[]},{"label":"<a href=\"Message.html\">Message</a>","id":"Message","children":[]},{"label":"<a href=\"MessageMedia.html\">MessageMedia</a>","id":"MessageMedia","children":[]},{"label":"<a href=\"NoAuth.html\">NoAuth</a>","id":"NoAuth","children":[]},{"label":"<a href=\"Order.html\">Order</a>","id":"Order","children":[]},{"label":"<a href=\"PrivateChat.html\">PrivateChat</a>","id":"PrivateChat","children":[]},{"label":"<a href=\"PrivateContact.html\">PrivateContact</a>","id":"PrivateContact","children":[]},{"label":"<a href=\"Product.html\">Product</a>","id":"Product","children":[]},{"label":"<a href=\"Util.html\">Util</a>","id":"Util","children":[]}],
|
data: [{"label":"<a href=\"global.html\">Globals</a>","id":"global","children":[]},{"label":"<a href=\"Base.html\">Base</a>","id":"Base","children":[]},{"label":"<a href=\"BaseAuthStrategy.html\">BaseAuthStrategy</a>","id":"BaseAuthStrategy","children":[]},{"label":"<a href=\"BusinessContact.html\">BusinessContact</a>","id":"BusinessContact","children":[]},{"label":"<a href=\"Buttons.html\">Buttons</a>","id":"Buttons","children":[]},{"label":"<a href=\"Call.html\">Call</a>","id":"Call","children":[]},{"label":"<a href=\"Chat.html\">Chat</a>","id":"Chat","children":[]},{"label":"<a href=\"Client.html\">Client</a>","id":"Client","children":[]},{"label":"<a href=\"ClientInfo.html\">ClientInfo</a>","id":"ClientInfo","children":[]},{"label":"<a href=\"Contact.html\">Contact</a>","id":"Contact","children":[]},{"label":"<a href=\"GroupChat.html\">GroupChat</a>","id":"GroupChat","children":[]},{"label":"<a href=\"GroupNotification.html\">GroupNotification</a>","id":"GroupNotification","children":[]},{"label":"<a href=\"InterfaceController.html\">InterfaceController</a>","id":"InterfaceController","children":[]},{"label":"<a href=\"Label.html\">Label</a>","id":"Label","children":[]},{"label":"<a href=\"LegacySessionAuth.html\">LegacySessionAuth</a>","id":"LegacySessionAuth","children":[]},{"label":"<a href=\"List.html\">List</a>","id":"List","children":[]},{"label":"<a href=\"LocalAuth.html\">LocalAuth</a>","id":"LocalAuth","children":[]},{"label":"<a href=\"Location.html\">Location</a>","id":"Location","children":[]},{"label":"<a href=\"Message.html\">Message</a>","id":"Message","children":[]},{"label":"<a href=\"MessageMedia.html\">MessageMedia</a>","id":"MessageMedia","children":[]},{"label":"<a href=\"NoAuth.html\">NoAuth</a>","id":"NoAuth","children":[]},{"label":"<a href=\"Order.html\">Order</a>","id":"Order","children":[]},{"label":"<a href=\"PrivateChat.html\">PrivateChat</a>","id":"PrivateChat","children":[]},{"label":"<a href=\"PrivateContact.html\">PrivateContact</a>","id":"PrivateContact","children":[]},{"label":"<a href=\"Product.html\">Product</a>","id":"Product","children":[]},{"label":"<a href=\"Reaction.html\">Reaction</a>","id":"Reaction","children":[]},{"label":"<a href=\"RemoteAuth.html\">RemoteAuth</a>","id":"RemoteAuth","children":[]},{"label":"<a href=\"Util.html\">Util</a>","id":"Util","children":[]}],
|
||||||
openedIcon: ' ⇣',
|
openedIcon: ' ⇣',
|
||||||
saveState: false,
|
saveState: false,
|
||||||
useContextMenu: false
|
useContextMenu: false
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta name="generator" content="JSDoc 3.6.7">
|
<meta name="generator" content="JSDoc 3.6.7">
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>whatsapp-web.js 1.16.6 » Source: structures/Base.js</title>
|
<title>whatsapp-web.js 1.18.4 » Source: structures/Base.js</title>
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
||||||
<div id="jsdoc-navbar-container">
|
<div id="jsdoc-navbar-container">
|
||||||
<div id="jsdoc-navbar-content">
|
<div id="jsdoc-navbar-content">
|
||||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>16.<wbr>6</a>
|
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>18.<wbr>4</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
@@ -60,7 +60,7 @@ module.exports = Base;</code></pre>
|
|||||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||||
<div id="jsdoc-footer-container">
|
<div id="jsdoc-footer-container">
|
||||||
<p>
|
<p>
|
||||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on April 21, 2022.
|
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on November 26, 2022.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta name="generator" content="JSDoc 3.6.7">
|
<meta name="generator" content="JSDoc 3.6.7">
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>whatsapp-web.js 1.16.6 » Source: structures/BusinessContact.js</title>
|
<title>whatsapp-web.js 1.18.4 » Source: structures/BusinessContact.js</title>
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
||||||
<div id="jsdoc-navbar-container">
|
<div id="jsdoc-navbar-container">
|
||||||
<div id="jsdoc-navbar-content">
|
<div id="jsdoc-navbar-content">
|
||||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>16.<wbr>6</a>
|
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>18.<wbr>4</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
@@ -59,7 +59,7 @@ module.exports = BusinessContact;</code></pre>
|
|||||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||||
<div id="jsdoc-footer-container">
|
<div id="jsdoc-footer-container">
|
||||||
<p>
|
<p>
|
||||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on April 21, 2022.
|
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on November 26, 2022.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta name="generator" content="JSDoc 3.6.7">
|
<meta name="generator" content="JSDoc 3.6.7">
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>whatsapp-web.js 1.16.6 » Source: structures/Buttons.js</title>
|
<title>whatsapp-web.js 1.18.4 » Source: structures/Buttons.js</title>
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
||||||
<div id="jsdoc-navbar-container">
|
<div id="jsdoc-navbar-container">
|
||||||
<div id="jsdoc-navbar-content">
|
<div id="jsdoc-navbar-content">
|
||||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>16.<wbr>6</a>
|
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>18.<wbr>4</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
@@ -120,7 +120,7 @@ module.exports = Buttons;</code></pre>
|
|||||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||||
<div id="jsdoc-footer-container">
|
<div id="jsdoc-footer-container">
|
||||||
<p>
|
<p>
|
||||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on April 21, 2022.
|
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on November 26, 2022.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta name="generator" content="JSDoc 3.6.7">
|
<meta name="generator" content="JSDoc 3.6.7">
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>whatsapp-web.js 1.16.6 » Source: structures/Call.js</title>
|
<title>whatsapp-web.js 1.18.4 » Source: structures/Call.js</title>
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
||||||
<div id="jsdoc-navbar-container">
|
<div id="jsdoc-navbar-container">
|
||||||
<div id="jsdoc-navbar-content">
|
<div id="jsdoc-navbar-content">
|
||||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>16.<wbr>6</a>
|
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>18.<wbr>4</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
@@ -106,7 +106,7 @@ module.exports = Call;</code></pre>
|
|||||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||||
<div id="jsdoc-footer-container">
|
<div id="jsdoc-footer-container">
|
||||||
<p>
|
<p>
|
||||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on April 21, 2022.
|
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on November 26, 2022.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta name="generator" content="JSDoc 3.6.7">
|
<meta name="generator" content="JSDoc 3.6.7">
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>whatsapp-web.js 1.16.6 » Source: structures/Chat.js</title>
|
<title>whatsapp-web.js 1.18.4 » Source: structures/Chat.js</title>
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
||||||
<div id="jsdoc-navbar-container">
|
<div id="jsdoc-navbar-container">
|
||||||
<div id="jsdoc-navbar-content">
|
<div id="jsdoc-navbar-content">
|
||||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>16.<wbr>6</a>
|
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>18.<wbr>4</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
@@ -201,21 +201,30 @@ class Chat extends Base {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Loads chat messages, sorted from earliest to latest.
|
* Loads chat messages, sorted from earliest to latest.
|
||||||
* @param {Object} searchOptions Options for searching messages. Right now only limit is supported.
|
* @param {Object} searchOptions Options for searching messages. Right now only limit and fromMe is supported.
|
||||||
* @param {Number} [searchOptions.limit] The amount of messages to return. If no limit is specified, the available messages will be returned. Note that the actual number of returned messages may be smaller if there aren't enough messages in the conversation. Set this to Infinity to load all messages.
|
* @param {Number} [searchOptions.limit] The amount of messages to return. If no limit is specified, the available messages will be returned. Note that the actual number of returned messages may be smaller if there aren't enough messages in the conversation. Set this to Infinity to load all messages.
|
||||||
|
* @param {Boolean} [searchOptions.fromMe] Return only messages from the bot number or vise versa. To get all messages, leave the option undefined.
|
||||||
* @returns {Promise&lt;Array&lt;Message>>}
|
* @returns {Promise&lt;Array&lt;Message>>}
|
||||||
*/
|
*/
|
||||||
async fetchMessages(searchOptions) {
|
async fetchMessages(searchOptions) {
|
||||||
let messages = await this.client.pupPage.evaluate(async (chatId, searchOptions) => {
|
let messages = await this.client.pupPage.evaluate(async (chatId, searchOptions) => {
|
||||||
const msgFilter = m => !m.isNotification; // dont include notification messages
|
const msgFilter = (m) => {
|
||||||
|
if (m.isNotification) {
|
||||||
|
return false; // dont include notification messages
|
||||||
|
}
|
||||||
|
if (searchOptions &amp;&amp; searchOptions.fromMe &amp;&amp; m.id.fromMe !== searchOptions.fromMe) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
};
|
||||||
|
|
||||||
const chat = window.Store.Chat.get(chatId);
|
const chat = window.Store.Chat.get(chatId);
|
||||||
let msgs = chat.msgs.models.filter(msgFilter);
|
let msgs = chat.msgs.getModelsArray().filter(msgFilter);
|
||||||
|
|
||||||
if (searchOptions &amp;&amp; searchOptions.limit > 0) {
|
if (searchOptions &amp;&amp; searchOptions.limit > 0) {
|
||||||
while (msgs.length &lt; searchOptions.limit) {
|
while (msgs.length &lt; searchOptions.limit) {
|
||||||
const loadedMessages = await chat.loadEarlierMsgs();
|
const loadedMessages = await window.Store.ConversationMsgs.loadEarlierMsgs(chat);
|
||||||
if (!loadedMessages) break;
|
if (!loadedMessages || !loadedMessages.length) break;
|
||||||
msgs = [...loadedMessages.filter(msgFilter), ...msgs];
|
msgs = [...loadedMessages.filter(msgFilter), ...msgs];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -290,7 +299,7 @@ module.exports = Chat;
|
|||||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||||
<div id="jsdoc-footer-container">
|
<div id="jsdoc-footer-container">
|
||||||
<p>
|
<p>
|
||||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on April 21, 2022.
|
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on November 26, 2022.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta name="generator" content="JSDoc 3.6.7">
|
<meta name="generator" content="JSDoc 3.6.7">
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>whatsapp-web.js 1.16.6 » Source: structures/ClientInfo.js</title>
|
<title>whatsapp-web.js 1.18.4 » Source: structures/ClientInfo.js</title>
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
||||||
<div id="jsdoc-navbar-container">
|
<div id="jsdoc-navbar-container">
|
||||||
<div id="jsdoc-navbar-content">
|
<div id="jsdoc-navbar-content">
|
||||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>16.<wbr>6</a>
|
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>18.<wbr>4</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
@@ -109,7 +109,7 @@ module.exports = ClientInfo;</code></pre>
|
|||||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||||
<div id="jsdoc-footer-container">
|
<div id="jsdoc-footer-container">
|
||||||
<p>
|
<p>
|
||||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on April 21, 2022.
|
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on November 26, 2022.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta name="generator" content="JSDoc 3.6.7">
|
<meta name="generator" content="JSDoc 3.6.7">
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>whatsapp-web.js 1.16.6 » Source: structures/Contact.js</title>
|
<title>whatsapp-web.js 1.18.4 » Source: structures/Contact.js</title>
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
||||||
<div id="jsdoc-navbar-container">
|
<div id="jsdoc-navbar-container">
|
||||||
<div id="jsdoc-navbar-content">
|
<div id="jsdoc-navbar-content">
|
||||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>16.<wbr>6</a>
|
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>18.<wbr>4</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
@@ -245,7 +245,7 @@ module.exports = Contact;
|
|||||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||||
<div id="jsdoc-footer-container">
|
<div id="jsdoc-footer-container">
|
||||||
<p>
|
<p>
|
||||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on April 21, 2022.
|
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on November 26, 2022.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta name="generator" content="JSDoc 3.6.7">
|
<meta name="generator" content="JSDoc 3.6.7">
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>whatsapp-web.js 1.16.6 » Source: structures/GroupChat.js</title>
|
<title>whatsapp-web.js 1.18.4 » Source: structures/GroupChat.js</title>
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
||||||
<div id="jsdoc-navbar-container">
|
<div id="jsdoc-navbar-container">
|
||||||
<div id="jsdoc-navbar-content">
|
<div id="jsdoc-navbar-content">
|
||||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>16.<wbr>6</a>
|
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>18.<wbr>4</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
@@ -272,7 +272,7 @@ module.exports = GroupChat;</code></pre>
|
|||||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||||
<div id="jsdoc-footer-container">
|
<div id="jsdoc-footer-container">
|
||||||
<p>
|
<p>
|
||||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on April 21, 2022.
|
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on November 26, 2022.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta name="generator" content="JSDoc 3.6.7">
|
<meta name="generator" content="JSDoc 3.6.7">
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>whatsapp-web.js 1.16.6 » Source: structures/GroupNotification.js</title>
|
<title>whatsapp-web.js 1.18.4 » Source: structures/GroupNotification.js</title>
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
||||||
<div id="jsdoc-navbar-container">
|
<div id="jsdoc-navbar-container">
|
||||||
<div id="jsdoc-navbar-content">
|
<div id="jsdoc-navbar-content">
|
||||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>16.<wbr>6</a>
|
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>18.<wbr>4</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
@@ -143,7 +143,7 @@ module.exports = GroupNotification;
|
|||||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||||
<div id="jsdoc-footer-container">
|
<div id="jsdoc-footer-container">
|
||||||
<p>
|
<p>
|
||||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on April 21, 2022.
|
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on November 26, 2022.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta name="generator" content="JSDoc 3.6.7">
|
<meta name="generator" content="JSDoc 3.6.7">
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>whatsapp-web.js 1.16.6 » Source: structures/Label.js</title>
|
<title>whatsapp-web.js 1.18.4 » 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/Karla:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
||||||
<div id="jsdoc-navbar-container">
|
<div id="jsdoc-navbar-container">
|
||||||
<div id="jsdoc-navbar-content">
|
<div id="jsdoc-navbar-content">
|
||||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>16.<wbr>6</a>
|
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>18.<wbr>4</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
@@ -88,7 +88,7 @@ module.exports = Label;</code></pre>
|
|||||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||||
<div id="jsdoc-footer-container">
|
<div id="jsdoc-footer-container">
|
||||||
<p>
|
<p>
|
||||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on April 21, 2022.
|
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on November 26, 2022.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta name="generator" content="JSDoc 3.6.7">
|
<meta name="generator" content="JSDoc 3.6.7">
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>whatsapp-web.js 1.16.6 » Source: structures/List.js</title>
|
<title>whatsapp-web.js 1.18.4 » Source: structures/List.js</title>
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
||||||
<div id="jsdoc-navbar-container">
|
<div id="jsdoc-navbar-container">
|
||||||
<div id="jsdoc-navbar-content">
|
<div id="jsdoc-navbar-content">
|
||||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>16.<wbr>6</a>
|
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>18.<wbr>4</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
@@ -118,7 +118,7 @@ module.exports = List;
|
|||||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||||
<div id="jsdoc-footer-container">
|
<div id="jsdoc-footer-container">
|
||||||
<p>
|
<p>
|
||||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on April 21, 2022.
|
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on November 26, 2022.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta name="generator" content="JSDoc 3.6.7">
|
<meta name="generator" content="JSDoc 3.6.7">
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>whatsapp-web.js 1.16.6 » Source: structures/Location.js</title>
|
<title>whatsapp-web.js 1.18.4 » Source: structures/Location.js</title>
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
||||||
<div id="jsdoc-navbar-container">
|
<div id="jsdoc-navbar-container">
|
||||||
<div id="jsdoc-navbar-content">
|
<div id="jsdoc-navbar-content">
|
||||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>16.<wbr>6</a>
|
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>18.<wbr>4</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
@@ -71,7 +71,7 @@ module.exports = Location;</code></pre>
|
|||||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||||
<div id="jsdoc-footer-container">
|
<div id="jsdoc-footer-container">
|
||||||
<p>
|
<p>
|
||||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on April 21, 2022.
|
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on November 26, 2022.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta name="generator" content="JSDoc 3.6.7">
|
<meta name="generator" content="JSDoc 3.6.7">
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>whatsapp-web.js 1.16.6 » Source: structures/Message.js</title>
|
<title>whatsapp-web.js 1.18.4 » Source: structures/Message.js</title>
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
||||||
<div id="jsdoc-navbar-container">
|
<div id="jsdoc-navbar-container">
|
||||||
<div id="jsdoc-navbar-content">
|
<div id="jsdoc-navbar-content">
|
||||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>16.<wbr>6</a>
|
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>18.<wbr>4</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
@@ -336,8 +336,9 @@ class Message extends Base {
|
|||||||
if (!this.hasQuotedMsg) return undefined;
|
if (!this.hasQuotedMsg) return undefined;
|
||||||
|
|
||||||
const quotedMsg = await this.client.pupPage.evaluate((msgId) => {
|
const quotedMsg = await this.client.pupPage.evaluate((msgId) => {
|
||||||
let msg = window.Store.Msg.get(msgId);
|
const msg = window.Store.Msg.get(msgId);
|
||||||
return msg.quotedMsgObj().serialize();
|
const quotedMsg = window.Store.QuotedMsg.getQuotedMsgObj(msg);
|
||||||
|
return window.WWebJS.getMessageModel(quotedMsg);
|
||||||
}, this.id._serialized);
|
}, this.id._serialized);
|
||||||
|
|
||||||
return new Message(this.client, quotedMsg);
|
return new Message(this.client, quotedMsg);
|
||||||
@@ -366,6 +367,20 @@ class Message extends Base {
|
|||||||
return this.client.sendMessage(chatId, content, options);
|
return this.client.sendMessage(chatId, content, options);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* React to this message with an emoji
|
||||||
|
* @param {string} reaction - Emoji to react with. Send an empty string to remove the reaction.
|
||||||
|
* @return {Promise}
|
||||||
|
*/
|
||||||
|
async react(reaction){
|
||||||
|
await this.client.pupPage.evaluate(async (messageId, reaction) => {
|
||||||
|
if (!messageId) { return undefined; }
|
||||||
|
|
||||||
|
const msg = await window.Store.Msg.get(messageId);
|
||||||
|
await window.Store.sendReactionToMsg(msg, reaction);
|
||||||
|
}, this.id._serialized, reaction);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Accept Group V4 Invite
|
* Accept Group V4 Invite
|
||||||
* @returns {Promise&lt;Object>}
|
* @returns {Promise&lt;Object>}
|
||||||
@@ -375,7 +390,7 @@ class Message extends Base {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Forwards this message to another chat
|
* Forwards this message to another chat (that you chatted before, otherwise it will fail)
|
||||||
*
|
*
|
||||||
* @param {string|Chat} chat Chat model or chat ID to which the message will be forwarded
|
* @param {string|Chat} chat Chat model or chat ID to which the message will be forwarded
|
||||||
* @returns {Promise}
|
* @returns {Promise}
|
||||||
@@ -427,12 +442,13 @@ class Message extends Base {
|
|||||||
signal: (new AbortController).signal
|
signal: (new AbortController).signal
|
||||||
});
|
});
|
||||||
|
|
||||||
const data = window.WWebJS.arrayBufferToBase64(decryptedMedia);
|
const data = await window.WWebJS.arrayBufferToBase64Async(decryptedMedia);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
data,
|
data,
|
||||||
mimetype: msg.mimetype,
|
mimetype: msg.mimetype,
|
||||||
filename: msg.filename
|
filename: msg.filename,
|
||||||
|
filesize: msg.size
|
||||||
};
|
};
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if(e.status &amp;&amp; e.status === 404) return undefined;
|
if(e.status &amp;&amp; e.status === 404) return undefined;
|
||||||
@@ -441,19 +457,20 @@ class Message extends Base {
|
|||||||
}, this.id._serialized);
|
}, this.id._serialized);
|
||||||
|
|
||||||
if (!result) return undefined;
|
if (!result) return undefined;
|
||||||
return new MessageMedia(result.mimetype, result.data, result.filename);
|
return new MessageMedia(result.mimetype, result.data, result.filename, result.filesize);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Deletes a message from the chat
|
* Deletes a message from the chat
|
||||||
* @param {?boolean} everyone If true and the message is sent by the current user, will delete it for everyone in the chat.
|
* @param {?boolean} everyone If true and the message is sent by the current user or the user is an admin, will delete it for everyone in the chat.
|
||||||
*/
|
*/
|
||||||
async delete(everyone) {
|
async delete(everyone) {
|
||||||
await this.client.pupPage.evaluate((msgId, everyone) => {
|
await this.client.pupPage.evaluate((msgId, everyone) => {
|
||||||
let msg = window.Store.Msg.get(msgId);
|
let msg = window.Store.Msg.get(msgId);
|
||||||
|
|
||||||
if (everyone &amp;&amp; msg.id.fromMe &amp;&amp; msg._canRevoke()) {
|
const canRevoke = window.Store.MsgActionChecks.canSenderRevokeMsg(msg) || window.Store.MsgActionChecks.canAdminRevokeMsg(msg);
|
||||||
return window.Store.Cmd.sendRevokeMsgs(msg.chat, [msg], {type: 'Sender'});
|
if (everyone &amp;&amp; canRevoke) {
|
||||||
|
return window.Store.Cmd.sendRevokeMsgs(msg.chat, [msg], { type: msg.id.fromMe ? 'Sender' : 'Admin' });
|
||||||
}
|
}
|
||||||
|
|
||||||
return window.Store.Cmd.sendDeleteMsgs(msg.chat, [msg], true);
|
return window.Store.Cmd.sendDeleteMsgs(msg.chat, [msg], true);
|
||||||
@@ -467,8 +484,8 @@ class Message extends Base {
|
|||||||
await this.client.pupPage.evaluate((msgId) => {
|
await this.client.pupPage.evaluate((msgId) => {
|
||||||
let msg = window.Store.Msg.get(msgId);
|
let msg = window.Store.Msg.get(msgId);
|
||||||
|
|
||||||
if (msg.canStar()) {
|
if (window.Store.MsgActionChecks.canStarMsg(msg)) {
|
||||||
return msg.chat.sendStarMsgs([msg], true);
|
return window.Store.Cmd.sendStarMsgs(msg.chat, [msg], false);
|
||||||
}
|
}
|
||||||
}, this.id._serialized);
|
}, this.id._serialized);
|
||||||
}
|
}
|
||||||
@@ -480,8 +497,8 @@ class Message extends Base {
|
|||||||
await this.client.pupPage.evaluate((msgId) => {
|
await this.client.pupPage.evaluate((msgId) => {
|
||||||
let msg = window.Store.Msg.get(msgId);
|
let msg = window.Store.Msg.get(msgId);
|
||||||
|
|
||||||
if (msg.canStar()) {
|
if (window.Store.MsgActionChecks.canStarMsg(msg)) {
|
||||||
return msg.chat.sendStarMsgs([msg], false);
|
return window.Store.Cmd.sendUnstarMsgs(msg.chat, [msg], false);
|
||||||
}
|
}
|
||||||
}, this.id._serialized);
|
}, this.id._serialized);
|
||||||
}
|
}
|
||||||
@@ -554,7 +571,7 @@ module.exports = Message;
|
|||||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||||
<div id="jsdoc-footer-container">
|
<div id="jsdoc-footer-container">
|
||||||
<p>
|
<p>
|
||||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on April 21, 2022.
|
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on November 26, 2022.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta name="generator" content="JSDoc 3.6.7">
|
<meta name="generator" content="JSDoc 3.6.7">
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>whatsapp-web.js 1.16.6 » Source: structures/MessageMedia.js</title>
|
<title>whatsapp-web.js 1.18.4 » Source: structures/MessageMedia.js</title>
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
||||||
<div id="jsdoc-navbar-container">
|
<div id="jsdoc-navbar-container">
|
||||||
<div id="jsdoc-navbar-content">
|
<div id="jsdoc-navbar-content">
|
||||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>16.<wbr>6</a>
|
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>18.<wbr>4</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
@@ -41,10 +41,11 @@ const { URL } = require('url');
|
|||||||
* Media attached to a message
|
* Media attached to a message
|
||||||
* @param {string} mimetype MIME type of the attachment
|
* @param {string} mimetype MIME type of the attachment
|
||||||
* @param {string} data Base64-encoded data of the file
|
* @param {string} data Base64-encoded data of the file
|
||||||
* @param {?string} filename Document file name
|
* @param {?string} filename Document file name. Value can be null
|
||||||
|
* @param {?number} filesize Document file size in bytes. Value can be null
|
||||||
*/
|
*/
|
||||||
class MessageMedia {
|
class MessageMedia {
|
||||||
constructor(mimetype, data, filename) {
|
constructor(mimetype, data, filename, filesize) {
|
||||||
/**
|
/**
|
||||||
* MIME type of the attachment
|
* MIME type of the attachment
|
||||||
* @type {string}
|
* @type {string}
|
||||||
@@ -58,10 +59,16 @@ class MessageMedia {
|
|||||||
this.data = data;
|
this.data = data;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Name of the file (for documents)
|
* Document file name. Value can be null
|
||||||
* @type {?string}
|
* @type {?string}
|
||||||
*/
|
*/
|
||||||
this.filename = filename;
|
this.filename = filename;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Document file size in bytes. Value can be null
|
||||||
|
* @type {?number}
|
||||||
|
*/
|
||||||
|
this.filesize = filesize;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -99,6 +106,7 @@ class MessageMedia {
|
|||||||
const reqOptions = Object.assign({ headers: { accept: 'image/* video/* text/* audio/*' } }, options);
|
const reqOptions = Object.assign({ headers: { accept: 'image/* video/* text/* audio/*' } }, options);
|
||||||
const response = await fetch(url, reqOptions);
|
const response = await fetch(url, reqOptions);
|
||||||
const mime = response.headers.get('Content-Type');
|
const mime = response.headers.get('Content-Type');
|
||||||
|
const size = response.headers.get('Content-Length');
|
||||||
|
|
||||||
const contentDisposition = response.headers.get('Content-Disposition');
|
const contentDisposition = response.headers.get('Content-Disposition');
|
||||||
const name = contentDisposition ? contentDisposition.match(/((?&lt;=filename=")(.*)(?="))/) : null;
|
const name = contentDisposition ? contentDisposition.match(/((?&lt;=filename=")(.*)(?="))/) : null;
|
||||||
@@ -114,7 +122,7 @@ class MessageMedia {
|
|||||||
data = btoa(data);
|
data = btoa(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
return { data, mime, name };
|
return { data, mime, name, size };
|
||||||
}
|
}
|
||||||
|
|
||||||
const res = options.client
|
const res = options.client
|
||||||
@@ -127,7 +135,7 @@ class MessageMedia {
|
|||||||
if (!mimetype)
|
if (!mimetype)
|
||||||
mimetype = res.mime;
|
mimetype = res.mime;
|
||||||
|
|
||||||
return new MessageMedia(mimetype, res.data, filename);
|
return new MessageMedia(mimetype, res.data, filename, res.size || null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -142,7 +150,7 @@ module.exports = MessageMedia;
|
|||||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||||
<div id="jsdoc-footer-container">
|
<div id="jsdoc-footer-container">
|
||||||
<p>
|
<p>
|
||||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on April 21, 2022.
|
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on November 26, 2022.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta name="generator" content="JSDoc 3.6.7">
|
<meta name="generator" content="JSDoc 3.6.7">
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>whatsapp-web.js 1.16.6 » Source: structures/Order.js</title>
|
<title>whatsapp-web.js 1.18.4 » 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/Karla:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
||||||
<div id="jsdoc-navbar-container">
|
<div id="jsdoc-navbar-container">
|
||||||
<div id="jsdoc-navbar-content">
|
<div id="jsdoc-navbar-content">
|
||||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>16.<wbr>6</a>
|
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>18.<wbr>4</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
@@ -90,7 +90,7 @@ module.exports = Order;</code></pre>
|
|||||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||||
<div id="jsdoc-footer-container">
|
<div id="jsdoc-footer-container">
|
||||||
<p>
|
<p>
|
||||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on April 21, 2022.
|
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on November 26, 2022.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta name="generator" content="JSDoc 3.6.7">
|
<meta name="generator" content="JSDoc 3.6.7">
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>whatsapp-web.js 1.16.6 » Source: structures/Payment.js</title>
|
<title>whatsapp-web.js 1.18.4 » Source: structures/Payment.js</title>
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
||||||
<div id="jsdoc-navbar-container">
|
<div id="jsdoc-navbar-container">
|
||||||
<div id="jsdoc-navbar-content">
|
<div id="jsdoc-navbar-content">
|
||||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>16.<wbr>6</a>
|
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>18.<wbr>4</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
@@ -118,7 +118,7 @@ module.exports = Payment;
|
|||||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||||
<div id="jsdoc-footer-container">
|
<div id="jsdoc-footer-container">
|
||||||
<p>
|
<p>
|
||||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on April 21, 2022.
|
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on November 26, 2022.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta name="generator" content="JSDoc 3.6.7">
|
<meta name="generator" content="JSDoc 3.6.7">
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>whatsapp-web.js 1.16.6 » Source: structures/PrivateChat.js</title>
|
<title>whatsapp-web.js 1.18.4 » Source: structures/PrivateChat.js</title>
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
||||||
<div id="jsdoc-navbar-container">
|
<div id="jsdoc-navbar-container">
|
||||||
<div id="jsdoc-navbar-content">
|
<div id="jsdoc-navbar-content">
|
||||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>16.<wbr>6</a>
|
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>18.<wbr>4</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
@@ -51,7 +51,7 @@ module.exports = PrivateChat;</code></pre>
|
|||||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||||
<div id="jsdoc-footer-container">
|
<div id="jsdoc-footer-container">
|
||||||
<p>
|
<p>
|
||||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on April 21, 2022.
|
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on November 26, 2022.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta name="generator" content="JSDoc 3.6.7">
|
<meta name="generator" content="JSDoc 3.6.7">
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>whatsapp-web.js 1.16.6 » Source: structures/PrivateContact.js</title>
|
<title>whatsapp-web.js 1.18.4 » Source: structures/PrivateContact.js</title>
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
||||||
<div id="jsdoc-navbar-container">
|
<div id="jsdoc-navbar-container">
|
||||||
<div id="jsdoc-navbar-content">
|
<div id="jsdoc-navbar-content">
|
||||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>16.<wbr>6</a>
|
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>18.<wbr>4</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
@@ -51,7 +51,7 @@ module.exports = PrivateContact;</code></pre>
|
|||||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||||
<div id="jsdoc-footer-container">
|
<div id="jsdoc-footer-container">
|
||||||
<p>
|
<p>
|
||||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on April 21, 2022.
|
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on November 26, 2022.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta name="generator" content="JSDoc 3.6.7">
|
<meta name="generator" content="JSDoc 3.6.7">
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>whatsapp-web.js 1.16.6 » Source: structures/Product.js</title>
|
<title>whatsapp-web.js 1.18.4 » 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/Karla:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
||||||
<div id="jsdoc-navbar-container">
|
<div id="jsdoc-navbar-container">
|
||||||
<div id="jsdoc-navbar-content">
|
<div id="jsdoc-navbar-content">
|
||||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>16.<wbr>6</a>
|
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>18.<wbr>4</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
@@ -106,7 +106,7 @@ module.exports = Product;</code></pre>
|
|||||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||||
<div id="jsdoc-footer-container">
|
<div id="jsdoc-footer-container">
|
||||||
<p>
|
<p>
|
||||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on April 21, 2022.
|
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on November 26, 2022.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta name="generator" content="JSDoc 3.6.7">
|
<meta name="generator" content="JSDoc 3.6.7">
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>whatsapp-web.js 1.16.6 » Source: structures/ProductMetadata.js</title>
|
<title>whatsapp-web.js 1.18.4 » 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/Karla:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
||||||
<div id="jsdoc-navbar-container">
|
<div id="jsdoc-navbar-container">
|
||||||
<div id="jsdoc-navbar-content">
|
<div id="jsdoc-navbar-content">
|
||||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>16.<wbr>6</a>
|
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>18.<wbr>4</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
@@ -63,7 +63,7 @@ module.exports = ProductMetadata;</code></pre>
|
|||||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||||
<div id="jsdoc-footer-container">
|
<div id="jsdoc-footer-container">
|
||||||
<p>
|
<p>
|
||||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on April 21, 2022.
|
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on November 26, 2022.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
122
docs/structures_Reaction.js.html
Normal file
122
docs/structures_Reaction.js.html
Normal file
@@ -0,0 +1,122 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html>
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta name="generator" content="JSDoc 3.6.7">
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>whatsapp-web.js 1.18.4 » Source: structures/Reaction.js</title>
|
||||||
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
|
||||||
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
||||||
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
||||||
|
<link href="css/baseline.css" rel="stylesheet">
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body onload="prettyPrint()">
|
||||||
|
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
||||||
|
<div id="jsdoc-navbar-container">
|
||||||
|
<div id="jsdoc-navbar-content">
|
||||||
|
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>18.<wbr>4</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</nav>
|
||||||
|
<div id="jsdoc-body-container">
|
||||||
|
<div id="jsdoc-content">
|
||||||
|
<div id="jsdoc-content-container">
|
||||||
|
<div id="jsdoc-banner" role="banner">
|
||||||
|
</div>
|
||||||
|
<div id="jsdoc-main" role="main">
|
||||||
|
<header class="page-header">
|
||||||
|
<h1>Source: structures/Reaction.js</h1>
|
||||||
|
</header>
|
||||||
|
<article>
|
||||||
|
<pre class="prettyprint linenums"><code>'use strict';
|
||||||
|
|
||||||
|
const Base = require('./Base');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Represents a Reaction on WhatsApp
|
||||||
|
* @extends {Base}
|
||||||
|
*/
|
||||||
|
class Reaction extends Base {
|
||||||
|
constructor(client, data) {
|
||||||
|
super(client);
|
||||||
|
|
||||||
|
if (data) this._patch(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
_patch(data) {
|
||||||
|
/**
|
||||||
|
* Reaction ID
|
||||||
|
* @type {object}
|
||||||
|
*/
|
||||||
|
this.id = data.msgKey;
|
||||||
|
/**
|
||||||
|
* Orphan
|
||||||
|
* @type {number}
|
||||||
|
*/
|
||||||
|
this.orphan = data.orphan;
|
||||||
|
/**
|
||||||
|
* Orphan reason
|
||||||
|
* @type {?string}
|
||||||
|
*/
|
||||||
|
this.orphanReason = data.orphanReason;
|
||||||
|
/**
|
||||||
|
* Unix timestamp for when the reaction was created
|
||||||
|
* @type {number}
|
||||||
|
*/
|
||||||
|
this.timestamp = data.timestamp;
|
||||||
|
/**
|
||||||
|
* Reaction
|
||||||
|
* @type {string}
|
||||||
|
*/
|
||||||
|
this.reaction = data.reactionText;
|
||||||
|
/**
|
||||||
|
* Read
|
||||||
|
* @type {boolean}
|
||||||
|
*/
|
||||||
|
this.read = data.read;
|
||||||
|
/**
|
||||||
|
* Message ID
|
||||||
|
* @type {object}
|
||||||
|
*/
|
||||||
|
this.msgId = data.parentMsgKey;
|
||||||
|
/**
|
||||||
|
* Sender ID
|
||||||
|
* @type {string}
|
||||||
|
*/
|
||||||
|
this.senderId = data.senderUserJid;
|
||||||
|
/**
|
||||||
|
* ACK
|
||||||
|
* @type {?number}
|
||||||
|
*/
|
||||||
|
this.ack = data.ack;
|
||||||
|
|
||||||
|
|
||||||
|
return super._patch(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = Reaction;</code></pre>
|
||||||
|
</article>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<nav id="jsdoc-toc-nav" role="navigation"></nav>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||||
|
<div id="jsdoc-footer-container">
|
||||||
|
<p>
|
||||||
|
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on November 26, 2022.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</footer>
|
||||||
|
<script src="scripts/jquery.min.js"></script>
|
||||||
|
<script src="scripts/tree.jquery.js"></script>
|
||||||
|
<script src="scripts/prettify.js"></script>
|
||||||
|
<script src="scripts/jsdoc-toc.js"></script>
|
||||||
|
<script src="scripts/linenumber.js"></script>
|
||||||
|
<script src="scripts/scrollanchor.js"></script>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
||||||
@@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta name="generator" content="JSDoc 3.6.7">
|
<meta name="generator" content="JSDoc 3.6.7">
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>whatsapp-web.js 1.16.6 » Source: util/Constants.js</title>
|
<title>whatsapp-web.js 1.18.4 » Source: util/Constants.js</title>
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
||||||
<div id="jsdoc-navbar-container">
|
<div id="jsdoc-navbar-container">
|
||||||
<div id="jsdoc-navbar-content">
|
<div id="jsdoc-navbar-content">
|
||||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>16.<wbr>6</a>
|
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>18.<wbr>4</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
@@ -42,7 +42,7 @@ exports.DefaultOptions = {
|
|||||||
qrMaxRetries: 0,
|
qrMaxRetries: 0,
|
||||||
takeoverOnConflict: false,
|
takeoverOnConflict: false,
|
||||||
takeoverTimeoutMs: 0,
|
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',
|
userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.67 Safari/537.36',
|
||||||
ffmpegPath: 'ffmpeg',
|
ffmpegPath: 'ffmpeg',
|
||||||
bypassCSP: false
|
bypassCSP: false
|
||||||
};
|
};
|
||||||
@@ -72,15 +72,18 @@ exports.Events = {
|
|||||||
MESSAGE_REVOKED_EVERYONE: 'message_revoke_everyone',
|
MESSAGE_REVOKED_EVERYONE: 'message_revoke_everyone',
|
||||||
MESSAGE_REVOKED_ME: 'message_revoke_me',
|
MESSAGE_REVOKED_ME: 'message_revoke_me',
|
||||||
MESSAGE_ACK: 'message_ack',
|
MESSAGE_ACK: 'message_ack',
|
||||||
|
MESSAGE_REACTION: 'message_reaction',
|
||||||
MEDIA_UPLOADED: 'media_uploaded',
|
MEDIA_UPLOADED: 'media_uploaded',
|
||||||
GROUP_JOIN: 'group_join',
|
GROUP_JOIN: 'group_join',
|
||||||
GROUP_LEAVE: 'group_leave',
|
GROUP_LEAVE: 'group_leave',
|
||||||
GROUP_UPDATE: 'group_update',
|
GROUP_UPDATE: 'group_update',
|
||||||
QR_RECEIVED: 'qr',
|
QR_RECEIVED: 'qr',
|
||||||
|
LOADING_SCREEN: 'loading_screen',
|
||||||
DISCONNECTED: 'disconnected',
|
DISCONNECTED: 'disconnected',
|
||||||
STATE_CHANGED: 'change_state',
|
STATE_CHANGED: 'change_state',
|
||||||
BATTERY_CHANGED: 'change_battery',
|
BATTERY_CHANGED: 'change_battery',
|
||||||
INCOMING_CALL: 'incoming_call'
|
INCOMING_CALL: 'incoming_call',
|
||||||
|
REMOTE_SESSION_SAVED: 'remote_session_saved'
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -197,7 +200,7 @@ exports.MessageAck = {
|
|||||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||||
<div id="jsdoc-footer-container">
|
<div id="jsdoc-footer-container">
|
||||||
<p>
|
<p>
|
||||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on April 21, 2022.
|
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on November 26, 2022.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta name="generator" content="JSDoc 3.6.7">
|
<meta name="generator" content="JSDoc 3.6.7">
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>whatsapp-web.js 1.16.6 » Source: util/InterfaceController.js</title>
|
<title>whatsapp-web.js 1.18.4 » 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/Karla:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
||||||
<div id="jsdoc-navbar-container">
|
<div id="jsdoc-navbar-container">
|
||||||
<div id="jsdoc-navbar-content">
|
<div id="jsdoc-navbar-content">
|
||||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>16.<wbr>6</a>
|
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>18.<wbr>4</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
@@ -160,7 +160,7 @@ module.exports = InterfaceController;
|
|||||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||||
<div id="jsdoc-footer-container">
|
<div id="jsdoc-footer-container">
|
||||||
<p>
|
<p>
|
||||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on April 21, 2022.
|
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on November 26, 2022.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta name="generator" content="JSDoc 3.6.7">
|
<meta name="generator" content="JSDoc 3.6.7">
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>whatsapp-web.js 1.16.6 » Source: util/Util.js</title>
|
<title>whatsapp-web.js 1.18.4 » Source: util/Util.js</title>
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
|
||||||
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
|
||||||
<div id="jsdoc-navbar-container">
|
<div id="jsdoc-navbar-container">
|
||||||
<div id="jsdoc-navbar-content">
|
<div id="jsdoc-navbar-content">
|
||||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>16.<wbr>6</a>
|
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>18.<wbr>4</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
@@ -37,7 +37,6 @@ const { tmpdir } = require('os');
|
|||||||
const ffmpeg = require('fluent-ffmpeg');
|
const ffmpeg = require('fluent-ffmpeg');
|
||||||
const webp = require('node-webpmux');
|
const webp = require('node-webpmux');
|
||||||
const fs = require('fs').promises;
|
const fs = require('fs').promises;
|
||||||
|
|
||||||
const has = (o, k) => Object.prototype.hasOwnProperty.call(o, k);
|
const has = (o, k) => Object.prototype.hasOwnProperty.call(o, k);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -226,7 +225,7 @@ module.exports = Util;
|
|||||||
<footer id="jsdoc-footer" class="jsdoc-footer">
|
<footer id="jsdoc-footer" class="jsdoc-footer">
|
||||||
<div id="jsdoc-footer-container">
|
<div id="jsdoc-footer-container">
|
||||||
<p>
|
<p>
|
||||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on April 21, 2022.
|
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.7 on November 26, 2022.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
const { Client, Location, List, Buttons, LocalAuth } = require('./index');
|
const { Client, Location, List, Buttons, LocalAuth} = require('./index');
|
||||||
|
|
||||||
const client = new Client({
|
const client = new Client({
|
||||||
authStrategy: new LocalAuth(),
|
authStrategy: new LocalAuth(),
|
||||||
@@ -7,6 +7,10 @@ const client = new Client({
|
|||||||
|
|
||||||
client.initialize();
|
client.initialize();
|
||||||
|
|
||||||
|
client.on('loading_screen', (percent, message) => {
|
||||||
|
console.log('LOADING SCREEN', percent, message);
|
||||||
|
});
|
||||||
|
|
||||||
client.on('qr', (qr) => {
|
client.on('qr', (qr) => {
|
||||||
// NOTE: This event will not be fired if a session is specified.
|
// NOTE: This event will not be fired if a session is specified.
|
||||||
console.log('QR RECEIVED', qr);
|
console.log('QR RECEIVED', qr);
|
||||||
@@ -191,6 +195,8 @@ client.on('message', async msg => {
|
|||||||
let sections = [{title:'sectionTitle',rows:[{title:'ListItem1', description: 'desc'},{title:'ListItem2'}]}];
|
let sections = [{title:'sectionTitle',rows:[{title:'ListItem1', description: 'desc'},{title:'ListItem2'}]}];
|
||||||
let list = new List('List body','btnText',sections,'Title','footer');
|
let list = new List('List body','btnText',sections,'Title','footer');
|
||||||
client.sendMessage(msg.from, list);
|
client.sendMessage(msg.from, list);
|
||||||
|
} else if (msg.body === '!reaction') {
|
||||||
|
msg.react('👍');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
77
index.d.ts
vendored
77
index.d.ts
vendored
@@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
import { EventEmitter } from 'events'
|
import { EventEmitter } from 'events'
|
||||||
import { RequestInit } from 'node-fetch'
|
import { RequestInit } from 'node-fetch'
|
||||||
import puppeteer from 'puppeteer'
|
import * as puppeteer from 'puppeteer'
|
||||||
|
|
||||||
declare namespace WAWebJS {
|
declare namespace WAWebJS {
|
||||||
|
|
||||||
@@ -241,6 +241,15 @@ declare namespace WAWebJS {
|
|||||||
message: Message
|
message: Message
|
||||||
) => void): this
|
) => void): this
|
||||||
|
|
||||||
|
/** Emitted when a reaction is sent, received, updated or removed */
|
||||||
|
on(event: 'message_reaction', listener: (
|
||||||
|
/** The reaction object */
|
||||||
|
reaction: Reaction
|
||||||
|
) => void): this
|
||||||
|
|
||||||
|
/** Emitted when loading screen is appearing */
|
||||||
|
on(event: 'loading_screen', listener: (percent: string, message: string) => void): this
|
||||||
|
|
||||||
/** Emitted when the QR code is received */
|
/** Emitted when the QR code is received */
|
||||||
on(event: 'qr', listener: (
|
on(event: 'qr', listener: (
|
||||||
/** qr code string
|
/** qr code string
|
||||||
@@ -256,6 +265,9 @@ declare namespace WAWebJS {
|
|||||||
|
|
||||||
/** Emitted when the client has initialized and is ready to receive messages */
|
/** Emitted when the client has initialized and is ready to receive messages */
|
||||||
on(event: 'ready', listener: () => void): this
|
on(event: 'ready', listener: () => void): this
|
||||||
|
|
||||||
|
/** Emitted when the RemoteAuth session is saved successfully on the external Database */
|
||||||
|
on(event: 'remote_session_saved', listener: () => void): this
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Current connection information */
|
/** Current connection information */
|
||||||
@@ -345,6 +357,9 @@ declare namespace WAWebJS {
|
|||||||
failureEventPayload?: any
|
failureEventPayload?: any
|
||||||
}>;
|
}>;
|
||||||
getAuthEventPayload: () => Promise<any>;
|
getAuthEventPayload: () => Promise<any>;
|
||||||
|
afterAuthReady: () => Promise<void>;
|
||||||
|
disconnect: () => Promise<void>;
|
||||||
|
destroy: () => Promise<void>;
|
||||||
logout: () => Promise<void>;
|
logout: () => Promise<void>;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -366,6 +381,30 @@ declare namespace WAWebJS {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remote-based authentication
|
||||||
|
*/
|
||||||
|
export class RemoteAuth extends AuthStrategy {
|
||||||
|
public clientId?: string;
|
||||||
|
public dataPath?: string;
|
||||||
|
constructor(options?: {
|
||||||
|
store: Store,
|
||||||
|
clientId?: string,
|
||||||
|
dataPath?: string,
|
||||||
|
backupSyncIntervalMs: number
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remote store interface
|
||||||
|
*/
|
||||||
|
export interface Store {
|
||||||
|
sessionExists: (options: { session: string }) => Promise<boolean> | boolean,
|
||||||
|
delete: (options: { session: string }) => Promise<any> | any,
|
||||||
|
save: (options: { session: string }) => Promise<any> | any,
|
||||||
|
extract: (options: { session: string, path: string }) => Promise<any> | any,
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Legacy session auth strategy
|
* Legacy session auth strategy
|
||||||
* Not compatible with multi-device accounts.
|
* Not compatible with multi-device accounts.
|
||||||
@@ -463,9 +502,11 @@ declare namespace WAWebJS {
|
|||||||
GROUP_LEAVE = 'group_leave',
|
GROUP_LEAVE = 'group_leave',
|
||||||
GROUP_UPDATE = 'group_update',
|
GROUP_UPDATE = 'group_update',
|
||||||
QR_RECEIVED = 'qr',
|
QR_RECEIVED = 'qr',
|
||||||
|
LOADING_SCREEN = 'loading_screen',
|
||||||
DISCONNECTED = 'disconnected',
|
DISCONNECTED = 'disconnected',
|
||||||
STATE_CHANGED = 'change_state',
|
STATE_CHANGED = 'change_state',
|
||||||
BATTERY_CHANGED = 'change_battery',
|
BATTERY_CHANGED = 'change_battery',
|
||||||
|
REMOTE_SESSION_SAVED = 'remote_session_saved'
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Group notification types */
|
/** Group notification types */
|
||||||
@@ -604,6 +645,8 @@ declare namespace WAWebJS {
|
|||||||
ack: MessageAck,
|
ack: MessageAck,
|
||||||
/** If the message was sent to a group, this field will contain the user that sent the message. */
|
/** If the message was sent to a group, this field will contain the user that sent the message. */
|
||||||
author?: string,
|
author?: string,
|
||||||
|
/** String that represents from which device type the message was sent */
|
||||||
|
deviceType: string,
|
||||||
/** Message content */
|
/** Message content */
|
||||||
body: string,
|
body: string,
|
||||||
/** Indicates if the message was a broadcast */
|
/** Indicates if the message was a broadcast */
|
||||||
@@ -687,7 +730,7 @@ declare namespace WAWebJS {
|
|||||||
acceptGroupV4Invite: () => Promise<{status: number}>,
|
acceptGroupV4Invite: () => Promise<{status: number}>,
|
||||||
/** Deletes the message from the chat */
|
/** Deletes the message from the chat */
|
||||||
delete: (everyone?: boolean) => Promise<void>,
|
delete: (everyone?: boolean) => Promise<void>,
|
||||||
/** Downloads and returns the attatched message media */
|
/** Downloads and returns the attached message media */
|
||||||
downloadMedia: () => Promise<MessageMedia>,
|
downloadMedia: () => Promise<MessageMedia>,
|
||||||
/** Returns the Chat this message was sent in */
|
/** Returns the Chat this message was sent in */
|
||||||
getChat: () => Promise<Chat>,
|
getChat: () => Promise<Chat>,
|
||||||
@@ -703,15 +746,17 @@ declare namespace WAWebJS {
|
|||||||
* If not, it will send the message in the same Chat as the original message was sent.
|
* If not, it will send the message in the same Chat as the original message was sent.
|
||||||
*/
|
*/
|
||||||
reply: (content: MessageContent, chatId?: string, options?: MessageSendOptions) => Promise<Message>,
|
reply: (content: MessageContent, chatId?: string, options?: MessageSendOptions) => Promise<Message>,
|
||||||
|
/** React to this message with an emoji*/
|
||||||
|
react: (reaction: string) => Promise<void>,
|
||||||
/**
|
/**
|
||||||
* Forwards this message to another chat
|
* Forwards this message to another chat (that you chatted before, otherwise it will fail)
|
||||||
*/
|
*/
|
||||||
forward: (chat: Chat | string) => Promise<void>,
|
forward: (chat: Chat | string) => Promise<void>,
|
||||||
/** Star this message */
|
/** Star this message */
|
||||||
star: () => Promise<void>,
|
star: () => Promise<void>,
|
||||||
/** Unstar this message */
|
/** Unstar this message */
|
||||||
unstar: () => Promise<void>,
|
unstar: () => Promise<void>,
|
||||||
/** Get information about message delivery statuso */
|
/** Get information about message delivery status */
|
||||||
getInfo: () => Promise<MessageInfo | null>,
|
getInfo: () => Promise<MessageInfo | null>,
|
||||||
/**
|
/**
|
||||||
* Gets the order associated with a given message
|
* Gets the order associated with a given message
|
||||||
@@ -801,13 +846,16 @@ declare namespace WAWebJS {
|
|||||||
data: string
|
data: string
|
||||||
/** Document file name. Value can be null */
|
/** Document file name. Value can be null */
|
||||||
filename?: string | null
|
filename?: string | null
|
||||||
|
/** Document file size in bytes. Value can be null. */
|
||||||
|
filesize?: number | null
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string} mimetype MIME type of the attachment
|
* @param {string} mimetype MIME type of the attachment
|
||||||
* @param {string} data Base64-encoded data of the file
|
* @param {string} data Base64-encoded data of the file
|
||||||
* @param {?string} filename Document file name. Value can be null
|
* @param {?string} filename Document file name. Value can be null
|
||||||
|
* @param {?number} filesize Document file size in bytes. Value can be null.
|
||||||
*/
|
*/
|
||||||
constructor(mimetype: string, data: string, filename?: string | null)
|
constructor(mimetype: string, data: string, filename?: string | null, filesize?: number | null)
|
||||||
|
|
||||||
/** Creates a MessageMedia instance from a local file path */
|
/** Creates a MessageMedia instance from a local file path */
|
||||||
static fromFilePath: (filePath: string) => MessageMedia
|
static fromFilePath: (filePath: string) => MessageMedia
|
||||||
@@ -1014,6 +1062,10 @@ declare namespace WAWebJS {
|
|||||||
* Set this to Infinity to load all messages.
|
* Set this to Infinity to load all messages.
|
||||||
*/
|
*/
|
||||||
limit?: number
|
limit?: number
|
||||||
|
/**
|
||||||
|
* Return only messages from the bot number or vise versa. To get all messages, leave the option undefined.
|
||||||
|
*/
|
||||||
|
fromMe?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1287,7 +1339,7 @@ declare namespace WAWebJS {
|
|||||||
constructor(body: string, buttonText: string, sections: Array<any>, title?: string | null, footer?: string | null)
|
constructor(body: string, buttonText: string, sections: Array<any>, title?: string | null, footer?: string | null)
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Message type buttons */
|
/** Message type Buttons */
|
||||||
export class Buttons {
|
export class Buttons {
|
||||||
body: string | MessageMedia
|
body: string | MessageMedia
|
||||||
buttons: Array<{ buttonId: string; buttonText: {displayText: string}; type: number }>
|
buttons: Array<{ buttonId: string; buttonText: {displayText: string}; type: number }>
|
||||||
@@ -1296,6 +1348,19 @@ declare namespace WAWebJS {
|
|||||||
|
|
||||||
constructor(body: string, buttons: Array<{ id?: string; body: string }>, title?: string | null, footer?: string | null)
|
constructor(body: string, buttons: Array<{ id?: string; body: string }>, title?: string | null, footer?: string | null)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Message type Reaction */
|
||||||
|
export class Reaction {
|
||||||
|
id: MessageId
|
||||||
|
orphan: number
|
||||||
|
orphanReason?: string
|
||||||
|
timestamp: number
|
||||||
|
reaction: string
|
||||||
|
read: boolean
|
||||||
|
msgId: MessageId
|
||||||
|
senderId: string
|
||||||
|
ack?: number
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export = WAWebJS
|
export = WAWebJS
|
||||||
|
|||||||
1
index.js
1
index.js
@@ -25,6 +25,7 @@ module.exports = {
|
|||||||
// Auth Strategies
|
// Auth Strategies
|
||||||
NoAuth: require('./src/authStrategies/NoAuth'),
|
NoAuth: require('./src/authStrategies/NoAuth'),
|
||||||
LocalAuth: require('./src/authStrategies/LocalAuth'),
|
LocalAuth: require('./src/authStrategies/LocalAuth'),
|
||||||
|
RemoteAuth: require('./src/authStrategies/RemoteAuth'),
|
||||||
LegacySessionAuth: require('./src/authStrategies/LegacySessionAuth'),
|
LegacySessionAuth: require('./src/authStrategies/LegacySessionAuth'),
|
||||||
|
|
||||||
...Constants
|
...Constants
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "whatsapp-web.js",
|
"name": "whatsapp-web.js",
|
||||||
"version": "1.16.6",
|
"version": "1.18.4",
|
||||||
"description": "Library for interacting with the WhatsApp Web API ",
|
"description": "Library for interacting with the WhatsApp Web API ",
|
||||||
"main": "./index.js",
|
"main": "./index.js",
|
||||||
"typings": "./index.d.ts",
|
"typings": "./index.d.ts",
|
||||||
@@ -51,5 +51,10 @@
|
|||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=12.0.0"
|
"node": ">=12.0.0"
|
||||||
|
},
|
||||||
|
"optionalDependencies": {
|
||||||
|
"archiver": "^5.3.1",
|
||||||
|
"fs-extra": "^10.1.0",
|
||||||
|
"unzipper": "^0.10.11"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
138
src/Client.js
138
src/Client.js
@@ -6,11 +6,12 @@ const moduleRaid = require('@pedroslopez/moduleraid/moduleraid');
|
|||||||
|
|
||||||
const Util = require('./util/Util');
|
const Util = require('./util/Util');
|
||||||
const InterfaceController = require('./util/InterfaceController');
|
const InterfaceController = require('./util/InterfaceController');
|
||||||
|
const { getIndexForVersion } = require('./util/VersionResolver');
|
||||||
const { WhatsWebURL, DefaultOptions, Events, WAState } = require('./util/Constants');
|
const { WhatsWebURL, DefaultOptions, Events, WAState } = require('./util/Constants');
|
||||||
const { ExposeStore, LoadUtils } = require('./util/Injected');
|
const { ExposeStore, LoadUtils } = require('./util/Injected');
|
||||||
const ChatFactory = require('./factories/ChatFactory');
|
const ChatFactory = require('./factories/ChatFactory');
|
||||||
const ContactFactory = require('./factories/ContactFactory');
|
const ContactFactory = require('./factories/ContactFactory');
|
||||||
const { ClientInfo, Message, MessageMedia, Contact, Location, GroupNotification, Label, Call, Buttons, List } = require('./structures');
|
const { ClientInfo, Message, MessageMedia, Contact, Location, GroupNotification, Label, Call, Buttons, List, Reaction } = require('./structures');
|
||||||
const LegacySessionAuth = require('./authStrategies/LegacySessionAuth');
|
const LegacySessionAuth = require('./authStrategies/LegacySessionAuth');
|
||||||
const NoAuth = require('./authStrategies/NoAuth');
|
const NoAuth = require('./authStrategies/NoAuth');
|
||||||
|
|
||||||
@@ -92,7 +93,12 @@ class Client extends EventEmitter {
|
|||||||
browser = await puppeteer.connect(puppeteerOpts);
|
browser = await puppeteer.connect(puppeteerOpts);
|
||||||
page = await browser.newPage();
|
page = await browser.newPage();
|
||||||
} else {
|
} else {
|
||||||
browser = await puppeteer.launch(puppeteerOpts);
|
const browserArgs = [...(puppeteerOpts.args || [])];
|
||||||
|
if(!browserArgs.find(arg => arg.includes('--user-agent'))) {
|
||||||
|
browserArgs.push(`--user-agent=${this.options.userAgent}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
browser = await puppeteer.launch({...puppeteerOpts, args: browserArgs});
|
||||||
page = (await browser.pages())[0];
|
page = (await browser.pages())[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -103,6 +109,7 @@ class Client extends EventEmitter {
|
|||||||
this.pupPage = page;
|
this.pupPage = page;
|
||||||
|
|
||||||
await this.authStrategy.afterBrowserInitialized();
|
await this.authStrategy.afterBrowserInitialized();
|
||||||
|
await this.initVersionOverride();
|
||||||
|
|
||||||
await page.goto(WhatsWebURL, {
|
await page.goto(WhatsWebURL, {
|
||||||
waitUntil: 'load',
|
waitUntil: 'load',
|
||||||
@@ -110,6 +117,52 @@ class Client extends EventEmitter {
|
|||||||
referer: 'https://whatsapp.com/'
|
referer: 'https://whatsapp.com/'
|
||||||
});
|
});
|
||||||
|
|
||||||
|
await page.evaluate(`function getElementByXpath(path) {
|
||||||
|
return document.evaluate(path, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
|
||||||
|
}`);
|
||||||
|
|
||||||
|
let lastPercent = null,
|
||||||
|
lastPercentMessage = null;
|
||||||
|
|
||||||
|
await page.exposeFunction('loadingScreen', async (percent, message) => {
|
||||||
|
if (lastPercent !== percent || lastPercentMessage !== message) {
|
||||||
|
this.emit(Events.LOADING_SCREEN, percent, message);
|
||||||
|
lastPercent = percent;
|
||||||
|
lastPercentMessage = message;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
await page.evaluate(
|
||||||
|
async function (selectors) {
|
||||||
|
var observer = new MutationObserver(function () {
|
||||||
|
let progressBar = window.getElementByXpath(
|
||||||
|
selectors.PROGRESS
|
||||||
|
);
|
||||||
|
let progressMessage = window.getElementByXpath(
|
||||||
|
selectors.PROGRESS_MESSAGE
|
||||||
|
);
|
||||||
|
|
||||||
|
if (progressBar) {
|
||||||
|
window.loadingScreen(
|
||||||
|
progressBar.value,
|
||||||
|
progressMessage.innerText
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
observer.observe(document, {
|
||||||
|
attributes: true,
|
||||||
|
childList: true,
|
||||||
|
characterData: true,
|
||||||
|
subtree: true,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
{
|
||||||
|
PROGRESS: '//*[@id=\'app\']/div/div/div[2]/progress',
|
||||||
|
PROGRESS_MESSAGE: '//*[@id=\'app\']/div/div/div[3]',
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
const INTRO_IMG_SELECTOR = '[data-testid="intro-md-beta-logo-dark"], [data-testid="intro-md-beta-logo-light"], [data-asset-intro-image-light="true"], [data-asset-intro-image-dark="true"]';
|
const INTRO_IMG_SELECTOR = '[data-testid="intro-md-beta-logo-dark"], [data-testid="intro-md-beta-logo-light"], [data-asset-intro-image-light="true"], [data-asset-intro-image-dark="true"]';
|
||||||
const INTRO_QRCODE_SELECTOR = 'div[data-ref] canvas';
|
const INTRO_QRCODE_SELECTOR = 'div[data-ref] canvas';
|
||||||
|
|
||||||
@@ -127,7 +180,7 @@ class Client extends EventEmitter {
|
|||||||
})
|
})
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// Checks if an error ocurred on the first found selector. The second will be discarded and ignored by .race;
|
// Checks if an error occurred on the first found selector. The second will be discarded and ignored by .race;
|
||||||
if (needAuthentication instanceof Error) throw needAuthentication;
|
if (needAuthentication instanceof Error) throw needAuthentication;
|
||||||
|
|
||||||
// Scan-qrcode selector was found. Needs authentication
|
// Scan-qrcode selector was found. Needs authentication
|
||||||
@@ -368,7 +421,7 @@ class Client extends EventEmitter {
|
|||||||
this.emit(Events.MEDIA_UPLOADED, message);
|
this.emit(Events.MEDIA_UPLOADED, message);
|
||||||
});
|
});
|
||||||
|
|
||||||
await page.exposeFunction('onAppStateChangedEvent', (state) => {
|
await page.exposeFunction('onAppStateChangedEvent', async (state) => {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Emitted when the connection state changes
|
* Emitted when the connection state changes
|
||||||
@@ -395,6 +448,7 @@ class Client extends EventEmitter {
|
|||||||
* @event Client#disconnected
|
* @event Client#disconnected
|
||||||
* @param {WAState|"NAVIGATION"} reason reason that caused the disconnect
|
* @param {WAState|"NAVIGATION"} reason reason that caused the disconnect
|
||||||
*/
|
*/
|
||||||
|
await this.authStrategy.disconnect();
|
||||||
this.emit(Events.DISCONNECTED, state);
|
this.emit(Events.DISCONNECTED, state);
|
||||||
this.destroy();
|
this.destroy();
|
||||||
}
|
}
|
||||||
@@ -434,6 +488,27 @@ class Client extends EventEmitter {
|
|||||||
this.emit(Events.INCOMING_CALL, cll);
|
this.emit(Events.INCOMING_CALL, cll);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
await page.exposeFunction('onReaction', (reactions) => {
|
||||||
|
for (const reaction of reactions) {
|
||||||
|
/**
|
||||||
|
* Emitted when a reaction is sent, received, updated or removed
|
||||||
|
* @event Client#message_reaction
|
||||||
|
* @param {object} reaction
|
||||||
|
* @param {object} reaction.id - Reaction id
|
||||||
|
* @param {number} reaction.orphan - Orphan
|
||||||
|
* @param {?string} reaction.orphanReason - Orphan reason
|
||||||
|
* @param {number} reaction.timestamp - Timestamp
|
||||||
|
* @param {string} reaction.reaction - Reaction
|
||||||
|
* @param {boolean} reaction.read - Read
|
||||||
|
* @param {object} reaction.msgId - Parent message id
|
||||||
|
* @param {string} reaction.senderId - Sender id
|
||||||
|
* @param {?number} reaction.ack - Ack
|
||||||
|
*/
|
||||||
|
|
||||||
|
this.emit(Events.MESSAGE_REACTION, new Reaction(this, reaction));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
await page.evaluate(() => {
|
await page.evaluate(() => {
|
||||||
window.Store.Msg.on('change', (msg) => { window.onChangeMessageEvent(window.WWebJS.getMessageModel(msg)); });
|
window.Store.Msg.on('change', (msg) => { window.onChangeMessageEvent(window.WWebJS.getMessageModel(msg)); });
|
||||||
window.Store.Msg.on('change:type', (msg) => { window.onChangeMessageTypeEvent(window.WWebJS.getMessageModel(msg)); });
|
window.Store.Msg.on('change:type', (msg) => { window.onChangeMessageTypeEvent(window.WWebJS.getMessageModel(msg)); });
|
||||||
@@ -453,6 +528,22 @@ class Client extends EventEmitter {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
{
|
||||||
|
const module = window.Store.createOrUpdateReactionsModule;
|
||||||
|
const ogMethod = module.createOrUpdateReactions;
|
||||||
|
module.createOrUpdateReactions = ((...args) => {
|
||||||
|
window.onReaction(args[0].map(reaction => {
|
||||||
|
const msgKey = window.Store.MsgKey.fromString(reaction.msgKey);
|
||||||
|
const parentMsgKey = window.Store.MsgKey.fromString(reaction.parentMsgKey);
|
||||||
|
const timestamp = reaction.timestamp / 1000;
|
||||||
|
|
||||||
|
return {...reaction, msgKey, parentMsgKey, timestamp };
|
||||||
|
}));
|
||||||
|
|
||||||
|
return ogMethod(...args);
|
||||||
|
}).bind(module);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -460,22 +551,41 @@ class Client extends EventEmitter {
|
|||||||
* @event Client#ready
|
* @event Client#ready
|
||||||
*/
|
*/
|
||||||
this.emit(Events.READY);
|
this.emit(Events.READY);
|
||||||
|
this.authStrategy.afterAuthReady();
|
||||||
|
|
||||||
// Disconnect when navigating away when in PAIRING state (detect logout)
|
// Disconnect when navigating away when in PAIRING state (detect logout)
|
||||||
this.pupPage.on('framenavigated', async () => {
|
this.pupPage.on('framenavigated', async () => {
|
||||||
const appState = await this.getState();
|
const appState = await this.getState();
|
||||||
if(!appState || appState === WAState.PAIRING) {
|
if(!appState || appState === WAState.PAIRING) {
|
||||||
|
await this.authStrategy.disconnect();
|
||||||
this.emit(Events.DISCONNECTED, 'NAVIGATION');
|
this.emit(Events.DISCONNECTED, 'NAVIGATION');
|
||||||
await this.destroy();
|
await this.destroy();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async initVersionOverride() {
|
||||||
|
const version = this.options.webVersion;
|
||||||
|
await this.pupPage.setRequestInterception(true);
|
||||||
|
this.pupPage.on('request', async (req) => {
|
||||||
|
if(req.url() === WhatsWebURL) {
|
||||||
|
req.respond({
|
||||||
|
status: 200,
|
||||||
|
contentType: 'text/html',
|
||||||
|
body: await getIndexForVersion(version)
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
req.continue();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Closes the client
|
* Closes the client
|
||||||
*/
|
*/
|
||||||
async destroy() {
|
async destroy() {
|
||||||
await this.pupBrowser.close();
|
await this.pupBrowser.close();
|
||||||
|
await this.authStrategy.destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -809,8 +919,9 @@ class Client extends EventEmitter {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
const MAX_PIN_COUNT = 3;
|
const MAX_PIN_COUNT = 3;
|
||||||
if (window.Store.Chat.models.length > MAX_PIN_COUNT) {
|
const chatModels = window.Store.Chat.getModelsArray();
|
||||||
let maxPinned = window.Store.Chat.models[MAX_PIN_COUNT - 1].pin;
|
if (chatModels.length > MAX_PIN_COUNT) {
|
||||||
|
let maxPinned = chatModels[MAX_PIN_COUNT - 1].pin;
|
||||||
if (maxPinned) {
|
if (maxPinned) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -896,7 +1007,13 @@ class Client extends EventEmitter {
|
|||||||
*/
|
*/
|
||||||
async getCommonGroups(contactId) {
|
async getCommonGroups(contactId) {
|
||||||
const commonGroups = await this.pupPage.evaluate(async (contactId) => {
|
const commonGroups = await this.pupPage.evaluate(async (contactId) => {
|
||||||
const contact = window.Store.Contact.get(contactId);
|
let contact = window.Store.Contact.get(contactId);
|
||||||
|
if (!contact) {
|
||||||
|
const wid = window.Store.WidFactory.createUserWid(contactId);
|
||||||
|
const chatConstructor = window.Store.Contact.getModelsArray().find(c=>!c.isGroup).constructor;
|
||||||
|
contact = new chatConstructor({id: wid});
|
||||||
|
}
|
||||||
|
|
||||||
if (contact.commonGroups) {
|
if (contact.commonGroups) {
|
||||||
return contact.commonGroups.serialize();
|
return contact.commonGroups.serialize();
|
||||||
}
|
}
|
||||||
@@ -943,7 +1060,8 @@ class Client extends EventEmitter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return await this.pupPage.evaluate(async number => {
|
return await this.pupPage.evaluate(async number => {
|
||||||
const result = await window.Store.QueryExist(number);
|
const wid = window.Store.WidFactory.createWid(number);
|
||||||
|
const result = await window.Store.QueryExist(wid);
|
||||||
if (!result || result.wid === undefined) return null;
|
if (!result || result.wid === undefined) return null;
|
||||||
return result.wid;
|
return result.wid;
|
||||||
}, number);
|
}, number);
|
||||||
@@ -1056,7 +1174,7 @@ class Client extends EventEmitter {
|
|||||||
async getChatsByLabelId(labelId) {
|
async getChatsByLabelId(labelId) {
|
||||||
const chatIds = await this.pupPage.evaluate(async (labelId) => {
|
const chatIds = await this.pupPage.evaluate(async (labelId) => {
|
||||||
const label = window.Store.Label.get(labelId);
|
const label = window.Store.Label.get(labelId);
|
||||||
const labelItems = label.labelItemCollection.models;
|
const labelItems = label.labelItemCollection.getModelsArray();
|
||||||
return labelItems.reduce((result, item) => {
|
return labelItems.reduce((result, item) => {
|
||||||
if (item.parentType === 'Chat') {
|
if (item.parentType === 'Chat') {
|
||||||
result.push(item.parentId);
|
result.push(item.parentId);
|
||||||
@@ -1074,7 +1192,7 @@ class Client extends EventEmitter {
|
|||||||
*/
|
*/
|
||||||
async getBlockedContacts() {
|
async getBlockedContacts() {
|
||||||
const blockedContacts = await this.pupPage.evaluate(() => {
|
const blockedContacts = await this.pupPage.evaluate(() => {
|
||||||
let chatIds = window.Store.Blocklist.models.map(a => a.id._serialized);
|
let chatIds = window.Store.Blocklist.getModelsArray().map(a => a.id._serialized);
|
||||||
return Promise.all(chatIds.map(id => window.WWebJS.getContact(id)));
|
return Promise.all(chatIds.map(id => window.WWebJS.getContact(id)));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -18,6 +18,9 @@ class BaseAuthStrategy {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
async getAuthEventPayload() {}
|
async getAuthEventPayload() {}
|
||||||
|
async afterAuthReady() {}
|
||||||
|
async disconnect() {}
|
||||||
|
async destroy() {}
|
||||||
async logout() {}
|
async logout() {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
204
src/authStrategies/RemoteAuth.js
Normal file
204
src/authStrategies/RemoteAuth.js
Normal file
@@ -0,0 +1,204 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
|
/* Require Optional Dependencies */
|
||||||
|
try {
|
||||||
|
var fs = require('fs-extra');
|
||||||
|
var unzipper = require('unzipper');
|
||||||
|
var archiver = require('archiver');
|
||||||
|
} catch {
|
||||||
|
fs = undefined;
|
||||||
|
unzipper = undefined;
|
||||||
|
archiver = undefined;
|
||||||
|
}
|
||||||
|
|
||||||
|
const path = require('path');
|
||||||
|
const { Events } = require('./../util/Constants');
|
||||||
|
const BaseAuthStrategy = require('./BaseAuthStrategy');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remote-based authentication
|
||||||
|
* @param {object} options - options
|
||||||
|
* @param {object} options.store - Remote database store instance
|
||||||
|
* @param {string} options.clientId - Client id to distinguish instances if you are using multiple, otherwise keep null if you are using only one instance
|
||||||
|
* @param {string} options.dataPath - Change the default path for saving session files, default is: "./.wwebjs_auth/"
|
||||||
|
* @param {number} options.backupSyncIntervalMs - Sets the time interval for periodic session backups. Accepts values starting from 60000ms {1 minute}
|
||||||
|
*/
|
||||||
|
class RemoteAuth extends BaseAuthStrategy {
|
||||||
|
constructor({ clientId, dataPath, store, backupSyncIntervalMs } = {}) {
|
||||||
|
if (!fs && !unzipper && !archiver) throw new Error('Optional Dependencies [fs-extra, unzipper, archiver] are required to use RemoteAuth. Make sure to run npm install correctly and remove the --no-optional flag');
|
||||||
|
super();
|
||||||
|
|
||||||
|
const idRegex = /^[-_\w]+$/i;
|
||||||
|
if (clientId && !idRegex.test(clientId)) {
|
||||||
|
throw new Error('Invalid clientId. Only alphanumeric characters, underscores and hyphens are allowed.');
|
||||||
|
}
|
||||||
|
if (!backupSyncIntervalMs || backupSyncIntervalMs < 60000) {
|
||||||
|
throw new Error('Invalid backupSyncIntervalMs. Accepts values starting from 60000ms {1 minute}.');
|
||||||
|
}
|
||||||
|
if(!store) throw new Error('Remote database store is required.');
|
||||||
|
|
||||||
|
this.store = store;
|
||||||
|
this.clientId = clientId;
|
||||||
|
this.backupSyncIntervalMs = backupSyncIntervalMs;
|
||||||
|
this.dataPath = path.resolve(dataPath || './.wwebjs_auth/');
|
||||||
|
this.tempDir = `${this.dataPath}/wwebjs_temp_session`;
|
||||||
|
this.requiredDirs = ['Default', 'IndexedDB', 'Local Storage']; /* => Required Files & Dirs in WWebJS to restore session */
|
||||||
|
}
|
||||||
|
|
||||||
|
async beforeBrowserInitialized() {
|
||||||
|
const puppeteerOpts = this.client.options.puppeteer;
|
||||||
|
const sessionDirName = this.clientId ? `RemoteAuth-${this.clientId}` : 'RemoteAuth';
|
||||||
|
const dirPath = path.join(this.dataPath, sessionDirName);
|
||||||
|
|
||||||
|
if (puppeteerOpts.userDataDir && puppeteerOpts.userDataDir !== dirPath) {
|
||||||
|
throw new Error('RemoteAuth is not compatible with a user-supplied userDataDir.');
|
||||||
|
}
|
||||||
|
|
||||||
|
this.userDataDir = dirPath;
|
||||||
|
this.sessionName = sessionDirName;
|
||||||
|
|
||||||
|
await this.extractRemoteSession();
|
||||||
|
|
||||||
|
this.client.options.puppeteer = {
|
||||||
|
...puppeteerOpts,
|
||||||
|
userDataDir: dirPath
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
async logout() {
|
||||||
|
await this.disconnect();
|
||||||
|
}
|
||||||
|
|
||||||
|
async destroy() {
|
||||||
|
clearInterval(this.backupSync);
|
||||||
|
}
|
||||||
|
|
||||||
|
async disconnect() {
|
||||||
|
await this.deleteRemoteSession();
|
||||||
|
|
||||||
|
let pathExists = await this.isValidPath(this.userDataDir);
|
||||||
|
if (pathExists) {
|
||||||
|
await fs.promises.rm(this.userDataDir, {
|
||||||
|
recursive: true,
|
||||||
|
force: true
|
||||||
|
}).catch(() => {});
|
||||||
|
}
|
||||||
|
clearInterval(this.backupSync);
|
||||||
|
}
|
||||||
|
|
||||||
|
async afterAuthReady() {
|
||||||
|
const sessionExists = await this.store.sessionExists({session: this.sessionName});
|
||||||
|
if(!sessionExists) {
|
||||||
|
await this.delay(60000); /* Initial delay sync required for session to be stable enough to recover */
|
||||||
|
await this.storeRemoteSession({emit: true});
|
||||||
|
}
|
||||||
|
var self = this;
|
||||||
|
this.backupSync = setInterval(async function () {
|
||||||
|
await self.storeRemoteSession();
|
||||||
|
}, this.backupSyncIntervalMs);
|
||||||
|
}
|
||||||
|
|
||||||
|
async storeRemoteSession(options) {
|
||||||
|
/* Compress & Store Session */
|
||||||
|
const pathExists = await this.isValidPath(this.userDataDir);
|
||||||
|
if (pathExists) {
|
||||||
|
await this.compressSession();
|
||||||
|
await this.store.save({session: this.sessionName});
|
||||||
|
await fs.promises.unlink(`${this.sessionName}.zip`);
|
||||||
|
await fs.promises.rm(`${this.tempDir}`, {
|
||||||
|
recursive: true,
|
||||||
|
force: true
|
||||||
|
}).catch(() => {});
|
||||||
|
if(options && options.emit) this.client.emit(Events.REMOTE_SESSION_SAVED);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async extractRemoteSession() {
|
||||||
|
const pathExists = await this.isValidPath(this.userDataDir);
|
||||||
|
const compressedSessionPath = `${this.sessionName}.zip`;
|
||||||
|
const sessionExists = await this.store.sessionExists({session: this.sessionName});
|
||||||
|
if (pathExists) {
|
||||||
|
await fs.promises.rm(this.userDataDir, {
|
||||||
|
recursive: true,
|
||||||
|
force: true
|
||||||
|
}).catch(() => {});
|
||||||
|
}
|
||||||
|
if (sessionExists) {
|
||||||
|
await this.store.extract({session: this.sessionName, path: compressedSessionPath});
|
||||||
|
await this.unCompressSession(compressedSessionPath);
|
||||||
|
} else {
|
||||||
|
fs.mkdirSync(this.userDataDir, { recursive: true });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async deleteRemoteSession() {
|
||||||
|
const sessionExists = await this.store.sessionExists({session: this.sessionName});
|
||||||
|
if (sessionExists) await this.store.delete({session: this.sessionName});
|
||||||
|
}
|
||||||
|
|
||||||
|
async compressSession() {
|
||||||
|
const archive = archiver('zip');
|
||||||
|
const stream = fs.createWriteStream(`${this.sessionName}.zip`);
|
||||||
|
|
||||||
|
await fs.copy(this.userDataDir, this.tempDir).catch(() => {});
|
||||||
|
await this.deleteMetadata();
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
archive
|
||||||
|
.directory(this.tempDir, false)
|
||||||
|
.on('error', err => reject(err))
|
||||||
|
.pipe(stream);
|
||||||
|
|
||||||
|
stream.on('close', () => resolve());
|
||||||
|
archive.finalize();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async unCompressSession(compressedSessionPath) {
|
||||||
|
var stream = fs.createReadStream(compressedSessionPath);
|
||||||
|
await new Promise((resolve, reject) => {
|
||||||
|
stream.pipe(unzipper.Extract({
|
||||||
|
path: this.userDataDir
|
||||||
|
}))
|
||||||
|
.on('error', err => reject(err))
|
||||||
|
.on('finish', () => resolve());
|
||||||
|
});
|
||||||
|
await fs.promises.unlink(compressedSessionPath);
|
||||||
|
}
|
||||||
|
|
||||||
|
async deleteMetadata() {
|
||||||
|
const sessionDirs = [this.tempDir, path.join(this.tempDir, 'Default')];
|
||||||
|
for (const dir of sessionDirs) {
|
||||||
|
const sessionFiles = await fs.promises.readdir(dir);
|
||||||
|
for (const element of sessionFiles) {
|
||||||
|
if (!this.requiredDirs.includes(element)) {
|
||||||
|
const dirElement = path.join(dir, element);
|
||||||
|
const stats = await fs.promises.lstat(dirElement);
|
||||||
|
|
||||||
|
if (stats.isDirectory()) {
|
||||||
|
await fs.promises.rm(dirElement, {
|
||||||
|
recursive: true,
|
||||||
|
force: true
|
||||||
|
}).catch(() => {});
|
||||||
|
} else {
|
||||||
|
await fs.promises.unlink(dirElement).catch(() => {});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async isValidPath(path) {
|
||||||
|
try {
|
||||||
|
await fs.promises.access(path);
|
||||||
|
return true;
|
||||||
|
} catch {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async delay(ms) {
|
||||||
|
return new Promise(resolve => setTimeout(resolve, ms));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = RemoteAuth;
|
||||||
@@ -170,21 +170,30 @@ class Chat extends Base {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Loads chat messages, sorted from earliest to latest.
|
* Loads chat messages, sorted from earliest to latest.
|
||||||
* @param {Object} searchOptions Options for searching messages. Right now only limit is supported.
|
* @param {Object} searchOptions Options for searching messages. Right now only limit and fromMe is supported.
|
||||||
* @param {Number} [searchOptions.limit] The amount of messages to return. If no limit is specified, the available messages will be returned. Note that the actual number of returned messages may be smaller if there aren't enough messages in the conversation. Set this to Infinity to load all messages.
|
* @param {Number} [searchOptions.limit] The amount of messages to return. If no limit is specified, the available messages will be returned. Note that the actual number of returned messages may be smaller if there aren't enough messages in the conversation. Set this to Infinity to load all messages.
|
||||||
|
* @param {Boolean} [searchOptions.fromMe] Return only messages from the bot number or vise versa. To get all messages, leave the option undefined.
|
||||||
* @returns {Promise<Array<Message>>}
|
* @returns {Promise<Array<Message>>}
|
||||||
*/
|
*/
|
||||||
async fetchMessages(searchOptions) {
|
async fetchMessages(searchOptions) {
|
||||||
let messages = await this.client.pupPage.evaluate(async (chatId, searchOptions) => {
|
let messages = await this.client.pupPage.evaluate(async (chatId, searchOptions) => {
|
||||||
const msgFilter = m => !m.isNotification; // dont include notification messages
|
const msgFilter = (m) => {
|
||||||
|
if (m.isNotification) {
|
||||||
|
return false; // dont include notification messages
|
||||||
|
}
|
||||||
|
if (searchOptions && searchOptions.fromMe && m.id.fromMe !== searchOptions.fromMe) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
};
|
||||||
|
|
||||||
const chat = window.Store.Chat.get(chatId);
|
const chat = window.Store.Chat.get(chatId);
|
||||||
let msgs = chat.msgs.models.filter(msgFilter);
|
let msgs = chat.msgs.getModelsArray().filter(msgFilter);
|
||||||
|
|
||||||
if (searchOptions && searchOptions.limit > 0) {
|
if (searchOptions && searchOptions.limit > 0) {
|
||||||
while (msgs.length < searchOptions.limit) {
|
while (msgs.length < searchOptions.limit) {
|
||||||
const loadedMessages = await chat.loadEarlierMsgs();
|
const loadedMessages = await window.Store.ConversationMsgs.loadEarlierMsgs(chat);
|
||||||
if (!loadedMessages) break;
|
if (!loadedMessages || !loadedMessages.length) break;
|
||||||
msgs = [...loadedMessages.filter(msgFilter), ...msgs];
|
msgs = [...loadedMessages.filter(msgFilter), ...msgs];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -305,8 +305,9 @@ class Message extends Base {
|
|||||||
if (!this.hasQuotedMsg) return undefined;
|
if (!this.hasQuotedMsg) return undefined;
|
||||||
|
|
||||||
const quotedMsg = await this.client.pupPage.evaluate((msgId) => {
|
const quotedMsg = await this.client.pupPage.evaluate((msgId) => {
|
||||||
let msg = window.Store.Msg.get(msgId);
|
const msg = window.Store.Msg.get(msgId);
|
||||||
return msg.quotedMsgObj().serialize();
|
const quotedMsg = window.Store.QuotedMsg.getQuotedMsgObj(msg);
|
||||||
|
return window.WWebJS.getMessageModel(quotedMsg);
|
||||||
}, this.id._serialized);
|
}, this.id._serialized);
|
||||||
|
|
||||||
return new Message(this.client, quotedMsg);
|
return new Message(this.client, quotedMsg);
|
||||||
@@ -335,6 +336,20 @@ class Message extends Base {
|
|||||||
return this.client.sendMessage(chatId, content, options);
|
return this.client.sendMessage(chatId, content, options);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* React to this message with an emoji
|
||||||
|
* @param {string} reaction - Emoji to react with. Send an empty string to remove the reaction.
|
||||||
|
* @return {Promise}
|
||||||
|
*/
|
||||||
|
async react(reaction){
|
||||||
|
await this.client.pupPage.evaluate(async (messageId, reaction) => {
|
||||||
|
if (!messageId) { return undefined; }
|
||||||
|
|
||||||
|
const msg = await window.Store.Msg.get(messageId);
|
||||||
|
await window.Store.sendReactionToMsg(msg, reaction);
|
||||||
|
}, this.id._serialized, reaction);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Accept Group V4 Invite
|
* Accept Group V4 Invite
|
||||||
* @returns {Promise<Object>}
|
* @returns {Promise<Object>}
|
||||||
@@ -344,7 +359,7 @@ class Message extends Base {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Forwards this message to another chat
|
* Forwards this message to another chat (that you chatted before, otherwise it will fail)
|
||||||
*
|
*
|
||||||
* @param {string|Chat} chat Chat model or chat ID to which the message will be forwarded
|
* @param {string|Chat} chat Chat model or chat ID to which the message will be forwarded
|
||||||
* @returns {Promise}
|
* @returns {Promise}
|
||||||
@@ -396,12 +411,13 @@ class Message extends Base {
|
|||||||
signal: (new AbortController).signal
|
signal: (new AbortController).signal
|
||||||
});
|
});
|
||||||
|
|
||||||
const data = window.WWebJS.arrayBufferToBase64(decryptedMedia);
|
const data = await window.WWebJS.arrayBufferToBase64Async(decryptedMedia);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
data,
|
data,
|
||||||
mimetype: msg.mimetype,
|
mimetype: msg.mimetype,
|
||||||
filename: msg.filename
|
filename: msg.filename,
|
||||||
|
filesize: msg.size
|
||||||
};
|
};
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if(e.status && e.status === 404) return undefined;
|
if(e.status && e.status === 404) return undefined;
|
||||||
@@ -410,19 +426,20 @@ class Message extends Base {
|
|||||||
}, this.id._serialized);
|
}, this.id._serialized);
|
||||||
|
|
||||||
if (!result) return undefined;
|
if (!result) return undefined;
|
||||||
return new MessageMedia(result.mimetype, result.data, result.filename);
|
return new MessageMedia(result.mimetype, result.data, result.filename, result.filesize);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Deletes a message from the chat
|
* Deletes a message from the chat
|
||||||
* @param {?boolean} everyone If true and the message is sent by the current user, will delete it for everyone in the chat.
|
* @param {?boolean} everyone If true and the message is sent by the current user or the user is an admin, will delete it for everyone in the chat.
|
||||||
*/
|
*/
|
||||||
async delete(everyone) {
|
async delete(everyone) {
|
||||||
await this.client.pupPage.evaluate((msgId, everyone) => {
|
await this.client.pupPage.evaluate((msgId, everyone) => {
|
||||||
let msg = window.Store.Msg.get(msgId);
|
let msg = window.Store.Msg.get(msgId);
|
||||||
|
|
||||||
if (everyone && msg.id.fromMe && msg._canRevoke()) {
|
const canRevoke = window.Store.MsgActionChecks.canSenderRevokeMsg(msg) || window.Store.MsgActionChecks.canAdminRevokeMsg(msg);
|
||||||
return window.Store.Cmd.sendRevokeMsgs(msg.chat, [msg], {type: 'Sender'});
|
if (everyone && canRevoke) {
|
||||||
|
return window.Store.Cmd.sendRevokeMsgs(msg.chat, [msg], { type: msg.id.fromMe ? 'Sender' : 'Admin' });
|
||||||
}
|
}
|
||||||
|
|
||||||
return window.Store.Cmd.sendDeleteMsgs(msg.chat, [msg], true);
|
return window.Store.Cmd.sendDeleteMsgs(msg.chat, [msg], true);
|
||||||
@@ -436,8 +453,8 @@ class Message extends Base {
|
|||||||
await this.client.pupPage.evaluate((msgId) => {
|
await this.client.pupPage.evaluate((msgId) => {
|
||||||
let msg = window.Store.Msg.get(msgId);
|
let msg = window.Store.Msg.get(msgId);
|
||||||
|
|
||||||
if (msg.canStar()) {
|
if (window.Store.MsgActionChecks.canStarMsg(msg)) {
|
||||||
return msg.chat.sendStarMsgs([msg], true);
|
return window.Store.Cmd.sendStarMsgs(msg.chat, [msg], false);
|
||||||
}
|
}
|
||||||
}, this.id._serialized);
|
}, this.id._serialized);
|
||||||
}
|
}
|
||||||
@@ -449,8 +466,8 @@ class Message extends Base {
|
|||||||
await this.client.pupPage.evaluate((msgId) => {
|
await this.client.pupPage.evaluate((msgId) => {
|
||||||
let msg = window.Store.Msg.get(msgId);
|
let msg = window.Store.Msg.get(msgId);
|
||||||
|
|
||||||
if (msg.canStar()) {
|
if (window.Store.MsgActionChecks.canStarMsg(msg)) {
|
||||||
return msg.chat.sendStarMsgs([msg], false);
|
return window.Store.Cmd.sendUnstarMsgs(msg.chat, [msg], false);
|
||||||
}
|
}
|
||||||
}, this.id._serialized);
|
}, this.id._serialized);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,10 +10,11 @@ const { URL } = require('url');
|
|||||||
* Media attached to a message
|
* Media attached to a message
|
||||||
* @param {string} mimetype MIME type of the attachment
|
* @param {string} mimetype MIME type of the attachment
|
||||||
* @param {string} data Base64-encoded data of the file
|
* @param {string} data Base64-encoded data of the file
|
||||||
* @param {?string} filename Document file name
|
* @param {?string} filename Document file name. Value can be null
|
||||||
|
* @param {?number} filesize Document file size in bytes. Value can be null
|
||||||
*/
|
*/
|
||||||
class MessageMedia {
|
class MessageMedia {
|
||||||
constructor(mimetype, data, filename) {
|
constructor(mimetype, data, filename, filesize) {
|
||||||
/**
|
/**
|
||||||
* MIME type of the attachment
|
* MIME type of the attachment
|
||||||
* @type {string}
|
* @type {string}
|
||||||
@@ -27,10 +28,16 @@ class MessageMedia {
|
|||||||
this.data = data;
|
this.data = data;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Name of the file (for documents)
|
* Document file name. Value can be null
|
||||||
* @type {?string}
|
* @type {?string}
|
||||||
*/
|
*/
|
||||||
this.filename = filename;
|
this.filename = filename;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Document file size in bytes. Value can be null
|
||||||
|
* @type {?number}
|
||||||
|
*/
|
||||||
|
this.filesize = filesize;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -68,6 +75,7 @@ class MessageMedia {
|
|||||||
const reqOptions = Object.assign({ headers: { accept: 'image/* video/* text/* audio/*' } }, options);
|
const reqOptions = Object.assign({ headers: { accept: 'image/* video/* text/* audio/*' } }, options);
|
||||||
const response = await fetch(url, reqOptions);
|
const response = await fetch(url, reqOptions);
|
||||||
const mime = response.headers.get('Content-Type');
|
const mime = response.headers.get('Content-Type');
|
||||||
|
const size = response.headers.get('Content-Length');
|
||||||
|
|
||||||
const contentDisposition = response.headers.get('Content-Disposition');
|
const contentDisposition = response.headers.get('Content-Disposition');
|
||||||
const name = contentDisposition ? contentDisposition.match(/((?<=filename=")(.*)(?="))/) : null;
|
const name = contentDisposition ? contentDisposition.match(/((?<=filename=")(.*)(?="))/) : null;
|
||||||
@@ -83,7 +91,7 @@ class MessageMedia {
|
|||||||
data = btoa(data);
|
data = btoa(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
return { data, mime, name };
|
return { data, mime, name, size };
|
||||||
}
|
}
|
||||||
|
|
||||||
const res = options.client
|
const res = options.client
|
||||||
@@ -96,7 +104,7 @@ class MessageMedia {
|
|||||||
if (!mimetype)
|
if (!mimetype)
|
||||||
mimetype = res.mime;
|
mimetype = res.mime;
|
||||||
|
|
||||||
return new MessageMedia(mimetype, res.data, filename);
|
return new MessageMedia(mimetype, res.data, filename, res.size || null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
69
src/structures/Reaction.js
Normal file
69
src/structures/Reaction.js
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
|
const Base = require('./Base');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Represents a Reaction on WhatsApp
|
||||||
|
* @extends {Base}
|
||||||
|
*/
|
||||||
|
class Reaction extends Base {
|
||||||
|
constructor(client, data) {
|
||||||
|
super(client);
|
||||||
|
|
||||||
|
if (data) this._patch(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
_patch(data) {
|
||||||
|
/**
|
||||||
|
* Reaction ID
|
||||||
|
* @type {object}
|
||||||
|
*/
|
||||||
|
this.id = data.msgKey;
|
||||||
|
/**
|
||||||
|
* Orphan
|
||||||
|
* @type {number}
|
||||||
|
*/
|
||||||
|
this.orphan = data.orphan;
|
||||||
|
/**
|
||||||
|
* Orphan reason
|
||||||
|
* @type {?string}
|
||||||
|
*/
|
||||||
|
this.orphanReason = data.orphanReason;
|
||||||
|
/**
|
||||||
|
* Unix timestamp for when the reaction was created
|
||||||
|
* @type {number}
|
||||||
|
*/
|
||||||
|
this.timestamp = data.timestamp;
|
||||||
|
/**
|
||||||
|
* Reaction
|
||||||
|
* @type {string}
|
||||||
|
*/
|
||||||
|
this.reaction = data.reactionText;
|
||||||
|
/**
|
||||||
|
* Read
|
||||||
|
* @type {boolean}
|
||||||
|
*/
|
||||||
|
this.read = data.read;
|
||||||
|
/**
|
||||||
|
* Message ID
|
||||||
|
* @type {object}
|
||||||
|
*/
|
||||||
|
this.msgId = data.parentMsgKey;
|
||||||
|
/**
|
||||||
|
* Sender ID
|
||||||
|
* @type {string}
|
||||||
|
*/
|
||||||
|
this.senderId = data.senderUserJid;
|
||||||
|
/**
|
||||||
|
* ACK
|
||||||
|
* @type {?number}
|
||||||
|
*/
|
||||||
|
this.ack = data.ack;
|
||||||
|
|
||||||
|
|
||||||
|
return super._patch(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = Reaction;
|
||||||
@@ -17,5 +17,6 @@ module.exports = {
|
|||||||
Call: require('./Call'),
|
Call: require('./Call'),
|
||||||
Buttons: require('./Buttons'),
|
Buttons: require('./Buttons'),
|
||||||
List: require('./List'),
|
List: require('./List'),
|
||||||
Payment: require('./Payment')
|
Payment: require('./Payment'),
|
||||||
|
Reaction: require('./Reaction'),
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -7,11 +7,12 @@ exports.DefaultOptions = {
|
|||||||
headless: true,
|
headless: true,
|
||||||
defaultViewport: null
|
defaultViewport: null
|
||||||
},
|
},
|
||||||
|
webVersion: '2.2244.6',
|
||||||
authTimeoutMs: 0,
|
authTimeoutMs: 0,
|
||||||
qrMaxRetries: 0,
|
qrMaxRetries: 0,
|
||||||
takeoverOnConflict: false,
|
takeoverOnConflict: false,
|
||||||
takeoverTimeoutMs: 0,
|
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',
|
userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.67 Safari/537.36',
|
||||||
ffmpegPath: 'ffmpeg',
|
ffmpegPath: 'ffmpeg',
|
||||||
bypassCSP: false
|
bypassCSP: false
|
||||||
};
|
};
|
||||||
@@ -41,15 +42,18 @@ exports.Events = {
|
|||||||
MESSAGE_REVOKED_EVERYONE: 'message_revoke_everyone',
|
MESSAGE_REVOKED_EVERYONE: 'message_revoke_everyone',
|
||||||
MESSAGE_REVOKED_ME: 'message_revoke_me',
|
MESSAGE_REVOKED_ME: 'message_revoke_me',
|
||||||
MESSAGE_ACK: 'message_ack',
|
MESSAGE_ACK: 'message_ack',
|
||||||
|
MESSAGE_REACTION: 'message_reaction',
|
||||||
MEDIA_UPLOADED: 'media_uploaded',
|
MEDIA_UPLOADED: 'media_uploaded',
|
||||||
GROUP_JOIN: 'group_join',
|
GROUP_JOIN: 'group_join',
|
||||||
GROUP_LEAVE: 'group_leave',
|
GROUP_LEAVE: 'group_leave',
|
||||||
GROUP_UPDATE: 'group_update',
|
GROUP_UPDATE: 'group_update',
|
||||||
QR_RECEIVED: 'qr',
|
QR_RECEIVED: 'qr',
|
||||||
|
LOADING_SCREEN: 'loading_screen',
|
||||||
DISCONNECTED: 'disconnected',
|
DISCONNECTED: 'disconnected',
|
||||||
STATE_CHANGED: 'change_state',
|
STATE_CHANGED: 'change_state',
|
||||||
BATTERY_CHANGED: 'change_battery',
|
BATTERY_CHANGED: 'change_battery',
|
||||||
INCOMING_CALL: 'incoming_call'
|
INCOMING_CALL: 'incoming_call',
|
||||||
|
REMOTE_SESSION_SAVED: 'remote_session_saved'
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -13,9 +13,8 @@ exports.ExposeStore = (moduleRaidStr) => {
|
|||||||
window.Store.Cmd = window.mR.findModule('Cmd')[0].Cmd;
|
window.Store.Cmd = window.mR.findModule('Cmd')[0].Cmd;
|
||||||
window.Store.CryptoLib = window.mR.findModule('decryptE2EMedia')[0];
|
window.Store.CryptoLib = window.mR.findModule('decryptE2EMedia')[0];
|
||||||
window.Store.DownloadManager = window.mR.findModule('downloadManager')[0].downloadManager;
|
window.Store.DownloadManager = window.mR.findModule('downloadManager')[0].downloadManager;
|
||||||
window.Store.MDBackend = window.mR.findModule('isMDBackend')[0].isMDBackend();
|
|
||||||
window.Store.Features = window.mR.findModule('FEATURE_CHANGE_EVENT')[0].LegacyPhoneFeatures;
|
window.Store.Features = window.mR.findModule('FEATURE_CHANGE_EVENT')[0].LegacyPhoneFeatures;
|
||||||
window.Store.GroupMetadata = window.mR.findModule((module) => module.default && module.default.handlePendingInvite)[0].default;
|
window.Store.GroupMetadata = window.mR.findModule('GroupMetadata')[0].default.GroupMetadata;
|
||||||
window.Store.Invite = window.mR.findModule('sendJoinGroupViaInvite')[0];
|
window.Store.Invite = window.mR.findModule('sendJoinGroupViaInvite')[0];
|
||||||
window.Store.InviteInfo = window.mR.findModule('sendQueryGroupInvite')[0];
|
window.Store.InviteInfo = window.mR.findModule('sendQueryGroupInvite')[0];
|
||||||
window.Store.Label = window.mR.findModule('LabelCollection')[0].LabelCollection;
|
window.Store.Label = window.mR.findModule('LabelCollection')[0].LabelCollection;
|
||||||
@@ -39,7 +38,6 @@ exports.ExposeStore = (moduleRaidStr) => {
|
|||||||
window.Store.UserConstructor = window.mR.findModule((module) => (module.default && module.default.prototype && module.default.prototype.isServer && module.default.prototype.isUser) ? module.default : null)[0].default;
|
window.Store.UserConstructor = window.mR.findModule((module) => (module.default && module.default.prototype && module.default.prototype.isServer && module.default.prototype.isUser) ? module.default : null)[0].default;
|
||||||
window.Store.Validators = window.mR.findModule('findLinks')[0];
|
window.Store.Validators = window.mR.findModule('findLinks')[0];
|
||||||
window.Store.VCard = window.mR.findModule('vcardFromContactModel')[0];
|
window.Store.VCard = window.mR.findModule('vcardFromContactModel')[0];
|
||||||
window.Store.Wap = window.mR.findModule('queryLinkPreview')[0].default;
|
|
||||||
window.Store.WidFactory = window.mR.findModule('createWid')[0];
|
window.Store.WidFactory = window.mR.findModule('createWid')[0];
|
||||||
window.Store.ProfilePic = window.mR.findModule('profilePicResync')[0];
|
window.Store.ProfilePic = window.mR.findModule('profilePicResync')[0];
|
||||||
window.Store.PresenceUtils = window.mR.findModule('sendPresenceAvailable')[0];
|
window.Store.PresenceUtils = window.mR.findModule('sendPresenceAvailable')[0];
|
||||||
@@ -48,6 +46,13 @@ exports.ExposeStore = (moduleRaidStr) => {
|
|||||||
window.Store.JoinInviteV4 = window.mR.findModule('sendJoinGroupViaInviteV4')[0];
|
window.Store.JoinInviteV4 = window.mR.findModule('sendJoinGroupViaInviteV4')[0];
|
||||||
window.Store.findCommonGroups = window.mR.findModule('findCommonGroups')[0].findCommonGroups;
|
window.Store.findCommonGroups = window.mR.findModule('findCommonGroups')[0].findCommonGroups;
|
||||||
window.Store.StatusUtils = window.mR.findModule('setMyStatus')[0];
|
window.Store.StatusUtils = window.mR.findModule('setMyStatus')[0];
|
||||||
|
window.Store.ConversationMsgs = window.mR.findModule('loadEarlierMsgs')[0];
|
||||||
|
window.Store.sendReactionToMsg = window.mR.findModule('sendReactionToMsg')[0].sendReactionToMsg;
|
||||||
|
window.Store.createOrUpdateReactionsModule = window.mR.findModule('createOrUpdateReactions')[0];
|
||||||
|
window.Store.EphemeralFields = window.mR.findModule('getEphemeralFields')[0];
|
||||||
|
window.Store.ReplyUtils = window.mR.findModule('canReplyMsg').length > 0 && window.mR.findModule('canReplyMsg')[0];
|
||||||
|
window.Store.MsgActionChecks = window.mR.findModule('canSenderRevokeMsg')[0];
|
||||||
|
window.Store.QuotedMsg = window.mR.findModule('getQuotedMsgObj')[0];
|
||||||
window.Store.StickerTools = {
|
window.Store.StickerTools = {
|
||||||
...window.mR.findModule('toWebpSticker')[0],
|
...window.mR.findModule('toWebpSticker')[0],
|
||||||
...window.mR.findModule('addWebpMetadata')[0]
|
...window.mR.findModule('addWebpMetadata')[0]
|
||||||
@@ -67,6 +72,19 @@ exports.ExposeStore = (moduleRaidStr) => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO remove these once everybody has been updated to WWebJS with legacy sessions removed
|
||||||
|
const _linkPreview = window.mR.findModule('queryLinkPreview');
|
||||||
|
if (_linkPreview && _linkPreview[0] && _linkPreview[0].default) {
|
||||||
|
window.Store.Wap = _linkPreview[0].default;
|
||||||
|
}
|
||||||
|
|
||||||
|
const _isMDBackend = window.mR.findModule('isMDBackend');
|
||||||
|
if(_isMDBackend && _isMDBackend[0] && _isMDBackend[0].isMDBackend) {
|
||||||
|
window.Store.MDBackend = _isMDBackend[0].isMDBackend();
|
||||||
|
} else {
|
||||||
|
window.Store.MDBackend = true;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.LoadUtils = () => {
|
exports.LoadUtils = () => {
|
||||||
@@ -98,11 +116,16 @@ exports.LoadUtils = () => {
|
|||||||
delete options.attachment;
|
delete options.attachment;
|
||||||
delete options.sendMediaAsSticker;
|
delete options.sendMediaAsSticker;
|
||||||
}
|
}
|
||||||
|
|
||||||
let quotedMsgOptions = {};
|
let quotedMsgOptions = {};
|
||||||
if (options.quotedMessageId) {
|
if (options.quotedMessageId) {
|
||||||
let quotedMessage = window.Store.Msg.get(options.quotedMessageId);
|
let quotedMessage = window.Store.Msg.get(options.quotedMessageId);
|
||||||
if (quotedMessage.canReply()) {
|
|
||||||
|
// TODO remove .canReply() once all clients are updated to >= v2.2241.6
|
||||||
|
const canReply = window.Store.ReplyUtils ?
|
||||||
|
window.Store.ReplyUtils.canReplyMsg(quotedMessage.unsafe()) :
|
||||||
|
quotedMessage.canReply();
|
||||||
|
|
||||||
|
if (canReply) {
|
||||||
quotedMsgOptions = quotedMessage.msgContextInfo(chat);
|
quotedMsgOptions = quotedMessage.msgContextInfo(chat);
|
||||||
}
|
}
|
||||||
delete options.quotedMessageId;
|
delete options.quotedMessageId;
|
||||||
@@ -225,11 +248,7 @@ exports.LoadUtils = () => {
|
|||||||
const extraOptions = options.extraOptions || {};
|
const extraOptions = options.extraOptions || {};
|
||||||
delete options.extraOptions;
|
delete options.extraOptions;
|
||||||
|
|
||||||
const ephemeralSettings = {
|
const ephemeralFields = window.Store.EphemeralFields.getEphemeralFields(chat);
|
||||||
ephemeralDuration: chat.isEphemeralSettingOn() ? chat.getEphemeralSetting() : undefined,
|
|
||||||
ephemeralSettingTimestamp: chat.getEphemeralSettingTimestamp() || undefined,
|
|
||||||
disappearingModeInitiator: chat.getDisappearingModeInitiator() || undefined,
|
|
||||||
};
|
|
||||||
|
|
||||||
const message = {
|
const message = {
|
||||||
...options,
|
...options,
|
||||||
@@ -243,7 +262,7 @@ exports.LoadUtils = () => {
|
|||||||
t: parseInt(new Date().getTime() / 1000),
|
t: parseInt(new Date().getTime() / 1000),
|
||||||
isNewMsg: true,
|
isNewMsg: true,
|
||||||
type: 'chat',
|
type: 'chat',
|
||||||
...ephemeralSettings,
|
...ephemeralFields,
|
||||||
...locationOptions,
|
...locationOptions,
|
||||||
...attOptions,
|
...attOptions,
|
||||||
...quotedMsgOptions,
|
...quotedMsgOptions,
|
||||||
@@ -364,7 +383,7 @@ exports.LoadUtils = () => {
|
|||||||
|
|
||||||
msg.isEphemeral = message.isEphemeral;
|
msg.isEphemeral = message.isEphemeral;
|
||||||
msg.isStatusV3 = message.isStatusV3;
|
msg.isStatusV3 = message.isStatusV3;
|
||||||
msg.links = (message.getLinks()).map(link => ({
|
msg.links = (message.getRawLinks()).map(link => ({
|
||||||
link: link.href,
|
link: link.href,
|
||||||
isSuspicious: Boolean(link.suspiciousCharacters && link.suspiciousCharacters.size)
|
isSuspicious: Boolean(link.suspiciousCharacters && link.suspiciousCharacters.size)
|
||||||
}));
|
}));
|
||||||
@@ -416,7 +435,7 @@ exports.LoadUtils = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
window.WWebJS.getChats = async () => {
|
window.WWebJS.getChats = async () => {
|
||||||
const chats = window.Store.Chat.models;
|
const chats = window.Store.Chat.getModelsArray();
|
||||||
|
|
||||||
const chatPromises = chats.map(chat => window.WWebJS.getChatModel(chat));
|
const chatPromises = chats.map(chat => window.WWebJS.getChatModel(chat));
|
||||||
return await Promise.all(chatPromises);
|
return await Promise.all(chatPromises);
|
||||||
@@ -448,7 +467,7 @@ exports.LoadUtils = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
window.WWebJS.getContacts = () => {
|
window.WWebJS.getContacts = () => {
|
||||||
const contacts = window.Store.Contact.models;
|
const contacts = window.Store.Contact.getModelsArray();
|
||||||
return contacts.map(contact => window.WWebJS.getContactModel(contact));
|
return contacts.map(contact => window.WWebJS.getContactModel(contact));
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -478,6 +497,20 @@ exports.LoadUtils = () => {
|
|||||||
return window.btoa(binary);
|
return window.btoa(binary);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
window.WWebJS.arrayBufferToBase64Async = (arrayBuffer) =>
|
||||||
|
new Promise((resolve, reject) => {
|
||||||
|
const blob = new Blob([arrayBuffer], {
|
||||||
|
type: 'application/octet-stream',
|
||||||
|
});
|
||||||
|
const fileReader = new FileReader();
|
||||||
|
fileReader.onload = () => {
|
||||||
|
const [, data] = fileReader.result.split(',');
|
||||||
|
resolve(data);
|
||||||
|
};
|
||||||
|
fileReader.onerror = (e) => reject(e);
|
||||||
|
fileReader.readAsDataURL(blob);
|
||||||
|
});
|
||||||
|
|
||||||
window.WWebJS.getFileHash = async (data) => {
|
window.WWebJS.getFileHash = async (data) => {
|
||||||
let buffer = await data.arrayBuffer();
|
let buffer = await data.arrayBuffer();
|
||||||
const hashBuffer = await crypto.subtle.digest('SHA-256', buffer);
|
const hashBuffer = await crypto.subtle.digest('SHA-256', buffer);
|
||||||
@@ -541,7 +574,7 @@ exports.LoadUtils = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
window.WWebJS.getLabels = () => {
|
window.WWebJS.getLabels = () => {
|
||||||
const labels = window.Store.Label.models;
|
const labels = window.Store.Label.getModelsArray();
|
||||||
return labels.map(label => window.WWebJS.getLabelModel(label));
|
return labels.map(label => window.WWebJS.getLabelModel(label));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ const { tmpdir } = require('os');
|
|||||||
const ffmpeg = require('fluent-ffmpeg');
|
const ffmpeg = require('fluent-ffmpeg');
|
||||||
const webp = require('node-webpmux');
|
const webp = require('node-webpmux');
|
||||||
const fs = require('fs').promises;
|
const fs = require('fs').promises;
|
||||||
|
|
||||||
const has = (o, k) => Object.prototype.hasOwnProperty.call(o, k);
|
const has = (o, k) => Object.prototype.hasOwnProperty.call(o, k);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
16
src/util/VersionResolver.js
Normal file
16
src/util/VersionResolver.js
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
const fetch = require('node-fetch');
|
||||||
|
|
||||||
|
const VERSION_ARCHIVE_URL = 'https://archive.wwebjs.dev/web-index';
|
||||||
|
|
||||||
|
class VersionResolveError extends Error { }
|
||||||
|
|
||||||
|
const getIndexForVersion = async (version) => {
|
||||||
|
const cachedRes = await fetch(`${VERSION_ARCHIVE_URL}/${version}`);
|
||||||
|
if(!cachedRes.ok) throw new VersionResolveError(`Couldn't load app for version ${version} from the archive`);
|
||||||
|
return cachedRes.text();
|
||||||
|
};
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
VersionResolveError,
|
||||||
|
getIndexForVersion
|
||||||
|
};
|
||||||
@@ -9,7 +9,7 @@ const Message = require('../src/structures/Message');
|
|||||||
const MessageMedia = require('../src/structures/MessageMedia');
|
const MessageMedia = require('../src/structures/MessageMedia');
|
||||||
const Location = require('../src/structures/Location');
|
const Location = require('../src/structures/Location');
|
||||||
const LegacySessionAuth = require('../src/authStrategies/LegacySessionAuth');
|
const LegacySessionAuth = require('../src/authStrategies/LegacySessionAuth');
|
||||||
const { MessageTypes, WAState } = require('../src/util/Constants');
|
const { MessageTypes, WAState, DefaultOptions } = require('../src/util/Constants');
|
||||||
|
|
||||||
const expect = chai.expect;
|
const expect = chai.expect;
|
||||||
chai.use(chaiAsPromised);
|
chai.use(chaiAsPromised);
|
||||||
@@ -18,6 +18,74 @@ const remoteId = helper.remoteId;
|
|||||||
const isMD = helper.isMD();
|
const isMD = helper.isMD();
|
||||||
|
|
||||||
describe('Client', function() {
|
describe('Client', function() {
|
||||||
|
describe('User Agent', function () {
|
||||||
|
it('should set user agent on browser', async function () {
|
||||||
|
this.timeout(25000);
|
||||||
|
|
||||||
|
const client = helper.createClient();
|
||||||
|
client.initialize();
|
||||||
|
|
||||||
|
await helper.sleep(20000);
|
||||||
|
|
||||||
|
const browserUA = await client.pupBrowser.userAgent();
|
||||||
|
expect(browserUA).to.equal(DefaultOptions.userAgent);
|
||||||
|
|
||||||
|
const pageUA = await client.pupPage.evaluate(() => window.navigator.userAgent);
|
||||||
|
expect(pageUA).to.equal(DefaultOptions.userAgent);
|
||||||
|
|
||||||
|
await client.destroy();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should set custom user agent on browser', async function () {
|
||||||
|
this.timeout(25000);
|
||||||
|
const customUA = DefaultOptions.userAgent.replace(/Chrome\/.* /, 'Chrome/99.9.9999.999 ');
|
||||||
|
|
||||||
|
const client = helper.createClient({
|
||||||
|
options: {
|
||||||
|
userAgent: customUA
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
client.initialize();
|
||||||
|
await helper.sleep(20000);
|
||||||
|
|
||||||
|
const browserUA = await client.pupBrowser.userAgent();
|
||||||
|
expect(browserUA).to.equal(customUA);
|
||||||
|
expect(browserUA.includes('Chrome/99.9.9999.999')).to.equal(true);
|
||||||
|
|
||||||
|
const pageUA = await client.pupPage.evaluate(() => window.navigator.userAgent);
|
||||||
|
expect(pageUA).to.equal(customUA);
|
||||||
|
|
||||||
|
await client.destroy();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should respect an existing user agent arg', async function () {
|
||||||
|
this.timeout(25000);
|
||||||
|
|
||||||
|
const customUA = DefaultOptions.userAgent.replace(/Chrome\/.* /, 'Chrome/99.9.9999.999 ');
|
||||||
|
|
||||||
|
const client = helper.createClient({
|
||||||
|
options: {
|
||||||
|
puppeteer: {
|
||||||
|
args: [`--user-agent=${customUA}`]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
client.initialize();
|
||||||
|
await helper.sleep(20000);
|
||||||
|
|
||||||
|
const browserUA = await client.pupBrowser.userAgent();
|
||||||
|
expect(browserUA).to.equal(customUA);
|
||||||
|
expect(browserUA.includes('Chrome/99.9.9999.999')).to.equal(true);
|
||||||
|
|
||||||
|
const pageUA = await client.pupPage.evaluate(() => window.navigator.userAgent);
|
||||||
|
expect(pageUA).to.equal(DefaultOptions.userAgent);
|
||||||
|
|
||||||
|
await client.destroy();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
describe('Authentication', function() {
|
describe('Authentication', function() {
|
||||||
it('should emit QR code if not authenticated', async function() {
|
it('should emit QR code if not authenticated', async function() {
|
||||||
this.timeout(25000);
|
this.timeout(25000);
|
||||||
@@ -30,7 +98,7 @@ describe('Client', function() {
|
|||||||
await helper.sleep(20000);
|
await helper.sleep(20000);
|
||||||
|
|
||||||
expect(callback.called).to.equal(true);
|
expect(callback.called).to.equal(true);
|
||||||
expect(callback.args[0][0]).to.have.lengthOf(152);
|
expect(callback.args[0][0]).to.have.length.greaterThanOrEqual(152);
|
||||||
|
|
||||||
await client.destroy();
|
await client.destroy();
|
||||||
});
|
});
|
||||||
@@ -156,7 +224,7 @@ describe('Client', function() {
|
|||||||
|
|
||||||
expect(authFailCallback.called).to.equal(true);
|
expect(authFailCallback.called).to.equal(true);
|
||||||
expect(qrCallback.called).to.equal(true);
|
expect(qrCallback.called).to.equal(true);
|
||||||
expect(qrCallback.args[0][0]).to.have.lengthOf(152);
|
expect(qrCallback.args[0][0]).to.have.length.greaterThanOrEqual(152);
|
||||||
|
|
||||||
await client.destroy();
|
await client.destroy();
|
||||||
});
|
});
|
||||||
@@ -245,6 +313,7 @@ describe('Client', function() {
|
|||||||
'Conn',
|
'Conn',
|
||||||
'Contact',
|
'Contact',
|
||||||
'DownloadManager',
|
'DownloadManager',
|
||||||
|
'EphemeralFields',
|
||||||
'Features',
|
'Features',
|
||||||
'GroupMetadata',
|
'GroupMetadata',
|
||||||
'GroupParticipants',
|
'GroupParticipants',
|
||||||
@@ -264,6 +333,7 @@ describe('Client', function() {
|
|||||||
'QueryOrder',
|
'QueryOrder',
|
||||||
'QueryProduct',
|
'QueryProduct',
|
||||||
'PresenceUtils',
|
'PresenceUtils',
|
||||||
|
'ProfilePic',
|
||||||
'QueryExist',
|
'QueryExist',
|
||||||
'QueryProduct',
|
'QueryProduct',
|
||||||
'QueryOrder',
|
'QueryOrder',
|
||||||
@@ -276,10 +346,9 @@ describe('Client', function() {
|
|||||||
'UserConstructor',
|
'UserConstructor',
|
||||||
'VCard',
|
'VCard',
|
||||||
'Validators',
|
'Validators',
|
||||||
'Wap',
|
|
||||||
'WidFactory',
|
'WidFactory',
|
||||||
'findCommonGroups',
|
'findCommonGroups',
|
||||||
'ProfilePic',
|
'sendReactionToMsg',
|
||||||
];
|
];
|
||||||
|
|
||||||
const loadedModules = await client.pupPage.evaluate((expectedModules) => {
|
const loadedModules = await client.pupPage.evaluate((expectedModules) => {
|
||||||
|
|||||||
@@ -66,6 +66,8 @@ describe('Message', function () {
|
|||||||
expect(message.isStarred).to.equal(false);
|
expect(message.isStarred).to.equal(false);
|
||||||
await message.star();
|
await message.star();
|
||||||
|
|
||||||
|
await helper.sleep(1000);
|
||||||
|
|
||||||
// reload and check
|
// reload and check
|
||||||
await message.reload();
|
await message.reload();
|
||||||
expect(message.isStarred).to.equal(true);
|
expect(message.isStarred).to.equal(true);
|
||||||
@@ -75,6 +77,8 @@ describe('Message', function () {
|
|||||||
expect(message.isStarred).to.equal(true);
|
expect(message.isStarred).to.equal(true);
|
||||||
await message.unstar();
|
await message.unstar();
|
||||||
|
|
||||||
|
await helper.sleep(1000);
|
||||||
|
|
||||||
// reload and check
|
// reload and check
|
||||||
await message.reload();
|
await message.reload();
|
||||||
expect(message.isStarred).to.equal(false);
|
expect(message.isStarred).to.equal(false);
|
||||||
@@ -85,7 +89,7 @@ describe('Message', function () {
|
|||||||
it('can delete a message for me', async function () {
|
it('can delete a message for me', async function () {
|
||||||
await message.delete();
|
await message.delete();
|
||||||
|
|
||||||
await helper.sleep(1000);
|
await helper.sleep(5000);
|
||||||
expect(await message.reload()).to.equal(null);
|
expect(await message.reload()).to.equal(null);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
80
tools/publish
Executable file
80
tools/publish
Executable file
@@ -0,0 +1,80 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
cd "$(dirname "$0")"
|
||||||
|
cd '..'
|
||||||
|
|
||||||
|
BRANCH=`git rev-parse --abbrev-ref HEAD`
|
||||||
|
RELEASE_MODE=$1
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "-----> CHECK INPUTS"
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
if [[ "$RELEASE_MODE" == "alpha" ]]
|
||||||
|
then
|
||||||
|
PRERELEASE='true'
|
||||||
|
VERSION_ARGS="prerelease --preid alpha"
|
||||||
|
DIST_TAG="next"
|
||||||
|
elif [[ "$RELEASE_MODE" == "alpha-minor" ]]
|
||||||
|
then
|
||||||
|
PRERELEASE='true'
|
||||||
|
VERSION_ARGS="preminor --preid alpha"
|
||||||
|
DIST_TAG="next"
|
||||||
|
elif [[ "$RELEASE_MODE" == "alpha-major" ]]
|
||||||
|
then
|
||||||
|
PRERELEASE='true'
|
||||||
|
VERSION_ARGS="premajor --preid alpha"
|
||||||
|
DIST_TAG="next"
|
||||||
|
else
|
||||||
|
echo 'Release Mode required'
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -f ~/.npmrc ]; then
|
||||||
|
echo "Found existing .npmrc"
|
||||||
|
else
|
||||||
|
if [[ -z "$NPM_TOKEN" ]];then
|
||||||
|
echo "No NPM_TOKEN or ~/.npmrc, exiting.."
|
||||||
|
exit 1;
|
||||||
|
else
|
||||||
|
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
echo "Publishing as NPM user: `npm whoami`"
|
||||||
|
|
||||||
|
if [[ $BRANCH != 'main' ]]; then
|
||||||
|
echo "Not on 'main' branch. Exiting"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -n $(git status -s) ]]; then
|
||||||
|
echo "There are uncommitted changes on this branch. Exiting..."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "-----> BUMP VERSION"
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
npm version $VERSION_ARGS || exit 1
|
||||||
|
git push && git push --tags || exit 1
|
||||||
|
|
||||||
|
NEW_VERSION=`cat package.json | jq -r .version`
|
||||||
|
echo "New Version: $NEW_VERSION"
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "-----> PUSH TO NPM"
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
npm publish --tag $DIST_TAG
|
||||||
|
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "-----> Done!"
|
||||||
|
echo "Version $NEW_VERSION published to $DIST_TAG tag"
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
echo "::set-output name=NEW_VERSION::$NEW_VERSION"
|
||||||
|
echo "::set-output name=PRERELEASE::$PRERELEASE"
|
||||||
|
|
||||||
|
exit 0
|
||||||
@@ -1 +1 @@
|
|||||||
2.2212.8
|
2.2245.9
|
||||||
@@ -18,15 +18,24 @@ const getCurrentVersion = () => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const updateInFile = (filePath, oldVersion, newVersion) => {
|
||||||
|
const originalFile = fs.readFileSync(filePath);
|
||||||
|
const newFile = originalFile.toString().replaceAll(oldVersion, newVersion);
|
||||||
|
|
||||||
|
fs.writeFileSync(filePath, newFile);
|
||||||
|
};
|
||||||
|
|
||||||
const updateVersion = async (oldVersion, newVersion) => {
|
const updateVersion = async (oldVersion, newVersion) => {
|
||||||
const readmePath = '../../README.md';
|
const filesToUpdate = [
|
||||||
|
'../../src/util/Constants.js',
|
||||||
|
'../../README.md',
|
||||||
|
];
|
||||||
|
|
||||||
const readme = fs.readFileSync(readmePath);
|
for (const file of filesToUpdate) {
|
||||||
const newReadme = readme.toString().replaceAll(oldVersion, newVersion);
|
updateInFile(file, oldVersion, newVersion);
|
||||||
|
}
|
||||||
|
|
||||||
fs.writeFileSync(readmePath, newReadme);
|
|
||||||
fs.writeFileSync('./.version', newVersion);
|
fs.writeFileSync('./.version', newVersion);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user