WhiskeySockets / Baileys

Lightweight full-featured typescript/javascript WhatsApp Web API
https://baileys.whiskeysockets.io/
MIT License
4.03k stars 1.37k forks source link

[BUG] conn.updateProfilePicture not working anymore #694

Open AKAZAMD opened 7 months ago

AKAZAMD commented 7 months ago

I want to change the profile with the code below case "setbotphoto": { let bot = conn.user.jid // Bot let q = m.quoted ? m.quoted : m let img = await q.download() if (!img) return reply('Fotonya Gak Ada Kak ┰ω┰') await conn.updateProfilePicture(bot, img) conn.sendText(m.chat, 'Selesai Mengganti Profil Bot Kak>ω<!', m) } break but I never got a response Error: Timed Out at /storage/emulated/0/al botz md/node_modules/@whiskeysockets/baileys/lib/Utils/generics.js:137:32 { data: { stack: 'Error\n' + ' at promiseTimeout (/storage/emulated/0/al botz md/node_modules/@whiskeysockets/baileys/lib/Utils/generics.js:132:19)\n' + ' at waitForMessage (/storage/emulated/0/al botz md/node_modules/@whiskeysockets/baileys/lib/Socket/socket.js:114:53)\n' + ' at query (/storage/emulated/0/al botz md/node_modules/@whiskeysockets/baileys/lib/Socket/socket.js:136:22)\n' + ' at Object.updateProfilePicture (/storage/emulated/0/al botz md/node_modules/@whiskeysockets/baileys/lib/Socket/chats.js:176:15)\n' + ' at async conn (/storage/emulated/0/al botz md/alan.js:953:9)' }, isBoom: true, isServer: false, output: { statusCode: 408, payload: { statusCode: 408, error: 'Request Time-out', message: 'Timed Out' }, headers: {} } } and after the error I tried directly with the bot number but it was the same

mrfzvx12 commented 7 months ago

I want to change the profile with the code below case "setbotphoto": { let bot = conn.user.jid // Bot let q = m.quoted ? m.quoted : m let img = await q.download() if (!img) return reply('Fotonya Gak Ada Kak ┰ω┰') await conn.updateProfilePicture(bot, img) conn.sendText(m.chat, 'Selesai Mengganti Profil Bot Kak>ω<!', m) } break but I never got a response Error: Timed Out at /storage/emulated/0/al botz md/node_modules/@whiskeysockets/baileys/lib/Utils/generics.js:137:32 { data: { stack: 'Error\n' + ' at promiseTimeout (/storage/emulated/0/al botz md/node_modules/@whiskeysockets/baileys/lib/Utils/generics.js:132:19)\n' + ' at waitForMessage (/storage/emulated/0/al botz md/node_modules/@whiskeysockets/baileys/lib/Socket/socket.js:114:53)\n' + ' at query (/storage/emulated/0/al botz md/node_modules/@whiskeysockets/baileys/lib/Socket/socket.js:136:22)\n' + ' at Object.updateProfilePicture (/storage/emulated/0/al botz md/node_modules/@whiskeysockets/baileys/lib/Socket/chats.js:176:15)\n' + ' at async conn (/storage/emulated/0/al botz md/alan.js:953:9)' }, isBoom: true, isServer: false, output: { statusCode: 408, payload: { statusCode: 408, error: 'Request Time-out', message: 'Timed Out' }, headers: {} } } and after the error I tried directly with the bot number but it was the same

you should use conn.user.id

AKAZAMD commented 5 months ago

Saya ingin mengubah profil dengan kode di bawah case "setbotphoto": { let bot = conn.user.jid // Bot let q = m.quoted ? m.quoted : m let img = menunggu q.download() if (!img) return reply('Fotonya Gak Ada Kak ┰ω┰ ') menunggu conn.updateProfilePicture(bot, img) conn.sendText(m.chat, ' Selesai Mengganti Profil Bot Kak>ω<!', m) } break tapi saya tidak pernah mendapat respon Error: Timed Out at /storage/emulated/0/al botz md/node_modules/@whiskeysockets/baileys/lib/Utils/ generics.js:137:32 { data: { tumpukan: 'Kesalahan\n' + ' di janjiTimeout (/storage/emulated/0/al botz md/node_modules/@whiskeysockets/baileys/lib/Utils/generics.js:132 :19)\n' + ' di waitForMessage (/storage/emulated/0/al botz md/node_modules/@whiskeysockets/baileys/lib/Socket/socket.js:114:53)\n' + ' di kueri (/ penyimpanan/emulasi/0/al botz md/node_modules/@whiskeysockets/baileys/lib/Socket/socket.js:136:22)\n' + ' di Object.updateProfilePicture (/storage/emulated/0/al botz md/ node_modules/@whiskeysockets/baileys/lib/Socket/chats.js:176:15)\n' + ' di async conn (/storage/emulated/0/al botz md/alan.js:953:9)' }, isBoom: true, isServer: false, output: { statusCode: 408, payload: { statusCode: 408, error: 'Request Time-out', message: 'Timed Out' }, headers: {} } } dan setelah kesalahan I dicoba langsung dengan nomor botnya tapi tetap sama

anda harus menggunakan conn.user.id

actually I have found another way with a query but now for some reason jimp error to crop the photo

Booitt commented 1 month ago
Error: Timed Out
    at /home/blitz/blitzcrank-baileys/node_modules/@whiskeysockets/baileys/lib/Utils/generics.js:145:32 {
  data: {
    stack: 'Error\n' +
      '    at promiseTimeout (/home/blitz/blitzcrank-baileys/node_modules/@whiskeysockets/baileys/lib/Utils/generics.js:140:19)\n' +
      '    at waitForMessage (/home/blitz/blitzcrank-baileys/node_modules/@whiskeysockets/baileys/lib/Socket/socket.js:119:53)\n' +
      '    at query (/home/blitz/blitzcrank-baileys/node_modules/@whiskeysockets/baileys/lib/Socket/socket.js:141:22)\n' +
      '    at Object.updateProfilePicture (/home/blitz/blitzcrank-baileys/node_modules/@whiskeysockets/baileys/lib/Socket/chats.js:187:15)'
  },
  isBoom: true,
  isServer: false,
  output: {
    statusCode: 408,
    payload: {
      statusCode: 408,
      error: 'Request Time-out',
      message: 'Timed Out'
    },
    headers: {}
  }
}

Code:

msg._sock.updateProfilePicture(jid, {
    url: path.join(__dirname, "../media/", IMAGE_ON)
})

Same here. Is there any update on this problem?

Edit:

I updated everything and it's working now.