-
-
Notifications
You must be signed in to change notification settings - Fork 133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
deleteMessage in group chat #1452
Comments
@icleitoncosta Could you please test if deleting messages (normal chat & groups) still works on your side? Thank you in advance. |
@loic-hamdi , could you post the example of code that you are using? |
I use this package https://pub.dev/packages/whatsapp_bot_flutter that is basically a communication bridge between Dart and wa-js. The dart code in the package is as follow: /// Delete message
/// Set revoke: true if you want to delete for everyone in group chat
Future deleteMessage({
required String phone,
required String messageId,
bool deleteMediaInDevice = false,
bool revoke = false,
}) async {
return await wpClient.evaluateJs(
'''WPP.chat.deleteMessage(${phone.phoneParse},${messageId.jsParse}, $deleteMediaInDevice, $revoke);''',
methodName: "deleteMessage",
);
} The JS equivalent as you can see is: If I try to delete a message in a group: Future<dynamic> deleteMessageInGroup(WhatsappClient client, Message message) async {
final messageId = message.id!.serialized;
final phone = message.id!.serialized.split('_').last;
final r = await executeWAFunction(() => client.chat.deleteMessage(phone: phone, messageId: messageId, deleteMediaInDevice: true, revoke: true));
return r;
} The future (promise in JS) returns this error message: |
@edgardmessias Did you have a chance to look at it? |
Hello, the functions are working fine within WAJS. I don't have knowledge of Flutter or Dart, as I've never used these languages. However, wouldn't the error be related to phoneParse and jsParse, perhaps? |
Hi, For some reasons I can't delete messages in group chat anymore.
Is it still working on your side?
Where do you get the data from for:
chatId
andid
?https://github.com/wppconnect-team/wa-js/blob/main/src/chat/functions/deleteMessage.ts#L47
https://wppconnect.io/wa-js/functions/chat.deleteMessage.html
The text was updated successfully, but these errors were encountered: