Open alechkos opened 1 month ago
Fix for the Message.delete function.
Message.delete
The PR fixes an issue where the delete function does not delete messages.
delete
Also was added a possibility to pass a second boolean value into the function for clearing media in the device (true by default).
true
closes #3245
// client initialization... client.on('message', async (message) => { const sender = 'XXXXXXXXXXX@c.us'; if (message?.author === sender || message?.from === sender) { // delete for everyone: true, clear media in device: true (by default) await message.delete(true); // delete for everyone: true, clear media in device: false await message.delete(true, false); // delete for everyone: false, clear media in device: true (by default) await message.delete(false); // delete for everyone: false, clear media in device: false await message.delete(false, false); } });
Everything works as expected.
npm install github:alechkos/whatsapp-web.js#fix-delete-msg
yarn add github:alechkos/whatsapp-web.js#fix-delete-msg
PR Details
Fix for the
Message.delete
function.Description
The PR fixes an issue where the
delete
function does not delete messages.Also was added a possibility to pass a second boolean value into the function for clearing media in the device (
true
by default).Related Issue
closes #3245
How Has This Been Tested
Everything works as expected.
You can try the fix by running one of the following commands:
Types of changes
Checklist