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.09k stars 591 forks source link

sendLinkWithAutoPreview does not show Auto-Preview #2603

Closed Kuroosh closed 2 years ago

Kuroosh commented 2 years 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?

Business account

Mode

My own code

Current Behavior

it worked before i updated the module... now its just sending it as a text without auto-preview.

Expected Behavior

it should show the auto-preview lmao

Steps To Reproduce

just try to use sendLinkWithAutoPreview with a link.. it will not work.

create() code

await VenoX.sendLinkWithAutoPreview(groupid, previewLink, '\nTEST-CODE');

DEBUG INFO

Debug info: {
  "WA_VERSION": "2.2210.9",
  "PAGE_UA": "WhatsApp/2.2147.16 Mozilla/5.0 (Macintosh; Intel Mac OS X 11_2_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36",
  "WA_AUTOMATE_VERSION": "4.31.7 UPDATE AVAILABLE: 4.32.17",
  "BROWSER_VERSION": "HeadlessChrome/99.0.4844.0",
  "OS": "Windows Server 2019",
  "START_TS": 1648475739393
}

Environment

- OS: Windows Server 2019
- Node: v16.13.2
- npm: npm@8.1.2

Screenshots/Logs

No response

Anything else?

No response

t0g3pii commented 2 years ago

Screenshot_20220328-153322_WhatsApp

Can Approve this issue

t0g3pii commented 2 years ago

Duplicate of #2545 Reason: Issue from wa itself with Multi-Device

Kuroosh commented 2 years ago

btw i tried it without multi-device... it didn't worked too...

smashah commented 2 years ago

@github-actions run

⚑ Release! ⚑ ```js (async () => { function exec(cmd) { console.log(execSync(cmd).toString()); } //set the version type process.env.VERS = "minor" // Config const gitUserEmail = "github-actions[bot]@users.noreply.github.com"; const gitUserName = "github-actions[bot]"; exec(`echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc`); exec(`git config --global user.email "${gitUserEmail}"`); exec(`git config --global user.name "${gitUserName}"`); exec(`npm i -D`); exec(`npm run release-ci $VERS`); // types only package exec('npm config set //registry.npmjs.org/:_authToken $NPM_TOKEN') exec(`cd ./types-only && npm version $VERS && npm run build && npm publish && cd ..`); exec(`git commit -a -m 'updated types-only package'`); exec(`git push --force`); //comment on the issue var result = execSync(`npx auto-changelog -o ./tempchangelog.txt --commit-limit false --template ./compact-keepachangelog.hbs --stdout`).toString(); await postComment(result); //create changelog image exec(`npm run release-image`); exec(`git commit -a -m 'updated release-image'`); exec(`git push --force`); })(); ```
smashah commented 2 years ago

Changelog

πŸš€ Release 4.33.0 (2022-03-29)

smashah commented 2 years ago

fixed in latest version

smashah commented 2 years ago

The workaround for this was to get the meta tags outside the browser context and then construct the link message manually. Instead of integrating another dependency for something that most people might not need, I decided to deploy a new api (on me) which grabs the link preview details.

You can choose to deploy your own (which I would prefer you do to save me some money) via Config.linkParser

Deploy with Vercel

https://github.com/RemiixInc/meta-grabber-serverless

Just F.Y.I, via the centralized default link parser API, I can see your links. So just for security, you should deploy your own anyways.