Open chauhanshivam079 opened 2 years ago
Could you share a relevant code snippet and the image/video which you were converting?
const stream = await downloadContentFromMessage( msg.videoMessage, "video" ); let buffer = Buffer.from([]); for await (const chunk of stream) { buffer = Buffer.concat([buffer, chunk]); } let randomName = (Math.random() + 1).toString(36).substring(7); fileName =
Media/stickers/${randomName}.mp4
; await writeFile(fileName, buffer); }
const sticker = new Sticker(fileName, {
pack: "I-Bot Stickers", // The pack name
author: "I-Bot", // The author name
type: StickerTypes.CROP, // The sticker type
categories: ["🤩", "🎉"], // The sticker category
id: "12345", // The sticker id
quality: 50, // The quality of the output file
});
await sock.sendMessage(chatId, await sticker.toMessage());
}
Thanks, I'll get back to you in a while
It worked for me. Are you on the latest version of WSF?
Thank you for the code. It worked for me.
not able to convert video to a sticker @AlenSaito1