whatsmeow
whatsmeow copied to clipboard
Keep getting banned
I've been doing more tests, creating numbers, chatting via my phone, getting replies etc, etc...
But as soon as I try to send a message via the API the first message is sent as: waiting for this message this may take a while
And whenever I send another one it bans the number.
This time the IP I'm using is residential and the same one where the phone is at. (sending via the phone works just fine)
This are the logs I see when sending via the api:
[Client/Send DEBUG] <iq id="67.158-13" to="s.whatsapp.net" type="get" xmlns="usync"><usync context="message" index="0" last="true" mode="query" sid="67.158-12"><query><devices version="2"/></query><list><user jid="[email protected]"/><user jid="[email protected]"/></list></usync></iq>
[Client/Send DEBUG] <iq id="67.158-14" to="s.whatsapp.net" type="get" xmlns="encrypt"><key><user jid="receiver_number.0:[email protected]" reason="identity"/><user jid="receiver_number.0:[email protected]" reason="identity"/><user jid="receiver_number.0:[email protected]" reason="identity"/></key></iq>
[Client/Recv DEBUG] <iq from="s.whatsapp.net" id="67.158-13" type="result"><usync context="message" index="0" last="true" mode="query" sid="67.158-12"><result><devices/></result><list><user jid="[email protected]"><devices><device-list><device id="0"/><device id="1" key-index="1"/></device-list><key-index-list ts="1635943982">0a1208ac8588c50610ae8c8a8c061801220201001240d91b7d1c2cc841db4886379fd1d483b5ca9d04179b96cf7c70269290b343aa1aee6f605ae5d6dff8a177e93d902270231199dd9ec7b7ef42a953ab14453cc60d</key-index-list></devices></user><user jid="[email protected]"><devices><device-list><device id="0"/><device id="2" key-index="1"/><device id="3" key-index="3"/></device-list><key-index-list ts="1635866815">0a13089b91c7fa0610bfb1858c061803220300010312409d9dbc9d80b49b1a8d248736b08e70d60341a51418f59fa18581101345cfc982b127b2e55ca2b5cde1bce1a6b2b44263969de75e9a47bd7c3bb61bf267138e06</key-index-list></devices></user></list></usync></iq>
[Client/Recv DEBUG] <iq from="s.whatsapp.net" id="67.158-14" type="result"><list><user jid="receiver_number.0:[email protected]" t="1635152159"><device-identity><!-- 148 bytes --></device-identity><registration>000017c4</registration><type>05</type><identity>b0e3a13ad13f87b6c98ebdfe63b24d235929eb9fb07ad3915b6edb2a8d4be166</identity><skey><id>000001</id><value>5507914be61671b2bff67d411751a85bd7dd37f6a3fe428a880bf330223e073b</value><signature>0e59d66dfab79cf28827d29d7e757c25be60a0594278e611b19262d7c1905e0105e53cdae8a317da05f6456512f8e411e0d38bca00a99ad1cfd146e64e17b201</signature></skey><key><id>00008d</id><value>58ef228b0b9b4470eaec5a31532b481ba7f8cc489112f434d5418a1664beb57f</value></key></user><user jid="receiver_number.0:[email protected]" t="1635866819"><device-identity><!-- 148 bytes --></device-identity><registration>00001a7c</registration><type>05</type><identity>1574d3ed8153b9f1f3be1262c3fe69a2173ee22fd532410bd0aae4f4a4ba137a</identity><skey><id>000001</id><value>038c711f6b8d2eec92534c8297b2b98ba7cb5f7b9cd03bf92f24aee5dbd9175b</value><signature>d3c3ec6997fc491ebb479c6604d38f2e97e917b4534bbb03ea8a7030479829918747afc78e9be704c59ca769b08437f965e1cc7792faac65250141f3ba71990c</signature></skey><key><id>00000c</id><value>4f8666095da22589d93806a653289ba59bf04b6e5c2c25813cf1ddc7f832a566</value></key></user><user jid="[email protected]" t="1633882725"><registration>10644b18</registration><type>05</type><identity>0d95eabdf750d14e09b26504e6e4750db97218b04482c7e4e3a9daaed1e3506e</identity><skey><id>1e109f</id><value>cf41a5212aa5830f2bf80e88d94cd3717c16d9da075f8a6c98f7814a0b7e6212</value><signature>2066983fad1c568738d3aabb535973ae6cc79ff1d3f1e438040154aa8f5c68d7dcf002dd2bdf07c25962922ea1555fbdc6215688b3a22d99c812a838bd944b0a</signature></skey><key><id>000177</id><value>658064e06c2f2b2f0ddac73abbb3339315438941cee573c0254158f332866a42</value></key></user></list></iq>
[Client DEBUG] Processing prekey bundle for receiver_number.0:[email protected]
[Client DEBUG] Processing prekey bundle for receiver_number.0:[email protected]
[Client DEBUG] Processing prekey bundle for receiver_number.0:[email protected]
[Client/Send DEBUG] <message id="8929688A91F10EBEEC631AD2B2E65331" to="[email protected]" type="text"><participants><to jid="sender_number.0:[email protected]"><enc type="msg" v="2"><!-- 146 bytes --></enc></to><to jid="receiver_number.0:[email protected]"><enc type="pkmsg" v="2"><!-- 184 bytes --></enc></to><to jid="receiver_number.0:[email protected]"><enc type="pkmsg" v="2"><!-- 182 bytes --></enc></to><to jid="receiver_number.0:[email protected]"><enc type="pkmsg" v="2"><!-- 181 bytes --></enc></to></participants><device-identity><!-- 148 bytes --></device-identity></message>
[Client/Recv DEBUG] <ack class="message" from="[email protected]" id="8929688A91F10EBEEC631AD2B2E65331" t="1635944692"/>
[Client/Recv DEBUG] <stream:error code="503"/>
[Client/Recv DEBUG] <xmlstreamend/>
[Client WARN] Received stream end frame
[Client WARN] Got 503 stream error, assuming automatic reconnect will handle it
[Client/Socket ERROR] Error reading from websocket: websocket: close 1006 (abnormal closure): unexpected EOF
[Client/Socket DEBUG] Frame websocket read pump exiting 0x1af1740
[Client DEBUG] Emitting Disconnected event
I'm using the version go.mau.fi/whatsmeow v0.0.0-20211103085107-c2cda88e7160
creating numbers
Are you using virtual/voip numbers? I doubt whatsapp likes those
Virtual, yes but it sends the messages just fine until I use the API.
I think you have to sacrifice a new real number for the test :)
I got banned twice yesterday with a real number, maybe it's related to the first waiting message, it always happens when I talk to the recipient for the first time.
They can definitely detect that something is off. It could be related to the first key exchange.
I've tested with Baileys using this example as base and so far no bans at all.
It could be related to how it sends the message, trying to emulate the user input. I'll test sending it with this library copying the same method they use whenever I find time just to validate the theory.
I've also noticed that when you link the client to the app it shows as a chrome browser instead of a custom app but that could be just some settings.
@xbassols It could be nice if you can share how did you create the virtual numbers for testing purposes. My experience with "twilio" failed (although it was a few years ago)
Any VoIP service that allows SMS should work. Ex. Google Voice, Skype, Vonage, Twilio... I use a mix of those to develop.
As a counterpoint, so far we've only seen bans from virtual Twilio numbers on emulators but real numbers have been safe.
I been banned twice using regular phone numbers, but was an error from the bot, start sending a lote of message.
when you get banned does the device used to create the account also get blacklisted?
Have you tried to get JID using isonwhatsapp request. https://pkg.go.dev/go.mau.fi/[email protected]/types#IsOnWhatsAppResponse https://pkg.go.dev/go.mau.fi/whatsmeow#Client.IsOnWhatsApp
As explained here, if at any given point WhatsApp judges whatever you're doing as harmful to their servers or their users, you'll get banned.
So expect any kind of retaliation from the platform to prevent suspicious behavior: blacklisting your public IP or a range of public IPs, information associated with your device or phone number, etc.
The best you can do is to rethink your business logic so that it's easier for the WhatsApp algorithm to realize whatever you're doing is not harmful according to their ToS.
If you speak for a business that wants to integrate WhatsApp into their workflow at scale, I highly suggest you read that explanation and get a WhatsApp Business API key instead.