whatsapp-web.js icon indicating copy to clipboard operation
whatsapp-web.js copied to clipboard

[MD friendly] Prevent bans for participant arrays (providing more than 1 id)

Open purpshell opened this issue 3 years ago • 10 comments

you can now use the participant array property in the method without getting banned for providing more than one entry.

Also added sleep timer for adding a delay in milliseconds between actions (added Foo, wait 500ms, added Bar)

purpshell avatar Jan 28 '22 23:01 purpshell

Can you explain why this way won't get banned?

shirser121 avatar Feb 02 '22 13:02 shirser121

Can you explain why this way won't get banned?

The function was getting flagged because of us passing all the ids in in one fell swoop, now we iterate each id and perform the action, giving whatsapp only 1 number

purpshell avatar Feb 06 '22 19:02 purpshell

Can you explain why this way won't get banned?

The function was getting flagged because of us passing all the ids in in one fell swoop, now we iterate each id and perform the action, giving whatsapp only 1 number

It is like doing a for loop with an array with one item like before, now we just simply do that loop internally

purpshell avatar Feb 09 '22 08:02 purpshell

Sounds good, maybe a sleep too to avoid too fast bans?

tuyuribr avatar Feb 17 '22 03:02 tuyuribr

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Apr 16 '22 02:04 stale[bot]

Sounds good, maybe a sleep too to avoid too fast bans?

hmm alright added

purpshell avatar Jul 07 '22 15:07 purpshell

addParticipants return this error

Uncaught TypeError: t.map is not a function

shirser121 avatar Jul 08 '22 15:07 shirser121

everything should be fixed, well that was some spaghetti code hahahh

purpshell avatar Aug 09 '22 10:08 purpshell

I understand the proposed logic, and it makes sense to get banned for bulk actions. but when applying this PR and testing it I see that isn't promoting admins.

So as it sends each promote request at once, I got in the current WhatsApp version code expects an array, so it wraps it back inside an array on the for and it worked for me - and I feel thats happening because Client.createGroup waits for an array (When you create a Group, it expects an array of partcicipants and in WhatsApp you can create a Group With some participants / than You will be instabanned When you to exceed the limit of App).

This is the way the app itself implements the adding/removal..

Anyways not wrapping the id in an array was a typo from my end 🙃

purpshell avatar Aug 09 '22 13:08 purpshell

@tuyuribr done

purpshell avatar Dec 23 '22 07:12 purpshell