transferGiftПоддерживается
Transfers an owned unique gift to another user. Requires the can_transfer_and_upgrade_gifts business bot right. Requires can_transfer_stars business bot right if the transfer is paid. Returns True on success.
Особенности StaticGram
collectibles only; free or paid (needs can_transfer_stars and the exact star_count), needs can_transfer_and_upgrade_gifts
Параметры
Unique identifier of the business connection
Unique identifier of the regular gift that should be transferred
Unique identifier of the chat which will own the gift. The chat must be active in the last 24 hours.
The amount of Telegram Stars that will be paid for the transfer from the business account balance. If positive, then the can_transfer_stars business bot right is required.
Пример запроса
curl
curl "https://api.staticgram.top/bot$TOKEN/transferGift" \
-H "Content-Type: application/json" \
-d '{
"business_connection_id": "<business_connection_id>",
"owned_gift_id": "<owned_gift_id>",
"new_owner_chat_id": 1
}'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.transfer_gift(
business_connection_id="<business_connection_id>",
owned_gift_id="<owned_gift_id>",
new_owner_chat_id=1,
)JavaScript
const res = await fetch(`https://api.staticgram.top/bot${TOKEN}/transferGift`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
"business_connection_id": "<business_connection_id>",
"owned_gift_id": "<owned_gift_id>",
"new_owner_chat_id": 1
}),
});
const data = await res.json();Ответ (True)
JSON
{
"ok": true,
"result": true
}