StaticGramBot API

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

Параметры

chat_idInteger or Stringобязательный
Unique identifier for the target chat or username of the target channel in the format @username
user_idIntegerобязательный
Unique identifier of the target user
is_anonymousBooleanнеобязательный
Pass True if the administrator's presence in the chat is hidden
can_manage_chatBooleanнеобязательный
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.
can_delete_messagesBooleanнеобязательный
Pass True if the administrator can delete messages of other users
can_manage_video_chatsBooleanнеобязательный
Pass True if the administrator can manage video chats
can_restrict_membersBooleanнеобязательный
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.
can_promote_membersBooleanнеобязательный
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)
can_change_infoBooleanнеобязательный
Pass True if the administrator can change chat title, photo and other settings
can_invite_usersBooleanнеобязательный
Pass True if the administrator can invite new users to the chat
can_post_storiesBooleanнеобязательный
Pass True if the administrator can post stories to the chat
can_edit_storiesBooleanнеобязательный
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
can_delete_storiesBooleanнеобязательный
Pass True if the administrator can delete stories posted by other users
can_post_messagesBooleanнеобязательный
Pass True if the administrator can post messages in the channel, approve suggested posts, or access channel statistics; for channels only
can_edit_messagesBooleanнеобязательный
Pass True if the administrator can edit messages of other users and can pin messages; for channels only
can_pin_messagesBooleanнеобязательный
Pass True if the administrator can pin messages; for supergroups only
can_manage_topicsBooleanнеобязательный
Pass True if the user is allowed to create, rename, close, and reopen forum topics; for supergroups only
can_manage_direct_messagesBooleanнеобязательный
Pass True if the administrator can manage direct messages within the channel and decline suggested posts; for channels only
can_manage_tagsBooleanнеобязательный
Pass True if the administrator can edit the tags of regular members; for groups and supergroups only
can_send_welcome_messagesBooleanнеобязательный
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
}

Описания методов и типов взяты из официальной документации Telegram Bot API (Bot API 10.3). Адрес API: https://api.staticgram.top