简体   繁体   English

我如何 go 关于在 discord 上创建自我机器人? 不使用 discord.py 但使用 python 中的模块请求?

[英]How do I go about creating a self-bot on discord? Without usage of discord.py but using the module requests in python?

I decided to take on the task of an automatic registering program, which sends valid data to: https://discord.com/api/v6/auth/register我决定承担一个自动注册程序的任务,它将有效数据发送到: https://discord.com/api/v6/auth/register

This lead me to the process of registering a new account, using preservation of logs in google dev tools to see how discord handles the packets, which i most partly understand.这引导我注册一个新帐户的过程,使用谷歌开发工具中的日志保存来查看 discord 如何处理数据包,我大部分理解。

This lead me to getting to this point:这导致我达到这一点:

import requests
import json

headers = {
    'user-agent': 'Mozilla/5.0'
}

payload = json.dumps{
           "captcha_key": None,
           "consent": True,
           "email": "TestEmail@gmail.com",
           "gift_code_sku_id": None,
           "invite": None,
           "password": "Password",
           "username": "Username"}

session = requests.Session()
r = session.post('https://discord.com/api/v6/auth/register', headers=headers,data=payload)

print(r.text)
# the session instance holds the cookie. So use it to get/post later.
# e.g. session.get('https://example.com/profile')

Which then returns an invalid body error status code 400. Which i understand due to no captcha being given, however how would i request for that captcha display it to me or allow it to be present in some form of data to solve.然后返回无效的正文错误状态代码 400。由于没有给出验证码,我理解这一点,但是我将如何请求该验证码向我显示或允许它以某种形式的数据存在以解决。 Get that key and send it back into the payload.获取该密钥并将其发送回有效负载。 This is one of my first steps to many, the priority is being able to register an account using requests.这是我对许多人的第一步,优先级是能够使用请求注册帐户。

Finally i bumped into another problem such as fingerprint which i have no understanding of even when researching but coming to no result.最后,我遇到了另一个问题,例如指纹,即使在研究时我也不了解,但没有结果。 If anyone has any ideas, solutions, or know which general direction to achieve this, it would be extremely helped.如果有人有任何想法、解决方案或知道实现这一目标的总体方向,那将非常有帮助。 Lastly the reason why i did not want to use discord.py because i would like to get use to requests and enable myself not to do this just on discord but other websites.最后是我不想使用 discord.py 的原因,因为我想习惯请求,让自己不要只在 discord 而是其他网站上这样做。

I know this is against TOS however there will be no use of malicious purposes just needed a challenging place to start and a point of interest.我知道这违反了 TOS,但是不会使用恶意目的,只需要一个具有挑战性的起点和一个兴趣点。

Sorry if any mistakes were made in the question, or in the actual program itself, i understand the majority of python and have experience however no experience in doing such tasks as these.抱歉,如果问题或实际程序本身出现任何错误,我了解 python 的大部分内容,并且有经验,但没有执行此类任务的经验。 Thankyou谢谢

I spent a lot of time today to understand how they are generated and found this!我今天花了很多时间来了解它们是如何生成的并找到了这个! Just submit a POST request to https://discord.com/api/v8/auth/fingerprint Get data in JSON format.只需向https://discord.com/api/v8/auth/fingerprint提交POST请求即可获取 JSON 格式的数据。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM