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

How Can I use getProfilePicUrl to download avatar #1711

Closed
1 task done
ToFaceOne opened this issue Sep 27, 2022 · 2 comments
Closed
1 task done

How Can I use getProfilePicUrl to download avatar #1711

ToFaceOne opened this issue Sep 27, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@ToFaceOne
Copy link

ToFaceOne commented Sep 27, 2022

Is there an existing issue for this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe.

No response

Describe the solution you'd like.

I have used a lot of methods, but I can't download the avatar through getProfilePicUrl,
Because I want to save my avatar locally, I can't download it through Nodejs

I Use #1542

but I can't get base64

pls help me

Describe an alternate solution.

No response

Additional context

image

@ToFaceOne ToFaceOne added the enhancement New feature or request label Sep 27, 2022
@ToFaceOne
Copy link
Author

const url = await client.getProfilePicUrl(chatId); const res = await fetch(url); const data = {data: (await res.arrayBuffer()).toString('base64'), mimetype: res.headers.get('Content-Type')};

this method can't get base64

@PurpShell
Copy link
Sponsor Collaborator

const url = await client.getProfilePicUrl(chatId); const res = await fetch(url); const data = {data: (await res.arrayBuffer()).toString('base64'), mimetype: res.headers.get('Content-Type')};

this method can't get base64

Since this is not an issue with whatsapp-web.js, this means that this shouldn't be discussed here, instead use the Discord server.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants