sendPaidMediaПоддерживается
Use this method to send paid media. On success, the sent Message is returned.
private chats, business chats (business_connection_id: sent as the account, Stars to the bot) and channels/supergroups; channel media stays locked per viewer (paid_media_purchases): buyers, the sender and admins of broadcast channels see messageExtendedMedia, others messageExtendedMediaPreview (w/h/duration + stripped blur thumb); purchase via payments.sendStarsForm → Stars to the channel balance (broadcast) or the bot (supergroups, private), updateMessageExtendedMedia to the buyer, purchased_paid_media except in broadcast channels; payload, message_thread_id, reply_parameters, show_caption_above_media, protect_content, video cover/start_timestamp/supports_streaming, thumbnail (attach:// only, used as the preview); allow_paid_broadcast accepted and ignored; channel direct messages chats → 400 "paid media can't be sent to channel direct messages chats"
Параметры
@username. If the chat is a channel, all Telegram Star proceeds from this media will be credited to the chat's balance. Otherwise, they will be credited to the bot's balance.Пример запроса
curl "https://api.staticgram.top/bot$TOKEN/sendPaidMedia" \
-H "Content-Type: application/json" \
-d '{
"chat_id": 123456789,
"star_count": 50,
"media": []
}'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.send_paid_media(chat_id=123456789, star_count=50, media=[])const res = await fetch(`https://api.staticgram.top/bot${TOKEN}/sendPaidMedia`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
"chat_id": 123456789,
"star_count": 50,
"media": []
}),
});
const data = await res.json();Ответ (Message)
{
"ok": true,
"result": {
"message_id": 1,
"date": 1790000000,
"chat": {
"id": 1780243423,
"type": "private"
}
}
}