pedroslopez / whatsapp-web.js

A WhatsApp client library for NodeJS that connects through the WhatsApp Web browser app
https://wwebjs.dev
Apache License 2.0
15.21k stars 3.63k forks source link

addParticipants is banning the account #1880

Closed NissiusRibas closed 8 months ago

NissiusRibas commented 1 year ago

Is there an existing issue for this?

Describe the bug

When trying to add a contact to a group that I am an administrator, whatsapp bans my number.

Expected behavior

I would like to add the number and not get banned.

Steps to Reproduce the Bug or Issue

1 - Add the phone number to the contact list 2 - Choose which group you want to add the contact to 3 - Find the ID of the contact I want to add 4 - I add the contact in the group selected in item 2. 5 - I'm banned

Relevant Code

client.on('ready', () => {
    console.log('Client is ready!');

    client.getChats().then((chats) => {
        const myGroupName = 'MY GROUP';
        const myGroup = chats.find((chat) => chat.name === myGroupName);
        client.getContacts().then((contacts) => {
            const contactToAdd = contacts.find(
                // Finding the contact Id using the contact's name
                (contact) => contact.name === 'Paulo'
              );

            if (contactToAdd) {
                console.log(' :D ');
                myGroup.addParticipants([contactToAdd.id._serialized]);
            }else{
                console.log(' :( ');
            }
        });
    })
});

Browser Type

Google Chrome

WhatsApp Account Type

Standard

Does your WhatsApp account have multidevice enabled?

Yes, I am using Multi Device

Environment

OS: Ubuntu 20.04 Phone: Android whatsapp-web.js: Last Version WhatsApp Web Version: 2.2247.6 Node: V.19.2

Additional context

No response

barrymihiran commented 1 year ago

It also happened to me. Then I tried #1153 (https://github.com/pedroslopez/whatsapp-web.js/compare/patch-participants) code changes and that number also got banned. Overall, 4 numbers got banned from WhatsApp after checking addParticipants.

@PurpShell any idea 😓😓