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: structures/Message.js</title>
<title>whatsapp-web.js 1.0.0 &raquo; Source: structures/Message.js</title>
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
@@ -15,7 +15,7 @@
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
<div id="jsdoc-navbar-container">
<div id="jsdoc-navbar-content">
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 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>
@@ -33,6 +33,8 @@
const Base &#x3D; require(&#x27;./Base&#x27;);
const MessageMedia &#x3D; require(&#x27;./MessageMedia&#x27;);
const Location &#x3D; require(&#x27;./Location&#x27;);
const { MessageTypes } &#x3D; require(&#x27;../util/Constants&#x27;);
/**
* Represents a Message on WhatsApp
@@ -121,6 +123,22 @@ class Message extends Base {
*/
this.hasQuotedMsg &#x3D; data.quotedMsg ? true : false;
/**
* Location information contained in the message, if the message is type &quot;location&quot;
* @type {Location}
*/
this.location &#x3D; data.type &#x3D;&#x3D;&#x3D; MessageTypes.LOCATION ? new Location(data.lat, data.lng, data.loc) : undefined;
/**
* Indicates the mentions in the message body.
* @type {Array&amp;lt;string&gt;}
*/
this.mentionedIds &#x3D; [];
if (data.mentionedJidList) {
this.mentionedIds &#x3D; data.mentionedJidList;
}
return super._patch(data);
}
@@ -141,7 +159,15 @@ class Message extends Base {
* @returns {Promise&amp;lt;Contact&gt;}
*/
getContact() {
return this.client.getContactById(this._getChatId());
return this.client.getContactById(this.author || this.from);
}
/**
* Returns the Contacts mentioned in this message
* @returns {Promise&amp;lt;Array&amp;lt;Contact&gt;&gt;}
*/
async getMentions() {
return await Promise.all(this.mentionedIds.map(async m &#x3D;&gt; await this.client.getContactById(m)));
}
/**
@@ -164,7 +190,7 @@ class Message extends Base {
* through the specified Chat. If not, it will send the message
* in the same Chat as the original message was sent.
*
* @param {string|MessageMedia} content
* @param {string|MessageMedia|Location} content
* @param {?string} chatId
* @param {object} options
* @returns {Promise&amp;lt;Message&gt;}
@@ -209,7 +235,8 @@ class Message extends Base {
}
}
module.exports &#x3D; Message;</code></pre>
module.exports &#x3D; Message;
</code></pre>
</article>
</div>
</div>
@@ -219,7 +246,7 @@ module.exports &#x3D; Message;</code></pre>
<footer id="jsdoc-footer" class="jsdoc-footer">
<div id="jsdoc-footer-container">
<p>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.3 on February 5, 2020.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.3 on February 9, 2020.
</p>
</div>
</footer>