convertGiftToStarsПоддерживается
Converts a given regular gift to Telegram Stars. Requires the can_convert_gifts_to_stars business bot right. Returns True on success.
Особенности StaticGram
acts as the business account (payments.convertStarGift), needs can_convert_gifts_to_stars; s<id> owned_gift_id (gift without a service message) → 400 STARGIFT_INVALID
Параметры
Unique identifier of the business connection
Unique identifier of the regular gift that should be converted to Telegram Stars
Пример запроса
curl
curl "https://api.staticgram.top/bot$TOKEN/convertGiftToStars" \
-H "Content-Type: application/json" \
-d '{
"business_connection_id": "<business_connection_id>",
"owned_gift_id": "<owned_gift_id>"
}'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.convert_gift_to_stars(
business_connection_id="<business_connection_id>",
owned_gift_id="<owned_gift_id>",
)JavaScript
const res = await fetch(`https://api.staticgram.top/bot${TOKEN}/convertGiftToStars`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
"business_connection_id": "<business_connection_id>",
"owned_gift_id": "<owned_gift_id>"
}),
});
const data = await res.json();Ответ (True)
JSON
{
"ok": true,
"result": true
}