Telegram Bot API
🌐 中文

editMessageCaption

分类: 编辑 · Bot API 10.3 · 官方文档

编辑媒体说明文字。

返回值: 调用成功时返回 Message or True。

参数

参数类型必填说明
business_connection_idString可选商业连接 ID
chat_idInteger or String可选聊天 ID
message_idInteger可选消息 ID
inline_message_idString可选内联消息 ID
captionString可选新的说明文字
parse_modeString可选HTML、Markdown 或 MarkdownV2
caption_entitiesArray of MessageEntity可选MessageEntity JSON 数组
show_caption_above_mediaBoolean可选在媒体上方显示说明文字
reply_markupInlineKeyboardMarkup可选JSON 对象:InlineKeyboardMarkup

参数说明为简要概括,完整内容请参阅官方文档。

请求示例

curl

curl -s "https://api.telegram.org/bot$TOKEN/editMessageCaption"

Python

import requests

TOKEN = "123456789:AAEexampleTokenReplaceWithYours"
resp = requests.get(f"https://api.telegram.org/bot{TOKEN}/editMessageCaption", timeout=30)
print(resp.json())

JavaScript

const TOKEN = "123456789:AAEexampleTokenReplaceWithYours";
const res = await fetch(`https://api.telegram.org/bot${TOKEN}/editMessageCaption`);
console.log(await res.json());

分步教程: Telegram 机器人教程:从零创建 Telegram 机器人并发送第一条消息