Wa-automate-nodejs: Implement a function that return the last message sent by the bot in a chat

Created on 12 Oct 2020  Â·  4Comments  Â·  Source: open-wa/wa-automate-nodejs

It would be nice if there was a function that would return the last message sent by the bot in a given chat. The currently method that I'm using is to call getAllMessagesInChat() and then loop it backwards until I find the last bot message. But, getAllMessagesInChat() takes a while to return the list of messages.

enhancement

All 4 comments

@github-actions run


âš¡ Release! âš¡

(async () => {
function exec(cmd) {
  console.log(execSync(cmd).toString());
}

// 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`);
exec(`npm run release-ci`);

//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`);
  })();

Changelog

🚀 Release 2.0.32 (2020-10-12)

  • build(deps): bump uuid-apikey from 1.4.6 to 1.5.1 #928
  • build(deps-dev): bump release-it from 14.0.4 to 14.1.0 #929
  • build(deps): bump p-queue from 6.6.1 to 6.6.2 #930
  • build(deps): bump ts-json-schema-generator from 0.75.0 to 0.76.1 #922
  • Fix #927 #927
  • Release 2.0.32 46e1fd8
  • added sendAudio as alias for sendPtt and example in demo b8e4440
  • Feature: Implemented getMyLastMessage #924 b357b1e
  • fix: patched #923 462fadb
  • chore: bump wa version 836b676
Was this page helpful?
0 / 5 - 0 ratings

Related issues

scoorpionx picture scoorpionx  Â·  7Comments

jazZcarabazZ picture jazZcarabazZ  Â·  5Comments

alishahlakhani picture alishahlakhani  Â·  7Comments

blackchineykh picture blackchineykh  Â·  4Comments

arisros picture arisros  Â·  4Comments