Отличия от Telegram
Из 185 методов Bot API 10.3 полностью поддерживаются 153, ещё 32 работают с ограничениями. Ниже то, что стоит учесть при переносе бота.
Не поддерживается
- Telegram Passport.
setPassportDataErrorsпринимает данные, но форм Passport на сервере нет. - Guard-боты заявок на вступление.
answerChatJoinRequestQueryиsendChatJoinRequestWebAppотвечаютQUERY_ID_INVALID. - Платные подписки по инвайт-ссылке.
createChatSubscriptionInviteLink,editChatSubscriptionInviteLinkвозвращают 400. - Гостевые запросы.
answerGuestQueryвсегдаQUERY_ID_INVALID. - Платные медиа в каналах и группах (в личных чатах работают), топики в личных чатах, редактирование live-локации в inline-сообщениях, реакции от имени канала (
actor_chat_id), области историйunique_gift. - Платёжные провайдеры. Только звёзды (
XTR), см. Оплата звёздами.
Работает иначе
- Нет обычных групп. Любая группа это супергруппа:
chat.typeбываетprivate,supergroupилиchannel, но неgroup. Id супергрупп и каналов имеют вид-100…. @usernameв chat_id работает для публичных каналов, супергрупп и ботов.- Файлы: загрузка до 25 МБ,
file_pathсовпадает сfile_id,file_idиз Telegram недействительны. См. Файлы. - Вебхуки: self-signed сертификат и
ip_addressигнорируются, разрешён HTTP. - logOut / close просто возвращают
true: сервер один, переносить нечего. - User: поля
language_code,is_premium,added_to_attachment_menuпока не заполняются.
Методы с ограничениями
Полный список частично поддерживаемых методов и что именно в них не работает. Тот же статус показан бейджем на странице каждого метода.
| Метод | Что не поддерживается |
|---|---|
answerChatJoinRequestQuery | no guard-bot join-request queries in the core (ChatJoinRequest.query_id never issued): validates result, answers QUERY_ID_INVALID |
answerGuestQuery | validates guest_query_id / InlineQueryResult, then 400 QUERY_ID_INVALID: the server never produces guest_message updates (no guest-bot concept in the core) |
closeForumTopic | forum supergroups only; emits forum_topic_closed |
createChatSubscriptionInviteLink | parameters validated, then 400 subscription invite links are not supported by this server (no Stars subscription billing in the core) |
createForumTopic | forum supergroups only (the core has no topics in private chats); emits forum_topic_created |
deleteAllMessageReactions | user_id only; actor_chat_id → 400 |
deleteForumTopic | forum supergroups only |
deleteMessageReaction | user_id only; actor_chat_id → 400 |
editChatSubscriptionInviteLink | same as createChatSubscriptionInviteLink (no subscription links can exist) |
editForumTopic | forum supergroups only; emits forum_topic_edited |
editMessageLiveLocation | chat messages only; inline messages → 400; business_connection_id: only messages this bot sent for the account |
editStory | replaces media/caption/areas; same area limits as postStory |
getBusinessAccountGifts | OwnedGiftRegular/Unique with a basic Gift/UniqueGift projection; exclude_from_blockchain honoured; sort_by_price sorts each page (keyset order between pages) |
postStory | needs can_manage_stories; attach:// photo/video, caption/entities, active_period, post_to_chat_page, protect_content, location/suggested_reaction/link/weather areas; unique_gift areas → 400 STORY_AREA_UNSUPPORTED |
reopenForumTopic | forum supergroups only; emits forum_topic_reopened |
sendAnimation | see sendPhoto |
sendAudio | see sendPhoto |
sendChatJoinRequestWebApp | see answerChatJoinRequestQuery (validates the HTTPS web_app_url) |
sendDocument | see sendPhoto |
sendLivePhoto | see sendPhoto |
sendPaidMedia | private chats with Stars (previews until bought, unlock by edit, purchased_paid_media); channels/supergroups → 400 PAID_MEDIA_CHAT_UNSUPPORTED; thumbnail/cover/start_timestamp/show_caption_above_media ignored; business_connection_id rejected |
sendPhoto | photo/document/audio/video/animation/voice/video_note/sticker/live_photo via upload, file_id or URL; has_spoiler, show_caption_above_media, reply/quote/thread/protect/effect honoured; thumbnail, cover, start_timestamp, supports_streaming accepted and ignored; direct-messages-topic/suggested-post options → 400; business_connection_id supported (see sendMessage) |
sendPoll | regular/quiz, anonymous/public, multiple answers, revoting, shuffle, hide results, open_period/close_date, is_closed, description, poll/option media (photo/video/animation/document/audio); members_only, country_codes, explanation_media → 400; allow_adding_options ignored; quiz needs exactly one correct option; business_connection_id supported (poll created by the account) |
sendRichMessageDraft | rich content validated, delivered as a plain-text draft |
sendSticker | see sendPhoto |
sendVideo | see sendPhoto |
sendVideoNote | see sendPhoto |
sendVoice | see sendPhoto |
setManagedBotAccessSettings | stored and returned; not enforced on incoming messages yet |
setPassportDataErrors | validated and stored; the server has no Telegram Passport forms to surface them |
stopMessageLiveLocation | see editMessageLiveLocation |
unpinAllForumTopicMessages | forum supergroups only; unpins the topic's pinned messages one by one |