wppconnect-team / wa-js

WPPConnect/WA-JS is an open-source project with the aim of exporting functions from WhatsApp Web
https://wppconnect.io/wa-js/
Apache License 2.0
408 stars 129 forks source link

Nothing happens when using WPP.chat.deleteMessage #2047

Closed Souhaibahar closed 3 months ago

Souhaibahar commented 3 months ago

WA-JS Version

3.4.0

WhatsApp Version

2.3000.1014410277-alpha

Browser Version

Latest Chrome

Operation System

Windows 10

Steps to reproduce

public async Task<bool> DeleteMessage(string contactId, string messageId) { try { await Page.EvaluateFunctionAsync(@"async () => { await WPP.chat.deleteMessage('CONTACT_ID@c.us', 'MESSAGE_ID') }".Replace("CONTACT_ID", contactId).Replace("MESSAGE_ID", messageId)).ConfigureAwait(false); return true; } catch (Exception ex) { Console.WriteLine(ex.ToString()); return false; } } when i call DeleteMessage it return true with no exception , but the message dosen't delete , itried with recent messages and it's same thing

What is expected?

To the message to be deleted

What is actually happening?

Nothing

Any additional comments?

No response

icleitoncosta commented 3 months ago

For delete and revoke msg use:

await WPP.chat.deleteMessage('[number]@c.us', '[msgId@c.us_3EB06A9EC8E5624576163', true, true);
Souhaibahar commented 3 months ago

For delete and revoke msg use:

await WPP.chat.deleteMessage('[number]@c.us', '[msgId@c.us_3EB06A9EC8E5624576163', true, true);

this worked to unsend my own messages ,, but it dosen't delete the message for chat , and only works for the messages i sended and can't delete the messages i received