如何通过API在不和谐频道中发送消息

时间:2020-04-05 12:48:34

标签: python discord

我正在尝试在我的频道中发送消息。正如我所阅读的,我需要在发布请求中将消息作为内容参数传递。这是该代码的简短python

import requests

URL = "https://discordapp.com/api/webhooks/super/secret

r = requests.get(URL,data={"content":"123"},headers={"Content-Type":"application/json"})

print(r.text)

但这给了我一个答复:

<a href=//www.google.com/><span id=logo aria-label=Google></span></a>
  <p><b>400.</b> <ins>That’s an error.</ins>
  <p>Your client has issued a malformed or illegal request.  <ins>That’s all we know.</ins>

1 个答案:

答案 0 :(得分:0)

他们的文档HERE中的不一致表示:

某些API和网关版本现在不起作用,并标记为 为后代而在下表中停掉。尝试使用这些 版本将失败并返回400错误请求。