From 8e011e023322bfb9047e1b696737eedcba44a1a7 Mon Sep 17 00:00:00 2001 From: Pedro Lopez Date: Sat, 11 Apr 2020 14:59:32 -0400 Subject: [PATCH] feat: get current whatsapp web version --- src/Client.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/Client.js b/src/Client.js index 6dec95cf5..23b308c32 100644 --- a/src/Client.js +++ b/src/Client.js @@ -335,6 +335,17 @@ class Client extends EventEmitter { async destroy() { await this.pupBrowser.close(); } + + /** + * Returns the version of WhatsApp Web currently being run + * @returns Promise + */ + async getWWebVersion() { + return await this.pupPage.evaluate(() => { + return window.Debug.VERSION; + }); + } + /** * Mark as seen for the Chat * @param {string} chatId @@ -348,6 +359,7 @@ class Client extends EventEmitter { }, chatId); return result; } + /** * Send a message to a specific chatId * @param {string} chatId