getUserProfilePhotos
사용자 프로필 사진을 반환합니다.
반환값: 성공 시 반환값: UserProfilePhotos.
매개변수
| 매개변수 | 타입 | 필수 | 설명 |
|---|---|---|---|
user_id | Integer | 예 | 사용자 ID |
offset | Integer | 선택 | 페이지네이션 오프셋 |
limit | Integer | 선택 | 사진 수 (1-100, 기본값 100) |
요청 예제
curl
curl -s -X POST "https://api.telegram.org/bot$TOKEN/getUserProfilePhotos" \
-H "Content-Type: application/json" \
-d '{"user_id":123456789}'
Python
import requests
TOKEN = "123456789:AAEexampleTokenReplaceWithYours"
resp = requests.post(
f"https://api.telegram.org/bot{TOKEN}/getUserProfilePhotos",
json={
"user_id": 123456789
},
timeout=30,
)
print(resp.json())
JavaScript
const TOKEN = "123456789:AAEexampleTokenReplaceWithYours";
const res = await fetch(`https://api.telegram.org/bot${TOKEN}/getUserProfilePhotos`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
"user_id": 123456789
}),
});
console.log(await res.json());
단계별 가이드: 텔레그램 봇 만들기: @BotFather로 생성하고 첫 메시지 보내기
관련 메서드
getMe봇 정보를 반환합니다.getMyCommands현재 봇 명령어 목록을 반환합니다.setMyCommands봇 명령어 목록을 설정합니다.deleteMyCommands봇 명령어를 삭제합니다.getMyName봇 이름을 반환합니다.setMyName봇 이름을 설정합니다.getMyDescription봇 설명을 반환합니다.setMyDescription봇 설명을 설정합니다.getMyShortDescription봇의 짧은 설명을 반환합니다.setMyShortDescription봇의 짧은 설명을 설정합니다.setMyProfilePhoto봇 프로필 사진을 설정합니다.removeMyProfilePhoto봇 프로필 사진을 삭제합니다.