Closed ceekfadeblack closed 8 months ago
@ceekfadeblack
The group ID have to be in a format XXXXXXXXXX@g.us
, i.e.: 123456789@g.us
const groupId = 'DoJ7CWhXvXtAF6YcEacxxx'; // New group ID
This in invalid group ID
I have tried bro still same you can try if you want my mode.
@ceekfadeblack To find your group ID use this:
// ...
const groupId = (await client.getChats()).filter((x) => x.isGroup && x.name === 'YOUR GROUP NAME')[0].id._serialized;
// ...
@ceekfadeblack
const numberId = await client.getNumberId(phoneNumber);
if (numberId) {
await groupChat.addParticipants([numberId._serialized]);
console.log(`Step 7: Phone number ${phoneNumber} has been successfully added to the group.`);
}
MATE! YOU SAVE MY HOURS. I LOVE YOU. THANK YOU!
I wanna do something for you. Please tell me brother.. thanks alot!
@ceekfadeblack
MATE! YOU SAVE MY HOURS. I LOVE YOU. THANK YOU!
You are welcome :)
Is there an existing issue for this?
Describe the bug
const qrcode = require('qrcode-terminal'); const { Client } = require('whatsapp-web.js');
const client = new Client({ puppeteer: { args: ['--no-sandbox'] }, });
// Step 1: Display QR code for client authentication client.on('qr', qr => { qrcode.generate(qr, { small: true }); });
// Step 2: When client is ready client.on('ready', () => { console.log('Step 2: Client is ready!'); });
// Step 3: Listen for incoming messages client.on('message', async message => { if (message.body === '!addMember') { try { const groupId = 'DoJ7CWhXvXtAF6YcEacxxx'; // New group ID const phoneNumber = 'XXXXXXXXXX'; // Phone number to add (without '+' at the beginning)
});
// Step 8: Initialize the client client.initialize();
I've been struggling for at least 10 hours trying to add a single phone number to a group, and I just can't seem to do it! I'm losing my mind. Please help me solve this problem.
Step 2: Error getting group chat: Evaluation failed: Error: wid error: invalid wid at e (https://web.whatsapp.com/:2:4911) at new f (https://web.whatsapp.com/app.d61b42d11fedf617d4e8.js:311:221995) at Object.d [as createWid] (https://web.whatsapp.com/app.d61b42d11fedf617d4e8.js:311:228400) at Object.window.WWebJS.getChat (_puppeteer_evaluationscript:439:49) at _puppeteer_evaluationscript:2:40
Expected behavior
Evaluation failed: Error: wid error: invalid wid at e (https://web.whatsapp.com/:2:4911) at new f (https://web.whatsapp.com/app.d61b42d11fedf617d4e8.js:311:221995) at Object.d [as createWid] (https://web.whatsapp.com/app.d61b42d11fedf617d4e8.js:311:228400) at Object.window.WWebJS.getChat (puppeteer_evaluation_script:439:49) at puppeteer_evaluation_script:2:40
Steps to Reproduce the Bug or Issue
I did everything tried everything whatever you dream. but still same.
Relevant Code
Evaluation failed: Error: wid error: invalid wid at e (https://web.whatsapp.com/:2:4911) at new f (https://web.whatsapp.com/app.d61b42d11fedf617d4e8.js:311:221995) at Object.d [as createWid] (https://web.whatsapp.com/app.d61b42d11fedf617d4e8.js:311:228400) at Object.window.WWebJS.getChat (puppeteer_evaluation_script:439:49) at puppeteer_evaluation_script:2:40
Browser Type
Chromium
WhatsApp Account Type
WhatsApp Business
Does your WhatsApp account have multidevice enabled?
Yes, I am using Multi Device
Environment
Evaluation failed: Error: wid error: invalid wid at e (https://web.whatsapp.com/:2:4911) at new f (https://web.whatsapp.com/app.d61b42d11fedf617d4e8.js:311:221995) at Object.d [as createWid] (https://web.whatsapp.com/app.d61b42d11fedf617d4e8.js:311:228400) at Object.window.WWebJS.getChat (puppeteer_evaluation_script:439:49) at puppeteer_evaluation_script:2:40
Additional context
really needed help