mukulhase / WebWhatsapp-Wrapper

An API for sending and receiving messages over web.whatsapp [Working as of 18th May 2018]
https://webwhatsapi.readthedocs.io/en/latest/
MIT License
2.02k stars 797 forks source link

Banned after sent a few messages #416

Closed samuelrbo closed 5 years ago

samuelrbo commented 5 years ago

Hi guys, how do you going?

Last week I'd been trying to send message for new users using:

const chatId = new Store.UserConstructor(user.country_code+user.phone+'@c.us'); Store.Chat.find(chatId).then(chat => { chat.sendMessage(welcome_message); });

I get the new users by web service, but, when I'm sending the messages for 20 persons I get banned :(

To test I'm using a new number for Whatsapp and my test base I'm using the team numbers to send the welcome message.

I added all numbers to whatsapp contact list but I'm still getting banned. I tryed to send:

redtiens commented 5 years ago

Have you tried to use official whatsapp url for new messages? ...whatsapp.com/send?phone=[phone_number]

The project has a method for this purpose, check the Python code.

samuelrbo commented 5 years ago

Have you tried to use official whatsapp url for new messages? ...whatsapp.com/send?phone=[phone_number]

The project has a method for this purpose, check the Python code.

I'll try. Thanks.

lfdelphino commented 5 years ago

That's the point, Whatsapp knows that it's uncommon for someone to send so many messages to people they've never talked to each other before so it considers as spam/marketing junk pretty fast. Bot's are not wrong from Whatsapp's point of view but you should only reply and never start a new conversation.

brunosoaresds commented 5 years ago

try:

That’s worked for me.

lfdelphino commented 5 years ago

What has worked so far for sending up to 120 new messages/hour ~and I hope Zuckerberg doesn't come here~:

Dos and Don'ts:

  1. Have a real content, a survey that the person agreed with is different than a marketing message on a saturday night
  2. Add every contact you will send a message to your contacts list
  3. Send messages written in different ways, you could make a script that places spacebars randomly on your string AND include the person's (first) name
  4. Never use fixed times, always go for sending the first message, wait a random time between 30 ~ 60 seconds and then send the second message
  5. It's expected that you run Whatsapp Web on the same network of the primary app on your phone. If you have whatsapp (app) running on your real phone with you and whatsapp (web) on some cloud solution like AWS that is hosted far away from you, I'm sure you will be banned
  6. Unless you know how to crack whatsapp's number validation system very well (there are some tutorials), prefer to use physical devices other than emulators
  7. A good proxy is a must, make sure that both phone and bot are on the same IP and that this IP matches with your contacts country
  8. Always try to group contacts by their area code, Whatsapp expects a regular person to talk mostly with contacts that are within the same area of your phone number
  9. Have a profile picture, this is not related to Whatsapp Bots Catcher® but sending a new message for someone not having a picture/name/status will elevate your chances of being manually tagged as spam
  10. Don't keep sending messages to people that have already blocked you, I suggest checking before sending the message if the contact is blocked
  11. Even though you will be able to send messages to contacts that doesn't have whatsapp, you must never do that. Always check if your contacts have whatsapp before sending a message
  12. There are some special numbers that I believe are under tests from whatsapp, if you send a message to 00@c.us a official whatsapp advertising account will get the message, it's like selling cocaine to the police
  13. Don't let your code make requests that a regular Whatsapp Web wouldn't, for example reaching a number without @c.us, some errors are logged as well
  14. Send "seen" confirmation to messages or disable it on Whatsapp
  15. Don't instantly reply to messages, a nice wait time is a random value from 5 to 10 seconds
  16. It's a good practice when sending messages to open the chat, mark as read, send a "typing..." status, wait a few seconds and then send the message
  17. Have a new browser everytime you open Whatsapp Web, I mean, don't keep cache. It's a real pain to always have to enter the QR code but unless you have only one account and the bot isn't overloaded it's for the best
  18. Avoid sending links that were previously marked as spam on Whatsapp or non-HTTPS. A URL shortener is a good idea
  19. IMPORTANT: It's really bad if you send messages 24/7 without giving it some time to wait. Random belays between messages are not enough, send a resonable amount of messages keeping in mind your conversions rate, for exemple: for one hour send a maximum of 4 messages per contact that have replied to your message, stop sending messages for one hours, then start again. Again, don't send messages without stopping for a while between every "package"
  20. Send only one short message when starting a conversation, one should not send long texts or multiple messages without the user conscenting
  21. If you have to send multiple messages as a reply, send the first one, wait a few seconds and then go for the second message. You can still get banned if it's too fast even though you waited some seconds to reply. Always try to get everything inside one message
  22. Don't send different messages to different people at the same time, make it one-way only.
  23. Avoid prefixes for messages
  24. Do not use yowsup-cli
  25. Become online to send messages

Have in mind:

  1. For everyone you send a message that doesn't have your number on their contact list will be asked it that's spam, being tagged as spam a few times (5 - 10) will definitely get you banned
  2. Whatsapp records every movement you do, you can even check the logs when sending simple support email, it contains all kinds of information, this said: act as human as possible
  3. There seems to be no penalty for things like checking if the number has whatsapp, download profile pictures, etc. You can run those without any delay smoothly because you just shouldn't send messages to new people
  4. Apps that duplicates whatsapp are generally not a good idea because whatsapp knows it's running under a nonauthorized app and may also ban you
  5. Try to engage in conversations, as long as you send a message and the person doesn't automatically blocks you it'll be quite okay. People constantly talking to you and adding you to their contact list will make your number stronger against a ban
  6. Think about that like a points system, you start with zero points (negative if your IP or device were previously blacklisted), if you reach zero you are out, if you engage in conversations you get a point, if you are tagged as spam you lose some points, if you are blocked you may lose more points
  7. Don't let your bot running alone for too long, from time to time open Whatsapp on the device, roll over some chats, close Whatsapp Web and open again, etc
  8. In some countries virtual numbers will be from a specific range that whatsapp generally knows, on most of cases you won't be able to even register without a "Not a valid number for country XX" error
  9. If whatsapp is not reachable on the device and Whatsapp Web doesn't notice, you will be able to execute some commands but it won't take long to get you banned, so avoid at all costs doing anything if the phone is not connected.
  10. If you are running multiple whatsapp accounts under the same IP doing basically the same thing and you notice one of them got banned, stop and close everything of the other accounts, otherwise they will be all banned sequentially. As I'm writing this, I just got 7 out of 9 numbers banned together
  11. If your content is clearly spam, it doesn't matter if you are using a broadcast list, group or direct contact, you will still be banned

Let's say you just got banned but you won't give up:

  1. Delete whatsapp and everything related to it
  2. Do a factory reset on the phone if possible
  3. Get a new IP address
  4. Install whatsapp again
  5. Let the first message be special: don't register the number and start sending messages, first start a conversation with this new number from an old and trusted number, like your own phone.
  6. There are people saying you should wait 12 ~ 36 hours after this first message to start sending more, on the other hand some people will say that if you just register a phone and don't send messages for a day, you will be banned as soon as you start sending messages. I personally send the first message, wait a few hours and then start sending messages

What happens if you send an email to Whatsapp asking the reason you were banned? There's a remote chance of being unbanned, I have cases where the number was unbanned after 1 day and cases that it has been months and it's still banned. Their reply time is quick but the answer is final and immutable:

## - WhatsApp Support - ##
Hello,
Thanks for getting in touch with us!
Your WhatsApp account has been disabled because you have violated our Terms of Service when using an unauthorized app or an unsupported device.
Please remove the application and install an authorized version on a compatible device at: www.whatsapp.com/download
Please keep in mind that we do not allow support for unofficial or jailbroken / rooted clients (including emulators) and unsupported devices.
To use WhatsApp on your computer, visit our website from your computer's browser. Then open WhatsApp and scan the QR code using the WhatsApp application on your phone (look for WhatsApp Web in the WhatsApp settings on your device). WhatsApp can only be installed on your computer if you are using Windows operating systems 8.0 and higher or Mac OSX.9 and above. If you are experiencing problems installing WhatsApp on a supported operating system, disable your anti-virus and try again.
You have the option to access WhatsApp through your browser here if you are using non-compatible operating systems.
Your account will be permanently disabled, and without the possibility of appeal if you continue to violate our Terms of Service.

Cheers,
Roshan
WhatsApp Support Team
Take a look at our FAQ.

Final Considerations and Conclusion: After a few months trying different ways of sending messages I can only say all that's left to do right now is agreeing with Whatsapp's policy, not sending spam messages and always wait for the other person to contact you first, you could make it by sending an SMS to the person with a link to start a chat on Whatsapp with you. I'm not using this to send junk spam and I blame who uses this API for this purpose. Everyone I contact has previously accepted it irl but whatsapp doesn't really care. I will be more than happy to keep this up-to-date with any suggestions that you have to add here. All of the above text is meant for a large scale production environment and may not work for tomorrow, who knows if Whatsapp will start to brutally ban anyone that doesn't pay for their official API. If you just ignore all of it and it still works, you probably have a low flow of messages and that's perfectly acceptable

samuelrbo commented 5 years ago

Thank you guys.

I'll do a refactoring of this functionality, with the points you've shown me, not to be banned again.

samuelrbo commented 5 years ago

Guys, I'll close this issue, after I test I'll put here the conclusion. Thanks again.

rudibr78 commented 5 years ago

@lfdelphino thanks a lot for all the tips.

I couldn't find where we can send a "typing..." status before sending the message tho...could you please assist me with that?

lfdelphino commented 5 years ago

Take a look at the following:

275 - how to send typing.. expaction to chat_id

487 - Get 'typing' status for any chat