Closed jasp402 closed 3 years ago
I think it can be implemented as a separate function like WAPI.sendSticker()
. Let me look into that.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I am currently trying to get this function working ... I will comment on how much I can make it work
/**
* Send Image As Sticker
* @param {*} imageBase64 A valid webp image is required.
* @param {*} chatId '000000000000@c.us'
* @param metadata about the image. Based on [sharp metadata](https://sharp.pixelplumbing.com/api-input#metadata)
*/
window.WAPI.sendImageAsSticker = async function (imageBase64,chatId, metadata) {
let mediaBlob = await window.WAPI.base64ImageToFile(
'data:image/webp;base64,'+imageBase64,
'file.webp'
);
let encrypted = await window.WAPI.encryptAndUploadFile("sticker", mediaBlob);
return await window.WAPI._sendSticker(encrypted, chatId, metadata);
};
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I have tried to send it the same as an image in (.webp) format. using the
WAPI.sendImage()
function however it sends it as an image. How can I send it but as stickers?