Open adithyan-hermit opened 2 months ago
This error occurs when the account does not have a profile picture. In this case, I recommend catching the error and either returning false
or generating a thumbnail for the user.
See example what i use:
async get_avatar(){
const ppUrl = await this.WASocket.profilePictureUrl(this.WASocket.user?.id ?? '').then((ppUrl) => ppUrl)
.catch((ex) => {
return random_avatar_byname(this.WASocket.user?.name);
});
return ppUrl;
}
This error occurs when the account does not have a profile picture. In this case, I recommend catching the error and either returning
false
or generating a thumbnail for the user.See example what i use:
async get_avatar(){ const ppUrl = await this.WASocket.profilePictureUrl(this.WASocket.user?.id ?? '').then((ppUrl) => ppUrl) .catch((ex) => { return random_avatar_byname(this.WASocket.user?.name); }); return ppUrl; }
Ya but it's only working when get my own jid profile not working of others jid. (Who has profile)
Use latest version of baileys, it should have been fixed in #901
Use latest version of baileys, it should have been fixed in #901
Already using baileys 6.7.7
I have the same issue, not with all profile pictures but alot give back an error. The error is different from the error that it gives when there is no profile picture.
Describe the bug A clear and concise description of what the bug is.
To Reproduce Steps to reproduce the behavior:
Expected behavior A clear and concise description of what you expected to happen.
Environment (please complete the following information):
connectOptions
look like? NormalAdditional context Add any other context about the problem here.
Error: bad-request at assertNodeErrorFree (/root/hermit-bot/node_modules/@WhiskeySockets/baileys/lib/WABinary/generic-utils.js:56:15) at query (/root/hermit-bot/node_modules/@WhiskeySockets/baileys/lib/Socket/socket.js:145:48) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async Object.profilePictureUrl (/root/hermit-bot/node_modules/@WhiskeySockets/baileys/lib/Socket/chats.js:442:24) { data: 400, isBoom: true, isServer: true, output: { statusCode: 500, payload: { statusCode: 500, error: 'Internal Server Error', message: 'An internal server error occurred' }, headers: {} } }