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

Stuck after WAPI Reinjected #590

Closed kresnaputra closed 4 years ago

kresnaputra commented 4 years ago

Describe the bug I try to running with simple code as showing in the Readme.md. But I got stuck after WAPI Reinjected.

Expected behavior Can running simple usage example like on Readme.md

DEBUG INFO (node:2869) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'safeMode' of undefined at Object. (/home/gevanni/Documents/Development/NodeJS/AutoTexting/node_modules/@open-wa/wa-automate/dist/controllers/initializer.js:240:33) at step (/home/gevanni/Documents/Development/NodeJS/AutoTexting/node_modules/@open-wa/wa-automate/dist/controllers/initializer.js:63:23) at Object.next (/home/gevanni/Documents/Development/NodeJS/AutoTexting/node_modules/@open-wa/wa-automate/dist/controllers/initializer.js:44:53) at fulfilled (/home/gevanni/Documents/Development/NodeJS/AutoTexting/node_modules/@open-wa/wa-automate/dist/controllers/initializer.js:35:58) at process._tickCallback (internal/process/next_tick.js:68:7) (node:2869) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1) (node:2869) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Debug Info {
  WA_VERSION: '2.2025.6'
  PAGE_UA: 'WhatsApp/2.2019.8 Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36',
  WA_AUTOMATE_VERSION: '1.9.86',
  BROWSER_VERSION:  'HeadlessChrome/83.0.4103.0'
}

Host (please complete the following information):

smashah commented 4 years ago

please share your create code @kresnaputra

smashah commented 4 years ago

@github-actions run

⚡ Release! ⚡ ```js (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`); })(); ```
smashah commented 4 years ago

Changelog

🚀 Release 1.9.87 (2020-06-27)

kresnaputra commented 4 years ago

please share your create code @kresnaputra

const format = require("date-fns/format"); const wa = require("@open-wa/wa-automate"); const dotenv = require("dotenv"); dotenv.config();

const MEGA = process.env.PHONE_NUMBER;

wa.create().then((client) => start(client));

function calculationTime(client) { setInterval(() => { if (format(new Date(), "k m s") === "7 0 0") { client.sendText(MEGA, "Hello"); } }, 1000); }

function replyMega(message, client) { if (message.body.toLocaleLowerCase().includes("Test")) client.sendText(MEGA, "Testing"); }

function start(client) { calculationTime(client);

client.onMessage((message) => { // Checking if sender is mega if (message.from === MEGA) { replyMega(message, client); } }); }

I already updated to newest version '1.9.88', after updated i got some error but the log come after "Passed Integrity Test"

smashah commented 4 years ago

wa.create({}).then((client)

smashah commented 4 years ago

@github-actions run

⚡ Release! ⚡ ```js (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`); })(); ```
smashah commented 4 years ago

Changelog

🚀 Release 1.9.90 (2020-06-28)

smashah commented 4 years ago

Should be fixed now

kresnaputra commented 4 years ago

Should be fixed now

Thanks, it's work like charm now