mirror of
https://github.com/cheveguerra/whatsapp-web.js.git
synced 2026-04-18 03:29:14 +00:00
Return new message after sending
This commit is contained in:
@@ -138,9 +138,12 @@ class Client extends EventEmitter {
|
||||
* @param {string} message
|
||||
*/
|
||||
async sendMessage(chatId, message) {
|
||||
await this.pupPage.evaluate((chatId, message) => {
|
||||
Store.SendMessage(Store.Chat.get(chatId), message);
|
||||
}, chatId, message)
|
||||
const newMessage = await this.pupPage.evaluate(async (chatId, message) => {
|
||||
const msg = await WWebJS.sendMessage(Store.Chat.get(chatId), message);
|
||||
return msg.serialize();
|
||||
}, chatId, message);
|
||||
|
||||
return new Message(this, newMessage);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user