editMessageLiveLocation
실시간 위치를 수정합니다.
반환값: 성공 시 반환값: Message or True.
매개변수
| 매개변수 | 타입 | 필수 | 설명 |
|---|---|---|---|
business_connection_id | String | 선택 | 비즈니스 연결 ID |
chat_id | Integer or String | 선택 | 채팅 ID |
message_id | Integer | 선택 | 메시지 ID |
inline_message_id | String | 선택 | 인라인 메시지 ID |
latitude | Float | 예 | 위도 |
longitude | Float | 예 | 경도 |
live_period | Integer | 선택 | 실시간 위치 공유 시간(초) |
horizontal_accuracy | Float | 선택 | 정확도(미터, 0-1500) |
heading | Integer | 선택 | 이동 방향(도, 1-360) |
proximity_alert_radius | Integer | 선택 | 근접 알림 반경 (1-100000) |
reply_markup | InlineKeyboardMarkup | 선택 | InlineKeyboardMarkup JSON 객체 |
요청 예제
curl
curl -s -X POST "https://api.telegram.org/bot$TOKEN/editMessageLiveLocation" \
-H "Content-Type: application/json" \
-d '{"latitude":51.5007,"longitude":-0.1246}'
Python
import requests
TOKEN = "123456789:AAEexampleTokenReplaceWithYours"
resp = requests.post(
f"https://api.telegram.org/bot{TOKEN}/editMessageLiveLocation",
json={
"latitude": 51.5007,
"longitude": -0.1246
},
timeout=30,
)
print(resp.json())
JavaScript
const TOKEN = "123456789:AAEexampleTokenReplaceWithYours";
const res = await fetch(`https://api.telegram.org/bot${TOKEN}/editMessageLiveLocation`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
"latitude": 51.5007,
"longitude": -0.1246
}),
});
console.log(await res.json());
단계별 가이드: 텔레그램 봇 만들기: @BotFather로 생성하고 첫 메시지 보내기
관련 메서드
editMessageText메시지 텍스트를 수정합니다.editMessageCaption미디어 캡션을 수정합니다.editMessageMedia메시지의 미디어를 수정합니다.editMessageReplyMarkup메시지의 인라인 키보드를 수정합니다.stopMessageLiveLocation실시간 위치 공유를 중지합니다.editMessageChecklist체크리스트를 수정합니다.