whatsapp-chatgpt
whatsapp-chatgpt copied to clipboard
Error: Evaluation failed: TypeError: window.Store.DownloadManager.downloadAndDecrypt is not a function
It crashes when someone sends audio.
C:\Users\Ogulc\Desktop\Yeni klasör (4)\whatsapp-chatgpt-master\node_modules\whatsapp-web.js\node_modules\puppeteer\lib\cjs\puppeteer\common\ExecutionContext.js:221 throw new Error('Evaluation failed: ' + helper_js_1.helper.getExceptionMessage(exceptionDetails)); ^
Error: Evaluation failed: TypeError: window.Store.DownloadManager.downloadAndDecrypt is not a function
at puppeteer_evaluation_script:20:75
at ExecutionContext._evaluateInternal (C:\Users\Ogulc\Desktop\Yeni klasör (4)\whatsapp-chatgpt-master\node_modules\whatsapp-web.js\node_modules\puppeteer\src\common\ExecutionContext.ts:273:13)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at ExecutionContext.evaluate (C:\Users\Ogulc\Desktop\Yeni klasör (4)\whatsapp-chatgpt-master\node_modules\whatsapp-web.js\node_modules\puppeteer\src\common\ExecutionContext.ts:140:12)
at Message.downloadMedia (C:\Users\Ogulc\Desktop\Yeni klasör (4)\whatsapp-chatgpt-master\node_modules\whatsapp-web.js\src\structures\Message.js:387:24)
at Module.handleIncomingMessage (C:\Users\Ogulc\Desktop\Yeni klasör (4)\whatsapp-chatgpt-master\src\handlers\message.ts:39:19)
at Client.
Node.js v18.13.0
I temporarily found the problem myself and came up with a solution. When I delete the "session" folder and open it again, the problem is fixed, but I have to do this every time I open and close the bot or it crashes. I need a permanent solution can you please help?
same, help pls
same when use TRANSCRIPTION_MODE=openai, and when use !dalle ,also shows the error .
It crashes when they send pictures, not just audio files.
It crashes when they send pictures, not just audio files.
yep, or if somebody send stickers, video, photo, gif and more
It also seems to be crashing with !dalle prompt. Only text prompts seems to be working for me. Deleted the sessions folder and relinked whatsapp, but still same error.
[DALL-E] Received prompt from [REDACED]: clouds, anime style
[DALL-E] Answer to [REDACED] | OpenAI request took 8343ms
E:\Temp\whatsapp-chatgpt\node_modules\whatsapp-web.js\node_modules\puppeteer\lib\cjs\puppeteer\common\ExecutionContext.js:221
throw new Error('Evaluation failed: ' + helper_js_1.helper.getExceptionMessage(exceptionDetails));
^
Error: Evaluation failed: TypeError: window.Store.MediaPrep.prepRawMedia is not a function
at Object.window.WWebJS.processMediaData (__puppeteer_evaluation_script__:235:50)
at async Object.window.WWebJS.sendMessage (__puppeteer_evaluation_script__:19:19)
at async __puppeteer_evaluation_script__:10:25
at ExecutionContext._evaluateInternal (E:\Temp\whatsapp-chatgpt\node_modules\whatsapp-web.js\node_modules\puppeteer\src\common\ExecutionContext.ts:273:13)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at ExecutionContext.evaluate (E:\Temp\whatsapp-chatgpt\node_modules\whatsapp-web.js\node_modules\puppeteer\src\common\ExecutionContext.ts:140:12)
at Client.sendMessage (E:\Temp\whatsapp-chatgpt\node_modules\whatsapp-web.js\src\Client.js:686:28)
Node.js v18.14.2
I fix it
declare for window.Store.DownloadManager.downloadAndDecrypt function name change at window.Store.DownloadManager.downloadAndMaybeDecrypt
\node_modules\whatsapp-web.js\src\structures\Message.js line 406
I change also Injected.js // window.Store.MediaPrep = window.mR.findModule('MediaPrep')[0]; window.Store.MediaPrep = window.mR.findModule('prepRawMedia')[0]; Thank You It's working.
I change also Injected.js // window.Store.MediaPrep = window.mR.findModule('MediaPrep')[0]; window.Store.MediaPrep = window.mR.findModule('prepRawMedia')[0]; Thank You It's working.
sorry,but where is the injected.js?
I change also Injected.js // window.Store.MediaPrep = window.mR.findModule('MediaPrep')[0]; window.Store.MediaPrep = window.mR.findModule('prepRawMedia')[0]; Thank You It's working.
sorry,but where is the injected.js?
node_modules/whatsapp-web.js/src/util
Go to the dowloadMedia function and find the following line: const decryptedMedia = await window.Store.DownloadManager.downloadAndDecrypt
Replace with this:
const decryptedMedia = await window.Store.DownloadManager.downloadAndMaybeDecrypt
It works thank you all
Shoule be fixed with the latest version of whatsapp-web.js I think.
change to in the package.json to "whatsapp-web.js": "1.21.1-alpha.1"