sendVideoNote
发送视频消息(圆形视频)。
返回值: 调用成功时返回 Message。
参数
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
business_connection_id | String | 可选 | 商业连接 ID |
chat_id | Integer or String | 是 | 聊天 ID 或 @username |
message_thread_id | Integer | 可选 | 论坛话题 ID |
direct_messages_topic_id | Integer | 可选 | 私信话题 ID (Bot API 10.0) |
ephemeral_message_parameters | EphemeralMessageParameters | 可选 | EphemeralMessageParameters JSON 对象——仅对单个用户可见的临时消息 (Bot API 10.3) |
video_note | InputFile or String | 是 | 视频消息 URL 或 file_id |
duration | Integer | 可选 | 时长(秒) |
length | Integer | 可选 | 宽度和高度(圆的直径) |
thumbnail | InputFile or String | 可选 | 缩略图 URL 或 file_id |
disable_notification | Boolean | 可选 | 静默发送 |
protect_content | Boolean | 可选 | 保护内容 |
allow_paid_broadcast | Boolean | 可选 | 允许付费广播 |
message_effect_id | String | 可选 | 消息特效 ID |
suggested_post_parameters | SuggestedPostParameters | 可选 | SuggestedPostParameters JSON 对象 |
reply_parameters | ReplyParameters | 可选 | ReplyParameters JSON 对象 |
reply_markup | InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply | 可选 | JSON 对象:InlineKeyboardMarkup / ReplyKeyboardMarkup / ReplyKeyboardRemove / ForceReply |
请求示例
curl
curl -s -X POST "https://api.telegram.org/bot$TOKEN/sendVideoNote" \
-H "Content-Type: application/json" \
-d '{"chat_id":123456789,"video_note":"FILE_ID"}'
Python
import requests
TOKEN = "123456789:AAEexampleTokenReplaceWithYours"
resp = requests.post(
f"https://api.telegram.org/bot{TOKEN}/sendVideoNote",
json={
"chat_id": 123456789,
"video_note": "FILE_ID"
},
timeout=30,
)
print(resp.json())
JavaScript
const TOKEN = "123456789:AAEexampleTokenReplaceWithYours";
const res = await fetch(`https://api.telegram.org/bot${TOKEN}/sendVideoNote`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
"chat_id": 123456789,
"video_note": "FILE_ID"
}),
});
console.log(await res.json());
分步教程: Telegram 机器人教程:从零创建 Telegram 机器人并发送第一条消息
相关方法
sendPhoto发送照片。sendVideo发送视频。sendDocument发送文件。sendAudio发送音频。sendAnimation发送动画(GIF)。sendSticker发送贴纸。sendVoice发送语音消息。sendMediaGroup发送一组媒体(相册)。sendPaidMedia发送付费媒体 (Bot API 8.0+)。sendDice发送骰子。sendLivePhoto发送实况照片(照片 + 视频,Bot API 10.0)。