Describe the bug
An error is thrown when trying to use getGroupMemebers function:
Error: Evaluation failed: TypeError: output.update is not a function
at Object.window.WAPI.getGroupMetadata (/node_modules/sulla-hotfix/dist/lib/wapi.js:633:26)
at Object.window.WAPI._getGroupParticipants (/node_modules/sulla-hotfix/dist/lib/wapi.js:651:33)
at Object.window.WAPI.getGroupParticipantIDs (/node_modules/sulla-hotfix/dist/lib/wapi.js:663:32)
at __puppeteer_evaluation_script__:1:35
at ExecutionContext._evaluateInternal (/node_modules/puppeteer/lib/ExecutionContext.js:122:13)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async ExecutionContext.evaluate (/node_modules/puppeteer/lib/ExecutionContext.js:48:12)
-- ASYNC --
at ExecutionContext.<anonymous> (/node_modules/puppeteer/lib/helper.js:111:15)
at DOMWorld.evaluate (/node_modules/puppeteer/lib/DOMWorld.js:112:20)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
-- ASYNC --
at Frame.<anonymous> (/node_modules/puppeteer/lib/helper.js:111:15)
at Page.evaluate (/node_modules/puppeteer/lib/Page.js:860:43)
at Page.<anonymous> (/node_modules/puppeteer/lib/helper.js:112:23)
at Whatsapp.<anonymous> (/node_modules/sulla-hotfix/dist/api/whatsapp.js:560:50)
at step (/node_modules/sulla-hotfix/dist/api/whatsapp.js:33:23)
at Object.next (/node_modules/sulla-hotfix/dist/api/whatsapp.js:14:53)
at /node_modules/sulla-hotfix/dist/api/whatsapp.js:8:71
at new Promise (<anonymous>)
at __awaiter (/node_modules/sulla-hotfix/dist/api/whatsapp.js:4:12)
at Whatsapp.getGroupMembersId (/node_modules/sulla-hotfix/dist/api/whatsapp.js:557:16)
at Whatsapp.<anonymous> (/node_modules/sulla-hotfix/dist/api/whatsapp.js:582:45)
at step (/node_modules/sulla-hotfix/dist/api/whatsapp.js:33:23)
at Object.next (/node_modules/sulla-hotfix/dist/api/whatsapp.js:14:53)
at /node_modules/sulla-hotfix/dist/api/whatsapp.js:8:71
at new Promise (<anonymous>)
at __awaiter (/node_modules/sulla-hotfix/dist/api/whatsapp.js:4:12)
at Whatsapp.getGroupMembers (/node_modules/sulla-hotfix/dist/api/whatsapp.js:577:16)
at start (/index.js:62:32)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async main (/home/ec2-user/corona-bot/index.js:259:5)
Steps to Reproduce
Steps to reproduce the behavior:
start:async function start(bot) {
let groups = [];
try {
groups = await bot.getAllGroups();
} catch (e) {
console.error(e);
return;
}
groups = groups.filter(({ isReadOnly }) => isReadOnly === false);
for (const group of groups) {
const contacts = await bot.getGroupMembers(group.id._serialized);
}
}
create() code
This is the code you use to create the client. e.g
async function main() {
let bot;
try {
bot = await sulla.create();
} catch (e) {
console.error(e);
return;
}
try {
await start(bot);
} catch (e) {
console.error(e);
}
}
main();
Expected behavior
A list of group members would be returned.
DEBUG INFO
This is the info printed to the console when you start your app. It should look like this
Debug Info {
WA_VERSION: '0.4.2081',
PAGE_UA: 'WhatsApp/0.4.613 Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) A
ppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36',
SULLA_HOTFIX_VERSION: '1.8.26',
BROWSER_VERSION: 'HeadlessChrome/80.0.3987.0'
}
Screenshots
Host (please complete the following information):
Additional context
thanks @yoavmmn for bringing this up. It's an issue with wapi.js on the new version of whatsapp web.
@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`);
var result = execSync(`npx auto-changelog -o ./tempchangelog.txt --commit-limit false --template ./compact-keepachangelog.hbs --stdout`).toString();
await postComment(result);
})();
@yoavmmn try the new version and report back if the fix worked for you. thanks
It seems to be solved. thanks!