From 4e324b140f111b2e5c3cba229c4100222e880e51 Mon Sep 17 00:00:00 2001 From: Shir Serlui <70711723+shirser121@users.noreply.github.com> Date: Mon, 15 Aug 2022 12:08:32 +0300 Subject: [PATCH] Use JSON parse and stringify instead of serialize (#1653) When puppeteer try to return serialized message with buttons, we get undefined instead of the message object, because the message serialized is not a JSON compatible (because of the buttons class) --- src/Client.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Client.js b/src/Client.js index b36eb96..f0f3b53 100644 --- a/src/Client.js +++ b/src/Client.js @@ -693,7 +693,7 @@ class Client extends EventEmitter { } const msg = await window.WWebJS.sendMessage(chat, message, options, sendSeen); - return msg.serialize(); + return JSON.parse(JSON.stringify(msg)); }, chatId, content, internalOptions, sendSeen); return new Message(this, newMessage);