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

[BUG] Profile Picture #1067

Open
Riders004 opened this issue Sep 29, 2024 · 7 comments
Open

[BUG] Profile Picture #1067

Riders004 opened this issue Sep 29, 2024 · 7 comments
Labels
bug Something isn't working

Comments

@Riders004
Copy link

await sock.updateProfilePicture(jid, { url: './new-profile-picture.jpeg' })

Not working

@Riders004 Riders004 added the bug Something isn't working label Sep 29, 2024
@Riders004
Copy link
Author

@PurpShell @SheIITear any idea ?

@dimasmpp130
Copy link

dimasmpp130 commented Sep 29, 2024

I have a solution to use the feature from sock.updateProfilePicture(jid, { url: './new-profile-picture.jpeg' }) , maybe in the current baileys version it doesn't work due to an error with the system code "408 error timeout"

You can use it with your eval bot for the case version, please tinker with it yourself. I'm just sharing, here is an example of the code I use:

const { S_WHATSAPP_NET } = require("@whiskeysockets/baileys");

const buffer = await mastahyabang.downloadAndSaveMediaMessage(quoted)
var { img } = await generateProfilePicture(buffer)
await mastahyabang.query({
tag: 'iq',
attrs: {
// target: '0',
to: S_WHATSAPP_NET,
type: 'set',
xmlns: 'w:profile:picture'
},
content: [
{
tag: 'picture',
attrs: { type: 'image' },
content: img
}
]
})
fs.unlinkSync(buffer)
mek.reply(Sukses)

Note:
if there is a sign like "//" don't delete it, for example if you delete the code it won't work and for the "generateProfilePicture" code it's just the default function code from my bot, not from baileys directly

This code works on the previous and latest versions of Baileys, please try the code if it works for you. I have tested it myself and the results work well without errors, thank you!!

@Riders004
Copy link
Author

Riders004 commented Sep 30, 2024

I have a solution to use the feature from sock.updateProfilePicture(jid, { url: './new-profile-picture.jpeg' }) , maybe in the current baileys version it doesn't work due to an error with the system code "408 error timeout"

You can use it with your eval bot for the case version, please tinker with it yourself. I'm just sharing, here is an example of the code I use:

const { S_WHATSAPP_NET } = require("@whiskeysockets/baileys");

