wa-automate-nodejs icon indicating copy to clipboard operation
wa-automate-nodejs copied to clipboard

sendButtons not working

Open ngoding-bro opened this issue 3 years ago • 7 comments

Are you using the latest version of the library?

  • [X] I have checked and am using the latest version of the library.

What type of session are you experiencing this issue on?

Legacy (Normal)

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

Business account

Mode

My own code

Current Behavior

sendButtons not responding

Expected Behavior

respond perfectly

Steps To Reproduce

  1. All went well, .reply, .sendText can be used
  2. I tried .sendButtons but it doesn't work and no response
  3. Even the error does not appear.
  4. I have checked your documents and libraries many times

create() code OR full CLI command + CONFIG

[This is file in index.js]
const {create, Client} = require("@open-wa/wa-automate")
const msgHndlr = require("./msgHndlr.js")
const options = require("./options.js")
const start = async(putra=new Client()) =>{
putra.onMessage((async(message=>{
msgHndlr(putra,message)}
}
create(options(true, start))
.then(putra => start(putra))
.catch((error)=>console.log(error))

[This is file in msgHndlr.js]
module.exports = msgHndler = async(putra,message) => {
try{
const {from} = message
putra.sendButtons(from, "Hello", [{id:"1","text":"Readme"},{id:"2","text":"Profile"}], "list", "")
} catch(err) {
console.log(err)
}

DEBUG INFO

{
  "WA_VERSION": "2.2230.9",
  "WA_AUTOMATE_VERSION": "4.43.2",
  "BROWSER_VERSION": "HeadlessChrome/104.0.5112.81",
  "START_TS": 1660133449695,
  "RAM_INFO": "Total: 4.21 GB | Free: 1.45 GB",
  "PPTR_VERSION": "15.0.0",
  "LATEST_VERSION": true,
  "CLI": false,
  "PATCH_HASH": "caadf",
  "LAUNCH_TIME_MS": 27395,
  "ACC_TYPE": "BUSINESS",
  "chats": 3,
  "messages": 15,
  "contacts": 176,
  "isBiz": true,
  "isMd": true,
  "INSTANCE_ID": "372ddb3c-05ef-4dc9-aabc-70f9c6919191"
}

Environment

- OS: Windows 10
- Node: 16.16.0
- npm: 8.11.0

Screenshots/Logs

Screenshot (91) WhatsApp Image 2022-08-10 at 18 18 08

Anything else?

ngoding-bro avatar Aug 10 '22 12:08 ngoding-bro

You selected in the issue that you are using a legacy account. But the debug shows that you're now on MD. Buttons are an insiders' feature on MD accounts. Do you have a license? Not sure why it's not showing you an error.

smashah avatar Aug 10 '22 13:08 smashah

So what should I do? and give me a hint, i just learned this

ngoding-bro avatar Aug 11 '22 03:08 ngoding-bro

Here too it doesn't work even with the multi device active

allanlisboa avatar Aug 11 '22 12:08 allanlisboa

@ngoding-bro you will see the error as the response from your buttons code:

console.log(await putra.sendButtons(from, "Hello", [{id:"1","text":"Readme"},{id:"2","text":"Profile"}], "list", ""))

smashah avatar Aug 12 '22 00:08 smashah

@github-actions run

⚡ Release! ⚡
(async () => {
function exec(cmd) {
  console.log(execSync(cmd).toString());
}
//set the version type
process.env.VERS = "patch"

// 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 avatar Aug 12 '22 01:08 smashah

Changelog

🚀 Release 4.43.3 (2022-08-12)

  • Release 4.43.3 2ef51af
  • 📝 docs: insiders feats new docs format ad0bf17
  • 🏷️ types: getMyLastMessage may return undefined #2829 6ffac67
  • 🔊 logs: added better logging for buttons/insiders features #2832 a264292
  • 🥚 patches update 8f15733
  • updated types-only package e1a951e

smashah avatar Aug 12 '22 01:08 smashah

In the latest release it will output in the console if the feature you're using requires an insiders license.

smashah avatar Aug 12 '22 03:08 smashah

@allanlisboa

@ngoding-bro

Can you please update, try again and then paste your logs here.

Till then, closing.

smashah avatar Aug 13 '22 16:08 smashah

Could you explain what this insider license is?

mikelustosa avatar Sep 05 '22 00:09 mikelustosa