Skip to content

Commit

Permalink
Merge pull request #8 from sambatpeople/new
Browse files Browse the repository at this point in the history
added clear message
  • Loading branch information
DikaArdnt authored Apr 16, 2024
2 parents b93232f + dfbd4aa commit 7d16eaa
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/Client.js
Original file line number Diff line number Diff line change
Expand Up @@ -863,6 +863,18 @@ class Client extends EventEmitter {
}, chatId);
}

/**
* Clears the chat history.
*
* @param {string} chatId The ID of the chat to be cleared.
*/

async clearMessage(chatId) {
await this.playPage.evaluate(async chatId => {
await window.WPP.chat.clear(chatId);
}, chatId);
}

/**
* Returns the contact ID's profile picture URL, if privacy settings allow it
* @param {string} contactId the whatsapp user's ID
Expand Down Expand Up @@ -1343,4 +1355,4 @@ class Client extends EventEmitter {
}
}

module.exports = Client;
module.exports = Client;

0 comments on commit 7d16eaa

Please sign in to comment.