Compare commits

..

6 Commits

Author SHA1 Message Date
Pedro Lopez
dd0a4c6cc3 chore: mark version v1.0.1 2020-02-09 21:33:27 -04:00
Pedro Lopez
ffe803306e fix: send message media
In some cases, the mediaBlob was not resolved correctly

ref: #38
2020-02-09 21:30:28 -04:00
Pedro Lopez
74cfc69367 fix location example 2020-02-09 20:10:56 -04:00
Pedro Lopez
2607e6df3a fix: send message media in options object
An inconsistency in variable names was preventing media sent through the options object from being processed
2020-02-09 02:49:21 -04:00
Pedro Lopez
5fbd8ddf68 feat(example): auto restore session
This is as suggested in #29. Mainly implemeted to ease work while developing, but also serves as an example.
2020-02-09 01:52:38 -04:00
Pedro Lopez
6f44fc586b chore: mark post release 2020-02-09 01:16:28 -04:00
33 changed files with 90 additions and 65 deletions

View File

@@ -4,7 +4,7 @@
<head>
<meta name="generator" content="JSDoc 3.6.3">
<meta charset="utf-8">
<title>whatsapp-web.js 1.0.0 &raquo; Class: Base</title>
<title>whatsapp-web.js 1.0.1 &raquo; Class: Base</title>
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
@@ -15,7 +15,7 @@
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
<div id="jsdoc-navbar-container">
<div id="jsdoc-navbar-content">
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>0.<wbr>0</a>
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>0.<wbr>1</a>
</div>
</div>
</nav>

View File

@@ -4,7 +4,7 @@
<head>
<meta name="generator" content="JSDoc 3.6.3">
<meta charset="utf-8">
<title>whatsapp-web.js 1.0.0 &raquo; Class: BusinessContact</title>
<title>whatsapp-web.js 1.0.1 &raquo; Class: BusinessContact</title>
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
@@ -15,7 +15,7 @@
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
<div id="jsdoc-navbar-container">
<div id="jsdoc-navbar-content">
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>0.<wbr>0</a>
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>0.<wbr>1</a>
</div>
</div>
</nav>

View File

@@ -4,7 +4,7 @@
<head>
<meta name="generator" content="JSDoc 3.6.3">
<meta charset="utf-8">
<title>whatsapp-web.js 1.0.0 &raquo; Class: Chat</title>
<title>whatsapp-web.js 1.0.1 &raquo; Class: Chat</title>
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
@@ -15,7 +15,7 @@
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
<div id="jsdoc-navbar-container">
<div id="jsdoc-navbar-content">
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>0.<wbr>0</a>
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>0.<wbr>1</a>
</div>
</div>
</nav>

View File

@@ -4,7 +4,7 @@
<head>
<meta name="generator" content="JSDoc 3.6.3">
<meta charset="utf-8">
<title>whatsapp-web.js 1.0.0 &raquo; Class: Client</title>
<title>whatsapp-web.js 1.0.1 &raquo; Class: Client</title>
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
@@ -15,7 +15,7 @@
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
<div id="jsdoc-navbar-container">
<div id="jsdoc-navbar-content">
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>0.<wbr>0</a>
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>0.<wbr>1</a>
</div>
</div>
</nav>

View File

