如何通过其API在discord频道中发送消息

问题描述 投票:0回答:1

我正在尝试在我的频道中发送消息。正如我所读到的,我需要将消息作为 post 请求中的内容参数传递。这是简短的 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>
python discord
1个回答
0
投票

他们的文档中不和谐这里 说:

一些 API 和网关版本现在无法运行,并被标记为 下表中已停止使用。尝试使用这些 版本将失败并返回 400 Bad Request。

© www.soinside.com 2019 - 2024. All rights reserved.