Skip to content
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

message.delete() is not working #3245

Open
1 task done
krajasekhar opened this issue Aug 17, 2024 · 4 comments · May be fixed by #3301
Open
1 task done

message.delete() is not working #3245

krajasekhar opened this issue Aug 17, 2024 · 4 comments · May be fixed by #3301
Labels
bug Something isn't working

Comments

@krajasekhar
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

I am able to do all other actions successfully but message.delete() is not reflecting anything while it is not even throwing it. It is even able to find the same message when I re-run the script.

Expected behavior

Delete the actual message (for me)

Steps to Reproduce the Bug or Issue

Run a simple snippet, scan qr code and all. Now send the 'TEST MESSAGE' text to your phone. It won't get deleted on the phone or other whatsapp web.
Also applies when I do the same deletion with message after searchMessages or chat.fetchMessages.

Relevant Code

Some simple code to test this:

client.on('message_create', async (message) => {
    try {
        if (message.body === 'TEST MESSAGE') {
            await message.delete();
            await message.reply('Thanks for message, let me come back soon');
        }
    } catch (error) {
        console.error('An error occurred:', error);
    }
});

Browser Type

Chromium

WhatsApp Account Type

Standard

Does your WhatsApp account have multidevice enabled?

Yes, I am using Multi Device

Environment

Mac
iOS
^1.25.0
2.3000.1015762919
v22.6.0

Additional context

No response

@krajasekhar krajasekhar added the bug Something isn't working label Aug 17, 2024
@gamoridev
Copy link

Is this successfuly resolved? @alechkos @krajasekhar
I tried with the latest release v1.26.0 and still happens as described.

I can delete a message for everyone using message.delete(true) but just "for me", nothing happens and I still get the message on chat context and no errors.

@alechkos
Copy link
Collaborator

@gamoridev We will check

@alechkos alechkos reopened this Sep 19, 2024
@krajasekhar
Copy link
Author

I tried ^1.26.0 with both message.delete(true) and message.delete(false) and is still failing to delete the message.

@alechkos alechkos linked a pull request Sep 28, 2024 that will close this issue
6 tasks
@alechkos
Copy link
Collaborator

@krajasekhar, @gamoridev
Fixed here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants