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
Параметры
Unique identifier of the business connection
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
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
}