getGameHighScores
게임 최고 점수를 반환합니다.
반환값: 성공 시 반환값: Array of GameHighScore.
매개변수
| 매개변수 | 타입 | 필수 | 설명 |
|---|---|---|---|
user_id | Integer | 예 | 사용자 ID |
chat_id | Integer | 선택 | 채팅 ID |
message_id | Integer | 선택 | 메시지 ID |
inline_message_id | String | 선택 | 인라인 메시지 ID |
요청 예제
curl
curl -s -X POST "https://api.telegram.org/bot$TOKEN/getGameHighScores" \
-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}/getGameHighScores",
json={
"user_id": 123456789
},
timeout=30,
)
print(resp.json())
JavaScript
const TOKEN = "123456789:AAEexampleTokenReplaceWithYours";
const res = await fetch(`https://api.telegram.org/bot${TOKEN}/getGameHighScores`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
"user_id": 123456789
}),
});
console.log(await res.json());
단계별 가이드: 텔레그램 봇 만들기: @BotFather로 생성하고 첫 메시지 보내기
관련 메서드
sendGame게임을 전송합니다.setGameScore사용자의 게임 점수를 설정합니다.