getBusinessAccountStarBalanceПоддерживается
Returns the amount of Telegram Stars owned by a managed business account. Requires the can_view_gifts_and_stars business bot right. Returns StarAmount on success.
Особенности StaticGram
can_view_gifts_and_stars
Параметры
Unique identifier of the business connection
Пример запроса
curl
curl "https://api.staticgram.top/bot$TOKEN/getBusinessAccountStarBalance" \
-H "Content-Type: application/json" \
-d '{
"business_connection_id": "<business_connection_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.get_business_account_star_balance(business_connection_id="<business_connection_id>")JavaScript
const res = await fetch(`https://api.staticgram.top/bot${TOKEN}/getBusinessAccountStarBalance`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
"business_connection_id": "<business_connection_id>"
}),
});
const data = await res.json();Ответ (StarAmount)
JSON
{
"ok": true,
"result": {
"amount": 1
}
}