venom: 'Error to processFiles' when sending a caption and an image using 'sendImageFromBase64' function

Description

i can login normally and it logs in fine. issue happens when i send an image along with a caption using the built in function of venom-bot ‘sendImageFromBase64’. sending fails with error message ‘Error to processFiles’.

Environment

  • **Venom version(s): v5.0.21
  • **Browser: chrome v116.0.5845.96
  • **OS: ubuntu server v22.04
  • **Node version: v18.17.0

Steps to Reproduce

  1. login your whatsapp to venom-bot
  2. send an image and a caption using the function ‘sendImageFromBase64’
  3. get the error

{ erro: true, text: ‘Error to processFiles’, status: 404 }

  1. that’s it

Log Output

Error when sending: { me: { id: { server: ‘c.us’, user: ‘xxxxxxxxxxxx’, _serialized: ‘xxxxxxxxxxxx@c.us’ }, displayName: null, verifiedName: null, searchName: null, pushname: ‘’, notifyName: null, isBusiness: null, formattedUser: null, tag: ‘2486081473’, eurl: ‘’, previewEurl: ‘’, fullDirectPath: ‘’, previewDirectPath: ‘’, filehash: ‘MPKobT7nW3zvIyZhd1UsoepPjDh2dOIycK4RYIUSJtw=’, stale: false, eurlStale: false, timestamp: 1695472629462, hostRetryCount: 0, isPlaceholder: false, description: ‘’, categories: [ [Object] ], profileOptions: { commerceExperience: ‘none’, cartEnabled: true, directConnection: false }, email: null, website: [], latitude: , longitude: , businessHours: { config: [Object], timezone: ‘Asia/Kolkata’ }, address: ', , ', fbPage: {}, igProfessional: {}, isProfileLinked: false, directConnection: { enabled: false }, coverPhoto: null, automatedType: ‘unknown’ }, to: { server: ‘c.us’, user: ‘xxxxxxxxxxxx’, _serialized: ‘xxxxxxxxxxxx@c.us’ }, erro: true, text: ‘Error to processFiles’, status: 404 }

Your Code

If relevant, paste all of your challenge code in here

Additional context / Screenshot

Add any other context about the problem here. If applicable, add screenshots to help explain.

About this issue

  • Original URL
  • State: closed
  • Created 9 months ago
  • Comments: 19

Most upvoted comments

Change your node_modules/venom-bot/dist/lib/wapi/wapi.js like this comment: https://github.com/orkestral/venom/issues/2482#issuecomment-1731692614 search in file by 0.4.613 and change: return await n.processAttachments("0.4.613"===Debug.VERSION?t:t.map((e=>({file:e}))),e,1),n} to: return await n.processAttachments("0.4.613"===Debug.VERSION?t:t.map((e=>({file:e}))),e,e),n} This solution running in venon-bot 5.0.21

@Oladapodaniel It’s not the best way, but I do it to fix it

// eslint-disable-next-line @typescript-eslint/no-var-requires
const { readFileSync, writeFileSync } = require('fs');

const path = './node_modules/venom-bot/dist/lib/wapi/wapi.js'

let toFix = readFileSync(path);


toFix = toFix.toString().replace(
	`return await n.processAttachments("0.4.613"===Debug.VERSION?t:t.map((e=>({file:e}))),e,1),n}`,
	`return await n.processAttachments("0.4.613"===Debug.VERSION?t:t.map((e=>({file:e}))),e,e),n}`
)


writeFileSync(path, toFix)

and before start project, I run that script.

like

{
......
"prestart": "node fix-venom.js"
}