editStory
代表商业账户编辑动态。
返回值: 调用成功时返回 Story。
参数
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
business_connection_id | String | 是 | 商业连接 ID |
story_id | Integer | 是 | 动态 ID |
content | InputStoryContent | 是 | InputStoryContent JSON 对象 |
caption | String | 可选 | 新的说明文字 |
parse_mode | String | 可选 | HTML、Markdown 或 MarkdownV2 |
caption_entities | Array of MessageEntity | 可选 | MessageEntity JSON 数组 |
areas | Array of StoryArea | 可选 | StoryArea JSON 数组 |
请求示例
curl
curl -s -X POST "https://api.telegram.org/bot$TOKEN/editStory" \
-H "Content-Type: application/json" \
-d '{
"business_connection_id": "BUSINESS_CONNECTION_ID",
"story_id": 1,
"content": {
"type": "photo",
"photo": "attach://photo"
}
}'
Python
import requests
TOKEN = "123456789:AAEexampleTokenReplaceWithYours"
resp = requests.post(
f"https://api.telegram.org/bot{TOKEN}/editStory",
json={
"business_connection_id": "BUSINESS_CONNECTION_ID",
"story_id": 1,
"content": {
"type": "photo",
"photo": "attach://photo"
}
},
timeout=30,
)
print(resp.json())
JavaScript
const TOKEN = "123456789:AAEexampleTokenReplaceWithYours";
const res = await fetch(`https://api.telegram.org/bot${TOKEN}/editStory`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
"business_connection_id": "BUSINESS_CONNECTION_ID",
"story_id": 1,
"content": {
"type": "photo",
"photo": "attach://photo"
}
}),
});
console.log(await res.json());
分步教程: Telegram 机器人教程:从零创建 Telegram 机器人并发送第一条消息
相关方法
postStory代表商业账户发布动态。deleteStory代表商业账户删除动态。repostStory在商业账户之间转发动态 (Bot API 9.3)。