open-wa / wa-automate-nodejs

šŸ’¬ šŸ¤– The most reliable tool for chatbots with advanced features. Be sure to šŸŒŸ this repository for updates!
https://docs.openwa.dev/
Other
3.05k stars 588 forks source link

sendTextWithMentions() returns "Error [TypeError]: Store[("add" + _0x502bb1(...) + _0x502bb1(...) + _0x502bb1(...) + _0x502bb1(...) + _0x502bb1(...) + "t")] is not a function" #3191

Closed TVARecordings closed 2 months ago

TVARecordings commented 2 months ago

Are you using the latest version of the library?

What type of session are you experiencing this issue on?

Multi-device and I have set multiDevice to true in my config OR am using the --multi-device flag

What type of host account are you experiencing this issue on?

Personal account (normal)

Mode

EASY API/CLI

Current Behavior

Code returns error due framework update.

Code:

console.log(`case 'ping' Step 4`)
const PingendTime = performance.now();
console.log(`case 'ping' Step 5`)
const elapsedTimeInSeconds = (PingendTime - startTime) / 1000;
console.log(`case 'ping' Step 6`)
const randomReply = await PingReply(); // Wait for the promise to resolve
console.log(`case 'ping' Step 7`)
const completeMessage = (`${randomReply}\n\`\`\`Ping: *${elapsedTimeInSeconds.toFixed(3)}* seconds \`\`\``)

console.log(`case 'ping' Step 8 (Trying sendTextWithMentions)`)
try {
  await client.sendTextWithMentions(from, `> ${sender.id ? `@${sender.id.split('@')[0]}` : ''} ${message.body.split(' ')[0]} \n${randomReply}\n\nPing: ${elapsedTimeInSeconds.toFixed(3)} seconds`);
} catch(error) {
  errorLog(error.message ? error.message : error)
  console.error(error)
};

Output:

Command: [Bot Development] [22h50:34.38] Tom ping Checking isAdmin isAdmin = true Checking if sender is Admin (true) switch (command) case 'ping' Step 1 isTomAdmin true && isBotAdmin true && IsBotChat false || IsVIP true || isAdmin true case 'ping' Step 2 case 'ping' Step 3 case 'ping' Step 4 case 'ping' Step 5 case 'ping' Step 6 case 'ping' Step 7 case 'ping' Step 8 (Trying sendTextWithMentions) ERROR: [22h50:34.83] Store[("add" + _0x502bb1(...) + _0x502bb1(...) + _0x502bb1(...) + _0x502bb1(...) + _0x502bb1(...) + "t")] is not a function Error [TypeError]: Store[("add" + _0x502bb1(...) + _0x502bb1(...) + _0x502bb1(...) + _0x502bb1(...) + _0x502bb1(...) + "t")] is not a function at window.. (evaluate at E:\AmecaCore\node_modules\@open-wa\wa-automate\dist\controllers\patch_manager.js:127:50, :0:328314) at #evaluate (E:\AmecaCore\node_modules\puppeteer-core\lib\cjs\puppeteer\cdp\ExecutionContext.js:222:56) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async ExecutionContext.evaluate (E:\AmecaCore\node_modules\puppeteer-core\lib\cjs\puppeteer\cdp\ExecutionContext.js:117:16) at async IsolatedWorld.evaluate (E:\AmecaCore\node_modules\puppeteer-core\lib\cjs\puppeteer\cdp\IsolatedWorld.js:124:16) at async CdpFrame.evaluate (E:\AmecaCore\node_modules\puppeteer-core\lib\cjs\puppeteer\api\Frame.js:342:20) at async CdpPage.evaluate (E:\AmecaCore\node_modules\puppeteer-core\lib\cjs\puppeteer\api\Page.js:828:20) case 'ping' Step 9 Elapsed time: 0.133 seconds case 'ping' Step 15 case 'ping' Step 17

Expected Behavior

Send the message :-)

Steps To Reproduce

Run the line await client.sendTextWithMentions(from,> ${sender.id ? @${sender.id.split('@')[0]} : ''} ${message.body.split(' ')[0]} \n${randomReply}\n\nPing: ${elapsedTimeInSeconds.toFixed(3)} seconds);

create() code OR full CLI command + CONFIG

const configObject = {
  sessionId: 'aName',
  authTimeout: 0,
  cacheEnabled: true,
  useChrome: true,
  cachedPatch: true,
  devtools: false,
  chromiumArgs: ['--no-sandbox'],
  disableSpins: true,
  headless: false, //new
  popup: false,
  qrTimeout: 0,
  messagePreprocessor: "AUTO_DECRYPT", //"AUTO_DECRYPT","SCRUB"
  linkParser: "https://link.openwa.cloud/api",
  restartOnCrash: true,
  logInternalEvents: false, //ONLY TURN THIS ON IF ASKED TO!
  discord: 'Mine',
  ezqr: true,
  callTimeout: 0, // 600000
  licenseKey: "Mine"
  screenshotOnInitializationBrowserError: false,
  hostNotificationLang: 'nl-nl',
  killProcessOnBrowserClose: true,
  killProcessOnTimeout: false,
  logConsole: false,
  logConsoleErrors: true,
  logFile: true,
  onError: "LOG_AND_FALSE",
};

DEBUG INFO

{
  "WA_VERSION": "2.3000.1012651513",
  "WA_AUTOMATE_VERSION": "4.71.5",
  "BROWSER_VERSION": "Chrome/123.0.6312.106",
  "START_TS": 1712695793615,
  "RAM_INFO": "Total: 68.62 GB | Free: 45.10 GB",
  "PPTR_VERSION": "19.11.1",
  "LATEST_VERSION": true,
  "CLI": false,
  "PATCH_HASH": "CACHED-a2d04",
  "LAUNCH_TIME_MS": 16972,
  "ACC_TYPE": "BUSINESS",
  "chats": 338,
  "messages": 372,
  "contacts": 2655,
  "isBiz": true,
  "isMd": true,
  "INSTANCE_ID": "bdc8f531-d89e-4dc4-b5f2-9c416eb84c3a"
}

Environment

- OS: Windows 10
- Node: 20.11.1
- npm: 10.2.4

Screenshots/Logs

No response

Anything else?

This man is a legend!

smashah commented 2 months ago

Hey @TVARecordings there have been many patches since you submitted this. can you update to latest version, restart and try again please. if this continues to be an issue then feel free to bump this issue.