setBusinessAccountGiftSettings
비즈니스 계정의 선물 설정을 변경합니다.
반환값: 성공 시 반환값: True.
매개변수
| 매개변수 | 타입 | 필수 | 설명 |
|---|---|---|---|
business_connection_id | String | 예 | 비즈니스 연결 ID |
show_gift_button | Boolean | 예 | 선물 버튼 표시 |
accepted_gift_types | AcceptedGiftTypes | 예 | AcceptedGiftTypes JSON 객체 |
요청 예제
curl
curl -s -X POST "https://api.telegram.org/bot$TOKEN/setBusinessAccountGiftSettings" \
-H "Content-Type: application/json" \
-d '{
"business_connection_id": "BUSINESS_CONNECTION_ID",
"show_gift_button": true,
"accepted_gift_types": {
"unlimited_gifts": true,
"limited_gifts": true,
"unique_gifts": true,
"premium_subscription": true,
"gifts_from_channels": true
}
}'
Python
import requests
TOKEN = "123456789:AAEexampleTokenReplaceWithYours"
resp = requests.post(
f"https://api.telegram.org/bot{TOKEN}/setBusinessAccountGiftSettings",
json={
"business_connection_id": "BUSINESS_CONNECTION_ID",
"show_gift_button": True,
"accepted_gift_types": {
"unlimited_gifts": True,
"limited_gifts": True,
"unique_gifts": True,
"premium_subscription": True,
"gifts_from_channels": True
}
},
timeout=30,
)
print(resp.json())
JavaScript
const TOKEN = "123456789:AAEexampleTokenReplaceWithYours";
const res = await fetch(`https://api.telegram.org/bot${TOKEN}/setBusinessAccountGiftSettings`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
"business_connection_id": "BUSINESS_CONNECTION_ID",
"show_gift_button": true,
"accepted_gift_types": {
"unlimited_gifts": true,
"limited_gifts": true,
"unique_gifts": true,
"premium_subscription": true,
"gifts_from_channels": true
}
}),
});
console.log(await res.json());
단계별 가이드: 텔레그램 봇 만들기: @BotFather로 생성하고 첫 메시지 보내기
관련 메서드
getBusinessAccountStarBalance비즈니스 계정의 Stars 잔액을 반환합니다.getBusinessAccountGifts비즈니스 계정의 선물을 반환합니다.transferBusinessAccountStars비즈니스 계정의 Stars를 봇 잔액으로 이체합니다.readBusinessMessage비즈니스 계정을 대신하여 수신 메시지를 읽음으로 표시합니다.deleteBusinessMessages비즈니스 계정을 대신하여 메시지를 삭제합니다.setBusinessAccountName비즈니스 계정 이름을 설정합니다.setBusinessAccountUsername비즈니스 계정 사용자명을 설정합니다.setBusinessAccountBio비즈니스 계정 소개를 설정합니다.setBusinessAccountProfilePhoto비즈니스 계정 프로필 사진을 설정합니다.removeBusinessAccountProfilePhoto비즈니스 계정 프로필 사진을 삭제합니다.