sendLivePhoto
Mengirim live photo (foto + video, Bot API 10.0).
Nilai kembalian: Jika berhasil, mengembalikan Message.
Parameter
| Parameter | Tipe | Wajib | Deskripsi |
|---|---|---|---|
business_connection_id | String | Opsional | ID koneksi bisnis |
chat_id | Integer or String | Ya | ID chat atau @username |
message_thread_id | Integer | Opsional | ID topik forum |
direct_messages_topic_id | Integer | Opsional | ID topik pesan langsung (Bot API 10.0) |
ephemeral_message_parameters | EphemeralMessageParameters | Opsional | Objek JSON EphemeralMessageParameters — pesan efemeral yang hanya terlihat oleh satu pengguna (Bot API 10.3) |
live_photo | InputFile or String | Ya | Video live photo (URL/file_id, maks. 10 detik, 10 MB) |
photo | InputFile or String | Ya | Foto statis (URL/file_id) |
caption | String | Opsional | Keterangan (0-1024) |
parse_mode | String | Opsional | HTML, Markdown, MarkdownV2 |
caption_entities | Array of MessageEntity | Opsional | Array JSON MessageEntity untuk keterangan |
show_caption_above_media | Boolean | Opsional | Tampilkan keterangan di atas media |
has_spoiler | Boolean | Opsional | Sembunyikan konten (spoiler) |
disable_notification | Boolean | Opsional | Kirim tanpa suara |
protect_content | Boolean | Opsional | Lindungi konten |
allow_paid_broadcast | Boolean | Opsional | Izinkan siaran berbayar |
message_effect_id | String | Opsional | ID efek pesan |
suggested_post_parameters | SuggestedPostParameters | Opsional | Objek JSON SuggestedPostParameters |
reply_parameters | ReplyParameters | Opsional | Objek JSON ReplyParameters |
reply_markup | InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply | Opsional | Objek JSON: InlineKeyboardMarkup / ReplyKeyboardMarkup / ReplyKeyboardRemove / ForceReply |
Contoh permintaan
curl
curl -s -X POST "https://api.telegram.org/bot$TOKEN/sendLivePhoto" \
-H "Content-Type: application/json" \
-d '{
"chat_id": 123456789,
"live_photo": {},
"photo": "https://telegram.org/img/t_logo.png"
}'
Python
import requests
TOKEN = "123456789:AAEexampleTokenReplaceWithYours"
resp = requests.post(
f"https://api.telegram.org/bot{TOKEN}/sendLivePhoto",
json={
"chat_id": 123456789,
"live_photo": {},
"photo": "https://telegram.org/img/t_logo.png"
},
timeout=30,
)
print(resp.json())
JavaScript
const TOKEN = "123456789:AAEexampleTokenReplaceWithYours";
const res = await fetch(`https://api.telegram.org/bot${TOKEN}/sendLivePhoto`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
"chat_id": 123456789,
"live_photo": {},
"photo": "https://telegram.org/img/t_logo.png"
}),
});
console.log(await res.json());
Panduan langkah demi langkah: Cara Membuat Bot Telegram: dari BotFather sampai Pesan Pertama
Metode terkait
sendPhotoMengirim foto.sendVideoMengirim video.sendDocumentMengirim dokumen.sendAudioMengirim audio.sendAnimationMengirim animasi (GIF).sendStickerMengirim stiker.sendVoiceMengirim pesan suara.sendVideoNoteMengirim video note (video bulat).sendMediaGroupMengirim grup media (album).sendPaidMediaMengirim media berbayar (Bot API 8.0+).sendDiceMengirim dadu.