StaticGramBot API

setBusinessAccountGiftSettingsПоддерживается

Changes the privacy settings pertaining to incoming gifts in a managed business account. Requires the can_change_gift_settings business bot right. Returns True on success.

Особенности StaticGram

global privacy display_gifts_button + disallowed gifts

Параметры

business_connection_idStringобязательный
Unique identifier of the business connection
show_gift_buttonBooleanобязательный
Pass True if a button for sending a gift to the user or by the business account must always be shown in the input field
accepted_gift_typesAcceptedGiftTypesобязательный
Types of gifts accepted by the business account

Пример запроса

curl
curl "https://api.staticgram.top/bot$TOKEN/setBusinessAccountGiftSettings" \
  -H "Content-Type: application/json" \
  -d '{
    "business_connection_id": "<business_connection_id>",
    "show_gift_button": true,
    "accepted_gift_types": {}
  }'
aiogram 3
from aiogram import Bot
from aiogram.client.session.aiohttp import AiohttpSession
from aiogram.client.telegram import TelegramAPIServer

session = AiohttpSession(api=TelegramAPIServer.from_base("https://api.staticgram.top"))
bot = Bot(TOKEN, session=session)

result = await bot.set_business_account_gift_settings(
    business_connection_id="<business_connection_id>",
    show_gift_button=True,
    accepted_gift_types={},
)
JavaScript
const res = await fetch(`https://api.staticgram.top/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": {}
  }),
});
const data = await res.json();

Ответ (True)

JSON
{
  "ok": true,
  "result": true
}

Описания методов и типов взяты из официальной документации Telegram Bot API (Bot API 10.3). Адрес API: https://api.staticgram.top