promoteChatMemberПоддерживается
Use this method to promote or demote a user in a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Pass False for all boolean parameters to demote a user. Returns True on success.
Особенности StaticGram
channel-only / supergroup-only rights dropped per chat kind; can_restrict_members defaults to true for channel promotions; non-members rejected (USER_NOT_PARTICIPANT); only admins promoted by the bot are editable
Параметры
Unique identifier for the target chat or username of the target channel in the format
@usernameUnique identifier of the target user
Pass True if the administrator's presence in the chat is hidden
Pass True if the administrator can access the chat event log, get boost list, see hidden supergroup and channel members, report spam messages, ignore slow mode, and send messages to the chat without paying Telegram Stars. Implied by any other administrator privilege.
Pass True if the administrator can delete messages of other users
Pass True if the administrator can manage video chats
Pass True if the administrator can restrict, ban or unban chat members, or access supergroup statistics. For backward compatibility, defaults to True for promotions of channel administrators.
Pass True if the administrator can add new administrators with a subset of their own privileges or demote administrators that they have promoted, directly or indirectly (promoted by administrators that were appointed by him)
Pass True if the administrator can change chat title, photo and other settings
Pass True if the administrator can invite new users to the chat
Pass True if the administrator can post stories to the chat
Pass True if the administrator can edit stories posted by other users, post stories to the chat page, pin chat stories, and access the chat's story archive
Pass True if the administrator can delete stories posted by other users
Pass True if the administrator can post messages in the channel, approve suggested posts, or access channel statistics; for channels only
Pass True if the administrator can edit messages of other users and can pin messages; for channels only
Pass True if the administrator can pin messages; for supergroups only
Pass True if the user is allowed to create, rename, close, and reopen forum topics; for supergroups only
Pass True if the administrator can manage direct messages within the channel and decline suggested posts; for channels only
Pass True if the administrator can edit the tags of regular members; for groups and supergroups only
Pass True if the administrator can manage chat welcome messages or directly send them in the case of bots
Пример запроса
curl
curl "https://api.staticgram.top/bot$TOKEN/promoteChatMember" \
-H "Content-Type: application/json" \
-d '{
"chat_id": 123456789,
"user_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.promote_chat_member(chat_id=123456789, user_id=123456789)JavaScript
const res = await fetch(`https://api.staticgram.top/bot${TOKEN}/promoteChatMember`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
"chat_id": 123456789,
"user_id": 123456789
}),
});
const data = await res.json();Ответ (True)
JSON
{
"ok": true,
"result": true
}