Closed victorfreire100 closed 5 months ago
Same problem here.
"create({ session: 'chat-bot', disableWelcome: true, }).then(async (client: Whatsapp) => { client.onMessage(async (message: Message) => { if (message.type === 'image' && message.caption === '/sticker') { try { const buffer = await client.decryptFile(message);
if (buffer) {
const fileExtension = message.mimetype.split('/')[1];
const fileName = `temp-image.${fileExtension}`;
const outputPath = path.join('C:\\Users\\bruno\\Desktop\\bruno bot\\downloaded-media', fileName);
await fs.promises.writeFile(outputPath, buffer);
const outputPathPNG = path.join('C:\\Users\\b\\Desktop\\bot\\downloaded-media', 'temp-image.png');
await sharp(outputPath)
.resize(512, 512) .png() .toFile(outputPathPNG);
await client .sendImageAsSticker(message.from, outputPathPNG) .then((result) => { console.log('Result: ', result); }) .catch((error) => { console.error('Error when sending: ', error); });
fs.unlinkSync(outputPath);
fs.unlinkSync(outputPathPNG);
}
} catch (err) {
console.error('Error processing the image:', err);
}"
For some reason the sticker only appears on Whatsappweb. I'm using "venom-bot": "^5.0.21". ;
"import { ChatCompletionRequestMessage, ChatCompletionRequestMessageRoleEnum } from 'openai'; import { create, Whatsapp, Message } from 'venom-bot'; import { openai } from './lib/openai'; import fs from 'fs'; import path from 'path'; const sharp: any = require('sharp');"
Same here sticker sending is not working.
some here, sticker cant be download
New Release: npm i venom-bot@5.1.0
We have support for Venom for just $15 per month, if you are interested, call our support via the link: https://web.whatsapp.com/send?phone=5561985290357
This is my code: case '!s': if (isMedia || quotedMsg) { const msgData = isMedia ? message : quotedMsg; var stickerMetadata = { author: process.env.NOME_AUTOR_FIGURINHAS.trim(), pack:
${process.env.NOME_AUTOR_FIGURINHAS.trim()} Stickers
, keepScale: true, circle: false, discord: "155111" } console.log(process.env.NOME_AUTOR_FIGURINHAS)The problem is: The sticker on WhatsApp web appears normally, but on the cell phone it says that it is not valid according to the screenshot. Another problem is that you are not getting the titles for the sticker. Maybe this is the reason?