getUpdates
업데이트를 가져옵니다. Long Polling에는 '시작' 버튼을 사용하십시오.
반환값: 성공 시 반환값: Array of Update.
매개변수
| 매개변수 | 타입 | 필수 | 설명 |
|---|---|---|---|
offset | Integer | 선택 | 다음 요청용 오프셋 |
limit | Integer | 선택 | 최대 개수 (1-100) |
timeout | Integer | 선택 | 타임아웃(초) |
allowed_updates | Array of String | 선택 | 유형 JSON 배열 |
요청 예제
curl
curl -s "https://api.telegram.org/bot$TOKEN/getUpdates"
Python
import requests
TOKEN = "123456789:AAEexampleTokenReplaceWithYours"
resp = requests.get(f"https://api.telegram.org/bot{TOKEN}/getUpdates", timeout=30)
print(resp.json())
JavaScript
const TOKEN = "123456789:AAEexampleTokenReplaceWithYours";
const res = await fetch(`https://api.telegram.org/bot${TOKEN}/getUpdates`);
console.log(await res.json());
단계별 가이드: 텔레그램 chat id 확인방법: 개인, 그룹, 채널, 토픽별 chat id 찾기
관련 메서드
getWebhookInfo웹훅 정보를 반환합니다.setWebhook웹훅을 설정합니다.deleteWebhook웹훅을 삭제합니다.