getChatGiftsПоддерживается
Returns the gifts owned by a chat. Returns OwnedGifts on success.
Особенности StaticGram
unsaved gifts only when the bot is an admin; sort_by_price sorts within a page
Параметры
Unique identifier for the target chat or username of the target channel in the format
@usernamePass True to exclude gifts that aren't saved to the chat's profile page. Always True, unless the bot has the can_post_messages administrator right in the channel.
Pass True to exclude gifts that are saved to the chat's profile page. Always False, unless the bot has the can_post_messages administrator right in the channel.
Pass True to exclude gifts that can be purchased an unlimited number of times
Pass True to exclude gifts that can be purchased a limited number of times and can be upgraded to unique
Pass True to exclude gifts that can be purchased a limited number of times and can't be upgraded to unique
Pass True to exclude gifts that were assigned from the TON blockchain and can't be resold or transferred in Telegram
Pass True to exclude unique gifts
Pass True to sort results by gift price instead of send date. Sorting is applied before pagination.
Offset of the first entry to return as received from the previous request; use an empty string to get the first chunk of results
The maximum number of gifts to be returned; 1-100. Defaults to 100.
Пример запроса
curl
curl "https://api.staticgram.top/bot$TOKEN/getChatGifts" \
-H "Content-Type: application/json" \
-d '{
"chat_id": 123456789
}'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_chat_gifts(chat_id=123456789)JavaScript
const res = await fetch(`https://api.staticgram.top/bot${TOKEN}/getChatGifts`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
"chat_id": 123456789
}),
});
const data = await res.json();Ответ (OwnedGifts)
JSON
{
"ok": true,
"result": {
"total_count": 1,
"gifts": []
}
}