diff --git a/docs/Base.html b/docs/Base.html
index 891064e..3caea4a 100644
--- a/docs/Base.html
+++ b/docs/Base.html
@@ -4,7 +4,7 @@
- mediaKey
-
-
mentionedIds
@@ -215,6 +218,12 @@
String that represents from which device type the message was sent
+ forwardingScore
+ number
+ Indicates how many times the message was forwarded.
+ The maximum value is 127.
+
+
from
string
ID for the Chat that this message was sent to, except if the message was sent by the current user.
@@ -261,7 +270,7 @@
links
- Array of string
+ Array of {link: string, isSuspicious: boolean}
Links included in the message.
@@ -543,7 +552,7 @@
diff --git a/docs/MessageMedia.html b/docs/MessageMedia.html
index 7b6f13b..7390317 100644
--- a/docs/MessageMedia.html
+++ b/docs/MessageMedia.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.13.2 » Class: MessageMedia
+ whatsapp-web.js 1.14.0 » Class: MessageMedia
@@ -15,7 +15,7 @@
@@ -26,7 +26,7 @@
-
Method
+
Methods
@@ -159,7 +164,7 @@
-
Method
+
Methods
static
fromFilePath (filePath) → MessageMedia
@@ -198,6 +203,123 @@
MessageMedia
+ async static
+ fromUrl (url[, options]) → Promise containing MessageMedia
+ Creates a MessageMedia instance from a URL
+
+ Parameters
+
+
+
+ Name
+ Type
+ Optional
+ Description
+
+
+
+
+
+ url
+
+
+ string
+
+
+
+
+
+
+
+
+
+ options
+
+
+ Object
+
+
+ Yes
+
+
+ Values in options have the following properties:
+
+
+
+ Name
+ Type
+ Optional
+ Description
+
+
+
+
+
+ unsafeMime
+
+
+ number
+
+
+ Yes
+
+
+ Defaults to false.
+
+
+
+
+ client
+
+
+ object
+
+
+ Yes
+
+
+
+
+
+
+ reqOptions
+
+
+ object
+
+
+ Yes
+
+
+
+
+
+
+ reqOptions.size
+
+
+ number
+
+
+ Yes
+
+
+ Defaults to 0.
+
+
+
+
+
+
+
+
+
+
+ Returns
+
+ Promise containing MessageMedia
+
+
@@ -208,7 +330,7 @@
diff --git a/docs/Order.html b/docs/Order.html
index 08445ca..f26238b 100644
--- a/docs/Order.html
+++ b/docs/Order.html
@@ -4,7 +4,7 @@
-
whatsapp-web.js 1.13.2 » Class: Order
+
whatsapp-web.js 1.14.0 » Class: Order
@@ -15,7 +15,7 @@
@@ -102,7 +102,7 @@
diff --git a/docs/PrivateChat.html b/docs/PrivateChat.html
index d4cf73c..47d668e 100644
--- a/docs/PrivateChat.html
+++ b/docs/PrivateChat.html
@@ -4,7 +4,7 @@
-
whatsapp-web.js 1.13.2 » Class: PrivateChat
+
whatsapp-web.js 1.14.0 » Class: PrivateChat
@@ -15,7 +15,7 @@
@@ -519,7 +519,7 @@
diff --git a/docs/PrivateContact.html b/docs/PrivateContact.html
index 6f10e75..e165910 100644
--- a/docs/PrivateContact.html
+++ b/docs/PrivateContact.html
@@ -4,7 +4,7 @@
-
whatsapp-web.js 1.13.2 » Class: PrivateContact
+
whatsapp-web.js 1.14.0 » Class: PrivateContact
@@ -15,7 +15,7 @@
@@ -283,7 +283,7 @@
diff --git a/docs/Product.html b/docs/Product.html
index e627fa6..127063e 100644
--- a/docs/Product.html
+++ b/docs/Product.html
@@ -4,7 +4,7 @@
-
whatsapp-web.js 1.13.2 » Class: Product
+
whatsapp-web.js 1.14.0 » Class: Product
@@ -15,7 +15,7 @@
@@ -127,7 +127,7 @@
diff --git a/docs/Util.html b/docs/Util.html
index aa4f64e..9b3f7aa 100644
--- a/docs/Util.html
+++ b/docs/Util.html
@@ -4,7 +4,7 @@
-
whatsapp-web.js 1.13.2 » Class: Util
+
whatsapp-web.js 1.14.0 » Class: Util
@@ -15,7 +15,7 @@
@@ -240,7 +240,7 @@
diff --git a/docs/global.html b/docs/global.html
index efc2b00..810074b 100644
--- a/docs/global.html
+++ b/docs/global.html
@@ -4,7 +4,7 @@
-
whatsapp-web.js 1.13.2 » Globals
+
whatsapp-web.js 1.14.0 » Globals
@@ -15,7 +15,7 @@
@@ -383,6 +383,19 @@
+
+
+ INCOMING_CALL
+
+
+
+
+
+
+
+
+
+
@@ -1595,7 +1608,7 @@
diff --git a/docs/index.html b/docs/index.html
index 6457bdd..0b5d9bf 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -4,7 +4,7 @@
-
whatsapp-web.js 1.13.2 » Home
+
whatsapp-web.js 1.14.0 » Home
@@ -15,7 +15,7 @@
@@ -27,20 +27,21 @@
-
+
whatsapp-web.js
A WhatsApp API client that connects through the WhatsApp Web browser app
It uses Puppeteer to run a real instance of Whatsapp Web to avoid getting blocked.
NOTE: I can't guarantee you will not be blocked by using this method, although it has worked for me. WhatsApp does not allow bots or unofficial clients on their platform, so this shouldn't be considered totally safe.
Installation
The module is now available on npm! npm i whatsapp-web.js
- Please note that Node v14+ is required.
+ Please note that Node v12+ is required.
Example usage
const { Client } = require('whatsapp-web.js');
+
const client = new Client();
client.on('qr', (qr) => {
@@ -60,6 +61,33 @@ client.on('message', msg => {
client.initialize();
+ Remote Access
+ You could also connect to any previously existing browser instance:
+ const client = new Client({
+ puppeteer: {
+ browserWSEndpoint: `ws://localhost:3000`
+ }
+});
+
+ Docker
+
+ Installing a browser using browserless:
+
+ docker run \
+ --rm \
+ -p 3000:3000 \
+ -e "MAX_CONCURRENT_SESSIONS=1" \
+ browserless/chrome:latest
+
+ Reference: https://docs.browserless.io/docs/docker-quickstart.html
+ Remote Debugging
+
+ Running a browser with websocket remote debugging enabled:
+
+
+ chrome.exe --remote-debugging-port=9222
+
+ After that check the following webpage and check http://127.0.0.1:9220/json and get the webSocketDebuggerUrl
Take a look at example.js for another example with more use cases.
Supported features
@@ -84,7 +112,7 @@ client.initialize();
Send media (video)
- ✅ (requires google chrome)
+ ✅ (requires google chrome)
Send stickers
@@ -167,9 +195,10 @@ client.initialize();
Something missing? Make an issue and let us know!
Links
Contributing
Pull requests are welcome! If you see something you'd like to add, please do. For drastic changes, please open an issue first.
@@ -333,6 +362,75 @@ client.initialize();
+
Chat
@@ -602,6 +700,11 @@ client.initialize();
+
+ Client#event:incoming_call
+
+
+
Client#event:media_uploaded
@@ -617,15 +720,15 @@ client.initialize();
+
+
+
-
+
-
+
-
+
-
+
-
-
Message#location
@@ -1885,12 +1998,12 @@ client.initialize();
+
+ MessageMedia#filename
+
+
+
MessageMedia#mimetype
@@ -2583,7 +2701,7 @@ client.initialize();
diff --git a/docs/scripts/jsdoc-toc.js b/docs/scripts/jsdoc-toc.js
index ccd404e..a57fd14 100644
--- a/docs/scripts/jsdoc-toc.js
+++ b/docs/scripts/jsdoc-toc.js
@@ -6,7 +6,7 @@
treeNode.tree({
autoEscape: false,
closedIcon: '⇢',
- data: [{"label":"Globals ","id":"global","children":[]},{"label":"Base ","id":"Base","children":[]},{"label":"BusinessContact ","id":"BusinessContact","children":[]},{"label":"Chat ","id":"Chat","children":[]},{"label":"Client ","id":"Client","children":[]},{"label":"ClientInfo ","id":"ClientInfo","children":[]},{"label":"Contact ","id":"Contact","children":[]},{"label":"GroupChat ","id":"GroupChat","children":[]},{"label":"GroupNotification ","id":"GroupNotification","children":[]},{"label":"InterfaceController ","id":"InterfaceController","children":[]},{"label":"Label ","id":"Label","children":[]},{"label":"Location ","id":"Location","children":[]},{"label":"Message ","id":"Message","children":[]},{"label":"MessageMedia ","id":"MessageMedia","children":[]},{"label":"Order ","id":"Order","children":[]},{"label":"PrivateChat ","id":"PrivateChat","children":[]},{"label":"PrivateContact ","id":"PrivateContact","children":[]},{"label":"Product ","id":"Product","children":[]},{"label":"Util ","id":"Util","children":[]}],
+ data: [{"label":"Globals ","id":"global","children":[]},{"label":"Base ","id":"Base","children":[]},{"label":"BusinessContact ","id":"BusinessContact","children":[]},{"label":"Call ","id":"Call","children":[]},{"label":"Chat ","id":"Chat","children":[]},{"label":"Client ","id":"Client","children":[]},{"label":"ClientInfo ","id":"ClientInfo","children":[]},{"label":"Contact ","id":"Contact","children":[]},{"label":"GroupChat ","id":"GroupChat","children":[]},{"label":"GroupNotification ","id":"GroupNotification","children":[]},{"label":"InterfaceController ","id":"InterfaceController","children":[]},{"label":"Label ","id":"Label","children":[]},{"label":"Location ","id":"Location","children":[]},{"label":"Message ","id":"Message","children":[]},{"label":"MessageMedia ","id":"MessageMedia","children":[]},{"label":"Order ","id":"Order","children":[]},{"label":"PrivateChat ","id":"PrivateChat","children":[]},{"label":"PrivateContact ","id":"PrivateContact","children":[]},{"label":"Product ","id":"Product","children":[]},{"label":"Util ","id":"Util","children":[]}],
openedIcon: ' ⇣',
saveState: false,
useContextMenu: false
diff --git a/docs/structures_Base.js.html b/docs/structures_Base.js.html
index 539138f..5f75686 100644
--- a/docs/structures_Base.js.html
+++ b/docs/structures_Base.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.13.2 » Source: structures/Base.js
+ whatsapp-web.js 1.14.0 » Source: structures/Base.js
@@ -15,7 +15,7 @@
@@ -60,7 +60,7 @@ module.exports = Base;
diff --git a/docs/structures_BusinessContact.js.html b/docs/structures_BusinessContact.js.html
index d423ea7..fa62abf 100644
--- a/docs/structures_BusinessContact.js.html
+++ b/docs/structures_BusinessContact.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.13.2 » Source: structures/BusinessContact.js
+ whatsapp-web.js 1.14.0 » Source: structures/BusinessContact.js
@@ -15,7 +15,7 @@
@@ -59,7 +59,7 @@ module.exports = BusinessContact;
diff --git a/docs/structures_Call.js.html b/docs/structures_Call.js.html
new file mode 100644
index 0000000..ce9905b
--- /dev/null
+++ b/docs/structures_Call.js.html
@@ -0,0 +1,121 @@
+
+
+
+
+
+
+ whatsapp-web.js 1.14.0 » Source: structures/Call.js
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 'use strict';
+
+const Base = require('./Base');
+
+/**
+ * Represents a Call on WhatsApp
+ * @extends {Base}
+ */
+class Call extends Base {
+ constructor(client, data) {
+ super(client);
+
+ if (data) this._patch(data);
+ }
+
+ _patch(data) {
+ /**
+ * Call ID
+ * @type {string}
+ */
+ this.id = data.id;
+ /**
+ * From
+ * @type {string}
+ */
+ this.from = data.peerJid;
+ /**
+ * Unix timestamp for when the call was created
+ * @type {number}
+ */
+ this.timestamp = data.offerTime;
+ /**
+ * Is video
+ * @type {boolean}
+ */
+ this.isVideo = data.isVideo;
+ /**
+ * Is Group
+ * @type {boolean}
+ */
+ this.isGroup = data.isGroup;
+ /**
+ * Indicates if the call was sent by the current user
+ * @type {boolean}
+ */
+ this.fromMe = data.outgoing;
+ /**
+ * Indicates if the call can be handled in waweb
+ * @type {boolean}
+ */
+ this.canHandleLocally = data.canHandleLocally;
+ /**
+ * Indicates if the call Should be handled in waweb
+ * @type {boolean}
+ */
+ this.webClientShouldHandle = data.webClientShouldHandle;
+ /**
+ * Object with participants
+ * @type {object}
+ */
+ this.participants = data.participants;
+
+ return super._patch(data);
+ }
+
+}
+
+module.exports = Call;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/docs/structures_Chat.js.html b/docs/structures_Chat.js.html
index f072df6..34ad66e 100644
--- a/docs/structures_Chat.js.html
+++ b/docs/structures_Chat.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.13.2 » Source: structures/Chat.js
+ whatsapp-web.js 1.14.0 » Source: structures/Chat.js
@@ -15,7 +15,7 @@
@@ -288,7 +288,7 @@ module.exports = Chat;
diff --git a/docs/structures_ClientInfo.js.html b/docs/structures_ClientInfo.js.html
index 024ac67..5319b14 100644
--- a/docs/structures_ClientInfo.js.html
+++ b/docs/structures_ClientInfo.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.13.2 » Source: structures/ClientInfo.js
+ whatsapp-web.js 1.14.0 » Source: structures/ClientInfo.js
@@ -15,7 +15,7 @@
@@ -108,7 +108,7 @@ module.exports = ClientInfo;
diff --git a/docs/structures_Contact.js.html b/docs/structures_Contact.js.html
index 39c338a..aa01623 100644
--- a/docs/structures_Contact.js.html
+++ b/docs/structures_Contact.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.13.2 » Source: structures/Contact.js
+ whatsapp-web.js 1.14.0 » Source: structures/Contact.js
@@ -15,7 +15,7 @@
@@ -219,7 +219,7 @@ module.exports = Contact;
diff --git a/docs/structures_GroupChat.js.html b/docs/structures_GroupChat.js.html
index 8d51a80..82154a5 100644
--- a/docs/structures_GroupChat.js.html
+++ b/docs/structures_GroupChat.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.13.2 » Source: structures/GroupChat.js
+ whatsapp-web.js 1.14.0 » Source: structures/GroupChat.js
@@ -15,7 +15,7 @@
@@ -239,7 +239,7 @@ module.exports = GroupChat;
diff --git a/docs/structures_GroupNotification.js.html b/docs/structures_GroupNotification.js.html
index c6f7ab0..fa19ca3 100644
--- a/docs/structures_GroupNotification.js.html
+++ b/docs/structures_GroupNotification.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.13.2 » Source: structures/GroupNotification.js
+ whatsapp-web.js 1.14.0 » Source: structures/GroupNotification.js
@@ -15,7 +15,7 @@
@@ -143,7 +143,7 @@ module.exports = GroupNotification;
diff --git a/docs/structures_Label.js.html b/docs/structures_Label.js.html
index 73e8f7f..e4a7a1d 100644
--- a/docs/structures_Label.js.html
+++ b/docs/structures_Label.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.13.2 » Source: structures/Label.js
+ whatsapp-web.js 1.14.0 » Source: structures/Label.js
@@ -15,7 +15,7 @@
@@ -88,7 +88,7 @@ module.exports = Label;
diff --git a/docs/structures_Location.js.html b/docs/structures_Location.js.html
index ea8c985..4467d6e 100644
--- a/docs/structures_Location.js.html
+++ b/docs/structures_Location.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.13.2 » Source: structures/Location.js
+ whatsapp-web.js 1.14.0 » Source: structures/Location.js
@@ -15,7 +15,7 @@
@@ -71,7 +71,7 @@ module.exports = Location;
diff --git a/docs/structures_Message.js.html b/docs/structures_Message.js.html
index b3a5ddd..71a5d9d 100644
--- a/docs/structures_Message.js.html
+++ b/docs/structures_Message.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.13.2 » Source: structures/Message.js
+ whatsapp-web.js 1.14.0 » Source: structures/Message.js
@@ -15,7 +15,7 @@
@@ -125,6 +125,14 @@ class Message extends Base {
*/
this.isForwarded = data.isForwarded;
+ /**
+ * Indicates how many times the message was forwarded.
+ *
+ * The maximum value is 127.
+ * @type {number}
+ */
+ this.forwardingScore = data.forwardingScore || 0;
+
/**
* Indicates if the message is a status update
* @type {boolean}
@@ -223,7 +231,8 @@ class Message extends Base {
/**
* Links included in the message.
- * @type {Array<string>}
+ * @type {Array<{link: string, isSuspicious: boolean}>}
+ *
*/
this.links = data.links;
@@ -335,32 +344,39 @@ class Message extends Base {
if (msg.mediaData.mediaStage != 'RESOLVED') {
// try to resolve media
- await msg.downloadMedia(true, 1);
+ await msg.downloadMedia({
+ downloadEvenIfExpensive: true,
+ rmrReason: 1
+ });
}
- if (msg.mediaData.mediaStage.includes('ERROR')) {
+ if (msg.mediaData.mediaStage.includes('ERROR') || msg.mediaData.mediaStage === 'FETCHING') {
// media could not be downloaded
return undefined;
}
- const decryptedMedia = await window.Store.DownloadManager.downloadAndDecrypt({
- directPath: msg.directPath,
- encFilehash: msg.encFilehash,
- filehash: msg.filehash,
- mediaKey: msg.mediaKey,
- mediaKeyTimestamp: msg.mediaKeyTimestamp,
- type: msg.type,
- signal: (new AbortController).signal
- });
-
- const data = window.WWebJS.arrayBufferToBase64(decryptedMedia);
-
- return {
- data,
- mimetype: msg.mimetype,
- filename: msg.filename
- };
-
+ try {
+ const decryptedMedia = await window.Store.DownloadManager.downloadAndDecrypt({
+ directPath: msg.directPath,
+ encFilehash: msg.encFilehash,
+ filehash: msg.filehash,
+ mediaKey: msg.mediaKey,
+ mediaKeyTimestamp: msg.mediaKeyTimestamp,
+ type: msg.type,
+ signal: (new AbortController).signal
+ });
+
+ const data = window.WWebJS.arrayBufferToBase64(decryptedMedia);
+
+ return {
+ data,
+ mimetype: msg.mimetype,
+ filename: msg.filename
+ };
+ } catch (e) {
+ if(e.status && e.status === 404) return undefined;
+ throw e;
+ }
}, this.id._serialized);
if (!result) return undefined;
@@ -466,7 +482,7 @@ module.exports = Message;
diff --git a/docs/structures_MessageMedia.js.html b/docs/structures_MessageMedia.js.html
index 7cfc33b..9fc4bda 100644
--- a/docs/structures_MessageMedia.js.html
+++ b/docs/structures_MessageMedia.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.13.2 » Source: structures/MessageMedia.js
+ whatsapp-web.js 1.14.0 » Source: structures/MessageMedia.js
@@ -15,7 +15,7 @@
@@ -34,6 +34,8 @@
const fs = require('fs');
const path = require('path');
const mime = require('mime');
+const fetch = require('node-fetch');
+const { URL } = require('url');
/**
* Media attached to a message
@@ -74,6 +76,56 @@ class MessageMedia {
return new MessageMedia(mimetype, b64data, filename);
}
+
+ /**
+ * Creates a MessageMedia instance from a URL
+ * @param {string} url
+ * @param {Object} [options]
+ * @param {number} [options.unsafeMime=false]
+ * @param {object} [options.client]
+ * @param {object} [options.reqOptions]
+ * @param {number} [options.reqOptions.size=0]
+ * @returns {Promise<MessageMedia>}
+ */
+ static async fromUrl(url, options = {}) {
+ let mimetype;
+
+ if (!options.unsafeMime) {
+ const pUrl = new URL(url);
+ mimetype = mime.getType(pUrl.pathname);
+
+ if (!mimetype)
+ throw new Error('Unable to determine MIME type');
+ }
+
+ async function fetchData (url, options) {
+ const reqOptions = Object.assign({ headers: { accept: 'image/* video/* text/* audio/*' } }, options);
+ const response = await fetch(url, reqOptions);
+ const mime = response.headers.get('Content-Type');
+ let data = '';
+
+ if (response.buffer) {
+ data = (await response.buffer()).toString('base64');
+ } else {
+ const bArray = new Uint8Array(await response.arrayBuffer());
+ bArray.forEach((b) => {
+ data += String.fromCharCode(b);
+ });
+ data = btoa(data);
+ }
+
+ return { data, mime };
+ }
+
+ const res = options.client
+ ? (await options.client.pupPage.evaluate(fetchData, url, options.reqOptions))
+ : (await fetchData(url, options.reqOptions));
+
+ if (!mimetype)
+ mimetype = res.mime;
+
+ return new MessageMedia(mimetype, res.data, null);
+ }
}
module.exports = MessageMedia;
@@ -86,7 +138,7 @@ module.exports = MessageMedia;
diff --git a/docs/structures_Order.js.html b/docs/structures_Order.js.html
index fb993df..aeb36a4 100644
--- a/docs/structures_Order.js.html
+++ b/docs/structures_Order.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.13.2 » Source: structures/Order.js
+ whatsapp-web.js 1.14.0 » Source: structures/Order.js
@@ -15,7 +15,7 @@
@@ -90,7 +90,7 @@ module.exports = Order;
diff --git a/docs/structures_PrivateChat.js.html b/docs/structures_PrivateChat.js.html
index c79041c..1f63721 100644
--- a/docs/structures_PrivateChat.js.html
+++ b/docs/structures_PrivateChat.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.13.2 » Source: structures/PrivateChat.js
+ whatsapp-web.js 1.14.0 » Source: structures/PrivateChat.js
@@ -15,7 +15,7 @@
@@ -51,7 +51,7 @@ module.exports = PrivateChat;
diff --git a/docs/structures_PrivateContact.js.html b/docs/structures_PrivateContact.js.html
index f81a496..435c190 100644
--- a/docs/structures_PrivateContact.js.html
+++ b/docs/structures_PrivateContact.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.13.2 » Source: structures/PrivateContact.js
+ whatsapp-web.js 1.14.0 » Source: structures/PrivateContact.js
@@ -15,7 +15,7 @@
@@ -51,7 +51,7 @@ module.exports = PrivateContact;
diff --git a/docs/structures_Product.js.html b/docs/structures_Product.js.html
index 6ea5f83..0fd3bfb 100644
--- a/docs/structures_Product.js.html
+++ b/docs/structures_Product.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.13.2 » Source: structures/Product.js
+ whatsapp-web.js 1.14.0 » Source: structures/Product.js
@@ -15,7 +15,7 @@
@@ -106,7 +106,7 @@ module.exports = Product;
diff --git a/docs/structures_ProductMetadata.js.html b/docs/structures_ProductMetadata.js.html
index d089b9e..4ef90aa 100644
--- a/docs/structures_ProductMetadata.js.html
+++ b/docs/structures_ProductMetadata.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.13.2 » Source: structures/ProductMetadata.js
+ whatsapp-web.js 1.14.0 » Source: structures/ProductMetadata.js
@@ -15,7 +15,7 @@
@@ -63,7 +63,7 @@ module.exports = ProductMetadata;
diff --git a/docs/util_Constants.js.html b/docs/util_Constants.js.html
index 351dc2b..8692424 100644
--- a/docs/util_Constants.js.html
+++ b/docs/util_Constants.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.13.2 » Source: util/Constants.js
+ whatsapp-web.js 1.14.0 » Source: util/Constants.js
@@ -15,7 +15,7 @@
@@ -81,7 +81,8 @@ exports.Events = {
QR_RECEIVED: 'qr',
DISCONNECTED: 'disconnected',
STATE_CHANGED: 'change_state',
- BATTERY_CHANGED: 'change_battery'
+ BATTERY_CHANGED: 'change_battery',
+ INCOMING_CALL: 'incoming_call'
};
/**
@@ -178,7 +179,7 @@ exports.MessageAck = {
diff --git a/docs/util_InterfaceController.js.html b/docs/util_InterfaceController.js.html
index 3d9afe3..1c18ff1 100644
--- a/docs/util_InterfaceController.js.html
+++ b/docs/util_InterfaceController.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.13.2 » Source: util/InterfaceController.js
+ whatsapp-web.js 1.14.0 » Source: util/InterfaceController.js
@@ -15,7 +15,7 @@
@@ -160,7 +160,7 @@ module.exports = InterfaceController;
diff --git a/docs/util_Util.js.html b/docs/util_Util.js.html
index 36072ab..9063a69 100644
--- a/docs/util_Util.js.html
+++ b/docs/util_Util.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.13.2 » Source: util/Util.js
+ whatsapp-web.js 1.14.0 » Source: util/Util.js
@@ -15,7 +15,7 @@
@@ -214,9 +214,9 @@ class Util {
let jsonBuffer = Buffer.from(JSON.stringify(json), 'utf8');
let exif = Buffer.concat([exifAttr, jsonBuffer]);
exif.writeUIntLE(jsonBuffer.length, 14, 4);
- await img.loadBuffer(Buffer.from(webpMedia.data, 'base64'));
+ await img.load(Buffer.from(webpMedia.data, 'base64'));
img.exif = exif;
- webpMedia.data = (await img.saveBuffer()).toString('base64');
+ webpMedia.data = (await img.save(null)).toString('base64');
}
return webpMedia;
@@ -242,7 +242,7 @@ module.exports = Util;
diff --git a/package.json b/package.json
index e881dde..53ab1ad 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "whatsapp-web.js",
- "version": "1.13.2",
+ "version": "1.14.0",
"description": "Library for interacting with the WhatsApp Web API ",
"main": "./index.js",
"typings": "./index.d.ts",