const buffer = await mastahyabang.downloadAndSaveMediaMessage(quoted) var { img } = await generateProfilePicture(buffer) await mastahyabang.query({ tag: 'iq', attrs: { // target: '0', to: S_WHATSAPP_NET, type: 'set', xmlns: 'w:profile:picture' }, content: [ { tag: 'picture', attrs: { type: 'image' }, content: img } ] }) fs.unlinkSync(buffer) mek.reply(Sukses)

Note: if there is a sign like "//" don't delete it, for example if you delete the code it won't work and for the "generateProfilePicture" code it's just the default function code from my bot, not from baileys directly

This code works on the previous and latest versions of Baileys, please try the code if it works for you. I have tested it myself and the results work well without errors, thank you!!

Code of generateProfilePicture ?

And here to: S_WHATSAPP_NET, it's need a jid I'd but there's is s_whatsapp_net it's work only for our profile picture but not for group

// target: '0', is commented so by default bot can't run it

@Riders004
Copy link
Author

I have a solution to use the feature from sock.updateProfilePicture(jid, { url: './new-profile-picture.jpeg' }) , maybe in the current baileys version it doesn't work due to an error with the system code "408 error timeout"

You can use it with your eval bot for the case version, please tinker with it yourself. I'm just sharing, here is an example of the code I use:

const { S_WHATSAPP_NET } = require("@whiskeysockets/baileys");

const buffer = await mastahyabang.downloadAndSaveMediaMessage(quoted) var { img } = await generateProfilePicture(buffer) await mastahyabang.query({ tag: 'iq', attrs: { // target: '0', to: S_WHATSAPP_NET, type: 'set', xmlns: 'w:profile:picture' }, content: [ { tag: 'picture', attrs: { type: 'image' }, content: img } ] }) fs.unlinkSync(buffer) mek.reply(Sukses)

Note: if there is a sign like "//" don't delete it, for example if you delete the code it won't work and for the "generateProfilePicture" code it's just the default function code from my bot, not from baileys directly

This code works on the previous and latest versions of Baileys, please try the code if it works for you. I have tested it myself and the results work well without errors, thank you!!

@dimasmpp130

@ImYanXiao
Copy link

I have a solution to use the feature from sock.updateProfilePicture(jid, { url: './new-profile-picture.jpeg' }) , maybe in the current baileys version it doesn't work due to an error with the system code "408 error timeout"
You can use it with your eval bot for the case version, please tinker with it yourself. I'm just sharing, here is an example of the code I use:
const { S_WHATSAPP_NET } = require("@whiskeysockets/baileys");
const buffer = await mastahyabang.downloadAndSaveMediaMessage(quoted) var { img } = await generateProfilePicture(buffer) await mastahyabang.query({ tag: 'iq', attrs: { // target: '0', to: S_WHATSAPP_NET, type: 'set', xmlns: 'w:profile:picture' }, content: [ { tag: 'picture', attrs: { type: 'image' }, content: img } ] }) fs.unlinkSync(buffer) mek.reply(Sukses)
Note: if there is a sign like "//" don't delete it, for example if you delete the code it won't work and for the "generateProfilePicture" code it's just the default function code from my bot, not from baileys directly
This code works on the previous and latest versions of Baileys, please try the code if it works for you. I have tested it myself and the results work well without errors, thank you!!

@dimasmpp130

if you use it to change the group profile then target: group jid is what you want to change, whereas if you want to use it for the bot number itself, delete target:

@Salientekill
Copy link

I have a solution to use the feature from sock.updateProfilePicture(jid, { url: './new-profile-picture.jpeg' }) , maybe in the current baileys version it doesn't work due to an error with the system code "408 error timeout"

You can use it with your eval bot for the case version, please tinker with it yourself. I'm just sharing, here is an example of the code I use:

const { S_WHATSAPP_NET } = require("@whiskeysockets/baileys");

const buffer = await mastahyabang.downloadAndSaveMediaMessage(quoted) var { img } = await generateProfilePicture(buffer) await mastahyabang.query({ tag: 'iq', attrs: { // target: '0', to: S_WHATSAPP_NET, type: 'set', xmlns: 'w:profile:picture' }, content: [ { tag: 'picture', attrs: { type: 'image' }, content: img } ] }) fs.unlinkSync(buffer) mek.reply(Sukses)

Note: if there is a sign like "//" don't delete it, for example if you delete the code it won't work and for the "generateProfilePicture" code it's just the default function code from my bot, not from baileys directly

This code works on the previous and latest versions of Baileys, please try the code if it works for you. I have tested it myself and the results work well without errors, thank you!!

Error: No image processing library available

@viniciuscenci
Copy link

I have a solution to use the feature from sock.updateProfilePicture(jid, { url: './new-profile-picture.jpeg' }) , maybe in the current baileys version it doesn't work due to an error with the system code "408 error timeout"
You can use it with your eval bot for the case version, please tinker with it yourself. I'm just sharing, here is an example of the code I use:
const { S_WHATSAPP_NET } = require("@whiskeysockets/baileys");
const buffer = await mastahyabang.downloadAndSaveMediaMessage(quoted) var { img } = await generateProfilePicture(buffer) await mastahyabang.query({ tag: 'iq', attrs: { // target: '0', to: S_WHATSAPP_NET, type: 'set', xmlns: 'w:profile:picture' }, content: [ { tag: 'picture', attrs: { type: 'image' }, content: img } ] }) fs.unlinkSync(buffer) mek.reply(Sukses)
Note: if there is a sign like "//" don't delete it, for example if you delete the code it won't work and for the "generateProfilePicture" code it's just the default function code from my bot, not from baileys directly
This code works on the previous and latest versions of Baileys, please try the code if it works for you. I have tested it myself and the results work well without errors, thank you!!

Error: No image processing library available

npm i sharp

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

5 participants