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)
This commit is contained in:
Shir Serlui
2022-08-15 12:08:32 +03:00
committed by GitHub
parent 4fe001f32f
commit 4e324b140f

View File

@@ -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);