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.
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):
please share your create code @kresnaputra
@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`);
})();
e267ece9628a28client.refresh() #582 bc997c55abc74bExposedFn with SimpleListener #588 cb2e132279f202AvailableWebhooks to SimpleListener #588 a226e80onAck from middleware to client #588 c058eeeonMessage from middleware to client #588 232077363e5794SimpleListener #588 bb10f61onAnyMessage from middleware to client #588 8e811f6e19c5d3411ab2814904d4cfcb136eb647eeplease 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"
wa.create({}).then((client)
@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`);
})();
Should be fixed now
Should be fixed now
Thanks, it's work like charm now