chore: mark version v1.0.0

This commit is contained in:
Pedro Lopez
2020-02-09 00:58:10 -04:00
parent f947f75725
commit 7deef27800
34 changed files with 1130 additions and 168 deletions

View File

@@ -4,7 +4,7 @@
<head>
<meta name="generator" content="JSDoc 3.6.3">
<meta charset="utf-8">
<title>whatsapp-web.js 0.3.2-post &raquo; Source: Client.js</title>
<title>whatsapp-web.js 1.0.0 &raquo; Source: Client.js</title>
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
@@ -15,7 +15,7 @@
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
<div id="jsdoc-navbar-container">
<div id="jsdoc-navbar-content">
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 0.<wbr>3.<wbr>2-post</a>
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>0.<wbr>0</a>
</div>
</div>
</nav>
@@ -44,6 +44,7 @@ const ContactFactory &#x3D; require(&#x27;./factories/ContactFactory&#x27;);
const ClientInfo &#x3D; require(&#x27;./structures/ClientInfo&#x27;);
const Message &#x3D; require(&#x27;./structures/Message&#x27;);
const MessageMedia &#x3D; require(&#x27;./structures/MessageMedia&#x27;);
const Location &#x3D; require(&#x27;./structures/Location&#x27;);
/**
* Starting point for interacting with the WhatsApp Web API
@@ -236,8 +237,9 @@ class Client extends EventEmitter {
/**
* Emitted when the client has been disconnected
* @event Client#disconnected
* @param {WAState} reason state that caused the disconnect
*/
this.emit(Events.DISCONNECTED);
this.emit(Events.DISCONNECTED, state);
this.destroy();
}
});
@@ -270,14 +272,15 @@ class Client extends EventEmitter {
/**
* Send a message to a specific chatId
* @param {string} chatId
* @param {string|MessageMedia} content
* @param {string|MessageMedia|Location} content
* @param {object} options
* @returns {Promise&amp;lt;Message&gt;} Message that was just sent
*/
async sendMessage(chatId, content, options&#x3D;{}) {
let internalOptions &#x3D; {
caption: options.caption,
quotedMessageId: options.quotedMessageId
quotedMessageId: options.quotedMessageId,
mentionedJidList: Array.isArray(options.mentions) ? options.mentions.map(contact &#x3D;&gt; contact.id._serialized) : []
};
if(content instanceof MessageMedia) {
@@ -286,6 +289,9 @@ class Client extends EventEmitter {
} else if(options.media instanceof MessageMedia) {
internalOptions.media &#x3D; options.media;
internalOptions.caption &#x3D; content;
} else if(content instanceof Location) {
internalOptions.location &#x3D; content;
content &#x3D; &#x27;&#x27;;
}
const newMessage &#x3D; await this.pupPage.evaluate(async (chatId, message, options) &#x3D;&gt; {
@@ -358,6 +364,16 @@ class Client extends EventEmitter {
return chatId._serialized;
}
/**
* Sets the current user&#x27;s status message
* @param {string} status New status message
*/
async setStatus(status) {
await this.pupPage.evaluate(async status &#x3D;&gt; {
return await window.Store.Wap.sendSetStatus(status);
}, status);
}
}
module.exports &#x3D; Client;
@@ -371,7 +387,7 @@ module.exports &#x3D; Client;
<footer id="jsdoc-footer" class="jsdoc-footer">
<div id="jsdoc-footer-container">
<p>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.3 on February 5, 2020.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.3 on February 9, 2020.
</p>
</div>
</footer>