StaticGramBot API

answerChatJoinRequestQueryПоддерживается

Use this method to process a received chat join request query. Returns True on success.

Особенности StaticGram

guard bot set via channels.toggleJoinRequest guard_bot; chat_join_request carries query_id for the guard bot only; approve/decline run hideChatJoinRequest as the bot (needs can_invite_users), queue leaves the request to admins; the requester gets updateJoinChatWebViewDecision; 10 s window; unknown/foreign/answered/expired → QUERY_ID_INVALID; MTProto twin bots.setJoinChatResults

Параметры

chat_join_request_query_idStringобязательный
Unique identifier of the join request query
resultStringобязательный
Result of the query. Must be either “approve” to allow the user to join the chat, “decline” to disallow the user to join the chat, or “queue” to leave the decision to other administrators.

Пример запроса

curl
curl "https://api.staticgram.top/bot$TOKEN/answerChatJoinRequestQuery" \
  -H "Content-Type: application/json" \
  -d '{
    "chat_join_request_query_id": "value",
    "result": {}
  }'
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.answer_chat_join_request_query(chat_join_request_query_id="value", result={})
JavaScript
const res = await fetch(`https://api.staticgram.top/bot${TOKEN}/answerChatJoinRequestQuery`, {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "chat_join_request_query_id": "value",
    "result": {}
  }),
});
const data = await res.json();

Ответ (True)

JSON
{
  "ok": true,
  "result": true
}

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