如何通过 rest api 调用 discord bot 命令?

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

我想通过 HTTP API 调用来调用 discord bot 命令。

命令示例:/命令参数

我该怎么做?谢谢

我通过 discord API 向聊天室发送了一条消息,但机器人无法将其识别为命令。它作为常规文本发布。

CURL 示例(您可以导入邮递员)相应地更改 CHANNEL_ID 和 AUTH_TOKEN:

curl 'https://discord.com/api/v9/channels/______CHANNEL_ID_____/messages' \
  -H 'authorization: ______AUTH_TOKEN_____' \
  -H 'content-type: application/json' \
  --data-raw '{"content":"/command parameter"}' \
  --compressed
api discord discord.js discord.py bots
1个回答
0
投票
var response = client.UploadString("https://discord.com/api/v9/interactions", "POST", payloadJson

没有别的办法了。

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