I try send a msg to a new contact and the console show this
(node:1883) UnhandledPromiseRejectionWarning: Error: Evaluation failed: TypeError: chat.sendMessage is not a function
at Object.window.WAPI.sendMessage (/home/daniel/node_modules/@open-wa/wa-automate/dist/lib/wapi.js:857:31)
at ExecutionContext._evaluateInternal (/home/daniel/node_modules/puppeteer/lib/ExecutionContext.js:93:19)
at process._tickCallback (internal/process/next_tick.js:68:7)
-- ASYNC --
at ExecutionContext.
at DOMWorld.evaluate (/home/daniel/node_modules/puppeteer/lib/DOMWorld.js:111:24)
at process._tickCallback (internal/process/next_tick.js:68:7)
-- ASYNC --
at Frame.
at Page.evaluate (/home/daniel/node_modules/puppeteer/lib/Page.js:792:47)
at Page.
at Whatsapp.
at step (/home/daniel/node_modules/@open-wa/wa-automate/dist/api/whatsapp.js:44:23)
at Object.next (/home/daniel/node_modules/@open-wa/wa-automate/dist/api/whatsapp.js:25:53)
at /home/daniel/node_modules/@open-wa/wa-automate/dist/api/whatsapp.js:19:71
at new Promise (
at __awaiter (/home/daniel/node_modules/@open-wa/wa-automate/dist/api/whatsapp.js:15:12)
at Whatsapp.sendText (/home/daniel/node_modules/@open-wa/wa-automate/dist/api/whatsapp.js:326:16)
-- ASYNC --
at Page.
at Whatsapp.
at step (/home/daniel/node_modules/@open-wa/wa-automate/dist/api/whatsapp.js:44:23)
at Object.next (/home/daniel/node_modules/@open-wa/wa-automate/dist/api/whatsapp.js:25:53)
at /home/daniel/node_modules/@open-wa/wa-automate/dist/api/whatsapp.js:19:71
at new Promise (
at __awaiter (/home/daniel/node_modules/@open-wa/wa-automate/dist/api/whatsapp.js:15:12)
at Whatsapp.sendText (/home/daniel/node_modules/@open-wa/wa-automate/dist/api/whatsapp.js:326:16)
at /home/daniel/Desktop/Test_NPM/qrcode2.ts:25:9
at step (/home/daniel/Desktop/Test_NPM/qrcode2.ts:33:23)
(node:1883) 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:1883) [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.
My code is
const express = require('express')
const path = require("path");
import axios from 'axios';
const wa = require('@open-wa/wa-automate');
import { Whatsapp, decryptMedia, ev} from '@open-wa/wa-automate';
const mime = require('mime-types');
const fs = require('fs');
const ON_DEATH = require('death');
const app = express()
app.use(express.json())
ON_DEATH(async function(signal, err) {
console.log('killing session');
if(globalClient)await globalClient.kill();
})
let globalClient:Whatsapp;
wa.create().then(client => start(client));
async function start(client) {
client.sendText("[email protected]", ' Opa, ?Como q tá?');
}
@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`);
})();
@DeLuca92 should be working now.
Thx.
Bro, it's possible make a web interface?
like in php?
@DeLuca92 I don't know php but if you want you can start open-wa/wa-automate-php. Please discuss in the discord.
Most helpful comment
@github-actions run
âš¡ Release! âš¡