You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi! How are you? Can you tell me how to autosize the images? I'm using a whatsapp bot to make stickers, but If I don't receive an 1:1 relation image, the bot autosizes so ugly.
Hi! How are you? Can you tell me how to autosize the images? I'm using a whatsapp bot to make stickers, but If I don't receive an 1:1 relation image, the bot autosizes so ugly.
The current code is:
if (messageType == MessageType.image && m.message.imageMessage.url && ((m.message.imageMessage.caption == "!sticker") || (m.message.imageMessage.caption == "!Sticker"))) {
let imageBuffer = await conn.downloadMediaMessage(m);
let sticker = await imageminWebp({ preset: "icon" } })(imageBuffer);
await conn.sendMessage(m.key.remoteJid, sticker, MessageType.sticker);
console.log("Sticker enviado a : " + m.key.remoteJid);
}
I tried:
let sticker = await imageminWebp({ preset: "icon", crop: {x:512,y:512, width:512, height:512 } })(imageBuffer); await conn.sendMessage(m.key.remoteJid, sticker, MessageType.sticker);
but throws:
UnhandledPromiseRejectionWarning: Error: Error! Cannot crop picture
Can you help me? Thank you!
The text was updated successfully, but these errors were encountered: