From bf0fe8496cb090091aecd88ce9339e6bde82147e Mon Sep 17 00:00:00 2001 From: Pedro Lopez Date: Wed, 29 May 2019 22:42:43 -0400 Subject: [PATCH] [FIX] Use WhatsApp's new sendTextMsgToChat function for sending messages --- src/Client.js | 2 +- src/util/Injected.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Client.js b/src/Client.js index 5a12869..1b01e77 100644 --- a/src/Client.js +++ b/src/Client.js @@ -138,7 +138,7 @@ class Client extends EventEmitter { */ async sendMessage(chatId, message) { await this.pupPage.evaluate((chatId, message) => { - Store.Chat.get(chatId).sendMessage(message); + Store.SendMessage(Store.Chat.get(chatId), message); }, chatId, message) } diff --git a/src/util/Injected.js b/src/util/Injected.js index 819291a..20f14fb 100644 --- a/src/util/Injected.js +++ b/src/util/Injected.js @@ -161,6 +161,7 @@ exports.ExposeStore = () => { } window.Store = window.mR.findModule("Conn")[0].default; + window.Store.SendMessage = window.mR.findModule("sendTextMsgToChat")[0].sendTextMsgToChat; } /**