Closed textarea closed 3 years ago
Which function is giving this error? Could you give more details of your problem?
@jonalan7 in my cases is sendImage and sendImageFromBase64
Sorry, I don't have now more details, It could be in sendImageFromBase64 also for me
@textarea I have found the problem. in my case, i tried to use the sendImageFromBase64 ... if you inspect that method, you will see the method Promises a SendFileResult that it's a interface requiring the filename parameter.
Solution: is just pass a filename parameter to the sendImageFromBase64 or sendImage.
I will put my solution here:
let image = '<base64_image>';
let filename = '<filename>';
client.sendImageFromBase64('<your_number>@c.us', image, filename).then(result => {
console.log("Image Sended!")
}).catch(err => {
console.log("Something goes wrong ...")
console.log(err)
})
Description
Sometimes getting the following error in errors log. Don't know how to reproduce.
Environment
Log Output
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined at new NodeError (node:internal/errors:329:5) at validateString (node:internal/validators:129:11) at Object.extname (node:path:1273:5) at Object.filenameFromMimeType (/var/www/node_modules/venom-bot/dist/api/helpers/filename-from-mimetype.js:61:34) at Whatsapp. (/var/www/node_modules/venom-bot/dist/api/layers/sender.layer.js:301:73)
at step (/var/www/node_modules/venom-bot/dist/api/layers/sender.layer.js:48:23)
at Object.next (/var/ww/node_modules/venom-bot/dist/api/layers/sender.layer.js:29:53)
at /var/www/node_modules/venom-bot/dist/api/layers/sender.layer.js:23:71
at new Promise ()
at __awaiter (/var/www/node_modules/venom-bot/dist/api/layers/sender.layer.js:19:12)