@@ -4,7 +4,7 @@
<head>
<meta name="generator" content="JSDoc 3.6.3">
<meta charset="utf-8">
<title>whatsapp-web.js 1.0.0 &raquo; Source: Client.js</title>
<title>whatsapp-web.js 1.0.1 &raquo; Source: Client.js</title>
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
@@ -15,7 +15,7 @@
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
<div id="jsdoc-navbar-container">
<div id="jsdoc-navbar-content">
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>0.<wbr>0</a>
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>0.<wbr>1</a>
</div>
</div>
</nav>
@@ -287,7 +287,7 @@ class Client extends EventEmitter {
internalOptions.attachment &#x3D; content;
content &#x3D; &#x27;&#x27;;
} else if(options.media instanceof MessageMedia) {
internalOptions.media &#x3D; options.media;
internalOptions.attachment &#x3D; options.media;
internalOptions.caption &#x3D; content;
} else if(content instanceof Location) {
internalOptions.location &#x3D; content;

View File

@@ -4,7 +4,7 @@
<head>
<meta name="generator" content="JSDoc 3.6.3">
<meta charset="utf-8">
<title>whatsapp-web.js 1.0.0 &raquo; Class: ClientInfo</title>
<title>whatsapp-web.js 1.0.1 &raquo; Class: ClientInfo</title>
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
@@ -15,7 +15,7 @@
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
<div id="jsdoc-navbar-container">
<div id="jsdoc-navbar-content">
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>0.<wbr>0</a>
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>0.<wbr>1</a>
</div>
</div>
</nav>

View File

@@ -4,7 +4,7 @@
<head>
<meta name="generator" content="JSDoc 3.6.3">
<meta charset="utf-8">
<title>whatsapp-web.js 1.0.0 &raquo; Class: Contact</title>
<title>whatsapp-web.js 1.0.1 &raquo; Class: Contact</title>
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
@@ -15,7 +15,7 @@
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
<div id="jsdoc-navbar-container">
<div id="jsdoc-navbar-content">
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>0.<wbr>0</a>
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>0.<wbr>1</a>
</div>
</div>
</nav>

View File

@@ -4,7 +4,7 @@
<head>
<meta name="generator" content="JSDoc 3.6.3">
<meta charset="utf-8">
<title>whatsapp-web.js 1.0.0 &raquo; Class: GroupChat</title>
<title>whatsapp-web.js 1.0.1 &raquo; Class: GroupChat</title>
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
@@ -15,7 +15,7 @@
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
<div id="jsdoc-navbar-container">
<div id="jsdoc-navbar-content">
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>0.<wbr>0</a>
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>0.<wbr>1</a>
</div>
</div>
</nav>

View File

@@ -4,7 +4,7 @@
<head>
<meta name="generator" content="JSDoc 3.6.3">
<meta charset="utf-8">
<title>whatsapp-web.js 1.0.0 &raquo; Class: Location</title>
<title>whatsapp-web.js 1.0.1 &raquo; Class: Location</title>
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
@@ -15,7 +15,7 @@
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
<div id="jsdoc-navbar-container">
<div id="jsdoc-navbar-content">
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>0.<wbr>0</a>
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>0.<wbr>1</a>
</div>
</div>
</nav>

View File

@@ -4,7 +4,7 @@
<head>
<meta name="generator" content="JSDoc 3.6.3">
<meta charset="utf-8">
<title>whatsapp-web.js 1.0.0 &raquo; Class: Message</title>
<title>whatsapp-web.js 1.0.1 &raquo; Class: Message</title>
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
@@ -15,7 +15,7 @@
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
<div id="jsdoc-navbar-container">
<div id="jsdoc-navbar-content">
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>0.<wbr>0</a>
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>0.<wbr>1</a>
</div>
</div>
</nav>

View File

@@ -4,7 +4,7 @@
<head>
<meta name="generator" content="JSDoc 3.6.3">
<meta charset="utf-8">
<title>whatsapp-web.js 1.0.0 &raquo; Class: MessageMedia</title>
<title>whatsapp-web.js 1.0.1 &raquo; Class: MessageMedia</title>
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
@@ -15,7 +15,7 @@
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
<div id="jsdoc-navbar-container">
<div id="jsdoc-navbar-content">
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>0.<wbr>0</a>
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>0.<wbr>1</a>
</div>
</div>
</nav>

View File

@@ -4,7 +4,7 @@
<head>
<meta name="generator" content="JSDoc 3.6.3">
<meta charset="utf-8">
<title>whatsapp-web.js 1.0.0 &raquo; Class: PrivateChat</title>
<title>whatsapp-web.js 1.0.1 &raquo; Class: PrivateChat</title>
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
@@ -15,7 +15,7 @@
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
<div id="jsdoc-navbar-container">
<div id="jsdoc-navbar-content">
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>0.<wbr>0</a>
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>0.<wbr>1</a>
</div>
</div>
</nav>

View File

@@ -4,7 +4,7 @@
<head>
<meta name="generator" content="JSDoc 3.6.3">
<meta charset="utf-8">
<title>whatsapp-web.js 1.0.0 &raquo; Class: PrivateContact</title>
<title>whatsapp-web.js 1.0.1 &raquo; Class: PrivateContact</title>
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
@@ -15,7 +15,7 @@
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
<div id="jsdoc-navbar-container">
<div id="jsdoc-navbar-content">
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>0.<wbr>0</a>
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>0.<wbr>1</a>
</div>
</div>
</nav>

View File

@@ -4,7 +4,7 @@
<head>
<meta name="generator" content="JSDoc 3.6.3">
<meta charset="utf-8">
<title>whatsapp-web.js 1.0.0 &raquo; Class: Util</title>
<title>whatsapp-web.js 1.0.1 &raquo; Class: Util</title>
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
@@ -15,7 +15,7 @@
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
<div id="jsdoc-navbar-container">
<div id="jsdoc-navbar-content">
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>0.<wbr>0</a>
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>0.<wbr>1</a>
</div>
</div>
</nav>

View File

@@ -4,7 +4,7 @@
<head>
<meta name="generator" content="JSDoc 3.6.3">
<meta charset="utf-8">
<title>whatsapp-web.js 1.0.0 &raquo; Globals</title>
<title>whatsapp-web.js 1.0.1 &raquo; Globals</title>
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
@@ -15,7 +15,7 @@
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
<div id="jsdoc-navbar-container">
<div id="jsdoc-navbar-content">
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>0.<wbr>0</a>
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>0.<wbr>1</a>
</div>
</div>
</nav>

View File

@@ -4,7 +4,7 @@
<head>
<meta name="generator" content="JSDoc 3.6.3">
<meta charset="utf-8">
<title>whatsapp-web.js 1.0.0 &raquo; Home</title>
<title>whatsapp-web.js 1.0.1 &raquo; Home</title>
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
@@ -15,7 +15,7 @@
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
<div id="jsdoc-navbar-container">
<div id="jsdoc-navbar-content">
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>0.<wbr>0</a>
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>0.<wbr>1</a>
</div>
</div>
</nav>
@@ -27,7 +27,7 @@
<div id="jsdoc-main" role="main">
<header class="page-header">
<h1>
whatsapp-web.js 1.0.0
whatsapp-web.js 1.0.1
</h1>
</header>
<article>

View File

@@ -4,7 +4,7 @@
<head>
<meta name="generator" content="JSDoc 3.6.3">
<meta charset="utf-8">
<title>whatsapp-web.js 1.0.0 &raquo; Source: structures/Base.js</title>
<title>whatsapp-web.js 1.0.1 &raquo; Source: structures/Base.js</title>
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
@@ -15,7 +15,7 @@
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
<div id="jsdoc-navbar-container">
<div id="jsdoc-navbar-content">
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>0.<wbr>0</a>
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>0.<wbr>1</a>
</div>
</div>
</nav>

View File

@@ -4,7 +4,7 @@
<head>
<meta name="generator" content="JSDoc 3.6.3">
<meta charset="utf-8">
<title>whatsapp-web.js 1.0.0 &raquo; Source: structures/BusinessContact.js</title>
<title>whatsapp-web.js 1.0.1 &raquo; Source: structures/BusinessContact.js</title>
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
@@ -15,7 +15,7 @@
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
<div id="jsdoc-navbar-container">
<div id="jsdoc-navbar-content">
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>0.<wbr>0</a>
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>0.<wbr>1</a>
</div>
</div>
</nav>

View File

@@ -4,7 +4,7 @@
<head>
<meta name="generator" content="JSDoc 3.6.3">
<meta charset="utf-8">
<title>whatsapp-web.js 1.0.0 &raquo; Source: structures/Chat.js</title>
<title>whatsapp-web.js 1.0.1 &raquo; Source: structures/Chat.js</title>
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
@@ -15,7 +15,7 @@
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
<div id="jsdoc-navbar-container">
<div id="jsdoc-navbar-content">
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>0.<wbr>0</a>
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>0.<wbr>1</a>
</div>
</div>
</nav>

View File

@@ -4,7 +4,7 @@
<head>
<meta name="generator" content="JSDoc 3.6.3">
<meta charset="utf-8">
<title>whatsapp-web.js 1.0.0 &raquo; Source: structures/ClientInfo.js</title>
<title>whatsapp-web.js 1.0.1 &raquo; Source: structures/ClientInfo.js</title>
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
@@ -15,7 +15,7 @@
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
<div id="jsdoc-navbar-container">
<div id="jsdoc-navbar-content">
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>0.<wbr>0</a>
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>0.<wbr>1</a>
</div>
</div>
</nav>

View File

@@ -4,7 +4,7 @@
<head>
<meta name="generator" content="JSDoc 3.6.3">
<meta charset="utf-8">
<title>whatsapp-web.js 1.0.0 &raquo; Source: structures/Contact.js</title>
<title>whatsapp-web.js 1.0.1 &raquo; Source: structures/Contact.js</title>
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
@@ -15,7 +15,7 @@
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
<div id="jsdoc-navbar-container">
<div id="jsdoc-navbar-content">
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>0.<wbr>0</a>
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>0.<wbr>1</a>
</div>
</div>
</nav>

View File

@@ -4,7 +4,7 @@
<head>
<meta name="generator" content="JSDoc 3.6.3">
<meta charset="utf-8">
<title>whatsapp-web.js 1.0.0 &raquo; Source: structures/GroupChat.js</title>
<title>whatsapp-web.js 1.0.1 &raquo; Source: structures/GroupChat.js</title>
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
@@ -15,7 +15,7 @@
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
<div id="jsdoc-navbar-container">
<div id="jsdoc-navbar-content">
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>0.<wbr>0</a>
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>0.<wbr>1</a>
</div>
</div>
</nav>

View File

@@ -4,7 +4,7 @@
<head>
<meta name="generator" content="JSDoc 3.6.3">
<meta charset="utf-8">
<title>whatsapp-web.js 1.0.0 &raquo; Source: structures/Location.js</title>
<title>whatsapp-web.js 1.0.1 &raquo; Source: structures/Location.js</title>
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
@@ -15,7 +15,7 @@
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
<div id="jsdoc-navbar-container">
<div id="jsdoc-navbar-content">
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>0.<wbr>0</a>
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>0.<wbr>1</a>
</div>
</div>
</nav>

View File

@@ -4,7 +4,7 @@
<head>
<meta name="generator" content="JSDoc 3.6.3">
<meta charset="utf-8">
<title>whatsapp-web.js 1.0.0 &raquo; Source: structures/Message.js</title>
<title>whatsapp-web.js 1.0.1 &raquo; Source: structures/Message.js</title>
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
@@ -15,7 +15,7 @@
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
<div id="jsdoc-navbar-container">
<div id="jsdoc-navbar-content">
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>0.<wbr>0</a>
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>0.<wbr>1</a>
</div>
</div>
</nav>

View File

@@ -4,7 +4,7 @@
<head>
<meta name="generator" content="JSDoc 3.6.3">
<meta charset="utf-8">
<title>whatsapp-web.js 1.0.0 &raquo; Source: structures/MessageMedia.js</title>
<title>whatsapp-web.js 1.0.1 &raquo; Source: structures/MessageMedia.js</title>
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
@@ -15,7 +15,7 @@
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
<div id="jsdoc-navbar-container">
<div id="jsdoc-navbar-content">
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>0.<wbr>0</a>
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>0.<wbr>1</a>
</div>
</div>
</nav>

View File

@@ -4,7 +4,7 @@
<head>
<meta name="generator" content="JSDoc 3.6.3">
<meta charset="utf-8">
<title>whatsapp-web.js 1.0.0 &raquo; Source: structures/PrivateChat.js</title>
<title>whatsapp-web.js 1.0.1 &raquo; Source: structures/PrivateChat.js</title>
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
@@ -15,7 +15,7 @@
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
<div id="jsdoc-navbar-container">
<div id="jsdoc-navbar-content">
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>0.<wbr>0</a>
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>0.<wbr>1</a>
</div>
</div>
</nav>

View File

@@ -4,7 +4,7 @@
<head>
<meta name="generator" content="JSDoc 3.6.3">
<meta charset="utf-8">
<title>whatsapp-web.js 1.0.0 &raquo; Source: structures/PrivateContact.js</title>
<title>whatsapp-web.js 1.0.1 &raquo; Source: structures/PrivateContact.js</title>
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
@@ -15,7 +15,7 @@
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
<div id="jsdoc-navbar-container">
<div id="jsdoc-navbar-content">
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>0.<wbr>0</a>
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>0.<wbr>1</a>
</div>
</div>
</nav>

View File

@@ -4,7 +4,7 @@
<head>
<meta name="generator" content="JSDoc 3.6.3">
<meta charset="utf-8">
<title>whatsapp-web.js 1.0.0 &raquo; Source: util/Constants.js</title>
<title>whatsapp-web.js 1.0.1 &raquo; Source: util/Constants.js</title>
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
@@ -15,7 +15,7 @@
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
<div id="jsdoc-navbar-container">
<div id="jsdoc-navbar-content">
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>0.<wbr>0</a>
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>0.<wbr>1</a>
</div>
</div>
</nav>

View File

@@ -4,7 +4,7 @@
<head>
<meta name="generator" content="JSDoc 3.6.3">
<meta charset="utf-8">
<title>whatsapp-web.js 1.0.0 &raquo; Source: util/Util.js</title>
<title>whatsapp-web.js 1.0.1 &raquo; Source: util/Util.js</title>
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
@@ -15,7 +15,7 @@
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
<div id="jsdoc-navbar-container">
<div id="jsdoc-navbar-content">
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>0.<wbr>0</a>
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>0.<wbr>1</a>
</div>
</div>
</nav>

View File

@@ -1,6 +1,13 @@
const { Client } = require('./index');
const fs = require('fs');
const { Client, Location } = require('./index');
const client = new Client({puppeteer: {headless: false}});
const SESSION_FILE_PATH = './session.json';
let sessionCfg;
if (fs.existsSync(SESSION_FILE_PATH)) {
sessionCfg = require(SESSION_FILE_PATH);
}
const client = new Client({puppeteer: {headless: false}, session: sessionCfg});
// You can use an existing session and avoid scanning a QR code by adding a "session" object to the client options.
// This object must include WABrowserId, WASecretBundle, WAToken1 and WAToken2.
@@ -13,6 +20,14 @@ client.on('qr', (qr) => {
client.on('authenticated', (session) => {
console.log('AUTHENTICATED', session);
if (!fs.existsSync(SESSION_FILE_PATH)) {
fs.writeFile(SESSION_FILE_PATH, JSON.stringify(session), function(err) {
if (err) {
console.error(err);
}
});
}
});
client.on('auth_failure', msg => {

View File

@@ -1,6 +1,6 @@
{
"name": "whatsapp-web.js",
"version": "1.0.0",
"version": "1.0.1",
"description": "Library for interacting with the WhatsApp Web API ",
"main": "./index.js",
"scripts": {

View File

@@ -256,7 +256,7 @@ class Client extends EventEmitter {
internalOptions.attachment = content;
content = '';
} else if(options.media instanceof MessageMedia) {
internalOptions.media = options.media;
internalOptions.attachment = options.media;
internalOptions.caption = content;
} else if(content instanceof Location) {
internalOptions.location = content;

View File

@@ -40,7 +40,9 @@ exports.LoadUtils = () => {
delete options.quotedMessageId;
}
options.mentionedJidList = options.mentionedJidList.map(cId=> window.Store.Contact.get(cId).id);
if (options.mentionedJidList) {
options.mentionedJidList = options.mentionedJidList.map(cId=> window.Store.Contact.get(cId).id);
}
let locationOptions = {};
if (options.location) {
@@ -92,6 +94,14 @@ exports.LoadUtils = () => {
isGif: mediaData.isGif
});
if(!(mediaData.mediaBlob instanceof window.Store.OpaqueData.default)) {
mediaData.mediaBlob = await window.Store.OpaqueData.default.createFromData(mediaData.mediaBlob, mediaData.mediaBlob.type);
}
mediaData.renderableUrl = mediaData.mediaBlob.url();
mediaObject.consolidate(mediaData.toJSON());
mediaData.mediaBlob.autorelease();
const uploadedMedia = await window.Store.MediaUpload.uploadMedia(mediaData.mimetype, mediaObject, mediaType);
if (!uploadedMedia) {
throw new Error('upload failed: media entry was not created');