Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

await client.sendStickerfromUrl() returns error: TypeError: ((intermediate value)(intermediate value)(intermediate value) || (intermediate value)(intermediate value)(intermediate value)).replace is not a function #3211

Closed
1 task done
TVARecordings opened this issue May 16, 2024 · 3 comments

Comments

@TVARecordings
Copy link

Are you using the latest version of the library?

  • I have checked and am 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?

Business account

Mode

EASY API/CLI

Current Behavior

Code

const currentDate = new Date();
const day = currentDate.getDate().toString().padStart(2, '0'); // Get the day and pad with leading zero if needed
const month = (currentDate.getMonth() + 1).toString().padStart(2, '0'); // Get the month (months are zero-based) and pad with leading zero if needed
const year = currentDate.getFullYear().toString().slice(-2); //
console.log(`${message.body.split(' ')[0]} Step 11`)
await client.sendStickerfromUrl(from, 'https://c.tenor.com/c07YTR6SIE8AAAAC/tenor.gif', { author: `🤖 Ameca ${day}/${month}/${year}`, pack: `📱 www.tva-community.chat`, keepScale: true, crop: false })

returns error:

[messageHandler.js] TypeError: ((intermediate value)(intermediate value)(intermediate value) || (intermediate value)(intermediate value)(intermediate value)).replace is not a function
Error [TypeError]: _0x23febf(_0x281f83(...) + "QU") is not a function
at window.. (evaluate at E:\AmecaCore\node_modules@open-wa\wa-automate\dist\controllers\patch_manager.js:127:50, :0:511775)
at #evaluate (E:\AmecaCore\node_modules\puppeteer-core\lib\cjs\puppeteer\cdp\ExecutionContext.js:222:56)
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)

Expected Behavior

To just send the sticker like it did in the past.

Steps To Reproduce

[messageHandler.js] TypeError: ((intermediate value)(intermediate value)(intermediate value) || (intermediate value)(intermediate value)(intermediate value)).replace is not a function
Error [TypeError]: _0x23febf(_0x281f83(...) + "QU") is not a function
at window.. (evaluate at E:\AmecaCore\node_modules@open-wa\wa-automate\dist\controllers\patch_manager.js:127:50, :0:511775)
at #evaluate (E:\AmecaCore\node_modules\puppeteer-core\lib\cjs\puppeteer\cdp\ExecutionContext.js:222:56)
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)

create() code OR full CLI command + CONFIG

const configObject = {
  sessionId: '',
  authTimeout: 0,
  blockCrashLogs: true, // Setting this to true will block any network calls to crash log servers. This should keep anything you do under the radar. Def: true
  cacheEnabled: true, // Setting this to false turn off the cache. This may improve memory usage.
  cachedPatch: true, // Setting this to true will save a local copy of the patches.json file (as patches.ignore.data.json) which will be used in subsequent instantiations of the session.
  callTimeout: 600000, // Amount of time (in ms) to wait for a client method (specifically methods that interact with the WA web session) to resolve.   
  disableSpins: true, // Setting this to true will simplify logs for use within docker containers by disabling spins (will still print raw messages).
  discord: '',
  ezqr: true,
  headless: true,
  linkParser: "https://link.openwa.cloud/api",
  logFile: true,
  messagePreprocessor: "AUTO_DECRYPT", //"AUTO_DECRYPT","SCRUB"
  onError: "LOG_AND_FALSE",
  popup: false,
  qrTimeout: 0,
  useChrome: true,
  debug: true,
  logging: [{
    type: console
  }],
  logInternalEvents: true, //ONLY TURN THIS ON IF ASKED TO!
  logConsoleErrors: true,
};

DEBUG INFO

{
  "WA_VERSION": "2.3000.1013569446",
  "WA_AUTOMATE_VERSION": "4.71.11",
  "BROWSER_VERSION": "Chrome/124.0.6367.208",
  "START_TS": 1715900267082,
  "RAM_INFO": "Total: 68.62 GB | Free: 52.17 GB",
  "PPTR_VERSION": "19.11.1",
  "LATEST_VERSION": true,
  "CLI": false,
  "PATCH_HASH": "CACHED-e6695",
  "LAUNCH_TIME_MS": 6951,
  "ACC_TYPE": "BUSINESS",
  "chats": 9,
  "messages": 76,
  "contacts": 1527,
  "isBiz": true,
  "isMd": true,
  "INSTANCE_ID": "71ebd4a3-f90d-4411-86be-447474a6b993"
}

Environment

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

Screenshots/Logs

No response

Anything else?

No response

@TVARecordings
Copy link
Author

sendMp4AsSticker is broken too:

sendMp4AsSticker TypeError: ((intermediate value)(intermediate value)(intermediate value) || (intermediate value)(intermediate value)(intermediate value)).replace is not a function

@homam49
Copy link

homam49 commented Jun 4, 2024

were you able to fix it ?

@smashah
Copy link
Member

smashah commented Jun 8, 2024

should be fixed with latest version

@smashah smashah closed this as completed Jun 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants