Skip to main content
POST
/
api
/
v1
/
platform
/
bots
/
{bot_uuid}
/
send_message
通过机器人发送消息
curl --request POST \
  --url http://localhost:5300/api/v1/platform/bots/{bot_uuid}/send_message \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "target_type": "person",
  "target_id": "<string>",
  "message_chain": [
    {
      "type": "Plain",
      "text": "Hello, World!"
    }
  ]
}
'
{
  "code": 0,
  "data": {
    "sent": true
  }
}

Authorizations

X-API-Key
string
header
required

Path Parameters

bot_uuid
string<uuid>
required

Body

application/json
target_type
enum<string>
required

目标类型

Available options:
person,
group
target_id
string
required

目标 ID(用户 ID 或群组 ID)

message_chain
object[]
required

消息链

Example:
[
{ "type": "Plain", "text": "Hello, World!" }
]

Response

发送成功

code
integer
Example:

0

data
object