discord-mass-DM-GO icon indicating copy to clipboard operation
discord-mass-DM-GO copied to clipboard

Captcha Solution

Open Wade6060 opened this issue 2 years ago • 3 comments

I am writing my python bot to send DM messages. But I ran into the problem that if I write to a person for the first time, I get a captcha in the request: {'captcha_key': ['captcha-required'], 'captcha_sitekey': 'DELL', 'captcha_service': 'hcaptcha', 'captcha_rqdata': 'DELL', 'captcha_rqtoken': 'DELL'}. (Deleted the data from the response) With the help of your bot, there is no such problem and the message is sent calmly, I would like to know how you got around it, thank you for the answer.

Wade6060 avatar Jul 21 '22 09:07 Wade6060

Hey,

If while sending messages you're detected in anyway (Flagged browser information, bad TLS config Usually HTTPX works best without messing with TLS, Modules like requests are "patched" because of this unless you change the TLS config, Incomplete Header information, etc) Sometimes the token is captcha'd, but if you can send messages manually, you should be able to with automation as well.

I recommend checking out Discord.py-self which is a fork for discord.py but for selfbots.

I believe they have everything properly implemented, you can use the library or also use their code.

Let me know if you have any other questions.

V4NSH4J avatar Jul 21 '22 11:07 V4NSH4J

Hey,

If while sending messages you're detected in anyway (Flagged browser information, bad TLS config Usually HTTPX works best without messing with TLS, Modules like requests are "patched" because of this unless you change the TLS config, Incomplete Header information, etc) Sometimes the token is captcha'd, but if you can send messages manually, you should be able to with automation as well.

I recommend checking out Discord.py-self which is a fork for discord.py but for selfbots.

I believe they have everything properly implemented, you can use the library or also use their code.

Let me know if you have any other questions.

I don't use Discord libraries. I am sending the usual message sending requests:

u = 'https://discord.com/api/v9/users/@me/channels
d = {
"recipients": [f"{user_id}"]
}
payload = {
"content": f"You <@{user_id}>"
 }
 header = {
"authorization": token
}
r =requests.post(url=u, json=d, headers=header)
jss = json.loads(r.text)
url = f'https://discord.com/api/v9/channels/{jss["id"]}/messages'
r = requests.post(url,data=payload,headers=header)
jss = json.loads(r.text)

If I had a dialogue with a person before, then the message is sent without any problems. If I write messages to a person for the first time, then I immediately get a captcha.

Wade6060 avatar Jul 21 '22 13:07 Wade6060

Your headers aren't sufficient enough for discord to believe it. You are missing the usual headers like user-agent, etc. But also the custom ones discord uses, like x-context-properties and x-super-properties. To get the headers, use the network tab on chrome devtools. Make the request on discord.com, see what headers its using, and copy them. Sometimes you may need to slightly modify them, so keep that in mind.

You are (by the looks of it) using the requests library, which is what Vanshaj could be causing flags as well, from TLS.

Modules like requests are "patched" because of this unless you change the TLS config

I'm using httpx no problems, so I recommend trying that out. It should be just as simple as replacing import requests and requests.post with import httpx and httpx.post.

itschasa avatar Jul 22 '22 11:07 itschasa