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

downloadMedia() fails the first time for stickers only #3397

Open
2 tasks done
GiamBoscaro opened this issue Nov 30, 2024 · 0 comments
Open
2 tasks done

downloadMedia() fails the first time for stickers only #3397

GiamBoscaro opened this issue Nov 30, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@GiamBoscaro
Copy link

Is there an existing issue for this?

  • I have searched the existing issues.

Is this a problem caused by your code, or is it specifically because of the library?

  • I have double-checked my code carefully.

Describe the bug.

When seeding a sticker, downloadMedia() aways returns undefined the sticker was never sent before. All the subsequent times, downloadMedia() returns the media correctly.

Expected Behavior

msg.downloadMedia() should work the first time a new sticker is sent.

Steps to Reproduce the Bug or Issue

client.on('message', async (msg) => {
    if (msg.hasMedia) {
        const media = await msg.downloadMedia();
    }
});

Send a sticker and verify the content of media

WhatsApp Account Type

Standard

Browser Type

Google Chrome

Operation System Type

Windows 11

Phone OS Type

Android

WhatsApp-Web.js Version

v1.26.1-alpha.3

WhatsApp Web Version

2.3000.1014654584

Node.js Version

18

Authentication Strategy

LocalAuth

Additional Context

Adding a 500ms delay before download media solves the problem. But why is this necessary?

@GiamBoscaro GiamBoscaro added the bug Something isn't working label Nov 30, 2024
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

No branches or pull requests

1 participant