Closed Riders004 closed 2 weeks ago
@PurpShell @SheIITear any idea ?
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!!
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
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
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:
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
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
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:
I'll got it
await sock.updateProfilePicture(jid, { url: './new-profile-picture.jpeg' })
Not working