From 99ea79571676869fe5a21b26a9a37c52229b84b8 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Sat, 5 Feb 2022 04:41:48 +0000 Subject: [PATCH] Update content of files --- data/core.telegram.org/api.html | 253 + data/core.telegram.org/api/config.html | 422 + data/core.telegram.org/api/end-to-end.html | 244 + .../api/end-to-end/video-calls.html | 215 + data/core.telegram.org/api/pin.html | 149 + data/core.telegram.org/api/stats.html | 297 - .../api/url-authorization.html | 160 + ...sages.sendBroadcast => apple_privacy.html} | 49 +- data/core.telegram.org/bots.html | 437 + .../core.telegram.org/bots/api-changelog.html | 670 -- data/core.telegram.org/bots/api.html | 9488 +++++++++++++++++ data/core.telegram.org/bots/inline.html | 182 + .../constructor/account.authorizationForm | 174 - .../constructor/auth.codeTypeCall | 132 - .../constructor/auth.passwordRecovery | 152 - .../constructor/baseThemeTinted.html | 132 - .../constructor/boolTrue.html | 132 - .../botCommandScopePeerAdmins.html | 150 - .../constructor/channel.html | 289 - ...nnelAdminLogEventActionChangeLocation.html | 152 - .../constructor/contacts.contactsNotModified | 132 - .../decryptedMessageMediaAudio.html | 174 - .../constructor/inlineQueryPeerTypePM.html | 132 - .../constructor/inputFileLocation.html | 165 - .../inputKeyboardButtonUrlAuth.html | 176 - ...userEmpty.html => inputMediaGeoPoint.html} | 24 +- ...html => inputReportReasonPornography.html} | 18 +- .../messageActionInviteToGroupCall.html | 152 - .../messageActionPaymentSentMe.html | 179 - .../messages.allStickersNotModified | 132 - .../constructor/messages.exportedChatInvite | 152 - .../constructor/peerNotifySettings.html | 182 - .../constructor/secureValueTypeAddress.html | 132 - .../secureValueTypeTemporaryRegistration.html | 132 - .../{textUnderline.html => statsURL.html} | 24 +- .../constructor/stickerSet.html} | 99 +- ...tml => topPeerCategoryCorrespondents.html} | 16 +- .../constructor/updateChannelTooLong.html | 161 - ...mpty.html => updateDialogFilterOrder.html} | 28 +- ...eActionDeleteMessages.html => upload.file} | 35 +- data/core.telegram.org/contest300K.html | 237 - .../core.telegram.org/css/bootstrap-extra.css | 3274 ------ data/core.telegram.org/css/core-widgets.css | 105 - data/core.telegram.org/css/telegram-extra.css | 246 - data/core.telegram.org/getProxyConfig.html | 24 + data/core.telegram.org/import-stickers.html | 159 + data/core.telegram.org/js/core-widgets.js | 279 - data/core.telegram.org/js/jquery-ui.min.js | 9 - .../js/telegram-passport2.js | 413 - ...essages.searchGifs => account.verifyPhone} | 54 +- ...ges.editChatTitle => messages.editMessage} | 189 +- ...earAllDrafts => messages.getDialogFilters} | 26 +- .../method/messages.getHistory | 232 - .../method/messages.readDiscussion} | 51 +- .../method/messages.uninstallStickerSet} | 38 +- .../method/payments.clearSavedInfo | 160 - ...cussionMessage => stats.getMegagroupStats} | 56 +- .../method/stats.getMessagePublicForwards | 212 - data/core.telegram.org/mtproto.html | 260 + .../mtproto/TL-polymorph.html | 170 + data/core.telegram.org/mtproto/TL-types.html | 124 + .../mtproto/description_v1.html | 205 + data/core.telegram.org/mtproto/serialize.html | 240 + data/core.telegram.org/passport/example.html | 585 - .../reproducible-builds.html | 488 + data/core.telegram.org/schema.html | 1800 ++++ .../schema/end-to-end-json.html | 1 - data/core.telegram.org/stickers.html | 249 + .../stickers/webm-vp9-encoding.html | 159 + data/core.telegram.org/tdlib.html | 147 + data/core.telegram.org/tdlib/options.html | 501 - data/core.telegram.org/techfaq.html | 333 + .../type/ChannelAdminLogEventAction.html | 298 - .../type/ChannelLocation.html | 148 - .../type/ChatParticipant.html | 153 - .../type/ExportedChatInvite.html | 162 - .../type/ExportedMessageLink.html | 162 - .../type/InputStickerSetItem.html | 143 - ...ortedAuthorization => LangPackString.html} | 41 +- data/core.telegram.org/type/Null.html | 143 - .../type/PasswordKdfAlgo.html | 151 - data/core.telegram.org/type/SavedContact.html | 143 - data/core.telegram.org/type/SecureFile.html | 151 - .../type/SecureValueType.html | 203 - .../StatsGroupTopAdmin.html} | 35 +- data/core.telegram.org/type/Updates.html | 508 - .../type/{contacts.Found => WallPaper.html} | 36 +- .../type/auth.PasswordRecovery | 165 - .../type/messages.ArchivedStickers | 162 - .../type/payments.BankCardData | 162 - data/core.telegram.org/video_stickers.html | 115 + data/corefork.telegram.org.html | 253 + .../api/animated-emojis.html | 187 + .../api/auth.html | 6 +- .../api/bots/commands.html | 140 + .../corefork.telegram.org/api/datacenter.html | 148 - .../corefork.telegram.org/api/discussion.html | 151 + data/corefork.telegram.org/api/drafts.html | 131 + .../api/end-to-end/seq_no.html | 173 - data/corefork.telegram.org/api/errors.html | 189 + data/corefork.telegram.org/api/files.html | 568 + data/corefork.telegram.org/api/folders.html | 179 + data/corefork.telegram.org/api/import.html | 173 + data/corefork.telegram.org/api/invoking.html | 154 + data/corefork.telegram.org/api/mentions.html | 152 + .../api/obtaining_api_id.html | 140 + data/corefork.telegram.org/api/search.html | 179 + data/corefork.telegram.org/api/srp.html | 307 + data/corefork.telegram.org/api/threads.html | 182 + .../api/url-authorization.html | 160 + data/corefork.telegram.org/cdn.html | 210 - .../constructor/auth.sentAppCode | 163 - ...nLogEventActionParticipantToggleAdmin.html | 155 - ...nLogEventActionToggleGroupCallSetting.html | 147 - .../channelParticipantsAdmins.html | 132 + ...ns.html => channelParticipantsBanned.html} | 24 +- .../constructor/channelParticipantsBots.html | 132 + .../channelParticipantsContacts.html | 147 + .../channelParticipantsKicked.html | 147 + ....html => channelParticipantsMentions.html} | 41 +- .../channelParticipantsRecent.html | 6 +- ...ne.html => channelParticipantsSearch.html} | 24 +- .../decryptedMessageActionResend.html | 155 - ...ages.recentStickers => help.countriesList} | 40 +- .../constructor/help.countriesListNotModified | 132 + .../constructor/inputAppEvent.html | 162 - ...{pageBlockAudio.html => inputChannel.html} | 32 +- ...ryChannels.html => inputChannelEmpty.html} | 18 +- .../constructor/inputChannelFromMessage.html | 160 + .../inputDocumentFileLocation.html | 167 - .../constructor/inputMediaPhoto.html | 157 - .../inputPeerChannelFromMessage.html | 160 + .../{peerUser.html => inputPeerChat.html} | 22 +- .../constructor/inputPeerEmpty.html | 132 + .../constructor/inputPeerSelf.html | 6 +- ...pdateGroupCall.html => inputPeerUser.html} | 32 +- .../constructor/inputPeerUserFromMessage.html | 160 + .../inputPrivacyKeyAddedByPhone.html | 132 - .../{photoSizeEmpty.html => inputUser.html} | 33 +- ...ickerSetEmpty.html => inputUserEmpty.html} | 18 +- .../constructor/inputUserFromMessage.html | 160 + ...geBlockDivider.html => inputUserSelf.html} | 18 +- .../messageActionInviteToGroupCall.html | 152 - ...ntMessageLink => messages.affectedHistory} | 40 +- .../constructor/peerLocated.html | 157 - .../{photoPathSize.html => photoSize.html} | 36 +- .../constructor/savedPhoneContact.html | 162 - .../constructor/secureSecretSettings.html | 157 - .../constructor/{chatEmpty.html => true.html} | 37 +- ...ileReuploadNeeded => updateMessageID.html} | 32 +- .../css/telegram-extra.css | 246 - .../corefork.telegram.org/getProxyConfig.html | 24 + .../js/telegram-passport2.js | 413 - .../method/account.getWallPapers | 153 - .../method/account.getWebAuthorizations | 136 - .../method/account.reportProfilePhoto | 165 - .../method/account.updateProfile | 187 - .../method/auth.requestPasswordRecovery | 159 - ...tStickerSet => channels.deleteUserHistory} | 63 +- .../method/channels.getAdminedPublicChannels | 191 - .../method/channels.getSponsoredMessages | 154 - .../method/contacts.getContactIDs | 151 - ...UpNotification => contacts.toggleTopPeers} | 25 +- .../method/help.getAppConfig | 142 - .../method/help.getAppUpdate | 150 - .../method/help.getPromoData | 135 - .../method/help.getSupport | 134 - .../method/help.saveAppLog | 150 - .../method/help.setBotUpdatesStatus | 156 - .../method/messages.deleteHistory} | 67 +- .../method/messages.getSplitRanges | 133 - ...suggestShortName => messages.readMentions} | 45 +- .../method/messages.sendEncryptedService | 205 - ...etChatThemes => messages.unpinAllMessages} | 32 +- .../method/photos.deletePhotos | 148 - .../mtproto/TL-abstract-types.html | 202 + .../mtproto/TL-combinators.html | 251 + .../mtproto/TL-dependent.html | 236 + .../mtproto/TL-formal.html | 319 + .../mtproto/TL-optargs.html | 6 +- .../mtproto/TL-patterns.html | 129 + .../mtproto/TL-polymorph.html | 170 + data/corefork.telegram.org/mtproto/TL-tl.html | 308 + .../mtproto/TL-types.html | 124 + .../mtproto/serialize.html | 240 + .../passport/sdk-android.html | 180 - data/corefork.telegram.org/themes.html | 143 + .../corefork.telegram.org/type/CdnConfig.html | 164 - ...ey.html => ChannelParticipantsFilter.html} | 62 +- .../type/ImportedContact.html | 143 - ...WebFileLocation.html => InputChannel.html} | 31 +- .../type/{RecentMeUrl.html => InputPeer.html} | 54 +- .../{PageListItem.html => InputUser.html} | 36 +- .../type/PageListOrderedItem.html | 148 - .../type/PaymentSavedCredentials.html | 143 - .../type/ReceivedNotifyMessage.html | 143 - data/corefork.telegram.org/type/RichText.html | 218 - .../{RestrictionReason.html => True.html} | 24 +- .../type/auth.CheckedPhone | 128 - .../{help.DeepLinkInfo => help.CountriesList} | 32 +- .../type/long.html} | 30 +- ...swordSettings => messages.AffectedHistory} | 46 +- data/corefork.telegram.org/widgets.html | 141 + .../widgets/discussion.html | 226 + ...android.html => desktop.telegram.org.html} | 46 +- .../auth.html} | 3 +- data/instantview.telegram.org/docs.html | 1527 +++ data/instantview.telegram.org/samples.html | 395 - data/promote.telegram.org/basics.html | 205 - .../promote.telegram.org/getting-started.html | 321 + data/promote.telegram.org/tos.html | 253 - .../api.html => telegram.org.html} | 4 +- ...d-and-usage.html => admin-revolution.html} | 116 +- ...rounds-2-0.html => animated-stickers.html} | 86 +- data/telegram.org/blog/apple-watch.html | 225 - data/telegram.org/blog/cryptocontest.html | 224 - data/telegram.org/blog/folders.html | 298 - ...vacy-emoji.html => group-video-calls.html} | 109 +- .../blog/instant-view-contest-200K.html | 273 + data/telegram.org/blog/invite-links.html | 217 - .../blog/photo-editor-and-passcodes.html | 252 - .../pinned-messages-locations-playlists.html | 282 + .../blog/privacy-discussions-web-bots.html | 284 + ...profile-videos-people-nearby-and-more.html | 315 - ...ected-content-delete-by-date-and-more.html | 324 + .../blog/reactions-spoilers-translations.html | 300 + ...lling-calendar-join-requests-and-more.html | 343 + .../blog/silent-messages-slow-mode.html | 296 + ...android-2-0.html => translations-iv2.html} | 133 +- .../blog/verifiable-apps-and-more.html | 392 - .../blog/video-stickers-better-reactions.html | 273 + .../blog/voice-chats-on-steroids.html | 275 + .../{blog/6-years.html => evolution.html} | 850 +- data/telegram.org/faq.html | 705 ++ data/telegram.org/faq_spam.html | 163 - data/telegram.org/jobs.html | 156 + data/telegram.org/js/games.js | 206 - data/telegram.org/privacy.html | 299 + data/telegram.org/privacy/gmailbot.html | 161 + data/telegram.org/tos.html | 133 + data/telegram.org/tour.html | 144 + data/telegram.org/tour/channels.html | 294 + data/telegram.org/tour/screenshots.html | 217 - .../e2ee.html => themes.telegram.org.html} | 84 +- data/translations.telegram.org.html | 297 - data/translations.telegram.org/en.html | 333 - .../translations.telegram.org/en/android.html | 388 - .../en/android_x.html | 388 - data/translations.telegram.org/en/ios.html | 388 - data/translations.telegram.org/en/macos.html | 388 - .../en/tdesktop.html | 388 - data/tsf.telegram.org.html | 240 - data/tsf.telegram.org/css/billboard.css | 359 - data/tsf.telegram.org/css/bootstrap-extra.css | 3274 ------ data/tsf.telegram.org/css/bootstrap.min.css | 10 - data/tsf.telegram.org/css/health.css | 1422 --- data/tsf.telegram.org/css/jquery-ui.min.css | 6 - data/tsf.telegram.org/css/tchart.min.css | 1 - data/tsf.telegram.org/css/telegram.css | 4872 --------- data/tsf.telegram.org/css/tsf.css | 2473 ----- data/tsf.telegram.org/js/billboard.min.js | 13 - data/tsf.telegram.org/js/bootstrap.min.js | 11 - data/tsf.telegram.org/js/jquery-ui.min.js | 9 - data/tsf.telegram.org/js/jquery.min.js | 4 - data/tsf.telegram.org/js/main-aj.js | 1148 -- data/tsf.telegram.org/js/main.js | 685 -- data/tsf.telegram.org/js/stats.js | 683 -- data/tsf.telegram.org/js/tchart.min.js | 1 - data/tsf.telegram.org/js/tsf.js | 1236 --- data/tsf.telegram.org/manuals.html | 224 - .../manuals/answering_questions.html | 265 - data/tsf.telegram.org/manuals/bios.html | 331 - .../tsf.telegram.org/manuals/bug_herding.html | 334 - .../tsf.telegram.org/manuals/bug_hunting.html | 270 - data/tsf.telegram.org/manuals/bugs.html | 460 - .../tsf.telegram.org/manuals/come-and-go.html | 229 - 276 files changed, 31625 insertions(+), 46129 deletions(-) create mode 100644 data/core.telegram.org/api.html create mode 100644 data/core.telegram.org/api/config.html create mode 100644 data/core.telegram.org/api/end-to-end.html create mode 100644 data/core.telegram.org/api/end-to-end/video-calls.html create mode 100644 data/core.telegram.org/api/pin.html delete mode 100644 data/core.telegram.org/api/stats.html create mode 100644 data/core.telegram.org/api/url-authorization.html rename data/core.telegram.org/{method/messages.sendBroadcast => apple_privacy.html} (68%) create mode 100644 data/core.telegram.org/bots.html delete mode 100644 data/core.telegram.org/bots/api-changelog.html create mode 100644 data/core.telegram.org/bots/api.html create mode 100644 data/core.telegram.org/bots/inline.html delete mode 100644 data/core.telegram.org/constructor/account.authorizationForm delete mode 100644 data/core.telegram.org/constructor/auth.codeTypeCall delete mode 100644 data/core.telegram.org/constructor/auth.passwordRecovery delete mode 100644 data/core.telegram.org/constructor/baseThemeTinted.html delete mode 100644 data/core.telegram.org/constructor/boolTrue.html delete mode 100644 data/core.telegram.org/constructor/botCommandScopePeerAdmins.html delete mode 100644 data/core.telegram.org/constructor/channel.html delete mode 100644 data/core.telegram.org/constructor/channelAdminLogEventActionChangeLocation.html delete mode 100644 data/core.telegram.org/constructor/contacts.contactsNotModified delete mode 100644 data/core.telegram.org/constructor/decryptedMessageMediaAudio.html delete mode 100644 data/core.telegram.org/constructor/inlineQueryPeerTypePM.html delete mode 100644 data/core.telegram.org/constructor/inputFileLocation.html delete mode 100644 data/core.telegram.org/constructor/inputKeyboardButtonUrlAuth.html rename data/core.telegram.org/constructor/{userEmpty.html => inputMediaGeoPoint.html} (91%) rename data/core.telegram.org/constructor/{privacyValueDisallowContacts.html => inputReportReasonPornography.html} (91%) delete mode 100644 data/core.telegram.org/constructor/messageActionInviteToGroupCall.html delete mode 100644 data/core.telegram.org/constructor/messageActionPaymentSentMe.html delete mode 100644 data/core.telegram.org/constructor/messages.allStickersNotModified delete mode 100644 data/core.telegram.org/constructor/messages.exportedChatInvite delete mode 100644 data/core.telegram.org/constructor/peerNotifySettings.html delete mode 100644 data/core.telegram.org/constructor/secureValueTypeAddress.html delete mode 100644 data/core.telegram.org/constructor/secureValueTypeTemporaryRegistration.html rename data/core.telegram.org/constructor/{textUnderline.html => statsURL.html} (91%) rename data/{corefork.telegram.org/constructor/langPackLanguage.html => core.telegram.org/constructor/stickerSet.html} (73%) rename data/core.telegram.org/constructor/{topPeerCategoryForwardUsers.html => topPeerCategoryCorrespondents.html} (92%) delete mode 100644 data/core.telegram.org/constructor/updateChannelTooLong.html rename data/core.telegram.org/constructor/{photoSizeEmpty.html => updateDialogFilterOrder.html} (86%) rename data/core.telegram.org/constructor/{decryptedMessageActionDeleteMessages.html => upload.file} (87%) delete mode 100644 data/core.telegram.org/contest300K.html delete mode 100644 data/core.telegram.org/css/bootstrap-extra.css delete mode 100644 data/core.telegram.org/css/core-widgets.css delete mode 100644 data/core.telegram.org/css/telegram-extra.css create mode 100644 data/core.telegram.org/getProxyConfig.html create mode 100644 data/core.telegram.org/import-stickers.html delete mode 100644 data/core.telegram.org/js/core-widgets.js delete mode 100644 data/core.telegram.org/js/jquery-ui.min.js delete mode 100644 data/core.telegram.org/js/telegram-passport2.js rename data/core.telegram.org/method/{messages.searchGifs => account.verifyPhone} (77%) rename data/core.telegram.org/method/{messages.editChatTitle => messages.editMessage} (66%) rename data/core.telegram.org/method/{messages.clearAllDrafts => messages.getDialogFilters} (88%) delete mode 100644 data/core.telegram.org/method/messages.getHistory rename data/{corefork.telegram.org/method/account.resetAuthorization => core.telegram.org/method/messages.readDiscussion} (84%) rename data/{corefork.telegram.org/method/langpack.getLanguages => core.telegram.org/method/messages.uninstallStickerSet} (86%) delete mode 100644 data/core.telegram.org/method/payments.clearSavedInfo rename data/core.telegram.org/method/{messages.getDiscussionMessage => stats.getMegagroupStats} (72%) delete mode 100644 data/core.telegram.org/method/stats.getMessagePublicForwards create mode 100644 data/core.telegram.org/mtproto.html create mode 100644 data/core.telegram.org/mtproto/TL-polymorph.html create mode 100644 data/core.telegram.org/mtproto/TL-types.html create mode 100644 data/core.telegram.org/mtproto/description_v1.html create mode 100644 data/core.telegram.org/mtproto/serialize.html delete mode 100644 data/core.telegram.org/passport/example.html create mode 100644 data/core.telegram.org/reproducible-builds.html create mode 100644 data/core.telegram.org/schema.html delete mode 100644 data/core.telegram.org/schema/end-to-end-json.html create mode 100644 data/core.telegram.org/stickers.html create mode 100644 data/core.telegram.org/stickers/webm-vp9-encoding.html create mode 100644 data/core.telegram.org/tdlib.html delete mode 100644 data/core.telegram.org/tdlib/options.html create mode 100644 data/core.telegram.org/techfaq.html delete mode 100644 data/core.telegram.org/type/ChannelAdminLogEventAction.html delete mode 100644 data/core.telegram.org/type/ChannelLocation.html delete mode 100644 data/core.telegram.org/type/ChatParticipant.html delete mode 100644 data/core.telegram.org/type/ExportedChatInvite.html delete mode 100644 data/core.telegram.org/type/ExportedMessageLink.html delete mode 100644 data/core.telegram.org/type/InputStickerSetItem.html rename data/core.telegram.org/type/{auth.ExportedAuthorization => LangPackString.html} (79%) delete mode 100644 data/core.telegram.org/type/Null.html delete mode 100644 data/core.telegram.org/type/PasswordKdfAlgo.html delete mode 100644 data/core.telegram.org/type/SavedContact.html delete mode 100644 data/core.telegram.org/type/SecureFile.html delete mode 100644 data/core.telegram.org/type/SecureValueType.html rename data/core.telegram.org/{constructor/inlineQueryPeerTypeBroadcast.html => type/StatsGroupTopAdmin.html} (86%) delete mode 100644 data/core.telegram.org/type/Updates.html rename data/core.telegram.org/type/{contacts.Found => WallPaper.html} (79%) delete mode 100644 data/core.telegram.org/type/auth.PasswordRecovery delete mode 100644 data/core.telegram.org/type/messages.ArchivedStickers delete mode 100644 data/core.telegram.org/type/payments.BankCardData create mode 100644 data/core.telegram.org/video_stickers.html create mode 100644 data/corefork.telegram.org.html create mode 100644 data/corefork.telegram.org/api/animated-emojis.html rename data/{core.telegram.org => corefork.telegram.org}/api/auth.html (98%) create mode 100644 data/corefork.telegram.org/api/bots/commands.html delete mode 100644 data/corefork.telegram.org/api/datacenter.html create mode 100644 data/corefork.telegram.org/api/discussion.html create mode 100644 data/corefork.telegram.org/api/drafts.html delete mode 100644 data/corefork.telegram.org/api/end-to-end/seq_no.html create mode 100644 data/corefork.telegram.org/api/errors.html create mode 100644 data/corefork.telegram.org/api/files.html create mode 100644 data/corefork.telegram.org/api/folders.html create mode 100644 data/corefork.telegram.org/api/import.html create mode 100644 data/corefork.telegram.org/api/invoking.html create mode 100644 data/corefork.telegram.org/api/mentions.html create mode 100644 data/corefork.telegram.org/api/obtaining_api_id.html create mode 100644 data/corefork.telegram.org/api/search.html create mode 100644 data/corefork.telegram.org/api/srp.html create mode 100644 data/corefork.telegram.org/api/threads.html create mode 100644 data/corefork.telegram.org/api/url-authorization.html delete mode 100644 data/corefork.telegram.org/cdn.html delete mode 100644 data/corefork.telegram.org/constructor/auth.sentAppCode delete mode 100644 data/corefork.telegram.org/constructor/channelAdminLogEventActionParticipantToggleAdmin.html delete mode 100644 data/corefork.telegram.org/constructor/channelAdminLogEventActionToggleGroupCallSetting.html create mode 100644 data/corefork.telegram.org/constructor/channelParticipantsAdmins.html rename data/corefork.telegram.org/constructor/{updateDcOptions.html => channelParticipantsBanned.html} (89%) create mode 100644 data/corefork.telegram.org/constructor/channelParticipantsBots.html create mode 100644 data/corefork.telegram.org/constructor/channelParticipantsContacts.html create mode 100644 data/corefork.telegram.org/constructor/channelParticipantsKicked.html rename data/corefork.telegram.org/constructor/{channelParticipantCreator.html => channelParticipantsMentions.html} (79%) rename data/{core.telegram.org => corefork.telegram.org}/constructor/channelParticipantsRecent.html (98%) rename data/corefork.telegram.org/constructor/{textUnderline.html => channelParticipantsSearch.html} (89%) delete mode 100644 data/corefork.telegram.org/constructor/decryptedMessageActionResend.html rename data/corefork.telegram.org/constructor/{messages.recentStickers => help.countriesList} (84%) create mode 100644 data/corefork.telegram.org/constructor/help.countriesListNotModified delete mode 100644 data/corefork.telegram.org/constructor/inputAppEvent.html rename data/corefork.telegram.org/constructor/{pageBlockAudio.html => inputChannel.html} (88%) rename data/corefork.telegram.org/constructor/{topPeerCategoryChannels.html => inputChannelEmpty.html} (91%) create mode 100644 data/corefork.telegram.org/constructor/inputChannelFromMessage.html delete mode 100644 data/corefork.telegram.org/constructor/inputDocumentFileLocation.html delete mode 100644 data/corefork.telegram.org/constructor/inputMediaPhoto.html create mode 100644 data/corefork.telegram.org/constructor/inputPeerChannelFromMessage.html rename data/corefork.telegram.org/constructor/{peerUser.html => inputPeerChat.html} (91%) create mode 100644 data/corefork.telegram.org/constructor/inputPeerEmpty.html rename data/{core.telegram.org => corefork.telegram.org}/constructor/inputPeerSelf.html (98%) rename data/corefork.telegram.org/constructor/{updateGroupCall.html => inputPeerUser.html} (87%) create mode 100644 data/corefork.telegram.org/constructor/inputPeerUserFromMessage.html delete mode 100644 data/corefork.telegram.org/constructor/inputPrivacyKeyAddedByPhone.html rename data/corefork.telegram.org/constructor/{photoSizeEmpty.html => inputUser.html} (87%) rename data/corefork.telegram.org/constructor/{inputStickerSetEmpty.html => inputUserEmpty.html} (92%) create mode 100644 data/corefork.telegram.org/constructor/inputUserFromMessage.html rename data/corefork.telegram.org/constructor/{pageBlockDivider.html => inputUserSelf.html} (92%) delete mode 100644 data/corefork.telegram.org/constructor/messageActionInviteToGroupCall.html rename data/corefork.telegram.org/constructor/{messages.sentMessageLink => messages.affectedHistory} (86%) delete mode 100644 data/corefork.telegram.org/constructor/peerLocated.html rename data/corefork.telegram.org/constructor/{photoPathSize.html => photoSize.html} (87%) delete mode 100644 data/corefork.telegram.org/constructor/savedPhoneContact.html delete mode 100644 data/corefork.telegram.org/constructor/secureSecretSettings.html rename data/corefork.telegram.org/constructor/{chatEmpty.html => true.html} (90%) rename data/corefork.telegram.org/constructor/{upload.cdnFileReuploadNeeded => updateMessageID.html} (85%) delete mode 100644 data/corefork.telegram.org/css/telegram-extra.css create mode 100644 data/corefork.telegram.org/getProxyConfig.html delete mode 100644 data/corefork.telegram.org/js/telegram-passport2.js delete mode 100644 data/corefork.telegram.org/method/account.getWallPapers delete mode 100644 data/corefork.telegram.org/method/account.getWebAuthorizations delete mode 100644 data/corefork.telegram.org/method/account.reportProfilePhoto delete mode 100644 data/corefork.telegram.org/method/account.updateProfile delete mode 100644 data/corefork.telegram.org/method/auth.requestPasswordRecovery rename data/corefork.telegram.org/method/{messages.getStickerSet => channels.deleteUserHistory} (77%) delete mode 100644 data/corefork.telegram.org/method/channels.getAdminedPublicChannels delete mode 100644 data/corefork.telegram.org/method/channels.getSponsoredMessages delete mode 100644 data/corefork.telegram.org/method/contacts.getContactIDs rename data/corefork.telegram.org/method/{account.setContactSignUpNotification => contacts.toggleTopPeers} (87%) delete mode 100644 data/corefork.telegram.org/method/help.getAppConfig delete mode 100644 data/corefork.telegram.org/method/help.getAppUpdate delete mode 100644 data/corefork.telegram.org/method/help.getPromoData delete mode 100644 data/corefork.telegram.org/method/help.getSupport delete mode 100644 data/corefork.telegram.org/method/help.saveAppLog delete mode 100644 data/corefork.telegram.org/method/help.setBotUpdatesStatus rename data/{core.telegram.org/method/payments.getPaymentForm => corefork.telegram.org/method/messages.deleteHistory} (78%) delete mode 100644 data/corefork.telegram.org/method/messages.getSplitRanges rename data/corefork.telegram.org/method/{stickers.suggestShortName => messages.readMentions} (85%) delete mode 100644 data/corefork.telegram.org/method/messages.sendEncryptedService rename data/corefork.telegram.org/method/{account.getChatThemes => messages.unpinAllMessages} (83%) delete mode 100644 data/corefork.telegram.org/method/photos.deletePhotos create mode 100644 data/corefork.telegram.org/mtproto/TL-abstract-types.html create mode 100644 data/corefork.telegram.org/mtproto/TL-combinators.html create mode 100644 data/corefork.telegram.org/mtproto/TL-dependent.html create mode 100644 data/corefork.telegram.org/mtproto/TL-formal.html rename data/{core.telegram.org => corefork.telegram.org}/mtproto/TL-optargs.html (98%) create mode 100644 data/corefork.telegram.org/mtproto/TL-patterns.html create mode 100644 data/corefork.telegram.org/mtproto/TL-polymorph.html create mode 100644 data/corefork.telegram.org/mtproto/TL-tl.html create mode 100644 data/corefork.telegram.org/mtproto/TL-types.html create mode 100644 data/corefork.telegram.org/mtproto/serialize.html delete mode 100644 data/corefork.telegram.org/passport/sdk-android.html create mode 100644 data/corefork.telegram.org/themes.html delete mode 100644 data/corefork.telegram.org/type/CdnConfig.html rename data/corefork.telegram.org/type/{InputPrivacyKey.html => ChannelParticipantsFilter.html} (70%) delete mode 100644 data/corefork.telegram.org/type/ImportedContact.html rename data/corefork.telegram.org/type/{InputWebFileLocation.html => InputChannel.html} (84%) rename data/corefork.telegram.org/type/{RecentMeUrl.html => InputPeer.html} (73%) rename data/corefork.telegram.org/type/{PageListItem.html => InputUser.html} (81%) delete mode 100644 data/corefork.telegram.org/type/PageListOrderedItem.html delete mode 100644 data/corefork.telegram.org/type/PaymentSavedCredentials.html delete mode 100644 data/corefork.telegram.org/type/ReceivedNotifyMessage.html delete mode 100644 data/corefork.telegram.org/type/RichText.html rename data/corefork.telegram.org/type/{RestrictionReason.html => True.html} (88%) delete mode 100644 data/corefork.telegram.org/type/auth.CheckedPhone rename data/corefork.telegram.org/type/{help.DeepLinkInfo => help.CountriesList} (82%) rename data/{core.telegram.org/type/string.html => corefork.telegram.org/type/long.html} (66%) rename data/corefork.telegram.org/type/{account.PasswordSettings => messages.AffectedHistory} (74%) create mode 100644 data/corefork.telegram.org/widgets.html create mode 100644 data/corefork.telegram.org/widgets/discussion.html rename data/{telegram.org/android.html => desktop.telegram.org.html} (50%) rename data/{instantview.telegram.org.html => instantview.telegram.org/auth.html} (99%) create mode 100644 data/instantview.telegram.org/docs.html delete mode 100644 data/instantview.telegram.org/samples.html delete mode 100644 data/promote.telegram.org/basics.html create mode 100644 data/promote.telegram.org/getting-started.html delete mode 100644 data/promote.telegram.org/tos.html rename data/{telegram.org/api.html => telegram.org.html} (99%) rename data/telegram.org/blog/{unsend-and-usage.html => admin-revolution.html} (58%) rename data/telegram.org/blog/{backgrounds-2-0.html => animated-stickers.html} (55%) delete mode 100644 data/telegram.org/blog/apple-watch.html delete mode 100644 data/telegram.org/blog/cryptocontest.html delete mode 100644 data/telegram.org/blog/folders.html rename data/telegram.org/blog/{unsend-privacy-emoji.html => group-video-calls.html} (58%) create mode 100644 data/telegram.org/blog/instant-view-contest-200K.html delete mode 100644 data/telegram.org/blog/invite-links.html delete mode 100644 data/telegram.org/blog/photo-editor-and-passcodes.html create mode 100644 data/telegram.org/blog/pinned-messages-locations-playlists.html create mode 100644 data/telegram.org/blog/privacy-discussions-web-bots.html delete mode 100644 data/telegram.org/blog/profile-videos-people-nearby-and-more.html create mode 100644 data/telegram.org/blog/protected-content-delete-by-date-and-more.html create mode 100644 data/telegram.org/blog/reactions-spoilers-translations.html create mode 100644 data/telegram.org/blog/shared-media-scrolling-calendar-join-requests-and-more.html create mode 100644 data/telegram.org/blog/silent-messages-slow-mode.html rename data/telegram.org/blog/{android-2-0.html => translations-iv2.html} (52%) delete mode 100644 data/telegram.org/blog/verifiable-apps-and-more.html create mode 100644 data/telegram.org/blog/video-stickers-better-reactions.html create mode 100644 data/telegram.org/blog/voice-chats-on-steroids.html rename data/telegram.org/{blog/6-years.html => evolution.html} (57%) create mode 100644 data/telegram.org/faq.html delete mode 100644 data/telegram.org/faq_spam.html create mode 100644 data/telegram.org/jobs.html delete mode 100644 data/telegram.org/js/games.js create mode 100644 data/telegram.org/privacy.html create mode 100644 data/telegram.org/privacy/gmailbot.html create mode 100644 data/telegram.org/tos.html create mode 100644 data/telegram.org/tour.html create mode 100644 data/telegram.org/tour/channels.html delete mode 100644 data/telegram.org/tour/screenshots.html rename data/{tsf.telegram.org/manuals/e2ee.html => themes.telegram.org.html} (64%) delete mode 100644 data/translations.telegram.org.html delete mode 100644 data/translations.telegram.org/en.html delete mode 100644 data/translations.telegram.org/en/android.html delete mode 100644 data/translations.telegram.org/en/android_x.html delete mode 100644 data/translations.telegram.org/en/ios.html delete mode 100644 data/translations.telegram.org/en/macos.html delete mode 100644 data/translations.telegram.org/en/tdesktop.html delete mode 100644 data/tsf.telegram.org.html delete mode 100644 data/tsf.telegram.org/css/billboard.css delete mode 100644 data/tsf.telegram.org/css/bootstrap-extra.css delete mode 100644 data/tsf.telegram.org/css/bootstrap.min.css delete mode 100644 data/tsf.telegram.org/css/health.css delete mode 100644 data/tsf.telegram.org/css/jquery-ui.min.css delete mode 100644 data/tsf.telegram.org/css/tchart.min.css delete mode 100644 data/tsf.telegram.org/css/telegram.css delete mode 100644 data/tsf.telegram.org/css/tsf.css delete mode 100644 data/tsf.telegram.org/js/billboard.min.js delete mode 100644 data/tsf.telegram.org/js/bootstrap.min.js delete mode 100644 data/tsf.telegram.org/js/jquery-ui.min.js delete mode 100644 data/tsf.telegram.org/js/jquery.min.js delete mode 100644 data/tsf.telegram.org/js/main-aj.js delete mode 100644 data/tsf.telegram.org/js/main.js delete mode 100644 data/tsf.telegram.org/js/stats.js delete mode 100644 data/tsf.telegram.org/js/tchart.min.js delete mode 100644 data/tsf.telegram.org/js/tsf.js delete mode 100644 data/tsf.telegram.org/manuals.html delete mode 100644 data/tsf.telegram.org/manuals/answering_questions.html delete mode 100644 data/tsf.telegram.org/manuals/bios.html delete mode 100644 data/tsf.telegram.org/manuals/bug_herding.html delete mode 100644 data/tsf.telegram.org/manuals/bug_hunting.html delete mode 100644 data/tsf.telegram.org/manuals/bugs.html delete mode 100644 data/tsf.telegram.org/manuals/come-and-go.html diff --git a/data/core.telegram.org/api.html b/data/core.telegram.org/api.html new file mode 100644 index 0000000000..f6775268b5 --- /dev/null +++ b/data/core.telegram.org/api.html @@ -0,0 +1,253 @@ + + + + + Telegram APIs + + + + + + + + + + + + + +
+ +
+
+
+
+

Telegram APIs

+ +

We offer two kinds of APIs for developers. The Bot API allows you to easily create programs that use Telegram messages for an interface. The Telegram API and TDLib allow you to build your own customized Telegram clients. You are welcome to use both APIs free of charge.

+

You can also add Telegram Widgets to your website.

+

Designers are welcome to create Animated Stickers or Custom Themes for Telegram.

+
+

Bot API

+
+ +
+

This API allows you to connect bots to our system. Telegram Bots are special accounts that do not require an additional phone number to set up. These accounts serve as an interface for code running somewhere on your server.

+

To use this, you don't need to know anything about how our MTProto encryption protocol works — our intermediary server will handle all encryption and communication with the Telegram API for you. You communicate with this server via a simple HTTPS-interface that offers a simplified version of the Telegram API.

+
+

Learn more about the Bot API here »

+
+

Bot developers can also make use of our Payments API to accept payments from Telegram users around the world.

+
+

TDLib – build your own Telegram

+

Even if you're looking for maximum customization, you don't have to create your app from scratch. Try our Telegram Database Library (or simply TDLib), a tool for third-party developers that makes it easy to build fast, secure and feature-rich Telegram apps.

+

TDLib takes care of all network implementation details, encryption and local data storage, so that you can dedicate more time to design, responsive interfaces and beautiful animations.

+

TDLib supports all Telegram features and makes developing Telegram apps a breeze on any platform. It can be used on Android, iOS, Windows, macOS, Linux and virtually any other system. The library is open source and compatible with virtually any programming language.

+
+

Learn more about TDLib here »

+
+
+

Telegram API

+

This API allows you to build your own customized Telegram clients. It is 100% open for all developers who wish to create Telegram applications on our platform. Feel free to study the open source code of existing Telegram applications for examples of how things work here. Don't forget to register your application in our system.

+ +

Getting started

+

Creating an application

+

How to get your application identifier and create a new Telegram app.

+

User authorization

+

How to register a user's phone to start using the API.

+

Two-factor authentication

+

How to login to a user's account if they have enabled 2FA, how to change password.

+

QR code login

+

QR code login flow

+

Error handling

+

How to handle API return errors correctly.

+

Handling different data centers

+

How to connect to the closest DC access point for faster interaction with the API, and things to watch out for when developing a client.

+

Handling updates

+

How to subscribe to updates and handle them properly.

+

Handling PUSH-notifications

+

How to subscribe and handle them properly.

+

Channels, supergroups and groups

+

How to handle channels, supergroups, groups, and what's the difference between them.

+

Channel statistics

+

Telegram offers detailed channel statistics for channels and supergroups.

+

Calling methods

+

Additional options for calling methods.

+

Uploading and Downloading Files

+

How to transfer large data batches correctly.

+

Pagination

+

How to fetch results from large lists of objects.

+

Client configuration

+

The MTProto API has multiple client configuration parameters that can be fetched with the appropriate methods.

+

Security

+

Secret chats, end-to-end encryption

+

End-to-end-encrypted messaging.

+

Security guidelines

+

Important checks required in your client application.

+

Perfect Forward Secrecy

+

Binding temporary authorization key to permanent ones.

+

End-to-End Encryption in Voice and Video Calls

+

End-to-end-encrypted calls.

+

Optimization

+

Client optimization

+

Ways to boost API interactions.

+

API methods

+

Available method list

+

A list of available high-level methods.

+

API TL-schema, as JSON

+

Text and JSON-presentation of types and methods used in API.

+

Available layer list

+

A list of available schema versions.

+

Other articles

+

Working with bots, using the MTProto API

+

How to work with bots using the MTProto API.

+

Commands

+

Bots offer a set of commands that can be used by users in private, or in a chat.

+

Buttons

+

Users can interact with your bot via buttons or even inline buttons, straight from inline messages in any chat.

+

Inline queries

+

Users can interact with your bot via inline queries, straight from the text input field in any chat.

+

Games

+

Bots can offer users HTML5 games to play solo or to compete against each other in groups and one-on-one chats; how to work with games in the MTProto API.

+

Search & filters

+

Telegram allows applying detailed message filters while looking for messages in chats. +This allows the server to filter messages based on a text query, and even on their type, and this feature is often used by graphical clients to implement features like the chat gallery, chat profile pictures and more.

+

Polls

+

Telegram allows sending polls and quizes, that can be voted on by thousands, if not milions of users in chats and channels.

+

Admin, banned and default rights for channels, supergroups and groups

+

How to handle admin permissions, granular bans and global permissions in channels, groups and supergroups.

+

Discussion groups

+

Groups can be associated to a channel as a discussion group, to allow users to discuss about posts.

+

Channel comments and message threads

+

Telegram allows commenting on a channel post or on a generic group message, thanks to message threads.

+

Admin log

+

Both supergroups and channels offer a so-called admin log, a log of recent relevant supergroup and channel actions, like the modification of group/channel settings or information on behalf of an admin, user kicks and bans, and more.

+

Pinned messages

+

Telegram allows pinning multiple messages on top of a specific chat.

+

Mentions

+

Telegram allows mentioning other users in case of urgent duckling matters, and quickly navigating to those mentions in order to read them as swiftly as possible.

+

Scheduled messages

+

Telegram allows scheduling messages.

+

Live geolocations

+

Telegram allows sending the live geolocation of a user in a chat, optionally setting a proximity alert.

+

Min constructors

+

Sometimes, user and channel constructors met in group chat updates may not contain full info about the user: how to handle such constructors.

+

Account deletion

+

How to reset an account if the 2FA password was forgotten.

+

Imported messages

+

Telegram allows importing messages and media from foreign chat apps.

+

Telegram Passport

+

How to work with Telegram Passport directly using the MTProto API.

+

Telegram Payments

+

How to work with Telegram Payments directly using the MTProto API.

+

Styled text with message entities

+

How to create styled text with message entities

+

Working with animated emojis

+

Graphical telegram clients should transform emojis into their respective animated version.

+

Working with animated dice

+

Telegram supports sending animated dice emojis.

+

Message drafts

+

How to handle message drafts

+

Folders

+

Working with folders

+

Top peer rating

+

If enabled, the rating of top peers indicates the relevance of a frequently used peer in a certain category (frequently messaged users, frequently used bots, inline bots, frequently visited channels and so on).

+

Handling file references

+

How to handle file references.

+

Seamless Telegram Login

+

Handle Seamless Telegram Login URL authorization requests.

+

Web events

+

When interacting with HTML5 games and the websites of payment gateways, Telegram apps should expose the following JS APIs.

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/api/config.html b/data/core.telegram.org/api/config.html new file mode 100644 index 0000000000..5e804b24ce --- /dev/null +++ b/data/core.telegram.org/api/config.html @@ -0,0 +1,422 @@ + + + + + Client configuration + + + + + + + + + + + + + +
+ +
+
+
+ +

Client configuration

+ +
+ +

The MTProto API has multiple configuration parameters that can be fetched with the appropriate methods.

+

MTProto configuration

+
config#330b4067 flags:# phonecalls_enabled:flags.1?true default_p2p_contacts:flags.3?true preload_featured_stickers:flags.4?true ignore_phone_entities:flags.5?true revoke_pm_inbox:flags.6?true blocked_mode:flags.8?true pfs_enabled:flags.13?true date:int expires:int test_mode:Bool this_dc:int dc_options:Vector<DcOption> dc_txt_domain_name:string chat_size_max:int megagroup_size_max:int forwarded_count_max:int online_update_period_ms:int offline_blur_timeout_ms:int offline_idle_timeout_ms:int online_cloud_timeout_ms:int notify_cloud_delay_ms:int notify_default_delay_ms:int push_chat_period_ms:int push_chat_limit:int saved_gifs_limit:int edit_time_limit:int revoke_time_limit:int revoke_pm_time_limit:int rating_e_decay:int stickers_recent_limit:int stickers_faved_limit:int channels_read_media_period:int tmp_sessions:flags.0?int pinned_dialogs_count_max:int pinned_infolder_count_max:int call_receive_timeout_ms:int call_ring_timeout_ms:int call_connect_timeout_ms:int call_packet_timeout_ms:int me_url_prefix:string autoupdate_url_prefix:flags.7?string gif_search_username:flags.9?string venue_search_username:flags.10?string img_search_username:flags.11?string static_maps_provider:flags.12?string caption_length_max:int message_length_max:int webfile_dc_id:int suggested_lang_code:flags.2?string lang_pack_version:flags.2?int base_lang_pack_version:flags.2?int = Config;
+nearestDc#8e1a1775 country:string this_dc:int nearest_dc:int = NearestDc;
+
+---functions---
+
+help.getConfig#c4f9186b = Config;
+help.getNearestDc#1fb33026 = NearestDc;
+

The huge config constructor contains lots of useful information, from chat and message size limitations, to privacy settings, online status refresh interval and timeout, VoIP configuration, default inline bot usernames for GIF, image and venue lookup, and lots of other global and user-specific information, check out the constructor page for more information.

+

Client configuration

+
jsonObjectValue#c0de1bd9 key:string value:JSONValue = JSONObjectValue;
+
+jsonNull#3f6d7b68 = JSONValue;
+jsonBool#c7345e6a value:Bool = JSONValue;
+jsonNumber#2be0dfa4 value:double = JSONValue;
+jsonString#b71e767a value:string = JSONValue;
+jsonArray#f7444763 value:Vector<JSONValue> = JSONValue;
+jsonObject#99c1d49d value:Vector<JSONObjectValue> = JSONValue;
+
+---functions---
+
+help.getAppConfig#98914110 = JSONValue;
+

The help.getAppConfig method returns a JSON object containing rapidly evolving, client-specific configuration parameters.
+While help.getConfig returns MTProto-specific configuration with information about server-side limitations and other MTProto-related information, help.getAppConfig returns configuration parameters useful for graphical Telegram clients.

+

Typical fields included in the resulting JSON object are:

+
    +
  • emojies_animated_zoom - Animated emojis and animated dice should be scaled by this factor before being shown to the user (float)
  • +
  • keep_alive_service - Whether app clients should start a keepalive service to keep the app running and fetch updates even when the app is closed (boolean)
  • +
  • background_connection - Whether app clients should start a background TCP connection for MTProto update fetching (boolean)
  • +
  • emojies_send_dice - A list of supported animated dice stickers (array of strings).
  • +
  • emojies_send_dice_success - For animated dice emojis other than the basic 🎲, indicates the winning dice value and the final frame of the animated sticker, at which to show the fireworks 🎆 (object with emoji keys and object values, containing value and frame_start float values)
  • +
  • emojies_sounds - A map of soundbites to be played when the user clicks on the specified animated emoji; the file reference field should be base64-decoded before downloading the file (map of file IDs, with emoji string keys)
  • +
  • gif_search_branding - Specifies the name of the service providing GIF search through gif_search_username (string)
  • +
  • gif_search_emojies - Specifies a list of emojies that should be suggested as search term in a bar above the GIF search box (array of string emojis)
  • +
  • stickers_emoji_suggest_only_api - Specifies that the app should not display local sticker suggestions for emojis at all and just use the result of messages.getStickers (bool)
  • +
  • stickers_emoji_cache_time - Specifies the validity period of the local cache of messages.getStickers, also relevant when generating the pagination hash when invoking the method. (int)
  • +
  • qr_login_camera - Whether the Settings->Devices menu should show an option to scan a QR login code (boolean)
  • +
  • qr_login_code - Whether the login screen should show a QR code login option, possibly as default login method (string, "disabled", "primary" or "secondary")
  • +
  • dialog_filters_enabled - Whether clients should show an option for managing dialog filters AKA folders (boolean)
  • +
  • dialog_filters_tooltip - Whether clients should actively show a tooltip, inviting the user to configure dialog filters AKA folders; typically this happens when the chat list is long enough to start getting cluttered. (boolean)
  • +
  • autoarchive_setting_available - Whether clients can invoke account.setGlobalPrivacySettings with globalPrivacySettings.archive_and_mute_new_noncontact_peers = boolTrue, to automatically archive and mute new incoming chats from non-contacts. (boolean)
  • +
  • pending_suggestions - Contains a list of suggestions that should be actively shown as a tooltip to the user. (Array of strings, possible values shown in the suggestions section ».
  • +
  • url_auth_domains - A list of domains that support automatic login with manual user confirmation, click here for more info on URL authorization ». (array of strings)
  • +
  • autologin_domains - A list of Telegram domains that support automatic login with no user confirmation, click here for more info on URL authorization ». (array of strings)
  • +
  • autologin_token - Autologin token, click here for more info on URL authorization ». (string)
  • +
  • round_video_encoding - Contains a set of recommended codec parameters for round videos.
  • +
  • chat_read_mark_size_threshold - Per-user read receipts, fetchable using messages.getMessageReadParticipants will be available in groups with less than chat_read_mark_size_threshold participants. (int)
  • +
  • chat_read_mark_expire_period - To protect user privacy, read receipts are only stored for chat_read_mark_expire_period seconds after the message was sent. (int)
  • +
+

Example value:

+
{
+    "test": 1,
+    "emojies_animated_zoom": 0.625,
+    "emojies_send_dice": [
+        "\ud83c\udfb2",
+        "\ud83c\udfaf",
+        "\ud83c\udfc0",
+        "\u26bd",
+        "\u26bd\ufe0f",
+        "\ud83c\udfb0",
+        "\ud83c\udfb3"
+    ],
+    "emojies_send_dice_success": {
+        "\ud83c\udfaf": {
+            "value": 6,
+            "frame_start": 62
+        },
+        "\ud83c\udfc0": {
+            "value": 5,
+            "frame_start": 110
+        },
+        "\u26bd": {
+            "value": 5,
+            "frame_start": 110
+        },
+        "\u26bd\ufe0f": {
+            "value": 5,
+            "frame_start": 110
+        },
+        "\ud83c\udfb0": {
+            "value": 64,
+            "frame_start": 110
+        },
+        "\ud83c\udfb3": {
+            "value": 6,
+            "frame_start": 110
+        }
+    },
+    "emojies_sounds": {
+        "\ud83c\udf83": {
+            "id": "4956223179606458539",
+            "access_hash": "-2107001400913062971",
+            "file_reference_base64": "AGFhvoKbftK5O9K9RpgN1ZtgSzWy"
+        },
+        "\u26b0": {
+            "id": "4956223179606458540",
+            "access_hash": "-1498869544183595185",
+            "file_reference_base64": "AGFhvoJIm8Uz0qSMIdm3AsKlK7wJ"
+        },
+        "\ud83e\udddf\u200d\u2642": {
+            "id": "4960929110848176331",
+            "access_hash": "3986395821757915468",
+            "file_reference_base64": "AGFhvoLtXSSIclmvfg6ePz3KsHQF"
+        },
+        "\ud83e\udddf": {
+            "id": "4960929110848176332",
+            "access_hash": "-8929417974289765626",
+            "file_reference_base64": "AGFhvoImaz5Umt4GvMUD5nocIu0W"
+        },
+        "\ud83e\udddf\u200d\u2640": {
+            "id": "4960929110848176333",
+            "access_hash": "9161696144162881753",
+            "file_reference_base64": "AGFhvoIm1QZsb48xlpRfh4Mq7EMG"
+        },
+        "\ud83c\udf51": {
+            "id": "4963180910661861548",
+            "access_hash": "-7431729439735063448",
+            "file_reference_base64": "AGFhvoKLrwl_WKr5LR0Jjs7o3RyT"
+        },
+        "\ud83c\udf8a": {
+            "id": "5094064004578410732",
+            "access_hash": "8518192996098758509",
+            "file_reference_base64": "AGFhvoKMNffRV2J3vKED0O6d8e42"
+        },
+        "\ud83c\udf84": {
+            "id": "5094064004578410733",
+            "access_hash": "-4142643820629256996",
+            "file_reference_base64": "AGFhvoJ1ulPBbXEURlTZWwJFx6xZ"
+        },
+        "\ud83e\uddbe": {
+            "id": "5094064004578410734",
+            "access_hash": "-8934384022571962340",
+            "file_reference_base64": "AGFhvoL4zdMRmYv9z3L8KPaX4JQL"
+        }
+    },
+    "gif_search_branding": "tenor",
+    "gif_search_emojies": [
+        "\ud83d\udc4d",
+        "\ud83d\ude18",
+        "\ud83d\ude0d",
+        "\ud83d\ude21",
+        "\ud83e\udd73",
+        "\ud83d\ude02",
+        "\ud83d\ude2e",
+        "\ud83d\ude44",
+        "\ud83d\ude0e",
+        "\ud83d\udc4e"
+    ],
+    "stickers_emoji_suggest_only_api": false,
+    "stickers_emoji_cache_time": 86400,
+    "qr_login_camera": false,
+    "qr_login_code": "disabled",
+    "dialog_filters_enabled": true,
+    "dialog_filters_tooltip": false,
+    "autoarchive_setting_available": false,
+    "pending_suggestions": [
+        "AUTOARCHIVE_POPULAR",
+        "VALIDATE_PASSWORD",
+        "VALIDATE_PHONE_NUMBER",
+        "NEWCOMER_TICKS"
+    ],
+    "autologin_token": "string",
+    "autologin_domains": [
+        "instantview.telegram.org",
+        "translations.telegram.org",
+        "contest.dev",
+        "contest.com",
+        "bugs.telegram.org",
+        "suggestions.telegram.org",
+        "themes.telegram.org"
+    ],
+    "url_auth_domains": [
+        "somedomain.telegram.org"
+    ],
+    "round_video_encoding": {
+        "diameter": 384,
+        "video_bitrate": 1000,
+        "audio_bitrate": 64,
+        "max_size": 12582912
+    },
+    "chat_read_mark_size_threshold": 50,
+    "chat_read_mark_expire_period": 604800
+}
+

Suggestions

+

The API can return a set of useful suggestions for users of graphical clients.

+

Basic suggestions

+
jsonObjectValue#c0de1bd9 key:string value:JSONValue = JSONObjectValue;
+
+jsonNull#3f6d7b68 = JSONValue;
+jsonBool#c7345e6a value:Bool = JSONValue;
+jsonNumber#2be0dfa4 value:double = JSONValue;
+jsonString#b71e767a value:string = JSONValue;
+jsonArray#f7444763 value:Vector<JSONValue> = JSONValue;
+jsonObject#99c1d49d value:Vector<JSONObjectValue> = JSONValue;
+
+---functions---
+
+help.getAppConfig#98914110 = JSONValue;
+

The help.getAppConfig method returns a JSON object containing rapidly evolving, client-specific configuration parameters.
+A full list of these parameters can be seen in the Client Configuration section », but we're mostly interested in the pending_suggestions and autoarchive_setting_available fields of the returned JSON object:

+ +

Channel suggestions

+
messages.chatFull#e5d7d19c full_chat:ChatFull chats:Vector<Chat> users:Vector<User> = messages.ChatFull;
+
+channelFull#e9b27a17 flags:# can_view_participants:flags.3?true can_set_username:flags.6?true can_set_stickers:flags.7?true hidden_prehistory:flags.10?true can_set_location:flags.16?true has_scheduled:flags.19?true can_view_stats:flags.20?true blocked:flags.22?true id:long about:string participants_count:flags.0?int admins_count:flags.1?int kicked_count:flags.2?int banned_count:flags.2?int online_count:flags.13?int read_inbox_max_id:int read_outbox_max_id:int unread_count:int chat_photo:Photo notify_settings:PeerNotifySettings exported_invite:flags.23?ExportedChatInvite bot_info:Vector<BotInfo> migrated_from_chat_id:flags.4?long migrated_from_max_id:flags.4?int pinned_msg_id:flags.5?int stickerset:flags.8?StickerSet available_min_id:flags.9?int folder_id:flags.11?int linked_chat_id:flags.14?long location:flags.15?ChannelLocation slowmode_seconds:flags.17?int slowmode_next_send_date:flags.18?int stats_dc:flags.12?int pts:int call:flags.21?InputGroupCall ttl_period:flags.24?int pending_suggestions:flags.25?Vector<string> groupcall_default_join_as:flags.26?Peer theme_emoticon:flags.27?string = ChatFull;
+
+---functions---
+
+channels.getFullChannel#8736a09 channel:InputChannel = messages.ChatFull;
+

Some channel/supergroup-related suggestions can also be contained in the pending_suggestions field of the channelFull constructor, returned by channels.getFullChannel.
+Here's a list of possible suggestions:

+ +

Dismissing suggestions

+
boolFalse#bc799737 = Bool;
+boolTrue#997275b5 = Bool;
+
+---functions---
+
+help.dismissSuggestion#f50dbaa1 peer:InputPeer suggestion:string = Bool;
+

help.dismissSuggestion can be used to dismiss a suggestion.
+Pass inputPeerEmpty to peer for basic suggestions and the channel/supergroup's peer for channel suggestions.

+

App-specific configuration

+
help.appUpdate#ccbbce30 flags:# can_not_skip:flags.0?true id:int version:string text:string entities:Vector<MessageEntity> document:flags.1?Document url:flags.2?string sticker:flags.3?Document = help.AppUpdate;
+help.noAppUpdate#c45a6536 = help.AppUpdate;
+
+updates#74ae4240 updates:Vector<Update> users:Vector<User> chats:Vector<Chat> date:int seq:int = Updates;
+updateServiceNotification#ebe46819 flags:# popup:flags.0?true inbox_date:flags.1?int type:string message:string media:MessageMedia entities:Vector<MessageEntity> = Update;
+
+help.inviteText#18cb9f78 message:string = help.InviteText;
+
+---functions---
+
+help.getAppUpdate#522d5a7d source:string = help.AppUpdate;
+help.getAppChangelog#9010ef6f prev_app_version:string = Updates;
+
+help.getInviteText#4d392343 = help.InviteText;
+
    +
  • help.getAppUpdate - Get info about an application update, can contain the updated application binary in the attached document
  • +
  • help.getAppChangelog - Get a list of service messages with app-specific changelogs
  • +
  • help.getInviteText - Returns a localized invitation message that can be sent via SMS to contacts that haven't signed up to Telegram yet
  • +
+

Terms of service

+
help.termsOfServiceUpdateEmpty#e3309f7f expires:int = help.TermsOfServiceUpdate;
+help.termsOfServiceUpdate#28ecf961 expires:int terms_of_service:help.TermsOfService = help.TermsOfServiceUpdate;
+
+help.termsOfService#780a0310 flags:# popup:flags.0?true id:DataJSON text:string entities:Vector<MessageEntity> min_age_confirm:flags.1?int = help.TermsOfService;
+
+auth.authorizationSignUpRequired#44747e9a flags:# terms_of_service:flags.0?help.TermsOfService = auth.Authorization;
+
+---functions---
+
+help.getTermsOfServiceUpdate#2ca51fd1 = help.TermsOfServiceUpdate;
+help.acceptTermsOfService#ee72f79a id:DataJSON = Bool;
+
+auth.signIn#bcd51581 phone_number:string phone_code_hash:string phone_code:string = auth.Authorization;
+
+account.deleteAccount#418d4e0b reason:string = Bool;
+

These methods can be used for managing consent to Telegram's Terms Of Service.

+

Typically, before a user signs up by invoking auth.signUp, apps should show a pop-up (if the popup flag of the help.termsOfService method is set), asking the user to accept Telegram's terms of service; in case of denial, the user is to be returned to the initial page of the login flow.

+

When signing up for the first time, the help.termsOfService is to be obtained from the auth.authorizationSignUpRequired constructor returned by the auth.signIn.

+

After signing up, or when logging in as an existing user, apps are supposed to call help.getTermsOfServiceUpdate to check for any updates to the Terms of Service; this call should be repeated after expires seconds have elapsed.
+If an update to the Terms Of Service is available, clients are supposed to show a consent popup; if accepted, clients should call help.acceptTermsOfService, providing the termsOfService id JSON object; in case of denial, clients are to delete the account using account.deleteAccount, providing Decline ToS update as deletion reason.

+

Example implementation: android (signup), android (after login)

+

Telegram support info

+
user#3ff6ecb0 flags:# self:flags.10?true contact:flags.11?true mutual_contact:flags.12?true deleted:flags.13?true bot:flags.14?true bot_chat_history:flags.15?true bot_nochats:flags.16?true verified:flags.17?true restricted:flags.18?true min:flags.20?true bot_inline_geo:flags.21?true support:flags.23?true scam:flags.24?true apply_min_photo:flags.25?true fake:flags.26?true id:long access_hash:flags.0?long first_name:flags.1?string last_name:flags.2?string username:flags.3?string phone:flags.4?string photo:flags.5?UserProfilePhoto status:flags.6?UserStatus bot_info_version:flags.14?int restriction_reason:flags.18?Vector<RestrictionReason> bot_inline_placeholder:flags.19?string lang_code:flags.22?string = User;
+
+help.support#17c6b5f6 phone_number:string user:User = help.Support;
+help.supportName#8c05f1c9 name:string = help.SupportName;
+
+---functions---
+
+help.getSupport#9cdf08cd = help.Support;
+help.getSupportName#d360e72c = help.SupportName;
+

These methods can be used for fetching info about Telegram's support user, that users can use to get support and ask questions about the app.

+ +

Country information and login phone patterns

+
help.countryCode#4203c5ef flags:# country_code:string prefixes:flags.0?Vector<string> patterns:flags.1?Vector<string> = help.CountryCode;
+
+help.country#c3878e23 flags:# hidden:flags.0?true iso2:string default_name:string name:flags.1?string country_codes:Vector<help.CountryCode> = help.Country;
+
+help.countriesListNotModified#93cc1f32 = help.CountriesList;
+help.countriesList#87d0759e countries:Vector<help.Country> hash:int = help.CountriesList;
+
+---functions---
+help.getCountriesList#735787a8 lang_code:string hash:int = help.CountriesList;
+

help.getCountriesList can be used to fetch a list of localized names for all available countries and phone code patterns for logging in.

+

The phone code pattern should be used when showing the login screen, or when changing phone number: for example, a pattern value of XXX XXX XXX with country_code +39 indicates that the phone field for login should accept a spaced pattern like +39 123 456 789.
+Also, the beginning of the national part of the phone number (123 456 789) should match one of the prefixes, if any were returned.

+ +
+ +
+
+ +
+ + + + + + + + diff --git a/data/core.telegram.org/api/end-to-end.html b/data/core.telegram.org/api/end-to-end.html new file mode 100644 index 0000000000..40675ab00d --- /dev/null +++ b/data/core.telegram.org/api/end-to-end.html @@ -0,0 +1,244 @@ + + + + + End-to-End Encryption, Secret Chats + + + + + + + + + + + + + +
+ +
+
+
+ +

End-to-End Encryption, Secret Chats

+ +
+ +
+

This article on MTProto's End-to-End encryption is meant for advanced users. +If you want to learn more about Secret Chats from a less intimidating source, kindly see our general FAQ.

+
+
+

Note that as of version 4.6, major Telegram clients are using MTProto 2.0. +MTProto v.1.0 is deprecated and is currently being phased out.

+
+
+
Related articles
+

+
+

Secret Chats are one-on-one chats wherein messages are encrypted with a key held only by the chat’s participants. Note that the schema for these end-to-end encrypted Secret Chats is different from what is used for cloud chats:

+
+ +
+

A note on MTProto 2.0

+

This article describes the end-to-end encryption layer in the MTProto protocol version 2.0. +The principal differences from version 1.0 (described here for reference) are as follows:

+
    +
  • SHA-256 is used instead of SHA-1;
  • +
  • Padding bytes are involved in the computation of msg_key;
  • +
  • msg_key depends not only on the message to be encrypted, but on a portion of the secret chat key as well;
  • +
  • 12..1024 padding bytes are used instead of 0..15 padding bytes in v.1.0.
  • +
+

See also: MTProto 2.0: Cloud Chats, server-client encryption

+

Key Generation

+

Keys are generated using the Diffie-Hellman protocol.

+

Let us consider the following scenario: User A would like to initiate end-to-end encrypted communication with User B.

+

Sending a Request

+

User A executes messages.getDhConfig to obtain the Diffie-Hellman parameters: a prime p, and a high order element g.

+

Executing this method before each new key generation procedure is of vital importance. It makes sense to cache the values of the parameters together with the version in order to avoid having to receive all of the values every time. If the version stored on the client is still up-to-date, the server will return the constructor messages.dhConfigNotModified.

+

Client is expected to check whether p is a safe 2048-bit prime (meaning that both p and (p-1)/2 are prime, and that 2^2047 < p < 2^2048), and that g generates a cyclic subgroup of prime order (p-1)/2, i.e. is a quadratic residue mod p. Since g is always equal to 2, 3, 4, 5, 6 or 7, this is easily done using quadratic reciprocity law, yielding a simple condition on p mod 4g -- namely, p mod 8 = 7 for g = 2; p mod 3 = 2 for g = 3; no extra condition for g = 4; p mod 5 = 1 or 4 for g = 5; p mod 24 = 19 or 23 for g = 6; and p mod 7 = 3, 5 or 6 for g = 7. After g and p have been checked by the client, it makes sense to cache the result, so as to avoid repeating lengthy computations in future. This cache might be shared with one used for Authorization Key generation.

+

If the client needs additional entropy for the random number generator, it can pass the random_length parameter (random_length> 0) so the server generates its own random sequence random of the appropriate length. +Important: using the server’s random sequence in its raw form may be unsafe, it must be combined with a client sequence.

+

Client A computes a 2048-bit number a (using sufficient entropy or the server’s random; see above) and executes messages.requestEncryption after passing in g_a := pow(g, a) mod dh_prime.

+

User B receives the update updateEncryption for all associated authorization keys (all authorized devices) with the chat constructor encryptedChatRequested. The user must be shown basic information about User A and must be prompted to accept or reject the request.

+

Both clients are to check that g, g_a and g_b are greater than one and smaller than p-1. We recommend checking that g_a and g_b are between 2^{2048-64} and p - 2^{2048-64} as well.

+

Accepting a Request

+

After User B confirms the creation of a secret chat with A in the client interface, Client B also receives up-to-date configuration parameters for the Diffie-Hellman method. Thereafter, it generates a random 2048-bit number, b, using rules similar to those for a.

+

Having received g_a from the update with encryptedChatRequested, it can immediately generate the final shared key: key = (pow(g_a, b) mod dh_prime). If key length < 256 bytes, add several leading zero bytes as padding — so that the key is exactly 256 bytes long. Its fingerprint, key_fingerprint, is equal to the 64 last bits of SHA1 (key).

+

Note 1: in this particular case SHA1 is used here even for MTProto 2.0 secret chats.

+

Note 2: this fingerprint is used as a sanity check for the key exchange procedure to detect bugs when developing client software — it is not connected to the key visualization used on the clients as means of external authentication in secret chats. Key visualizations on the clients are generated using the first 128 bits of SHA1(initial key) followed by the first 160 bits of SHA256(key used when secret chat was updated to layer 46).

+

Client B executes messages.acceptEncryption after passing it g_b := pow(g, b) mod dh_prime and key_fingerprint.

+

For all of Client B’s authorized devices, except the current one, updateEncryption updates are sent with the constructor encryptedChatDiscarded. Thereafter, the only device that will be able to access the secret chat is Device B, which made the call to messages.acceptEncryption.

+

User A will be sent an updateEncryption update with the constructor encryptedChat, for the authorization key that initiated the chat.

+

With g_b from the update, Client A can also compute the shared key key = (pow(g_b, a) mod dh_prime). If key length < 256 bytes, add several leading zero bytes as padding — so that the key is exactly 256 bytes long. If the fingerprint for the received key is identical to the one that was passed to encryptedChat, incoming messages can be sent and processed. Otherwise, messages.discardEncryption must be executed and the user notified.

+

Perfect Forward Secrecy

+

In order to keep past communications safe, official Telegram clients will initiate re-keying once a key has been used to decrypt and encrypt more than 100 messages, or has been in use for more than one week, provided the key has been used to encrypt at least one message. Old keys are then securely discarded and cannot be reconstructed, even with access to the new keys currently in use.

+
+

The re-keying protocol is further described in this article: Perfect Forward Secrecy in Secret Chats.

+
+

Please note that your client must support Forward Secrecy in Secret Chats to be compatible with official Telegram clients.

+

Sending and Receiving Messages in a Secret Chat

+

Serialization and Encryption of Outgoing Messages

+

A TL object of type DecryptedMessage is created and contains the message in plain text. For backward compatibility, the object must be wrapped in the constructor decryptedMessageLayer with an indication of the supported layer (starting with 46).

+
+

The TL-Schema for the contents of end-to-end encrypted messages is available here »

+
+

The resulting construct is serialized as an array of bytes using generic TL rules. The resulting array is prepended by 4 bytes containing the array length not counting these 4 bytes.

+

The byte array is padded with 12 to 1024 random padding bytes to make its length divisible by 16 bytes. (In the older MTProto 1.0 encryption, only 0 to 15 padding bytes were used.)

+

Message key, msg_key, is computed as the 128 middle bits of the SHA256 of the data obtained in the previous step, prepended by 32 bytes from the shared key key. (For the older MTProto 1.0 encryption, msg_key was computed differently, as the 128 lower bits of SHA1 of the data obtained in the previous steps, excluding the padding bytes.)

+

For MTProto 2.0, the AES key aes_key and initialization vector aes_iv are computed ( key is the shared key obtained during Key Generation ) as follows:

+
    +
  • msg_key_large = SHA256 (substr (key, 88+x, 32) + plaintext + random_padding);
  • +
  • msg_key = substr (msg_key_large, 8, 16);
  • +
  • sha256_a = SHA256 (msg_key + substr (key, x, 36));
  • +
  • sha256_b = SHA256 (substr (key, 40+x, 36) + msg_key);
  • +
  • aes_key = substr (sha256_a, 0, 8) + substr (sha256_b, 8, 16) + substr (sha256_a, 24, 8);
  • +
  • aes_iv = substr (sha256_b, 0, 8) + substr (sha256_a, 8, 16) + substr (sha256_b, 24, 8);
  • +
+

For MTProto 2.0, x=0 for messages from the originator of the secret chat, x=8 for the messages in the opposite direction.

+

For the obsolete MTProto 1.0, msg_key, aes_key, and aes_iv were computed differently (see this document for reference).

+

Data is encrypted with a 256-bit key, aes_key, and a 256-bit initialization vector, aes-iv, using AES-256 encryption with infinite garble extension (IGE). Encryption key fingerprint key_fingerprint and the message key msg_key are added at the top of the resulting byte array.

+

Encrypted data is embedded into a messages.sendEncrypted API call and passed to Telegram server for delivery to the other party of the Secret Chat.

+

Upgrading to MTProto 2.0 from MTProto 1.0

+

As soon as both parties in a secret chat are using at least Layer 73, they should only use MTProto 2.0 for all outgoing messages. Some of the first received messages may use MTProto 1.0, if a sufficiently high starting layer has not been negotiated during the creation of the secret chat. After the first message encrypted with MTProto 2.0 (or the first message with Layer 73 or higher) is received, all messages with higher sequence numbers must be encrypted with MTProto 2.0 as well.

+

As long as the current layer is lower than 73, each party should try to decrypt received messages with MTProto 1.0, and if this is not successfull (msg_key does not match), try MTProto 2.0. Once the first MTProto 2.0-encrypted message arrives (or the layer is upgraded to 73), there is no need to try MTProto 1.0 decryption for any of the further messages (unless the client is still waiting for some gaps to be closed).

+

Decrypting an Incoming Message

+

The steps above are performed in reverse order. +When an encrypted message is received, you must check that msg_key is in fact equal to the 128 middle bits of the SHA256 hash of the decrypted message, prepended by 32 bytes taken from the shared key. +If the message layer is greater than the one supported by the client, the user must be notified that the client version is out of date and prompted to update.

+

Sequence numbers

+

It is necessary to interpret all messages in their original order to protect against possible manipulations. Secret chats support a special mechanism for handling seq_no counters independently from the server.

+
+

Proper handling of these counters is further described in this article: Sequence numbers in Secret Chats.

+
+

Please note that your client must support sequence numbers in Secret Chats to be compatible with official Telegram clients.

+

Sending Encrypted Files

+

All files sent to secret chats are encrypted with one-time keys that are in no way related to the chat’s shared key. Before an encrypted file is sent, it is assumed that the encrypted file’s address will be attached to the outside of an encrypted message using the file parameter of the messages.sendEncryptedFile method and that the key for direct decryption will be sent in the body of the message (the key parameter in the constructors decryptedMessageMediaPhoto, decryptedMessageMediaVideo and decryptedMessageMediaFile.

+

Prior to a file being sent to a secret chat, 2 random 256-bit numbers are computed which will serve as the AES key and initialization vector used to encrypt the file. AES-256 encryption with infinite garble extension (IGE) is used in like manner.

+

The key fingerprint is computed as follows:

+
    +
  • digest = md5(key + iv)
  • +
  • fingerprint = substr(digest, 0, 4) XOR substr(digest, 4, 4)
  • +
+

The encrypted contents of a file are stored on the server in much the same way as those of a file in cloud chats: piece by piece using calls to upload.saveFilePart. +A subsequent call to messages.sendEncryptedFile will assign an identifier to the stored file and send the address together with the message. The recipient will receive an update with encryptedMessage, and the file parameter will contain file information.

+

Incoming and outgoing encrypted files can be forwarded to other secret chats using the constructor inputEncryptedFile to avoid saving the same content on the server twice.

+

Working with an Update Box

+

Secret chats are associated with specific devices (or rather with authorization keys), not users. A conventional message box, which uses pts to describe the client’s status, is not suitable, because it is designed for long-term message storage and message access from different devices.

+

An additional temporary message queue is introduced as a solution to this problem. When an update regarding a message from a secret chat is sent, a new value of qts is sent, which helps reconstruct the difference if there has been a long break in the connection or in case of loss of an update.

+

As the number of events increases, the value of qts increases by 1 with each new event. The initial value may not (and will not) be equal to 0.

+

The fact that events from the temporary queue have been received and stored by the client is acknowledged explicitly by a call to the messages.receivedQueue method or implicitly by a call to updates.getDifference (the value of qts passed, not the final state). All messages acknowledged as delivered by the client, as well as any messages older than 7 days, may (and will) be deleted from the server.

+

Upon de-authorization, the event queue of the corresponding device will be forcibly cleared, and the value of qts will become irrelevant.

+

Updating to new layers

+

Your client should always store the maximal layer that is known to be supported by the client on the other side of a secret chat. When the secret chat is first created, this value should be initialized to 46. This remote layer value must always be updated immediately after receiving any packet containing information of an upper layer, i.e.:

+
    +
  • any secret chat message containing layer_no in its decryptedMessageLayer with layer>=46, or
  • +
  • a decryptedMessageActionNotifyLayer service message, wrapped as if it were the decryptedMessageService constructor of the obsolete layer 8 (constructor decryptedMessageService#aa48327d).
  • +
+

Notifying the remote client about your local layer

+

In order to notify the remote client of your local layer, your client must send a message of the decryptedMessageActionNotifyLayer type. This notification must be wrapped in a constructor of an appropriate layer.

+

There are two cases when your client must notify the remote client about its local layer:

+
    +
  1. As soon as a new secret chat has been created, immediately after the secret key has been successfully exchanged.
  2. +
  3. Immediately after the local client has been updated to support a new secret chat layer. In this case notifications must be sent to all currently existing secret chats. Note that this is only necessary when updating to new layers that contain changes in the secret chats implementation (e.g. you don’t need to do this when your client is updated from Layer 46 to Layer 47).
  4. +
+ +
+ +
+
+ +
+ + + + + + + + diff --git a/data/core.telegram.org/api/end-to-end/video-calls.html b/data/core.telegram.org/api/end-to-end/video-calls.html new file mode 100644 index 0000000000..f0e546831e --- /dev/null +++ b/data/core.telegram.org/api/end-to-end/video-calls.html @@ -0,0 +1,215 @@ + + + + + End-to-End Encrypted Voice and Video Calls + + + + + + + + + + + + + +
+ +
+
+
+ +

End-to-End Encrypted Voice and Video Calls

+ +

This article describes the end-to-end encryption used for Telegram voice and video calls.

+
Related Articles
+

+ +
+

Establishing Calls

+

Before a call is ready, some preliminary actions have to be performed. The calling party needs to contact the party to be called and check whether it is ready to accept the call. Besides that, the parties have to negotiate the protocols to be used, learn the IP addresses of each other or of the Telegram relay servers to be used (so-called reflectors), and generate a one-time encryption key for this voice call with the aid of Diffie--Hellman key exchange. All of this is accomplished in parallel with the aid of several Telegram API methods and related notifications. This document covers details related to key generation, encryption and security.

+

Key Generation

+

The Diffie-Hellman key exchange, as well as the whole protocol used to create a new voice call, is quite similar to the one used for Secret Chats. We recommend studying the linked article before proceeding.

+

However, we have introduced some important changes to facilitate the key verification process. Below is the entire exchange between the two communicating parties, the Caller (A) and the Callee (B), through the Telegram servers (S).

+
    +
  • A executes messages.getDhConfig to find out the 2048-bit Diffie-Hellman prime p and generator g. The client is expected to check whether p is a safe prime and perform all the security checks necessary for secret chats.
  • +
  • A chooses a random value of a, 1 < a < p-1, and computes g_a:=power(g,a) mod p (a 256-byte number) and g_a_hash:=SHA256(g_a) (32 bytes long).
  • +
  • A invokes (sends to server S) phone.requestCall, which has the field g_a_hash:bytes, among others. For this call, this field is to be filled with g_a_hash, not g_a itself.
  • +
  • The Server S performs privacy checks and sends an updatePhoneCall update with a phoneCallRequested constructor to all of B's active devices. This update, apart from the identity of A and other relevant parameters, contains the g_a_hash field, filled with the value obtained from A.
  • +
  • B accepts the call on one of their devices, stores the received value of g_a_hash for this instance of the voice call creation protocol, chooses a random value of b, 1 < b < p-1, computes g_b:=power(g,b) mod p, performs all the required security checks, and invokes the phone.acceptCall method, which has a g_b:bytes field (among others), to be filled with the value of g_b itself (not its hash).
  • +
  • The Server S sends an updatePhoneCall with the phoneCallDiscarded constructor to all other devices B has authorized, to prevent accepting the same call on any of the other devices. From this point on, the server S works only with that of B's devices which has invoked phone.acceptCall first.
  • +
  • The Server S sends to A an updatePhoneCall update with phoneCallAccepted constructor, containing the value of g_b received from B.
  • +
  • A performs all the usual security checks on g_b and a, computes the Diffie--Hellman key key:=power(g_b,a) mod p and its fingerprint key_fingerprint:long, equal to the lower 64 bits of SHA1(key), the same as with secret chats. Then A invokes the phone.confirmCall method, containing g_a:bytes and key_fingerprint:long.
  • +
  • The Server S sends to B an updatePhoneCall update with the phoneCall constructor, containing the value of g_a in g_a_or_b:bytes field, and key_fingerprint:long
  • +
  • At this point B receives the value of g_a. It checks that SHA256(g_a) is indeed equal to the previously received value of g_a_hash, performs all the usual Diffie-Hellman security checks, and computes the key key:=power(g_a,b) mod p and its fingerprint, equal to the lower 64 bits of SHA1(key). Then it checks that this fingerprint equals the value of key_fingerprint:long received from the other side, as an implementation sanity check.
  • +
+

At this point, the Diffie--Hellman key exchange is complete, and both parties have a 256-byte shared secret key key which is used to encrypt all further exchanges between A and B.

+

It is of paramount importance to accept each update only once for each instance of the key generation protocol, discarding any duplicates or alternative versions of already received and processed messages (updates).

+

Encryption

+
+

This document describes encryption in voice and video calls as implemented in Telegram apps with versions 7.0 and above. See this document for details on encryption used in voice calls in app versions released before August 14, 2020.

+
+

The Telegram Voice and Video Call Library uses an optimized version of MTProto 2.0 to send and receive packets, consisting of one or more end-to-end encrypted messages of various types (ice candidates list, video formats, remote video status, audio stream data, video stream data, message ack or empty).

+

This document describes only the encryption process, leaving out encoding and network-dependent parts.

+

The library starts working with:

+
    +
  • An encryption key key shared between the parties, as generated above.
  • +
  • Information whether the call is outgoing or incoming.
  • +
  • Two data transfer channels: signaling, offered by the Telegram API, and transport based on WebRTC.
  • +
+

Both data transfer channels are unreliable (messages may get lost), but signaling is slower and more reliable.

+

Encrypting Call Data

+

The body of a packet (decrypted_body) consists of several messages and their respective seq numbers concatenated together.

+
    +
  • decrypted_body = message_seq1 + message_body1 + message_seq2 + message_body2
  • +
+

Each decrypted_body is unique because no two seq numbers of the first message can be the same. If only old messages need to be re-sent, an empty message with new unique seq is added to the packet first.

+

The encryption key key is used to compute a 128-bit msg_key and then a 256-bit aes_key and a 128-bit aes_iv:

+
    +
  • msg_key_large = SHA256 (substr(key, 88+x, 32) + decrypted_body);
  • +
  • msg_key = substr (msg_key_large, 8, 16);
  • +
  • sha256_a = SHA256 (msg_key + substr (key, x, 36));
  • +
  • sha256_b = SHA256 (substr (key, 40+x, 36) + msg_key);
  • +
  • aes_key = substr (sha256_a, 0, 8) + substr (sha256_b, 8, 16) + substr (sha256_a, 24, 8);
  • +
  • aes_iv = substr (sha256_b, 0, 4) + substr (sha256_a, 8, 8) + substr (sha256_b, 24, 4);
  • +
+

x depends on whether the call is outgoing or incoming and on the connection type:

+
    +
  • x = 0 for outgoing + transport
  • +
  • x = 8 for incoming + transport
  • +
  • x = 128 for outgoing + signaling
  • +
  • x = 136 for incoming + signaling
  • +
+

This allows apps to decide which packet types will be sent to which connections and work in these connections independently (with each having its own seq counter).

+

The resulting aes_key and aes_iv are used to encrypt decrypted_body:

+
    +
  • encrypted_body = AES_CTR (decrypted_body, aes_key, aes_iv)
  • +
+

The packet that gets sent consists of msg_key and encrypted_body:

+
    +
  • packet_bytes = msg_key + encrypted_body
  • +
+

When received, the packet gets decrypted using key and msg_key, after which msg_key is checked against the relevant SHA256 substring. If the check fails, the packet must be discarded.

+

Protecting Against Replay Attacks

+

Each of the peers maintains its own 32-bit monotonically increasing counter for outgoing messages, seq, starting with 1. This seq counter is prepended to each sent message and increased by 1 for each new message. No two seq numbers of the first message in a packet can be the same. If only old messages need to be re-sent, an empty message with a new unique seq is added to the packet first. When the seq counter reaches 2^30, the call must be aborted. Each peer stores seq values of all the messages it has received (and processed) which are larger than max_received_seq - 64, where max_received_seq is the largest seq number received so far.

+

If a packet is received, the first message of which has a seq that is smaller or equal to max_received_seq - 64 or its seq had already been received, the message is discarded. Otherwise, the seq values of all incoming messages are memorized and max_received_seq is adjusted. This guarantees that no two packets will be processed twice.

+

Key Verification

+

To verify the key, and ensure that no MITM attack is taking place, both parties concatenate the secret key key with the value g_a of the Caller ( A ), compute SHA256 and use it to generate a sequence of emoticons. More precisely, the SHA256 hash is split into four 64-bit integers; each of them is divided by the total number of emoticons used (currently 333), and the remainder is used to select specific emoticons. The specifics of the protocol guarantee that comparing four emoticons out of a set of 333 is sufficient to prevent eavesdropping (MiTM attack on DH) with a probability of 0.9999999999.

+

This is because instead of the standard Diffie-Hellman key exchange which requires only two messages between the parties:

+
    +
  • A->B : (generates a and) sends g_a := g^a
  • +
  • B->A : (generates b and true key (g_a)^b, then) sends g_b := g^b
  • +
  • A : computes key (g_b)^a
  • +
+

we use a three-message modification thereof that works well when both parties are online (which also happens to be a requirement for voice calls):

+
    +
  • A->B : (generates a and) sends g_a_hash := hash(g^a)
  • +
  • B->A : (stores g_a_hash, generates b and) sends g_b := g^b
  • +
  • A->B : (computes key (g_b)^a, then) sends g_a := g^a
  • +
  • B : checks hash(g_a) == g_a_hash, then computes key (g_a)^b
  • +
+

The idea here is that A commits to a specific value of a (and of g_a) without disclosing it to B. B has to choose its value of b and g_b without knowing the true value of g_a, so that it cannot try different values of b to force the final key (g_a)^b to have any specific properties (such as fixed lower 32 bits of SHA256(key)). At this point, B commits to a specific value of g_b without knowing g_a. Then A has to send its value g_a; it cannot change it even though it knows g_b now, because the other party B would accept only a value of g_a that has a hash specified in the very first message of the exchange.

+

If some impostor is pretending to be either A or B and tries to perform a Man-in-the-Middle Attack on this Diffie--Hellman key exchange, the above still holds. Party A will generate a shared key with B -- or whoever pretends to be B -- without having a second chance to change its exponent a depending on the value g_b received from the other side; and the impostor will not have a chance to adapt his value of b depending on g_a, because it has to commit to a value of g_b before learning g_a. The same is valid for the key generation between the impostor and the party B.

+

The use of hash commitment in the DH exchange constrains the attacker to only one guess to generate the correct visualization in their attack, which means that using just over 33 bits of entropy represented by four emoji in the visualization is enough to make a successful attack highly improbable.

+
+

For a slightly more user-friendly explanation of the above see: How are calls authenticated?

+
+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/api/pin.html b/data/core.telegram.org/api/pin.html new file mode 100644 index 0000000000..b5528f5a39 --- /dev/null +++ b/data/core.telegram.org/api/pin.html @@ -0,0 +1,149 @@ + + + + + Pinned messages + + + + + + + + + + + + + +
+ +
+
+
+ +

Pinned messages

+ +
+ +

Telegram allows pinning multiple messages on top of a specific chat.

+
message#85d6cbe2 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true post:flags.14?true from_scheduled:flags.18?true legacy:flags.19?true edit_hide:flags.21?true pinned:flags.24?true id:int from_id:flags.8?Peer peer_id:Peer fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?long reply_to:flags.3?MessageReplyHeader date:int message:string media:flags.9?MessageMedia reply_markup:flags.6?ReplyMarkup entities:flags.7?Vector<MessageEntity> views:flags.10?int forwards:flags.10?int replies:flags.23?MessageReplies edit_date:flags.15?int post_author:flags.16?string grouped_id:flags.17?long restriction_reason:flags.22?Vector<RestrictionReason> ttl_period:flags.25?int = Message;
+
+updatePinnedMessages#ed85eab5 flags:# pinned:flags.0?true peer:Peer messages:Vector<int> pts:int pts_count:int = Update;
+updatePinnedChannelMessages#5bb98608 flags:# pinned:flags.0?true channel_id:long messages:Vector<int> pts:int pts_count:int = Update;
+
+---functions---
+
+messages.updatePinnedMessage#d2aaf7ec flags:# silent:flags.0?true unpin:flags.1?true pm_oneside:flags.2?true peer:InputPeer id:int = Updates;
+messages.unpinAllMessages#f025bc8b peer:InputPeer = messages.AffectedHistory;
+
+messages.getMessages#63c66506 id:Vector<InputMessage> = messages.Messages;
+channels.getMessages#ad8c9a23 channel:InputChannel id:Vector<InputMessage> = messages.Messages;
+

The messages.updatePinnedMessage method can be used to pin or unpin a specific message in an arbitrary chat.
+The unpin flags specifies whether to unpin or pin the message, and pm_oneside specifies whether the message should only be pinned on the local side of a one-to-one chat.

+

messages.unpinAllMessages can be used to unpin all messages in a chat.

+

When (un)pinning messages, a updatePinnedMessages or updatePinnedChannelMessages update will be emitted, containing IDs of pinned or unpinned messages.

+

Pinned messages will also have the will also have the pinned flag of message set.

+

Getting pinned messages

+
userFull#d697ff05 flags:# blocked:flags.0?true phone_calls_available:flags.4?true phone_calls_private:flags.5?true can_pin_message:flags.7?true has_scheduled:flags.12?true video_calls_available:flags.13?true user:User about:flags.1?string settings:PeerSettings profile_photo:flags.2?Photo notify_settings:PeerNotifySettings bot_info:flags.3?BotInfo pinned_msg_id:flags.6?int common_chats_count:int folder_id:flags.11?int ttl_period:flags.14?int theme_emoticon:flags.15?string = UserFull;
+chatFull#4dbdc099 flags:# can_set_username:flags.7?true has_scheduled:flags.8?true id:long about:string participants:ChatParticipants chat_photo:flags.2?Photo notify_settings:PeerNotifySettings exported_invite:flags.13?ExportedChatInvite bot_info:flags.3?Vector<BotInfo> pinned_msg_id:flags.6?int folder_id:flags.11?int call:flags.12?InputGroupCall ttl_period:flags.14?int groupcall_default_join_as:flags.15?Peer theme_emoticon:flags.16?string = ChatFull;
+channelFull#e9b27a17 flags:# can_view_participants:flags.3?true can_set_username:flags.6?true can_set_stickers:flags.7?true hidden_prehistory:flags.10?true can_set_location:flags.16?true has_scheduled:flags.19?true can_view_stats:flags.20?true blocked:flags.22?true id:long about:string participants_count:flags.0?int admins_count:flags.1?int kicked_count:flags.2?int banned_count:flags.2?int online_count:flags.13?int read_inbox_max_id:int read_outbox_max_id:int unread_count:int chat_photo:Photo notify_settings:PeerNotifySettings exported_invite:flags.23?ExportedChatInvite bot_info:Vector<BotInfo> migrated_from_chat_id:flags.4?long migrated_from_max_id:flags.4?int pinned_msg_id:flags.5?int stickerset:flags.8?StickerSet available_min_id:flags.9?int folder_id:flags.11?int linked_chat_id:flags.14?long location:flags.15?ChannelLocation slowmode_seconds:flags.17?int slowmode_next_send_date:flags.18?int stats_dc:flags.12?int pts:int call:flags.21?InputGroupCall ttl_period:flags.24?int pending_suggestions:flags.25?Vector<string> groupcall_default_join_as:flags.26?Peer theme_emoticon:flags.27?string = ChatFull;
+
+inputMessagesFilterPinned#1bb00451 = MessagesFilter;
+
+---functions---
+
+messages.search#a0fda762 flags:# peer:InputPeer q:string from_id:flags.0?InputPeer top_msg_id:flags.1?int filter:MessagesFilter min_date:int max_date:int offset_id:int add_offset:int limit:int max_id:int min_id:int hash:long = messages.Messages;
+

The pinned_msg_id of userFull, chatFull, channelFull contains the ID of only the latest pinned message.
+To obtain a full list, use messages.search with inputMessagesFilterPinned filter.

+ +
+ +
+
+ +
+ + + + + + + + diff --git a/data/core.telegram.org/api/stats.html b/data/core.telegram.org/api/stats.html deleted file mode 100644 index c9372acb5a..0000000000 --- a/data/core.telegram.org/api/stats.html +++ /dev/null @@ -1,297 +0,0 @@ - - - - - Channel statistics - - - - - - - - - - - - - -
- -
-
-
- -

Channel statistics

- -
- -

Telegram offers detailed channel statistics for channels and supergroups.

-

Channel statistics

-

Schema:

-
statsDateRangeDays#b637edaf min_date:int max_date:int = StatsDateRangeDays;
-
-statsAbsValueAndPrev#cb43acde current:double previous:double = StatsAbsValueAndPrev;
-
-statsPercentValue#cbce2fe0 part:double total:double = StatsPercentValue;
-
-statsGraphAsync#4a27eb2d token:string = StatsGraph;
-statsGraphError#bedc9822 error:string = StatsGraph;
-statsGraph#8ea464b6 flags:# json:DataJSON zoom_token:flags.0?string = StatsGraph;
-
-messageInteractionCounters#ad4fc9bd msg_id:int views:int forwards:int = MessageInteractionCounters;
-
-stats.broadcastStats#bdf78394 period:StatsDateRangeDays followers:StatsAbsValueAndPrev views_per_post:StatsAbsValueAndPrev shares_per_post:StatsAbsValueAndPrev enabled_notifications:StatsPercentValue growth_graph:StatsGraph followers_graph:StatsGraph mute_graph:StatsGraph top_hours_graph:StatsGraph interactions_graph:StatsGraph iv_interactions_graph:StatsGraph views_by_source_graph:StatsGraph new_followers_by_source_graph:StatsGraph languages_graph:StatsGraph recent_message_interactions:Vector<MessageInteractionCounters> = stats.BroadcastStats;
-
----functions---
-
-stats.getBroadcastStats#ab42441a flags:# dark:flags.0?true channel:InputChannel = stats.BroadcastStats;
-stats.loadAsyncGraph#621d5fa0 flags:# token:string x:flags.0?long = StatsGraph;
-

Administrators of channels of a certain size (the exact limit is a server-side config, returned in the can_view_stats flag of channelFull) can call stats.getBroadcastStats to get detailed channel statistics.
-The returned stats.broadcastStats contains multiple statistics:

-
    -
  • Period-related statistics: a pair of values, one at the beginning and one at the end of the period in consideration (period).
    The period typically depends on channel activity.
      -
    • Absolute follower count (followers)
    • -
    • total_viewcount/postcount, for posts posted during the period in consideration (views_per_post).
      -Note that in this case, current refers to the period in consideration (min_date till max_date), and prev refers to the previous period ((min_date - (max_date - min_date)) till min_date).
    • -
    • total_sharecount/postcount, for posts posted during the period in consideration (shares_per_post).
      -Note that in this case, current refers to the period in consideration (min_date till max_date), and prev refers to the previous period ((min_date - (max_date - min_date)) till min_date).
    • -
    -
  • -
  • Percentage statistics
      -
    • Percentage of subscribers with enabled notifications (enabled_notifications)
    • -
    -
  • -
  • Graphs: graphs are described below ».
  • -
-

Supergroup statistics

-

Schema:

-
statsGroupTopPoster#9d04af9b user_id:long messages:int avg_chars:int = StatsGroupTopPoster;
-statsGroupTopInviter#535f779d user_id:long invitations:int = StatsGroupTopInviter;
-statsGroupTopAdmin#d7584c87 user_id:long deleted:int kicked:int banned:int = StatsGroupTopAdmin;
-
-stats.megagroupStats#ef7ff916 period:StatsDateRangeDays members:StatsAbsValueAndPrev messages:StatsAbsValueAndPrev viewers:StatsAbsValueAndPrev posters:StatsAbsValueAndPrev growth_graph:StatsGraph members_graph:StatsGraph new_members_by_source_graph:StatsGraph languages_graph:StatsGraph messages_graph:StatsGraph actions_graph:StatsGraph top_hours_graph:StatsGraph weekdays_graph:StatsGraph top_posters:Vector<StatsGroupTopPoster> top_admins:Vector<StatsGroupTopAdmin> top_inviters:Vector<StatsGroupTopInviter> users:Vector<User> = stats.MegagroupStats;
-
----functions---
-
-stats.getMegagroupStats#dcdf8607 flags:# dark:flags.0?true channel:InputChannel = stats.MegagroupStats;
-

Administrators of supergroups of a certain size (the exact limit is a server-side config, returned in the can_view_stats flag of channelFull) can call stats.getMegagroupStats to get detailed supergroup statistics.
-The returned stats.broadcastStats contains multiple statistics, see the constructor page for more info ».

-

Message statistics

-
stats.messageStats#8999f295 views_graph:StatsGraph = stats.MessageStats;
-
----functions---
-
-stats.getMessageStats#b6e0a3f5 flags:# dark:flags.0?true channel:InputChannel msg_id:int = stats.MessageStats;
-

Administrators of channels of a certain size (the exact limit is a server-side config, returned in the can_view_stats flag of channelFull) can call stats.getMessageStats to get statistics of a specific message.
-The returned stats.messageStats contains the view graph of the message.

-

Graph visualization

-

There are four available visualizations for graph types:

- -

Graph modifiers (see various graphs for examples):

-
    -
  • y_scaled - Indicates that each of the two (!) lines in a step graph must be visualized on its own scale, with two different tick axes on the left and right parts of the graph
  • -
  • percentage - Indicates whether value percentages should be shown in labels
  • -
  • stacked - Depending on the graph type, indicates stacking of multiple columns in the same graph
  • -
-

Graph syntax

-
statsGraphAsync#4a27eb2d token:string = StatsGraph;
-statsGraphError#bedc9822 error:string = StatsGraph;
-statsGraph#8ea464b6 flags:# json:DataJSON zoom_token:flags.0?string = StatsGraph;
-
-dataJSON#7d748d04 data:string = DataJSON;
-
----functions---
-
-stats.loadAsyncGraph#621d5fa0 flags:# token:string x:flags.0?long = StatsGraph;
-

Certain graphs are not directly sent in the stats.broadcastStats constructor to reduce server load: instead, those graphs will be sent as a statsGraphAsync constructor, and should be fetched separately using stats.loadAsyncGraph.

-

After obtaining the full statsGraph constructor, clients should parse the JSON graph object in the json field.

-

Object structure:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
KeyGraph title
columnsArray of all data column arrays in the chart. Each column array has its label at position 0, followed by values.
typesGraphs types for each of the column arrays (object, "label": "type"):
- line - line graph
- area - area graph
- step - step graph
- bar - bar graph
- x - x axis values for each of the charts at the corresponding positions, UNIX timestamps in milliseconds.
colorsColor for each type (object, "label": "colorKey#AAAAAA"; see chart colors).
namesLocalized name for each variable (object, "label": "Name")
subchartObject indicating the default zoom range for the graph, this is object's structure:
- show - Whether to use the specified zoom range (boolean)
- defaultZoom - An array with two x values, indicating the two ends of the default zoom range
y_scaledIndicates that each of the two (!) lines in a step graph must be visualized on its own scale, with two different tick axes on the left and right parts of the graph (boolean, see various graphs for examples)
percentageIndicates whether value percentages should be shown in labels (boolean, see various graphs for examples)
stackedDepending on the graph type, indicates stacking of multiple columns in the same graph (boolean, see various graphs for examples)
- -

The following chart restrictions apply:

-
    -
  • Up to 50 columns on one graph must be supported.
  • -
  • Chart types are always the same for every column in the graph.
  • -
  • The bar chart type and stacked option are always used together.
  • -
  • percentage is always used with the area graph. - -
  • -
-

Chart zooming

-
statsGraphError#bedc9822 error:string = StatsGraph;
-statsGraph#8ea464b6 flags:# json:DataJSON zoom_token:flags.0?string = StatsGraph;
-
-dataJSON#7d748d04 data:string = DataJSON;
-
----functions---
-
-stats.loadAsyncGraph#621d5fa0 flags:# token:string x:flags.0?long = StatsGraph;
-

Graphs that support zooming will contain a zoom_token in the statsGraph constructor.
-Said token should be then used as token in a new stats.loadAsyncGraph call triggered when the user clicks on the label, related to a certain x axis in the graph (see graph examples).
-The x coordinate of the label should be provided to the x parameter; the method will then return (if available) a more detailed subgraph.
-If not enough data is available, a localized statsGraphError will be returned.

-

Typical zoom visualization rules:

- -

Chart colors

-

Chart colors can be provided as a color key, followed by the primary color value in hex format:

-
red#e05356
-

The color key can be one of red, lightblue, lightgreen, golden, green, orange, blue, indigo.
-Apps can choose to use a color value specified by the currently loaded theme: for example, the android app uses statisticChartLine_* themekeys for each of the color keys, check out the assets directory for a bunch of default themes with various colors for channel statistics.

-

However, the server may also choose to return just a plain color value in hex format:

-
#e05356
-

In this case, the dark flag of the stats.getBroadcastStats method can be used to choose the palette of returned colors.

-

Graph examples

-

Line graph

-

Simple single line graph

-

Step graph

-

Step graph, always "stacked" (to indicate multiple lines)

-

Bar graph

-

Bar graph with multiple lines, always "stacked" (to indicate actual stacked bars, biggest bars first)

-

Area graph

-

Mixed bar/line graph, always "stacked" (to indicate actual stacked bars, biggest bars first)

-

Piechart

-

Piechart, typically obtained only when zooming into percentage graphs

- -
- -
-
- -
- - - - - - - - diff --git a/data/core.telegram.org/api/url-authorization.html b/data/core.telegram.org/api/url-authorization.html new file mode 100644 index 0000000000..5e711e4cd3 --- /dev/null +++ b/data/core.telegram.org/api/url-authorization.html @@ -0,0 +1,160 @@ + + + + + Seamless Telegram Login + + + + + + + + + + + + + +
+ +
+
+
+ +

Seamless Telegram Login

+ +
+ +

Bots or Telegram websites may ask users to login to a certain website via Telegram when clicking on certain links or URL buttons in inline keyboards.

+

Bot URL authorization

+

When the user clicks on keyboardButtonUrlAuth, messages.requestUrlAuth should be called, providing the button_id of the button and the ID and peer of the container message. +The returned urlAuthResultRequest object will contain more details about the authorization request:

+
    +
  • The domain parameter will contain the domain name of the website on which the user will log in (example: comments.app).
  • +
  • The bot parameter will contain info about the bot which will be used for user authorization (example: DiscussBot).
  • +
  • The request_write_access will be set if the bot would like to send messages to the user.
  • +
+

The info should be shown in a prompt:

+
+ TITLE +
+

If the user agrees to login to the URL, messages.acceptUrlAuth should be called (eventually setting the write_allowed if the permission was requested and the user consented). +The result will be a urlAuthResultAccepted with the final URL to open, which will include a query string with the requested info and a hash that must be verified upon receival by the service.

+

urlAuthResultDefault could also be returned, instead, in which case the url of the keyboardButtonUrlAuth must be opened, instead. +The same must be done if the user opens the link while refusing the authorization request.

+

Link URL authorization

+

Telegram supports automatic authorization on certain websites upon opening an HTTP URL in-app, upon clicking a link in a message or clicking on a keyboardButtonUrl.

+

Automatic authorization

+

Clients should automatically authenticate users when opening official Telegram websites, listed in the url_auth_domains key of the client configuration object ».

+

Upon clicking a link, the URL must be modified by appending the autologin_token from the client configuration object » to the query string, like so:

+

Original URL: https://somedomain.telegram.org/path?query=string#fragment=value
+Modified URL: https://somedomain.telegram.org/path?query=string&autologin_token=$autologin_token#fragment=value

+

Make sure that the used autologin_token is no more than 10000 seconds old, if it is older it must be refetched before use as described in the client configuration section ».

+

Manual authorization

+

Clients should show a confirmation prompt similar to the one used for bots, to authenticate users when opening certain Telegram websites, listed in the url_auth_domains key of the client configuration object ».

+

messages.requestUrlAuth should be called, providing only the original url. +The returned urlAuthResultRequest object will contain more details about the authorization request:

+
    +
  • The domain parameter will contain the domain name of the website on which the user will log in (example: comments.app).
  • +
  • The request_write_access will be set if the website would like to send messages to the user.
  • +
+

The info should be shown in a prompt.

+

If the user agrees to login to the URL, messages.acceptUrlAuth should be called (eventually setting the write_allowed if the permission was requested and the user consented). +The result will be a urlAuthResultAccepted with the final URL to open.

+

urlAuthResultDefault could also be returned, instead, in which case the original URL must be opened, instead. +The same must be done if the user opens the link while refusing the authorization request.

+

Related articles

+

Client configuration

+

The MTProto API has multiple configuration parameters that can be fetched with the appropriate methods.

+ +
+ +
+
+ +
+ + + + + + + + diff --git a/data/core.telegram.org/method/messages.sendBroadcast b/data/core.telegram.org/apple_privacy.html similarity index 68% rename from data/core.telegram.org/method/messages.sendBroadcast rename to data/core.telegram.org/apple_privacy.html index 5244109ad0..749930f957 100644 --- a/data/core.telegram.org/method/messages.sendBroadcast +++ b/data/core.telegram.org/apple_privacy.html @@ -2,12 +2,14 @@ - messages.sendBroadcast + Page moved - - + + - + @@ -26,7 +28,7 @@
  • Home
  • -
  • API
  • +
  • API
  • Protocol
  • Schema
  • @@ -36,40 +38,11 @@
    - -

    messages.sendBroadcast

    +
    +

    Page moved

    -

    Sends multiple messages to contacts.

    -

    {schema}

    -

    Parameters

    - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeDescription
    contactsVector<InputUser>List of user ID to whom a message will be sent
    messagestringMessage text
    mediaInputMediaMessage media-contents
    -

    Result

    -

    messages.StatedMessages

    +

    This is not the droid you're looking for.
    The page has been moved.

    +
    diff --git a/data/core.telegram.org/bots.html b/data/core.telegram.org/bots.html new file mode 100644 index 0000000000..fa4bec195b --- /dev/null +++ b/data/core.telegram.org/bots.html @@ -0,0 +1,437 @@ + + + + + Bots: An introduction for developers + + + + + + + + + + + + + +
    + +
    +
    +
    +
    +

    Bots: An introduction for developers

    + +
    + +

    Bots are third-party applications that run inside Telegram. Users can interact with bots by sending them messages, commands and inline requests. You control your bots using HTTPS requests to Telegram's Bot API.

    +
    +

    The full API reference for developers is available here.

    +
    +

    1. What can I do with bots?

    +
    + +
    + +

    To name just a few things, you could use bots to:

    +
      +
    • Get customized notifications and news. A bot can act as a smart newspaper, sending you relevant content as soon as it's published.

      +
    • +
    • Integrate with other services. A bot can enrich Telegram chats with content from external services.
      Gmail Bot, GIF bot, IMDB bot, Wiki bot, Music bot, Youtube bot, GitHubBot

      +
    • +
    • Accept payments from Telegram users. A bot can offer paid services or work as a virtual storefront. Read more »
      Demo Shop Bot, Demo Store

      +
    • +
    • Create custom tools. A bot may provide you with alerts, weather forecasts, translations, formatting or other services.
      Markdown bot, Sticker bot, Vote bot, Like bot

      +
    • +
    • Build single- and multiplayer games. A bot can offer rich HTML5 experiences, from simple arcades and puzzles to 3D-shooters and real-time strategy games.
      GameBot, Gamee

      +
    • +
    • Build social services. A bot could connect people looking for conversation partners based on common interests or proximity.

      +
    • +
    • Do virtually anything else. Except for dishes — bots are terrible at doing the dishes.

      +
    • +
    +

    2. How do bots work?

    +

    At the core, Telegram Bots are special accounts that do not require an additional phone number to set up. Users can interact with bots in two ways:

    +
      +
    • Send messages and commands to bots by opening a chat with them or by adding them to groups.
    • +
    • Send requests directly from the input field by typing the bot's @username and a query. This allows sending content from inline bots directly into any chat, group or channel.
    • +
    +

    Messages, commands and requests sent by users are passed to the software running on your servers. Our intermediary server handles all encryption and communication with the Telegram API for you. You communicate with this server via a simple HTTPS-interface that offers a simplified version of the Telegram API. We call that interface our Bot API.

    +
    +

    A detailed description of the Bot API is available on this page »

    +
    +

    3. How do I create a bot?

    +
    + +
    + +

    There's a… bot for that. Just talk to BotFather (described below) and follow a few simple steps. Once you've created a bot and received your authentication token, head down to the Bot API manual to see what you can teach your bot to do.

    +
    +

    You may also like to check out some code examples here »

    +
    +

    4. How are bots different from humans?

    +
      +
    • Bots have no online status and no last seen timestamps, the interface shows the label 'bot' instead.
    • +
    • Bots have limited cloud storage — older messages may be removed by the server shortly after they have been processed.
    • +
    • Bots can't initiate conversations with users. A user must either add them to a group or send them a message first. People can use t.me/<bot_username> links or username search to find your bot.
    • +
    • Bot usernames always end in 'bot' (e.g. @TriviaBot, @GitHub_bot).
    • +
    • When added to a group, bots do not receive all messages by default (see Privacy mode).
    • +
    • Bots never eat, sleep or complain (unless expressly programmed otherwise).
    • +
    +
    +

    5. Bot perks

    +

    Telegram bots are unique in many ways — we offer two kinds of keyboards, additional interfaces for default commands and deep linking as well as text formatting, integrated payments and more.

    +

    Inline mode

    + + +

    Users can interact with your bot via inline queries straight from the text input field in any chat. All they need to do is start a message with your bot's username and then type a query.

    +

    Having received the query, your bot can return some results. As soon as the user taps one of them, it is sent to the user's currently opened chat. This way, people can request content from your bot in any of their chats, groups or channels.

    +

    Check out this blog to see a sample inline bot in action. You can also try the @sticker and @music bots to see for yourself.

    +
    +
    + +
    + +

    We've also implemented an easy way for your bot to switch between inline and PM modes.

    +
    +

    Read more about the Inline Mode »

    +
    +

    Payment platform

    + + +

    You can use bots to accept payments from Telegram users around the world.

    +
      +
    • Send invoices to any chat, including to groups and channels.
    • +
    • Create invoices that can be forwarded and used by multiple buyers to order things.
    • +
    • Use inline mode to help users show your goods and services to their friends and communities.
    • +
    • Allow tips from users with preset and custom amounts.
    • +
    • Accept payments from users on mobile or desktop apps.
    • +
    • Try @ShopBot to create a test invoice – or start a message with @ShopBot ... in any chat for an inline invoice.
    • +
    • Check out Demo Shop for an example of a Telegram Channel used as virtual storefront.
    • +
    +
    + +
    + +
    +

    Read more about the Payments Platform »

    +
    +

    Gaming platform

    +

    Bots can offer their users HTML5 games to play solo or to compete against each other in groups and one-on-one chats. The platform allows your bot to keep track of high scores for every game played in every chat. Whenever there’s a new leader in the game, other playing members in the chat are notified that they need to step it up.

    +
    + + +
    +
    + +

    Since the underlying technology is HTML5, the games can be anything from simple arcades and puzzles to multiplayer 3D-shooters and real-time strategy games. Our team has created a couple of simple demos for you to try out:

    + +

    You can also check out the @gamee bot that has more than 20 games.

    +
    +

    Read more about the Gaming Platform »

    +
    +

    Keyboards

    +

    Traditional chat bots can of course be taught to understand human language. But sometimes you want some more formal input from the user — and this is where custom keyboards can become extremely useful.

    +

    Whenever your bot sends a message, it can pass along a special keyboard with predefined reply options (see ReplyKeyboardMarkup). Telegram apps that receive the message will display your keyboard to the user. Tapping any of the buttons will immediately send the respective command. This way you can drastically simplify user interaction with your bot.

    +

    We currently support text and emoji for your buttons. Here are some custom keyboard examples:

    +
    +
    + + + + + + + +
    + +
    +

    For more technical information on custom keyboards, please consult the Bot API manual (see sendMessage).

    +
    +

    Inline keyboards and on-the-fly updating

    +

    There are times when you'd prefer to do things without sending any messages to the chat. For example, when your user is changing settings or flipping through search results. In such cases you can use Inline Keyboards that are integrated directly into the messages they belong to.

    +

    Unlike with custom reply keyboards, pressing buttons on inline keyboards doesn't result in messages sent to the chat. Instead, inline keyboards support buttons that work behind the scenes: callback buttons, URL buttons and switch to inline buttons.

    +
    + + + + +
    + +
    + +

    When callback buttons are used, your bot can update its existing messages (or just their keyboards) so that the chat remains tidy. Check out these sample bots to see inline keyboards in action: @music, @vote, @like.

    +
    +

    Read more about inline keyboards and on-the-fly editing »

    +
    +

    Commands

    +

    Commands present a more flexible way to communicate with your bot. The following syntax may be used:

    +
    /command
    +

    A command must always start with the '/' symbol and may not be longer than 32 characters. Commands can use latin letters, numbers and underscores. Here are a few examples:

    +
    /get_messages_stats
    +/set_timer 10min Alarm!
    +/get_timezone London, UK
    +

    Messages that start with a slash are always passed to the bot (along with replies to its messages and messages that @mention the bot by username). Telegram apps will:

    +
      +
    • Suggest a list of supported commands with descriptions when the user enters a '/' (for this to work, you need to have provided a list of commands to the BotFather). Tapping on a command in the list immediately sends the command.
    • +
    • Show an additional (/) button in the input field in all chats with bots. Tapping it types a '/' and shows the list of commands.
    • +
    • Highlight /commands in messages. When the user taps a highlighted command, the command is sent at once.
    • +
    +
    + + + + + + + +
    + + +

    If multiple bots are in a group, it is possible to add bot usernames to commands in order to avoid confusion:

    +
    /start@TriviaBot
    +/start@ApocalypseBot
    +

    This is done automatically when commands are selected via the list of suggestions. Please remember that your bot needs to be able to process commands that are followed by its username.

    +
    Global commands
    +

    In order to make it easier for users to navigate the bot multiverse, we ask all developers to support a few basic commands. Telegram apps will have interface shortcuts for these commands.

    +
      +
    • /start - begins interaction with the user, e.g., by sending a greeting message. This command can also be used to pass additional parameters to the bot (see Deep linking)
    • +
    • /help - returns a help message. It can be a short text about what your bot can do and a list of commands.
    • +
    • /settings - (if applicable) returns the bot's settings for this user and suggests commands to edit these settings.
    • +
    +

    Users will see a Start button when they first open a conversation with your bot. Help and Settings links will be available in the menu on the bot's profile page.

    +
    + + + + +
    + +

    Formatting: bold, italic, fixed-width text and inline links

    +

    You can use bold, italic or fixed-width text, as well as inline links in your bots' messages. Telegram clients will render them accordingly.

    +
    +

    Read more in the Bot API manual »

    +
    +

    Privacy mode

    +

    Bots are frequently added to groups in order to augment communication between human users, e.g. by providing news, notifications from external services or additional search functionality. This is especially true for work-related groups. Now, when you share a group with a bot, you tend to ask yourself “How can I be sure that the little rascal isn't selling my chat history to my competitors?” The answer is — privacy mode.

    +

    A bot running in privacy mode will not receive all messages that people send to the group. Instead, it will only receive:

    +
      +
    • Messages that start with a slash '/' (see Commands above)
    • +
    • Replies to the bot's own messages
    • +
    • Service messages (people added or removed from the group, etc.)
    • +
    • Messages from channels where it's a member
    • +
    +

    On one hand, this helps some of us sleep better at night (in our tinfoil nightcaps), on the other — it allows the bot developer to save a lot of resources, since they won't need to process tens of thousands irrelevant messages each day.

    +

    Privacy mode is enabled by default for all bots, except bots that were added to the group as admins (bot admins always receive all messages). It can be disabled, so that the bot receives all messages like an ordinary user (the bot will need to be re-added to the group for this change to take effect). We only recommend doing this in cases where it is absolutely necessary for your bot to work — users can always see a bot's current privacy setting in the group members list. In most cases, using the force reply option for the bot's messages should be more than enough.

    +

    So what messages exactly will my bot get? »

    +

    Deep linking

    +

    Telegram bots have a deep linking mechanism, that allows for passing additional parameters to the bot on startup. It could be a command that launches the bot — or an authentication token to connect the user's Telegram account to their account on some external service.

    +

    Each bot has a link that opens a conversation with it in Telegram — https://t.me/<bot username>. You can add the parameters start or startgroup to this link, with values up to 64 characters long. For example:

    +
    https://t.me/triviabot?startgroup=test
    +

    A-Z, a-z, 0-9, _ and - are allowed. We recommend using base64url to encode parameters with binary and other types of content.

    +

    Following a link with the start parameter will open a one-on-one conversation with the bot, showing a START button in the place of the input field. If the startgroup parameter is used, the user is prompted to select a group to add the bot to. As soon as a user confirms the action (presses the START button in their app or selects a group to add the bot to), your bot will receive a message from that user in this format:

    +
    /start PAYLOAD
    +

    PAYLOAD stands for the value of the start or startgroup parameter that was passed in the link.

    +
    Deep linking Example
    +

    Suppose the website example.com would like to send notifications to its users via a Telegram bot. Here's what they could do to enable notifications for a user with the ID 123.

    +
      +
    1. Create a bot with a suitable username, e.g. @ExampleComBot
    2. +
    3. Set up a webhook for incoming messages
    4. +
    5. Generate a random string of a sufficient length, e.g. $memcache_key = "vCH1vGWJxfSeofSAs0K5PA"
    6. +
    7. Put the value 123 with the key $memcache_key into Memcache for 3600 seconds (one hour)
    8. +
    9. Show our user the button https://t.me/ExampleComBot?start=vCH1vGWJxfSeofSAs0K5PA
    10. +
    11. Configure the webhook processor to query Memcached with the parameter that is passed in incoming messages beginning with /start. If the key exists, record the chat_id passed to the webhook as telegram_chat_id for the user 123. Remove the key from Memcache.
    12. +
    13. Now when we want to send a notification to the user 123, check if they have the field telegram_chat_id. If yes, use the sendMessage method in the Bot API to send them a message in Telegram.
    14. +
    +

    Location and Number

    +

    Some bots need extra data from the user to work properly. For example, knowing the user's location helps provide more relevant geo-specific results. The user's phone number can be very useful for integrations with other services, like banks, etc.

    +

    Bots can ask a user for their location and phone number using special buttons. Note that both phone number and location request buttons will only work in private chats.

    +
    +
    + +
    + +

    When these buttons are pressed, Telegram clients will display a confirmation alert that tells the user what's about to happen.

    +
    +

    Manual: Number and location buttons »

    +
    +
    +

    6. BotFather

    +
    +

    Jump to top to learn everything about Telegram bots »

    +
    +

    BotFather is the one bot to rule them all. It will help you create new bots and change settings for existing ones.

    +

    Creating a new bot

    +

    Use the /newbot command to create a new bot. The BotFather will ask you for a name and username, then generate an authentication token for your new bot.

    +

    The name of your bot is displayed in contact details and elsewhere.

    +

    The Username is a short name, to be used in mentions and t.me links. Usernames are 5-32 characters long and are case insensitive, but may only include Latin characters, numbers, and underscores. Your bot's username must end in 'bot', e.g. 'tetris_bot' or 'TetrisBot'.

    +

    The token is a string along the lines of 110201543:AAHdqTcvCH1vGWJxfSeofSAs0K5PALDsaw that is required to authorize the bot and send requests to the Bot API. Keep your token secure and store it safely, it can be used by anyone to control your bot.

    +

    Generating an authentication token

    +

    If your existing token is compromised or you lost it for some reason, use the /token command to generate a new one.

    +

    Botfather commands

    +

    The remaining commands are pretty self-explanatory:

    +
      +
    • /mybots — returns a list of your bots with handy controls to edit their settings
    • +
    • /mygames — does the same for your games
    • +
    +

    Edit bots

    +
      +
    • /setname – change your bot's name.
    • +
    • /setdescription — change the bot's description, a short text of up to 512 characters, describing your bot. Users will see this text at the beginning of the conversation with the bot, titled 'What can this bot do?'.
    • +
    • /setabouttext — change the bot's about info, an even shorter text of up to 120 characters. Users will see this text on the bot's profile page. When they share your bot with someone, this text is sent together with the link.
    • +
    • /setuserpic — change the bot's profile pictures. It's always nice to put a face to a name.
    • +
    • /setcommands — change the list of commands supported by your bot. Users will see these commands as suggestions when they type / in the chat with your bot. Each command has a name (must start with a slash ‘/’, alphanumeric plus underscores, no more than 32 characters, case-insensitive), parameters, and a text description. Users will see the list of commands whenever they type '/' in a conversation with your bot.
    • +
    • /deletebot — delete your bot and free its username.
    • +
    +

    Edit settings

    +
      +
    • /setinline — toggle inline mode for your bot.
    • +
    • /setinlinegeo - request location data to provide location-based inline results.
    • +
    • /setjoingroups — toggle whether your bot can be added to groups or not. Any bot must be able to process private messages, but if your bot was not designed to work in groups, you can disable this.
    • +
    • /setprivacy — set which messages your bot will receive when added to a group. With privacy mode disabled, the bot will receive all messages. We recommend leaving privacy mode enabled. You will need to re-add the bot to existing groups for this change to take effect.
    • +
    +

    Manage games

    +
      +
    • /newgame — create a new game.
    • +
    • /listgames — get a list of your games.
    • +
    • /editgame — edit a game.
    • +
    • /deletegame — delete an existing game.
    • +
    +
    +

    Please note, that it may take a few minutes for changes to take effect.

    +
    +

    Status alerts

    +

    Millions choose Telegram for its speed. To stay competitive in this environment, your bot also needs to be responsive. In order to help developers keep their bots in shape, Botfather will send status alerts if it sees something is wrong.

    +

    We will be checking the number of replies and the request/response conversion rate for popular bots (~300 requests per minute: but don't write this down as the value may change in the future). If we get abnormally low readings, you will receive a notification from Botfather.

    +
    Responding to alerts
    +

    By default, you will only get one alert per bot per hour. Each alert has the following buttons:

    +
      +
    • Fixed. Use this if you found an issue with your bot and fixed it. If you press the fix button, we will resume sending alerts in the regular way so that you can see if your fix worked within 5-10 minutes instead of having to wait for an hour.
    • +
    • Support. Use this to open a chat with @BotSupport if you don't see any issues with your bot or if you think the problem is on our side.
    • +
    • Mute for 8h/1w. Use this if you can't fix your bot at the moment. This will disable all alerts for the bot in question for the specified period of time. We do not recommend using this option since your users may migrate to a more stable bot. You can unmute alerts in your bot's settings via Botfather.
    • +
    +
    Monitored issues
    +

    We will currently notify you about the following issues:

    +

    1.

    +
    Too few **private messages** are sent compared to previous weeks: **{value}**
    +

    Your bot is sending much fewer messages than it did in the previous weeks. This is useful for newsletter-style bots that send out messages without prompts from the users. The larger the value, the more significant the difference.

    +

    2.

    +
    Too few replies to incoming **private messages**. Conversion rate: **{value}**
    +

    Your bot is not replying to all messages that are being sent to it (the request/response conversion rate for your bot was too low for at least two of the last three 5-minute periods). To provide a good user experience, please respond to all messages that are sent to your bot. Respond to message updates by calling send… methods (e.g. sendMessage).

    +

    3.

    +
    Too few answers to **inline queries**. Conversion rate: **{value}**
    +

    Your bot is not replying to all inline queries that are being sent to it, calculated in the same way as above. Respond to inline_query updates by calling answerInlineQuery.

    +

    4.

    +
    Too few answers to **callback queries**. Conversion rate: **{value}**
    +Too few answers to **callback game queries**. Conversion rate: **{value}**
    +

    Your bot is not replying to all callback queries that are being sent to it (with or without games), calculated in the same way as above. Respond to callback_query updates by calling answerCallbackQuery.

    +
    +

    Please note that the status alerts feature is still being tested and will be improved in the future.

    +
    +
    +

    That's it for the introduction. You are now definitely ready to proceed to the BOT API MANUAL.

    +

    If you've got any questions, please check out our Bot FAQ »

    +
    + +
    + +
    +
    + +
    + + + + + + + + diff --git a/data/core.telegram.org/bots/api-changelog.html b/data/core.telegram.org/bots/api-changelog.html deleted file mode 100644 index c515fad459..0000000000 --- a/data/core.telegram.org/bots/api-changelog.html +++ /dev/null @@ -1,670 +0,0 @@ - - - - - Bot API changelog - - - - - - - - - - - - - -
    - -
    -
    -
    -
    -

    Bot API changelog

    - -
    - -
    -

    The Bot API is an HTTP-based interface created for developers keen on building bots for Telegram.
    To learn how to create and set up a bot, please consult our Introduction to Bots »

    -
    -

    You will find all changes to our Bot API on this page.

    -

    Recent changes

    -
    -

    Subscribe to @BotNews to be the first to know about the latest updates and join the discussion in @BotTalk

    -
    -

    January 31, 2022

    -

    Bot API 5.7

    - -

    December 30, 2021

    -

    Bot API 5.6

    - -

    December 7, 2021

    -

    Bot API 5.5

    -
      -
    • Bots are now allowed to contact users who sent a join request to a chat where the bot is an administrator with the can_invite_users administrator right – even if the user never interacted with the bot before.
    • -
    • Added support for mentioning users by their ID in inline keyboards. This will only work in Telegram versions released after December 7, 2021. Older clients will display unsupported message.
    • -
    • Added the methods banChatSenderChat and unbanChatSenderChat for banning and unbanning channel chats in supergroups and channels.
    • -
    • Added the field has_private_forwards to the class Chat for private chats, which can be used to check the possibility of mentioning the user by their ID.
    • -
    • Added the field has_protected_content to the classes Chat and Message.
    • -
    • Added the field is_automatic_forward to the class Message.
    • -
    -

    Note: After this update it will become impossible to forward messages from some chats. Use the fields has_protected_content in the classes Message and Chat to check this.

    -

    Note: After this update users are able to send messages on behalf of channels they own. Bots are expected to use the field sender_chat in the class Message to correctly support such messages.

    -

    Note: As previously announced, user identifiers can now have up to 52 significant bits and require a 64-bit integer or double-precision float type to be stored safely.

    -

    November 5, 2021

    -

    Bot API 5.4

    - -
    -
    -

    ⚠️ WARNING! ⚠️
    User identifiers will become bigger than 2^31 - 1 before the end of this year and it will be no longer possible to store them in a signed 32-bit integer type. User identifiers will have up to 52 significant bits, so a 64-bit integer or double-precision float type would still be safe for storing them. Please make sure that your code can correctly handle such user identifiers.

    -
    -
    -

    June 25, 2021

    -

    Bot API 5.3

    -

    Personalized Commands

    -
      -
    • Bots can now show lists of commands tailored to specific situations - including localized commands for users with different languages, as well as different commands based on chat type or for specific chats, and special lists of commands for chat admins.
    • -
    • Added the class BotCommandScope, describing the scope to which bot commands apply.
    • -
    • Added the parameters scope and language_code to the method setMyCommands to allow bots specify different commands for different chats and users.
    • -
    • Added the parameters scope and language_code to the method getMyCommands.
    • -
    • Added the method deleteMyCommands to allow deletion of the bot's commands for the given scope and user language.
    • -
    • Improved visibility of bot commands in Telegram apps with the new 'Menu' button in chats with bots, read more on the blog.
    • -
    -

    Custom Placeholders

    - -

    And More

    -
      -
    • Improved documentation of the class ChatMember by splitting it into 6 subclasses.
    • -
    • Renamed the method kickChatMember to banChatMember. The old method name can still be used.
    • -
    • Renamed the method getChatMembersCount to getChatMemberCount. The old method name can still be used.
    • -
    • Values of the field file_unique_id in objects of the type PhotoSize and of the fields small_file_unique_id and big_file_unique_id in objects of the type ChatPhoto were changed.
    • -
    -
    -
    -

    ⚠️ WARNING! ⚠️
    After one of the upcoming Bot API updates, user identifiers will become bigger than 2^31 - 1 and it will be no longer possible to store them in a signed 32-bit integer type. User identifiers will have up to 52 significant bits, so a 64-bit integer or double-precision float type would still be safe for storing them. Please make sure that your code can correctly handle such user identifiers.

    -
    -
    -

    April 26, 2021

    -

    Bot API 5.2

    -
      -
    • Support for Payments 2.0, see this manual for more details about the Bot Payments API.
    • -
    • Added the type InputInvoiceMessageContent to support sending invoices as inline query results.
    • -
    • Allowed sending invoices to group, supergroup and channel chats.
    • -
    • Added the fields max_tip_amount and suggested_tip_amounts to the method sendInvoice to allow adding optional tips to the payment.
    • -
    • The parameter start_parameter of the method sendInvoice became optional. If the parameter isn't specified, the invoice can be paid directly from forwarded messages.
    • -
    • Added the field chat_type to the class InlineQuery, containing the type of the chat, from which the inline request was sent.
    • -
    • Added the type VoiceChatScheduled and the field voice_chat_scheduled to the class Message.
    • -
    • Fixed an error in sendChatAction documentation to correctly mention “record_voice” and “upload_voice” instead of “record_audio” and “upload_audio” for related to voice note actions. Old action names will still work for backward compatibility.
    • -
    -
    -
    -

    ⚠️ WARNING! ⚠️
    After the next Bot API update (Bot API 5.3) there will be a one-time change of the value of the field file_unique_id in objects of the type PhotoSize and of the fields small_file_unique_id and big_file_unique_id in objects of the type ChatPhoto.

    -
    -
    -
    -

    ⚠️ WARNING! ⚠️
    Service messages about non-bot users joining the chat will be soon removed from large groups. We recommend using the “chat_member” update as a replacement.

    -
    -
    -
    -

    ⚠️ WARNING! ⚠️
    After one of the upcoming Bot API updates, user identifiers will become bigger than 2^31 - 1 and it will be no longer possible to store them in a signed 32-bit integer type. User identifiers will have up to 52 significant bits, so a 64-bit integer or double-precision float type would still be safe for storing them. Please make sure that your code can correctly handle such user identifiers.

    -
    -
    -

    March 9, 2021

    -

    Bot API 5.1

    -

    Added two new update types

    -
      -
    • Added updates about member status changes in chats, represented by the class ChatMemberUpdated and the fields my_chat_member and chat_member in the Update class. The bot must be an administrator in the chat to receive chat_member updates about other chat members. By default, only my_chat_member updates about the bot itself are received.
    • -
    -

    Improved Invite Links

    -
      -
    • Added the class ChatInviteLink, representing an invite link to a chat.
    • -
    • Added the method createChatInviteLink, which can be used to create new invite links in addition to the primary invite link.
    • -
    • Added the method editChatInviteLink, which can be used to edit non-primary invite links created by the bot.
    • -
    • Added the method revokeChatInviteLink, which can be used to revoke invite links created by the bot.
    • -
    -

    Voice Chat Info

    - -

    And More

    -
      -
    • Added the type MessageAutoDeleteTimerChanged and the field message_auto_delete_timer_changed to the class Message.
    • -
    • Added the parameter revoke_messages to the method kickChatMember, allowing to delete all messages from a group for the user who is being removed.
    • -
    • Added the new administrator privilege can_manage_chat to the class ChatMember and parameter can_manage_chat to the method promoteChatMember. This administrator right is implied by any other administrator privilege.
    • -
    • Supported the new bowling animation for the random dice. Choose between different animations (dice, darts, basketball, football, bowling, slot machine) by specifying the emoji parameter in the method sendDice.
    • -
    -
    -
    -

    ⚠️ WARNING! ⚠️
    After one of the upcoming Bot API updates, some user identifiers will become bigger than 2^31 - 1 and it will be no longer possible to store them in a signed 32-bit integer type. User identifiers will have up to 52 significant bits, so a 64-bit integer or double-precision float type would still be safe for storing them. Please make sure that your code can correctly handle such user identifiers.

    -
    -
    -

    November 4, 2020

    -

    Introducing Bot API 5.0

    -

    Run Your Own Bot API Server

    -
      -
    • Bot API source code is now available at telegram-bot-api. You can now run your own Bot API server locally, boosting your bots' performance.
    • -
    • Added the method logOut, which can be used to log out from the cloud Bot API server before launching your bot locally. You must log out the bot before running it locally, otherwise there is no guarantee that the bot will receive all updates.
    • -
    • Added the method close, which can be used to close the bot instance before moving it from one local server to another.
    • -
    -

    Transfer Bot Ownership

    -
      -
    • You can now use @BotFather to transfer your existing bots to another Telegram account.
    • -
    -

    Webhooks

    -
      -
    • Added the parameter ip_address to the method setWebhook, allowing to bypass DNS resolving and use the specified fixed IP address to send webhook requests.
    • -
    • Added the field ip_address to the class WebhookInfo, containing the current IP address used for webhook connections creation.
    • -
    • Added the ability to drop all pending updates when changing webhook URL using the parameter drop_pending_updates in the methods setWebhook and deleteWebhook.
    • -
    -

    Working with Groups

    -
      -
    • The getChat request now returns the user's bio for private chats if available.
    • -
    • The getChat request now returns the identifier of the linked chat for supergroups and channels, i.e. the discussion group identifier for a channel and vice versa.
    • -
    • The getChat request now returns the location to which the supergroup is connected (see Local Groups). Added the class ChatLocation to represent the location.
    • -
    • Added the parameter only_if_banned to the method unbanChatMember to allow safe unban.
    • -
    -

    Working with Files

    -
      -
    • Added the field file_name to the classes Audio and Video, containing the name of the original file.
    • -
    • Added the ability to disable server-side file content type detection using the parameter disable_content_type_detection in the method sendDocument and the class inputMediaDocument.
    • -
    -

    Multiple Pinned Messages

    -
      -
    • Added the ability to pin messages in private chats.
    • -
    • Added the parameter message_id to the method unpinChatMessage to allow unpinning of the specific pinned message.
    • -
    • Added the method unpinAllChatMessages, which can be used to unpin all pinned messages in a chat.
    • -
    -

    File Albums

    -
      -
    • Added support for sending and receiving audio and document albums in the method sendMediaGroup.
    • -
    -

    Live Locations

    - -

    Anonymous Admins

    -
      -
    • Added the field sender_chat to the class Message, containing the sender of a message which is a chat (group or channel). For backward compatibility in non-channel chats, the field from in such messages will contain the user 777000 for messages automatically forwarded to the discussion group and the user 1087968824 (@GroupAnonymousBot) for messages from anonymous group administrators.
    • -
    • Added the field is_anonymous to the class chatMember, which can be used to distinguish anonymous chat administrators.
    • -
    • Added the parameter is_anonymous to the method promoteChatMember, which allows to promote anonymous chat administrators. The bot itself should have the is_anonymous right to do this. Despite the fact that bots can have the is_anonymous right, they will never appear as anonymous in the chat. Bots can use the right only for passing to other administrators.
    • -
    • Added the custom title of an anonymous message sender to the class Message as author_signature.
    • -
    -

    And More

    - -

    And Last but not Least

    -
      -
    • Supported the new football and slot machine animations for the random dice. Choose between different animations (dice, darts, basketball, football, slot machine) by specifying the emoji parameter in the method sendDice.
    • -
    -

    June 4, 2020

    -

    Bot API 4.9

    -
      -
    • Added the new field via_bot to the Message object. You can now know which bot was used to send a message.
    • -
    • Supported video thumbnails for inline GIF and MPEG4 animations.
    • -
    • Supported the new basketball animation for the random dice. Choose between different animations (dice, darts, basketball) by specifying the emoji parameter in the method sendDice.
    • -
    -

    April 24, 2020

    -

    Bot API 4.8

    -
      -
    • Supported explanations for Quizzes 2.0. Add explanations by specifying the parameters explanation and explanation_parse_mode in the method sendPoll.
    • -
    • Added the fields explanation and explanation_entities to the Poll object.
    • -
    • Supported timed polls that automatically close at a certain date and time. Set up by specifying the parameter open_period or close_date in the method sendPoll.
    • -
    • Added the fields open_period and close_date to the Poll object.
    • -
    • Supported the new darts animation for the dice mini-game. Choose between the default dice animation and darts animation by specifying the parameter emoji in the method sendDice.
    • -
    • Added the field emoji to the Dice object.
    • -
    -

    March 30, 2020

    -

    Bot API 4.7

    -
      -
    • Added the method sendDice for sending a dice message, which will have a random value from 1 to 6. (Yes, we're aware of the “proper” singular of die. But it's awkward, and we decided to help it change. One dice at a time!)
    • -
    • Added the field dice to the Message object.
    • -
    • Added the method getMyCommands for getting the current list of the bot's commands.
    • -
    • Added the method setMyCommands for changing the list of the bot's commands through the Bot API instead of @BotFather.
    • -
    • Added the ability to create animated sticker sets by specifying the parameter tgs_sticker instead of png_sticker in the method createNewStickerSet.
    • -
    • Added the ability to add animated stickers to sets created by the bot by specifying the parameter tgs_sticker instead of png_sticker in the method addStickerToSet.
    • -
    • Added the field thumb to the StickerSet object.
    • -
    • Added the ability to change thumbnails of sticker sets created by the bot using the method setStickerSetThumb.
    • -
    -

    January 23, 2020

    -

    Bot API 4.6

    -
      -
    • Supported Polls 2.0.
    • -
    • Added the ability to send non-anonymous, multiple answer, and quiz-style polls: added the parameters is_anonymous, type, allows_multiple_answers, correct_option_id, is_closed options to the method sendPoll.
    • -
    • Added the object KeyboardButtonPollType and the field request_poll to the object KeyboardButton.
    • -
    • Added updates about changes of user answers in non-anonymous polls, represented by the object PollAnswer and the field poll_answer in the Update object.
    • -
    • Added the fields total_voter_count, is_anonymous, type, allows_multiple_answers, correct_option_id to the Poll object.
    • -
    • Bots can now send polls to private chats.
    • -
    • Added more information about the bot in response to the getMe request: added the fields can_join_groups, can_read_all_group_messages and supports_inline_queries to the User object.
    • -
    • Added the optional field language to the MessageEntity object.
    • -
    -

    December 31, 2019

    -

    Bot API 4.5

    -
      -
    • Added support for two new MessageEntity types, underline and strikethrough.
    • -
    • Added support for nested MessageEntity objects. Entities can now contain other entities. If two entities have common characters then one of them is fully contained inside the other.
    • -
    • Added support for nested entities and the new tags <u>/<ins> (for underlined text) and <s>/<strike>/<del> (for strikethrough text) in parse mode HTML.
    • -
    • Added a new parse mode, MarkdownV2, which supports nested entities and two new entities __ (for underlined text) and ~ (for strikethrough text). Parse mode Markdown remains unchanged for backward compatibility.
    • -
    • Added the field file_unique_id to the objects Animation, Audio, Document, PassportFile, PhotoSize, Sticker, Video, VideoNote, Voice, File and the fields small_file_unique_id and big_file_unique_id to the object ChatPhoto. The new fields contain a unique file identifier, which is supposed to be the same over time and for different bots, but can't be used to download or reuse the file.
    • -
    • Added the field custom_title to the ChatMember object.
    • -
    • Added the new method setChatAdministratorCustomTitle to manage the custom titles of administrators promoted by the bot.
    • -
    • Added the field slow_mode_delay to the Chat object.
    • -
    -

    July 29, 2019

    -

    Bot API 4.4

    -
      -
    • Added support for animated stickers. New field is_animated in Sticker and StickerSet objects, animated stickers can now be used in sendSticker and InlineQueryResultCachedSticker.
    • -
    • Added support for default permissions in groups. New object ChatPermissions, containing actions which a member can take in a chat. New field permissions in the Chat object; new method setChatPermissions.
    • -
    • The field all_members_are_administrators has been removed from the documentation for the Chat object. The field is still returned in the object for backward compatibility, but new bots should use the permissions field instead.
    • -
    • Added support for more permissions for group and supergroup members: added the new field can_send_polls to ChatMember object, added can_change_info, can_invite_users, can_pin_messages in ChatMember object for restricted users (previously available only for administrators).
    • -
    • The method restrictChatMember now takes the new user permissions in a single argument of the type ChatPermissions. The old way of passing parameters will keep working for a while for backward compatibility.
    • -
    • Added description support for basic groups (previously available in supergroups and channel chats). You can pass a group's chat_id to setChatDescription and receive the group's description in the Chat object in the response to getChat method.
    • -
    • Added invite_link support for basic groups (previously available in supergroups and channel chats). You can pass a group's chat_id to exportChatInviteLink and receive the group's invite link in the Chat object in the response to getChat method.
    • -
    • File identifiers from the ChatPhoto object are now invalidated and can no longer be used whenever the photo is changed.
    • -
    • All webhook requests from the Bot API are now coming from the subnets 149.154.160.0/20 and 91.108.4.0/22. Most users won't need to do anything to continue receiving webhooks. If you control inbound access with a firewall, you may need to update your configuration. You can always find the list of actual IP addresses of servers used to send webhooks there: https://core.telegram.org/bots/webhooks.
    • -
    • As of the next Bot API update (version 4.5), nested MessageEntity objects will be allowed in message texts and captions. Please make sure that your code can correctly handle such entities.
    • -
    -

    May 31, 2019

    -

    Bot API 4.3

    -
      -
    • Added support for Seamless Telegram Login on external websites.
    • -
    • Added the new object LoginUrl and the new field login_url to the InlineKeyboardButton object which allows to automatically authorize users before they go to a URL specified by the bot. Users will be asked to confirm authorization in their Telegram app (needs version 5.7 or higher) when they press the button:
    • -
    -
    - TITLE -
    - -

    Also in this update:

    -
      -
    • Added the field reply_markup to the Message object, containing the inline keyboard attached to the message.
    • -
    • If a message with an inline keyboard is forwarded, the forwarded message will now have an inline keyboard if the keyboard contained only url and login_url buttons or if the message was sent via a bot and the keyboard contained only url, login_url, switch_inline_query or switch_inline_query_current_chat buttons. In the latter case, switch_inline_query_current_chat buttons are replaced with switch_inline_query buttons.
    • -
    • Bots now receive the edited_message Update even if only Message.reply_markup has changed.
    • -
    • Bots that have the can_edit_messages right in a channel can now use the method editMessageReplyMarkup for messages written by other administrators forever without the 48 hours limit.
    • -
    • Don't forget that starting in July 2019, webhook requests from Bot API will be coming from the subnets 149.154.160.0/20 and 91.108.4.0/22. Most users won't need to do anything to continue receiving webhooks. If you control inbound access with a firewall, you may need to update your configuration. You can always find the list of actual IP addresses of servers used to send webhooks there: https://core.telegram.org/bots/webhooks.
    • -
    -

    April 14, 2019

    -

    Bot API 4.2

    -
      -
    • Added support for native polls: added the object Poll, the methods sendPoll and stopPoll and the field poll in the Message and Update objects.
    • -
    • The method deleteMessage can now be used to delete messages sent by a user to the bot in private chats within 48 hours.
    • -
    • Added support for pinned messages in basic groups in addition to supergroups and channel chats: you can pass group's chat_id to pinChatMessage and unpinChatMessage, and receive the pinned group message in Chat object.
    • -
    • Added the field is_member to the ChatMember object, which can be used to find whether a restricted user is a member of the chat.
    • -
    • Added the field forward_sender_name to the Message object, containing name of the sender who has opted to hide their account.
    • -
    • Starting in July 2019, webhook requests from Bot API will be coming from the subnets 149.154.160.0/20 and 91.108.4.0/22. Most users won't need to do anything to continue receiving webhooks. If you control inbound access with a firewall, you may need to update your configuration. You can always find the list of actual IP addresses of servers used to send webhooks there: https://core.telegram.org/bots/webhooks.
    • -
    • Document thumbnails now should be inscribed in a 320x320 square instead of 90x90.
    • -
    -

    August 27, 2018

    -

    Bot API 4.1

    - -

    July 26, 2018

    -

    Bot API 4.0.

    -
      -
    • Added support for Telegram Passport. See the official announcement on the blog and the manual for details.
    • -
    • Added support for editing the media content of messages: added the method editMessageMedia and new types InputMediaAnimation, InputMediaAudio, and InputMediaDocument.
    • -
    • Added the field thumb to the Audio object to contain the thumbnail of the album cover to which the music file belongs.
    • -
    • Added support for attaching custom thumbnails to uploaded files. For animations, audios, videos and video notes, which are less than 10 MB in size, thumbnails are generated automatically.
    • -
    • tg:// URLs now can be used in inline keyboard url buttons and text_link message entities.
    • -
    • Added the method sendAnimation, which can be used instead of sendDocument to send animations, specifying their duration, width and height.
    • -
    • Added the field animation to the Message object. For backward compatibility, when this field is set, the document field will be also set.
    • -
    • Added two new MessageEntity types: cashtag and phone_number.
    • -
    • Added support for Foursquare venues: added the new field foursquare_type to the objects Venue, InlineQueryResultVenue and InputVenueMessageContent, and the parameter foursquare_type to the sendVenue method.
    • -
    • You can now create inline mentions of users, who have pressed your bot's callback buttons.
    • -
    • You can now use the Retry-After response header to configure the delay after which the Bot API will retry the request after an unsuccessful response from a webhook.
    • -
    • If a webhook returns the HTTP error 410 Gone for all requests for more than 23 hours successively, it can be automatically removed.
    • -
    • Added vCard support when sharing contacts: added the field vcard to the objects Contact, InlineQueryResultContact, InputContactMessageContent and the method sendContact.
    • -
    -

    February 13, 2018

    -

    Bot API 3.6.

    -
      -
    • Supported text formatting in media captions. Specify the desired parse_mode (Markdown or HTML) when you provide a caption.
    • -
    • In supergroups, if the bot receives a message that is a reply, it will also receive the message to which that message is replying – even if the original message is inaccessible due to the bot's privacy settings. (In other words, replying to any message in a supergroup with a message that mentions the bot or features a command for it acts as forwarding the original message to the bot).
    • -
    • Added the new field connected_website to Message. The bot will receive a message with this field in a private chat when a user logs in on the bot's connected website using the Login Widget and allows sending messages from your bot.
    • -
    • Added the new parameter supports_streaming to the sendVideo method and a field with the same name to the InputMediaVideo object.
    • -
    -

    November 17, 2017

    -

    Bot API 3.5.

    - -

    October 11, 2017

    -

    Bot API 3.4.

    - -

    August 23, 2017

    -

    Bot API 3.3.

    -
      -
    • Bots can now mention users via inline mentions, without using usernames.
    • -
    • getChat now also returns pinned messages in supergroups, if present. Added the new field pinned_message to the Chat object.
    • -
    • Added the new fields author_signature and forward_signature to the Message object.
    • -
    • Added the new field is_bot to the User object.
    • -
    -

    July 21, 2017

    -

    Bot API 3.2. Teach your bot to handle stickers and sticker sets.

    - -

    June 30, 2017

    -

    Bot API 3.1. Build your own robotic police force for supergoups with these new methods for admin bots:

    - -

    May 18, 2017

    -

    Introducing Bot API 3.0.

    -

    NEW Payment Platform

    -

    See Introduction to Bot Payments for a brief overview. If you're not a developer, you may like this user-friendly blog post better.

    - -

    NEW Video Messages

    -
      -
    • As of Telegram v.4.0, users can send short rounded video messages, using an interface similar to that of voice notes.
    • -
    • Added the sendVideoNote method, the new field video_note to Message, the fields record_video_note or upload_video_note to sendChatAction.
    • -
    -

    NEW Multilingual Bots

    -
      -
    • The User object now may have a language_code field that contains the IETF language tag of the user's language.
    • -
    • Thanks to this, your bot can now offer localized responses to users that speak different languages.
    • -
    -

    More power to admin bots

    -
      -
    • unbanChatMemeber now also works in channels!
    • -
    • New method deleteMessage that allows the bot to delete its own messages, as well as messages posted by other in groups and channels where the bot is an administrator.
    • -
    -

    Minor Changes

    -
      -
    • Replaced the field new_chat_member in Message with new_chat_members (the old field will still be available for a while for compatibility purposes).
    • -
    • Inline keyboards with switch_inline_query and switch_inline_query_current_chat can no longer be sent to channels because they are useless there.
    • -
    • New fields gif_duration in InlineQueryResultGif and mpeg4_duration in InlineQueryResultMpeg4Gif.
    • -
    -

    December 4, 2016

    -

    Introducing Bot API 2.3.1, a nifty little update that will give you more control over how your bot gets its updates.

    -
      -
    • Use the new field max_connections in setWebhook to optimize your bot's server load
    • -
    • Use allowed_updates in setWebhook and getUpdates to selectively subscribe to updates of a certain type. Among other things, this allows you to stop getting updates about new posts in channels where your bot is an admin.
    • -
    • deleteWebhook moved out of setWebhook to get a whole separate method for itself.
    • -
    -

    November 21, 2016

    -

    Bot API 2.3

    -
      -
    • Modified bot privacy mode for the sake of consistency.
    • -
    • Your bot can now get updates about posts in channels. Added new fields channel_post and edited_channel_post to Update.

      -
    • -
    • You can now update high scores to a lower value by using the new force parameter in setGameScore. Handy for punishing cheaters or fixing errors in your game's High Score table.

      -
    • -
    • Starting today, messages with high scores will be updated with new high scores by default. Use disable_edit_message in setGameScore if you don't want this.
    • -
    • The edit_message parameter from setGameScore is no longer in use. For backward compatibility, it will be taken into account for a while, unless disable_edit_message is passed explicitly.
    • -
    • Added the new field forward_from_message_id to Message.
    • -
    • Added the new parameter cache_time to answerCallbackQuery. Will eventually work in Telegram apps — somewhere after version 3.14, maybe 3.15.
    • -
    • Renamed hide_keyboard to remove_keyboard in ReplyKeyboardRemove for clarity. hide_keyboard will still work for a while for backward compatibility.
    • -
    -

    October 3, 2016

    -

    Bot API 2.2. Introducing a new Gaming Platform! See this introduction for a brief overview.
    If you're not a developer, you may like this user-friendly blog post better.

    - -

    Other changes

    - -
      -
    • New field all_members_are_administrators in the Chat object.
    • -
    • Certain server responses may now contain the new parameters field with expanded info on errors that occurred while processing your requests.
    • -
    -

    May 25, 2016

    - -

    May 22, 2016

    - -

    May 12, 2016

    - -

    May 6, 2016

    -
      -
    • Added the field emoji to the Sticker object. Your bot can now know the emoji a sticker corresponds to.
    • -
    • Added the field forward_from_chat to the Message object for messages forwarded from channels.
    • -
    -

    April 9, 2016

    -

    Introducing Bot API 2.0. Check out this page for a review of this major update.

    - -

    Inline bots

    -
      -
    • Added support for all content types available on Telegram. 19 types of InlineQueryResult objects are now supported.
    • -
    • Inline bots can now substitute all kinds of content with text. Added 4 types of InputMessageContent objects.
    • -
    • Your inline bot can also ask users for permission to use their location. Added the new Botfather command /setinlinegeo, added field location to the InlineQuery object, added fields location and inline_message_id to the ChosenInlineResult object.
    • -
    • Added an easy way to switch between inline mode and a private chat with the bot – useful for settings, establishing external connections and teaching users how to use your bot in inline mode. Added parameters switch_pm_text and switch_pm_parameter to the method answerInlineQuery.
    • -
    -

    Miscellaneous

    - -

    February 20, 2016

    -
      -
    • Added the disable_notification parameter to all methods that send messages or any kind.
    • -
    • Removed backward compatibility from the method sendAudio. Voice messages now must be sent using the method sendVoice. There is no more need to specify a non-empty title or performer while sending the audio by file_id.
    • -
    -

    January 20, 2016

    -
      -
    • By the way, you can use both HTML-style and markdown-style formatting in your bot's messages to send bold, italic or fixed-width text and inline links. All official Telegram clients support this. See Formatting options for details.
    • -
    -

    January 14, 2016

    -
      -
    • You can now collect feedback on which results provided by your inline bot get chosen by the users. Added the setinlinefeedback command for Botfather, new type ChosenInlineResult, new field chosen_inline_result to the Update object.
    • -
    -

    January 4, 2016

    - -

    November, 2015

    -
      -
    • Added support for supergroups. The Type field in the Chat object can now contain 'supergroup'.
    • -
    • New optional fields added to the Message object: supergroup_chat_created, migrate_to_chat_id, migrate_from_chat_id and channel_chat_created.
    • -
    -

    October 8, 2015

    -
      -
    • Added initial channel support for bots (no Telegram clients support this at the moment, please wait for updates):
    • -
    • The Chat field in the Message is now of the new type Chat.
    • -
    • You can now pass a channel username (in the format @channelusername) in the place of chat_id in all methods (and instead of from_chat_id in forwardMessage). For this to work, the bot must be an administrator in the channel (and that's exactly what Telegram clients don't support yet — adding bots as administrators coming soon).
    • -
    -

    September 18, 2015

    -
      -
    • Bots can now download files and media sent by users.
    • -
    • Added getFile and File.
    • -
    -

    September 7, 2015

    -
      -
    • You can now pass parameters using application/json (please note that this doesn't work for file uploads: use multipart/form-data to upload files).
    • -
    • Added very basic markdown support. New field parse_mode added to sendMessage. For the moment messages with markdown will be displayed correctly only in Telegram for Android. Other official apps will catch up soon.
    • -
    -

    August 29, 2015

    -
      -
    • Added support for self-signed certificates: upload your certificate using the certificate parameter in the setWebhook method.
    • -
    • You can now make new requests when responding to webhook updates.
    • -
    -

    August 15, 2015

    -
      -
    • Added new type Voice and new method sendVoice for sending voice messages.
    • -
    • Earlier Audio and sendAudio should now be used for sending music files. Telegram clients will show such files in the in-app music player. If you were using sendAudio for your bot to send voice messages, please use sendVoice instead.
    • -
    • Added optional fields performer, title to the Audio object and sendAudio method.
    • -
    • Added optional field voice to the Message object.
    • -
    -

    July 2015

    -
      -
    • The thumb field is now optional for Video, Sticker and Document objects
    • -
    • The API now supports both video and photo captions. The caption field has been removed from the Video object and added to the Message object instead.
    • -
    • caption and duration optional fields have been added to the sendVideo method.
    • -
    • Fixed typo: user_id in the Contact object is now correctly labeled as Integer, not String
    • -
    -

    June 24, 2015

    -

    The bot platform was officially launched.

    -
    -

    Back to the Bot API Manual »

    -
    -
    - -
    - -
    -
    - -
    - - - - - - - - diff --git a/data/core.telegram.org/bots/api.html b/data/core.telegram.org/bots/api.html new file mode 100644 index 0000000000..b80cdfcfc8 --- /dev/null +++ b/data/core.telegram.org/bots/api.html @@ -0,0 +1,9488 @@ + + + + + Telegram Bot API + + + + + + + + + + + + + +
    + +
    +
    +
    + +

    Telegram Bot API

    + +
    + +
    +

    The Bot API is an HTTP-based interface created for developers keen on building bots for Telegram.
    To learn how to create and set up a bot, please consult our Introduction to Bots and Bot FAQ.

    +
    +

    Recent changes

    +
    +

    Subscribe to @BotNews to be the first to know about the latest updates and join the discussion in @BotTalk

    +
    +

    January 31, 2022

    +

    Bot API 5.7

    + +

    December 30, 2021

    +

    Bot API 5.6

    + +

    December 7, 2021

    +

    Bot API 5.5

    +
      +
    • Bots are now allowed to contact users who sent a join request to a chat where the bot is an administrator with the can_invite_users administrator right – even if the user never interacted with the bot before.
    • +
    • Added support for mentioning users by their ID in inline keyboards. This will only work in Telegram versions released after December 7, 2021. Older clients will display unsupported message.
    • +
    • Added the methods banChatSenderChat and unbanChatSenderChat for banning and unbanning channel chats in supergroups and channels.
    • +
    • Added the field has_private_forwards to the class Chat for private chats, which can be used to check the possibility of mentioning the user by their ID.
    • +
    • Added the field has_protected_content to the classes Chat and Message.
    • +
    • Added the field is_automatic_forward to the class Message.
    • +
    +

    Note: After this update it will become impossible to forward messages from some chats. Use the fields has_protected_content in the classes Message and Chat to check this.

    +

    Note: After this update users are able to send messages on behalf of channels they own. Bots are expected to use the field sender_chat in the class Message to correctly support such messages.

    +

    Note: As previously announced, user identifiers can now have up to 52 significant bits and require a 64-bit integer or double-precision float type to be stored safely.

    +

    November 5, 2021

    +

    Bot API 5.4

    + +

    See earlier changes »

    +

    Authorizing your bot

    +

    Each bot is given a unique authentication token when it is created. The token looks something like 123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11, but we'll use simply <token> in this document instead. You can learn about obtaining tokens and generating new ones in this document.

    +

    Making requests

    +

    All queries to the Telegram Bot API must be served over HTTPS and need to be presented in this form: https://api.telegram.org/bot<token>/METHOD_NAME. Like this for example:

    +
    https://api.telegram.org/bot123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11/getMe
    +

    We support GET and POST HTTP methods. We support four ways of passing parameters in Bot API requests:

    +
      +
    • URL query string
    • +
    • application/x-www-form-urlencoded
    • +
    • application/json (except for uploading files)
    • +
    • multipart/form-data (use to upload files)
    • +
    +

    The response contains a JSON object, which always has a Boolean field 'ok' and may have an optional String field 'description' with a human-readable description of the result. If 'ok' equals True, the request was successful and the result of the query can be found in the 'result' field. In case of an unsuccessful request, 'ok' equals false and the error is explained in the 'description'. An Integer 'error_code' field is also returned, but its contents are subject to change in the future. Some errors may also have an optional field 'parameters' of the type ResponseParameters, which can help to automatically handle the error.

    +
      +
    • All methods in the Bot API are case-insensitive.
    • +
    • All queries must be made using UTF-8.
    • +
    +

    Making requests when getting updates

    +

    If you're using webhooks, you can perform a request to the Bot API while sending an answer to the webhook. Use either application/json or application/x-www-form-urlencoded or multipart/form-data response content type for passing parameters. Specify the method to be invoked in the method parameter of the request. It's not possible to know that such a request was successful or get its result.

    +
    +

    Please see our FAQ for examples.

    +
    +

    Using a Local Bot API Server

    +

    The Bot API server source code is available at telegram-bot-api. You can run it locally and send the requests to your own server instead of https://api.telegram.org. If you switch to a local Bot API server, your bot will be able to:

    +
      +
    • Download files without a size limit.
    • +
    • Upload files up to 2000 MB.
    • +
    • Upload files using their local path and the file URI scheme.
    • +
    • Use an HTTP URL for the webhook.
    • +
    • Use any local IP address for the webhook.
    • +
    • Use any port for the webhook.
    • +
    • Set max_webhook_connections up to 100000.
    • +
    • Receive the absolute local path as a value of the file_path field without the need to download the file after a getFile request.
    • +
    +

    Do I need a Local Bot API Server

    +

    The majority of bots will be OK with the default configuration, running on our servers. But if you feel that you need one of these features, you're welcome to switch to your own at any time.

    +

    Getting updates

    +

    There are two mutually exclusive ways of receiving updates for your bot — the getUpdates method on one hand and Webhooks on the other. Incoming updates are stored on the server until the bot receives them either way, but they will not be kept longer than 24 hours.

    +

    Regardless of which option you choose, you will receive JSON-serialized Update objects as a result.

    +

    Update

    +

    This object represents an incoming update.
    At most one of the optional parameters can be present in any given update.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    update_idIntegerThe update's unique identifier. Update identifiers start from a certain positive number and increase sequentially. This ID becomes especially handy if you're using Webhooks, since it allows you to ignore repeated updates or to restore the correct update sequence, should they get out of order. If there are no new updates for at least a week, then identifier of the next update will be chosen randomly instead of sequentially.
    messageMessageOptional. New incoming message of any kind — text, photo, sticker, etc.
    edited_messageMessageOptional. New version of a message that is known to the bot and was edited
    channel_postMessageOptional. New incoming channel post of any kind — text, photo, sticker, etc.
    edited_channel_postMessageOptional. New version of a channel post that is known to the bot and was edited
    inline_queryInlineQueryOptional. New incoming inline query
    chosen_inline_resultChosenInlineResultOptional. The result of an inline query that was chosen by a user and sent to their chat partner. Please see our documentation on the feedback collecting for details on how to enable these updates for your bot.
    callback_queryCallbackQueryOptional. New incoming callback query
    shipping_queryShippingQueryOptional. New incoming shipping query. Only for invoices with flexible price
    pre_checkout_queryPreCheckoutQueryOptional. New incoming pre-checkout query. Contains full information about checkout
    pollPollOptional. New poll state. Bots receive only updates about stopped polls and polls, which are sent by the bot
    poll_answerPollAnswerOptional. A user changed their answer in a non-anonymous poll. Bots receive new votes only in polls that were sent by the bot itself.
    my_chat_memberChatMemberUpdatedOptional. The bot's chat member status was updated in a chat. For private chats, this update is received only when the bot is blocked or unblocked by the user.
    chat_memberChatMemberUpdatedOptional. A chat member's status was updated in a chat. The bot must be an administrator in the chat and must explicitly specify “chat_member” in the list of allowed_updates to receive these updates.
    chat_join_requestChatJoinRequestOptional. A request to join the chat has been sent. The bot must have the can_invite_users administrator right in the chat to receive these updates.
    +

    getUpdates

    +

    Use this method to receive incoming updates using long polling (wiki). An Array of Update objects is returned.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ParameterTypeRequiredDescription
    offsetIntegerOptionalIdentifier of the first update to be returned. Must be greater by one than the highest among the identifiers of previously received updates. By default, updates starting with the earliest unconfirmed update are returned. An update is considered confirmed as soon as getUpdates is called with an offset higher than its update_id. The negative offset can be specified to retrieve updates starting from -offset update from the end of the updates queue. All previous updates will forgotten.
    limitIntegerOptionalLimits the number of updates to be retrieved. Values between 1-100 are accepted. Defaults to 100.
    timeoutIntegerOptionalTimeout in seconds for long polling. Defaults to 0, i.e. usual short polling. Should be positive, short polling should be used for testing purposes only.
    allowed_updatesArray of StringOptionalA JSON-serialized list of the update types you want your bot to receive. For example, specify [“message”, “edited_channel_post”, “callback_query”] to only receive updates of these types. See Update for a complete list of available update types. Specify an empty list to receive all update types except chat_member (default). If not specified, the previous setting will be used.

    Please note that this parameter doesn't affect updates created before the call to the getUpdates, so unwanted updates may be received for a short period of time.
    +
    +

    Notes
    1. This method will not work if an outgoing webhook is set up.
    2. In order to avoid getting duplicate updates, recalculate offset after each server response.

    +
    +

    setWebhook

    +

    Use this method to specify a url and receive incoming updates via an outgoing webhook. Whenever there is an update for the bot, we will send an HTTPS POST request to the specified url, containing a JSON-serialized Update. In case of an unsuccessful request, we will give up after a reasonable amount of attempts. Returns True on success.

    +

    If you'd like to make sure that the Webhook request comes from Telegram, we recommend using a secret path in the URL, e.g. https://www.example.com/<token>. Since nobody else knows your bot's token, you can be pretty sure it's us.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ParameterTypeRequiredDescription
    urlStringYesHTTPS url to send updates to. Use an empty string to remove webhook integration
    certificateInputFileOptionalUpload your public key certificate so that the root certificate in use can be checked. See our self-signed guide for details.
    ip_addressStringOptionalThe fixed IP address which will be used to send webhook requests instead of the IP address resolved through DNS
    max_connectionsIntegerOptionalMaximum allowed number of simultaneous HTTPS connections to the webhook for update delivery, 1-100. Defaults to 40. Use lower values to limit the load on your bot's server, and higher values to increase your bot's throughput.
    allowed_updatesArray of StringOptionalA JSON-serialized list of the update types you want your bot to receive. For example, specify [“message”, “edited_channel_post”, “callback_query”] to only receive updates of these types. See Update for a complete list of available update types. Specify an empty list to receive all update types except chat_member (default). If not specified, the previous setting will be used.
    Please note that this parameter doesn't affect updates created before the call to the setWebhook, so unwanted updates may be received for a short period of time.
    drop_pending_updatesBooleanOptionalPass True to drop all pending updates
    +
    +

    Notes
    1. You will not be able to receive updates using getUpdates for as long as an outgoing webhook is set up.
    2. To use a self-signed certificate, you need to upload your public key certificate using certificate parameter. Please upload as InputFile, sending a String will not work.
    3. Ports currently supported for Webhooks: 443, 80, 88, 8443.

    +

    NEW! If you're having any trouble setting up webhooks, please check out this amazing guide to Webhooks.

    +
    +

    deleteWebhook

    +

    Use this method to remove webhook integration if you decide to switch back to getUpdates. Returns True on success.

    + + + + + + + + + + + + + + + + + +
    ParameterTypeRequiredDescription
    drop_pending_updatesBooleanOptionalPass True to drop all pending updates
    +

    getWebhookInfo

    +

    Use this method to get current webhook status. Requires no parameters. On success, returns a WebhookInfo object. If the bot is using getUpdates, will return an object with the url field empty.

    +

    WebhookInfo

    +

    Contains information about the current status of a webhook.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    urlStringWebhook URL, may be empty if webhook is not set up
    has_custom_certificateBooleanTrue, if a custom certificate was provided for webhook certificate checks
    pending_update_countIntegerNumber of updates awaiting delivery
    ip_addressStringOptional. Currently used webhook IP address
    last_error_dateIntegerOptional. Unix time for the most recent error that happened when trying to deliver an update via webhook
    last_error_messageStringOptional. Error message in human-readable format for the most recent error that happened when trying to deliver an update via webhook
    max_connectionsIntegerOptional. Maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery
    allowed_updatesArray of StringOptional. A list of update types the bot is subscribed to. Defaults to all update types except chat_member
    +

    Available types

    +

    All types used in the Bot API responses are represented as JSON-objects.

    +

    It is safe to use 32-bit signed integers for storing all Integer fields unless otherwise noted.

    +
    +

    Optional fields may be not returned when irrelevant.

    +
    +

    User

    +

    This object represents a Telegram user or bot.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    idIntegerUnique identifier for this user or bot. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier.
    is_botBooleanTrue, if this user is a bot
    first_nameStringUser's or bot's first name
    last_nameStringOptional. User's or bot's last name
    usernameStringOptional. User's or bot's username
    language_codeStringOptional. IETF language tag of the user's language
    can_join_groupsBooleanOptional. True, if the bot can be invited to groups. Returned only in getMe.
    can_read_all_group_messagesBooleanOptional. True, if privacy mode is disabled for the bot. Returned only in getMe.
    supports_inline_queriesBooleanOptional. True, if the bot supports inline queries. Returned only in getMe.
    +

    Chat

    +

    This object represents a chat.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    idIntegerUnique identifier for this chat. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier.
    typeStringType of chat, can be either “private”, “group”, “supergroup” or “channel”
    titleStringOptional. Title, for supergroups, channels and group chats
    usernameStringOptional. Username, for private chats, supergroups and channels if available
    first_nameStringOptional. First name of the other party in a private chat
    last_nameStringOptional. Last name of the other party in a private chat
    photoChatPhotoOptional. Chat photo. Returned only in getChat.
    bioStringOptional. Bio of the other party in a private chat. Returned only in getChat.
    has_private_forwardsTrueOptional. True, if privacy settings of the other party in the private chat allows to use tg://user?id=<user_id> links only in chats with the user. Returned only in getChat.
    descriptionStringOptional. Description, for groups, supergroups and channel chats. Returned only in getChat.
    invite_linkStringOptional. Primary invite link, for groups, supergroups and channel chats. Returned only in getChat.
    pinned_messageMessageOptional. The most recent pinned message (by sending date). Returned only in getChat.
    permissionsChatPermissionsOptional. Default chat member permissions, for groups and supergroups. Returned only in getChat.
    slow_mode_delayIntegerOptional. For supergroups, the minimum allowed delay between consecutive messages sent by each unpriviledged user; in seconds. Returned only in getChat.
    message_auto_delete_timeIntegerOptional. The time after which all messages sent to the chat will be automatically deleted; in seconds. Returned only in getChat.
    has_protected_contentTrueOptional. True, if messages from the chat can't be forwarded to other chats. Returned only in getChat.
    sticker_set_nameStringOptional. For supergroups, name of group sticker set. Returned only in getChat.
    can_set_sticker_setTrueOptional. True, if the bot can change the group sticker set. Returned only in getChat.
    linked_chat_idIntegerOptional. Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice versa; for supergroups and channel chats. This identifier may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier. Returned only in getChat.
    locationChatLocationOptional. For supergroups, the location to which the supergroup is connected. Returned only in getChat.
    +

    Message

    +

    This object represents a message.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    message_idIntegerUnique message identifier inside this chat
    fromUserOptional. Sender of the message; empty for messages sent to channels. For backward compatibility, the field contains a fake sender user in non-channel chats, if the message was sent on behalf of a chat.
    sender_chatChatOptional. Sender of the message, sent on behalf of a chat. For example, the channel itself for channel posts, the supergroup itself for messages from anonymous group administrators, the linked channel for messages automatically forwarded to the discussion group. For backward compatibility, the field from contains a fake sender user in non-channel chats, if the message was sent on behalf of a chat.
    dateIntegerDate the message was sent in Unix time
    chatChatConversation the message belongs to
    forward_fromUserOptional. For forwarded messages, sender of the original message
    forward_from_chatChatOptional. For messages forwarded from channels or from anonymous administrators, information about the original sender chat
    forward_from_message_idIntegerOptional. For messages forwarded from channels, identifier of the original message in the channel
    forward_signatureStringOptional. For forwarded messages that were originally sent in channels or by an anonymous chat administrator, signature of the message sender if present
    forward_sender_nameStringOptional. Sender's name for messages forwarded from users who disallow adding a link to their account in forwarded messages
    forward_dateIntegerOptional. For forwarded messages, date the original message was sent in Unix time
    is_automatic_forwardTrueOptional. True, if the message is a channel post that was automatically forwarded to the connected discussion group
    reply_to_messageMessageOptional. For replies, the original message. Note that the Message object in this field will not contain further reply_to_message fields even if it itself is a reply.
    via_botUserOptional. Bot through which the message was sent
    edit_dateIntegerOptional. Date the message was last edited in Unix time
    has_protected_contentTrueOptional. True, if the message can't be forwarded
    media_group_idStringOptional. The unique identifier of a media message group this message belongs to
    author_signatureStringOptional. Signature of the post author for messages in channels, or the custom title of an anonymous group administrator
    textStringOptional. For text messages, the actual UTF-8 text of the message, 0-4096 characters
    entitiesArray of MessageEntityOptional. For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text
    animationAnimationOptional. Message is an animation, information about the animation. For backward compatibility, when this field is set, the document field will also be set
    audioAudioOptional. Message is an audio file, information about the file
    documentDocumentOptional. Message is a general file, information about the file
    photoArray of PhotoSizeOptional. Message is a photo, available sizes of the photo
    stickerStickerOptional. Message is a sticker, information about the sticker
    videoVideoOptional. Message is a video, information about the video
    video_noteVideoNoteOptional. Message is a video note, information about the video message
    voiceVoiceOptional. Message is a voice message, information about the file
    captionStringOptional. Caption for the animation, audio, document, photo, video or voice, 0-1024 characters
    caption_entitiesArray of MessageEntityOptional. For messages with a caption, special entities like usernames, URLs, bot commands, etc. that appear in the caption
    contactContactOptional. Message is a shared contact, information about the contact
    diceDiceOptional. Message is a dice with random value
    gameGameOptional. Message is a game, information about the game. More about games »
    pollPollOptional. Message is a native poll, information about the poll
    venueVenueOptional. Message is a venue, information about the venue. For backward compatibility, when this field is set, the location field will also be set
    locationLocationOptional. Message is a shared location, information about the location
    new_chat_membersArray of UserOptional. New members that were added to the group or supergroup and information about them (the bot itself may be one of these members)
    left_chat_memberUserOptional. A member was removed from the group, information about them (this member may be the bot itself)
    new_chat_titleStringOptional. A chat title was changed to this value
    new_chat_photoArray of PhotoSizeOptional. A chat photo was change to this value
    delete_chat_photoTrueOptional. Service message: the chat photo was deleted
    group_chat_createdTrueOptional. Service message: the group has been created
    supergroup_chat_createdTrueOptional. Service message: the supergroup has been created. This field can't be received in a message coming through updates, because bot can't be a member of a supergroup when it is created. It can only be found in reply_to_message if someone replies to a very first message in a directly created supergroup.
    channel_chat_createdTrueOptional. Service message: the channel has been created. This field can't be received in a message coming through updates, because bot can't be a member of a channel when it is created. It can only be found in reply_to_message if someone replies to a very first message in a channel.
    message_auto_delete_timer_changedMessageAutoDeleteTimerChangedOptional. Service message: auto-delete timer settings changed in the chat
    migrate_to_chat_idIntegerOptional. The group has been migrated to a supergroup with the specified identifier. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier.
    migrate_from_chat_idIntegerOptional. The supergroup has been migrated from a group with the specified identifier. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier.
    pinned_messageMessageOptional. Specified message was pinned. Note that the Message object in this field will not contain further reply_to_message fields even if it is itself a reply.
    invoiceInvoiceOptional. Message is an invoice for a payment, information about the invoice. More about payments »
    successful_paymentSuccessfulPaymentOptional. Message is a service message about a successful payment, information about the payment. More about payments »
    connected_websiteStringOptional. The domain name of the website on which the user has logged in. More about Telegram Login »
    passport_dataPassportDataOptional. Telegram Passport data
    proximity_alert_triggeredProximityAlertTriggeredOptional. Service message. A user in the chat triggered another user's proximity alert while sharing Live Location.
    voice_chat_scheduledVoiceChatScheduledOptional. Service message: voice chat scheduled
    voice_chat_startedVoiceChatStartedOptional. Service message: voice chat started
    voice_chat_endedVoiceChatEndedOptional. Service message: voice chat ended
    voice_chat_participants_invitedVoiceChatParticipantsInvitedOptional. Service message: new participants invited to a voice chat
    reply_markupInlineKeyboardMarkupOptional. Inline keyboard attached to the message. login_url buttons are represented as ordinary url buttons.
    +

    MessageId

    +

    This object represents a unique message identifier.

    + + + + + + + + + + + + + + + +
    FieldTypeDescription
    message_idIntegerUnique message identifier
    +

    MessageEntity

    +

    This object represents one special entity in a text message. For example, hashtags, usernames, URLs, etc.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    typeStringType of the entity. Currently, can be “mention” (@username), “hashtag” (#hashtag), “cashtag” ($USD), “bot_command” (/start@jobs_bot), “url” (https://telegram.org), “email” (do-not-reply@telegram.org), “phone_number” (+1-212-555-0123), “bold” (bold text), “italic” (italic text), “underline” (underlined text), “strikethrough” (strikethrough text), “spoiler” (spoiler message), “code” (monowidth string), “pre” (monowidth block), “text_link” (for clickable text URLs), “text_mention” (for users without usernames)
    offsetIntegerOffset in UTF-16 code units to the start of the entity
    lengthIntegerLength of the entity in UTF-16 code units
    urlStringOptional. For “text_link” only, url that will be opened after user taps on the text
    userUserOptional. For “text_mention” only, the mentioned user
    languageStringOptional. For “pre” only, the programming language of the entity text
    +

    PhotoSize

    +

    This object represents one size of a photo or a file / sticker thumbnail.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    file_idStringIdentifier for this file, which can be used to download or reuse the file
    file_unique_idStringUnique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
    widthIntegerPhoto width
    heightIntegerPhoto height
    file_sizeIntegerOptional. File size in bytes
    +

    Animation

    +

    This object represents an animation file (GIF or H.264/MPEG-4 AVC video without sound).

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    file_idStringIdentifier for this file, which can be used to download or reuse the file
    file_unique_idStringUnique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
    widthIntegerVideo width as defined by sender
    heightIntegerVideo height as defined by sender
    durationIntegerDuration of the video in seconds as defined by sender
    thumbPhotoSizeOptional. Animation thumbnail as defined by sender
    file_nameStringOptional. Original animation filename as defined by sender
    mime_typeStringOptional. MIME type of the file as defined by sender
    file_sizeIntegerOptional. File size in bytes
    +

    Audio

    +

    This object represents an audio file to be treated as music by the Telegram clients.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    file_idStringIdentifier for this file, which can be used to download or reuse the file
    file_unique_idStringUnique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
    durationIntegerDuration of the audio in seconds as defined by sender
    performerStringOptional. Performer of the audio as defined by sender or by audio tags
    titleStringOptional. Title of the audio as defined by sender or by audio tags
    file_nameStringOptional. Original filename as defined by sender
    mime_typeStringOptional. MIME type of the file as defined by sender
    file_sizeIntegerOptional. File size in bytes
    thumbPhotoSizeOptional. Thumbnail of the album cover to which the music file belongs
    +

    Document

    +

    This object represents a general file (as opposed to photos, voice messages and audio files).

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    file_idStringIdentifier for this file, which can be used to download or reuse the file
    file_unique_idStringUnique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
    thumbPhotoSizeOptional. Document thumbnail as defined by sender
    file_nameStringOptional. Original filename as defined by sender
    mime_typeStringOptional. MIME type of the file as defined by sender
    file_sizeIntegerOptional. File size in bytes
    +

    Video

    +

    This object represents a video file.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    file_idStringIdentifier for this file, which can be used to download or reuse the file
    file_unique_idStringUnique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
    widthIntegerVideo width as defined by sender
    heightIntegerVideo height as defined by sender
    durationIntegerDuration of the video in seconds as defined by sender
    thumbPhotoSizeOptional. Video thumbnail
    file_nameStringOptional. Original filename as defined by sender
    mime_typeStringOptional. Mime type of a file as defined by sender
    file_sizeIntegerOptional. File size in bytes
    +

    VideoNote

    +

    This object represents a video message (available in Telegram apps as of v.4.0).

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    file_idStringIdentifier for this file, which can be used to download or reuse the file
    file_unique_idStringUnique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
    lengthIntegerVideo width and height (diameter of the video message) as defined by sender
    durationIntegerDuration of the video in seconds as defined by sender
    thumbPhotoSizeOptional. Video thumbnail
    file_sizeIntegerOptional. File size in bytes
    +

    Voice

    +

    This object represents a voice note.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    file_idStringIdentifier for this file, which can be used to download or reuse the file
    file_unique_idStringUnique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
    durationIntegerDuration of the audio in seconds as defined by sender
    mime_typeStringOptional. MIME type of the file as defined by sender
    file_sizeIntegerOptional. File size in bytes
    +

    Contact

    +

    This object represents a phone contact.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    phone_numberStringContact's phone number
    first_nameStringContact's first name
    last_nameStringOptional. Contact's last name
    user_idIntegerOptional. Contact's user identifier in Telegram. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier.
    vcardStringOptional. Additional data about the contact in the form of a vCard
    +

    Dice

    +

    This object represents an animated emoji that displays a random value.

    + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    emojiStringEmoji on which the dice throw animation is based
    valueIntegerValue of the dice, 1-6 for “🎲”, “🎯” and “🎳” base emoji, 1-5 for “🏀” and “⚽” base emoji, 1-64 for “🎰” base emoji
    +

    PollOption

    +

    This object contains information about one answer option in a poll.

    + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    textStringOption text, 1-100 characters
    voter_countIntegerNumber of users that voted for this option
    +

    PollAnswer

    +

    This object represents an answer of a user in a non-anonymous poll.

    + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    poll_idStringUnique poll identifier
    userUserThe user, who changed the answer to the poll
    option_idsArray of Integer0-based identifiers of answer options, chosen by the user. May be empty if the user retracted their vote.
    +

    Poll

    +

    This object contains information about a poll.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    idStringUnique poll identifier
    questionStringPoll question, 1-300 characters
    optionsArray of PollOptionList of poll options
    total_voter_countIntegerTotal number of users that voted in the poll
    is_closedBooleanTrue, if the poll is closed
    is_anonymousBooleanTrue, if the poll is anonymous
    typeStringPoll type, currently can be “regular” or “quiz”
    allows_multiple_answersBooleanTrue, if the poll allows multiple answers
    correct_option_idIntegerOptional. 0-based identifier of the correct answer option. Available only for polls in the quiz mode, which are closed, or was sent (not forwarded) by the bot or to the private chat with the bot.
    explanationStringOptional. Text that is shown when a user chooses an incorrect answer or taps on the lamp icon in a quiz-style poll, 0-200 characters
    explanation_entitiesArray of MessageEntityOptional. Special entities like usernames, URLs, bot commands, etc. that appear in the explanation
    open_periodIntegerOptional. Amount of time in seconds the poll will be active after creation
    close_dateIntegerOptional. Point in time (Unix timestamp) when the poll will be automatically closed
    +

    Location

    +

    This object represents a point on the map.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    longitudeFloatLongitude as defined by sender
    latitudeFloatLatitude as defined by sender
    horizontal_accuracyFloat numberOptional. The radius of uncertainty for the location, measured in meters; 0-1500
    live_periodIntegerOptional. Time relative to the message sending date, during which the location can be updated; in seconds. For active live locations only.
    headingIntegerOptional. The direction in which user is moving, in degrees; 1-360. For active live locations only.
    proximity_alert_radiusIntegerOptional. Maximum distance for proximity alerts about approaching another chat member, in meters. For sent live locations only.
    +

    Venue

    +

    This object represents a venue.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    locationLocationVenue location. Can't be a live location
    titleStringName of the venue
    addressStringAddress of the venue
    foursquare_idStringOptional. Foursquare identifier of the venue
    foursquare_typeStringOptional. Foursquare type of the venue. (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.)
    google_place_idStringOptional. Google Places identifier of the venue
    google_place_typeStringOptional. Google Places type of the venue. (See supported types.)
    +

    ProximityAlertTriggered

    +

    This object represents the content of a service message, sent whenever a user in the chat triggers a proximity alert set by another user.

    + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    travelerUserUser that triggered the alert
    watcherUserUser that set the alert
    distanceIntegerThe distance between the users
    +

    MessageAutoDeleteTimerChanged

    +

    This object represents a service message about a change in auto-delete timer settings.

    + + + + + + + + + + + + + + + +
    FieldTypeDescription
    message_auto_delete_timeIntegerNew auto-delete time for messages in the chat; in seconds
    +

    VoiceChatScheduled

    +

    This object represents a service message about a voice chat scheduled in the chat.

    + + + + + + + + + + + + + + + +
    FieldTypeDescription
    start_dateIntegerPoint in time (Unix timestamp) when the voice chat is supposed to be started by a chat administrator
    +

    VoiceChatStarted

    +

    This object represents a service message about a voice chat started in the chat. Currently holds no information.

    +

    VoiceChatEnded

    +

    This object represents a service message about a voice chat ended in the chat.

    + + + + + + + + + + + + + + + +
    FieldTypeDescription
    durationIntegerVoice chat duration in seconds
    +

    VoiceChatParticipantsInvited

    +

    This object represents a service message about new members invited to a voice chat.

    + + + + + + + + + + + + + + + +
    FieldTypeDescription
    usersArray of UserOptional. New members that were invited to the voice chat
    +

    UserProfilePhotos

    +

    This object represent a user's profile pictures.

    + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    total_countIntegerTotal number of profile pictures the target user has
    photosArray of Array of PhotoSizeRequested profile pictures (in up to 4 sizes each)
    +

    File

    +

    This object represents a file ready to be downloaded. The file can be downloaded via the link https://api.telegram.org/file/bot<token>/<file_path>. It is guaranteed that the link will be valid for at least 1 hour. When the link expires, a new one can be requested by calling getFile.

    +
    +

    Maximum file size to download is 20 MB

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    file_idStringIdentifier for this file, which can be used to download or reuse the file
    file_unique_idStringUnique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
    file_sizeIntegerOptional. File size in bytes, if known
    file_pathStringOptional. File path. Use https://api.telegram.org/file/bot<token>/<file_path> to get the file.
    +

    ReplyKeyboardMarkup

    +

    This object represents a custom keyboard with reply options (see Introduction to bots for details and examples).

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    keyboardArray of Array of KeyboardButtonArray of button rows, each represented by an Array of KeyboardButton objects
    resize_keyboardBooleanOptional. Requests clients to resize the keyboard vertically for optimal fit (e.g., make the keyboard smaller if there are just two rows of buttons). Defaults to false, in which case the custom keyboard is always of the same height as the app's standard keyboard.
    one_time_keyboardBooleanOptional. Requests clients to hide the keyboard as soon as it's been used. The keyboard will still be available, but clients will automatically display the usual letter-keyboard in the chat – the user can press a special button in the input field to see the custom keyboard again. Defaults to false.
    input_field_placeholderStringOptional. The placeholder to be shown in the input field when the keyboard is active; 1-64 characters
    selectiveBooleanOptional. Use this parameter if you want to show the keyboard to specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply (has reply_to_message_id), sender of the original message.

    Example: A user requests to change the bot's language, bot replies to the request with a keyboard to select the new language. Other users in the group don't see the keyboard.
    +

    KeyboardButton

    +

    This object represents one button of the reply keyboard. For simple text buttons String can be used instead of this object to specify text of the button. Optional fields request_contact, request_location, and request_poll are mutually exclusive.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    textStringText of the button. If none of the optional fields are used, it will be sent as a message when the button is pressed
    request_contactBooleanOptional. If True, the user's phone number will be sent as a contact when the button is pressed. Available in private chats only
    request_locationBooleanOptional. If True, the user's current location will be sent when the button is pressed. Available in private chats only
    request_pollKeyboardButtonPollTypeOptional. If specified, the user will be asked to create a poll and send it to the bot when the button is pressed. Available in private chats only
    +

    Note: request_contact and request_location options will only work in Telegram versions released after 9 April, 2016. Older clients will display unsupported message.
    Note: request_poll option will only work in Telegram versions released after 23 January, 2020. Older clients will display unsupported message.

    +

    KeyboardButtonPollType

    +

    This object represents type of a poll, which is allowed to be created and sent when the corresponding button is pressed.

    + + + + + + + + + + + + + + + +
    FieldTypeDescription
    typeStringOptional. If quiz is passed, the user will be allowed to create only polls in the quiz mode. If regular is passed, only regular polls will be allowed. Otherwise, the user will be allowed to create a poll of any type.
    +

    ReplyKeyboardRemove

    +

    Upon receiving a message with this object, Telegram clients will remove the current custom keyboard and display the default letter-keyboard. By default, custom keyboards are displayed until a new keyboard is sent by a bot. An exception is made for one-time keyboards that are hidden immediately after the user presses a button (see ReplyKeyboardMarkup).

    + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    remove_keyboardTrueRequests clients to remove the custom keyboard (user will not be able to summon this keyboard; if you want to hide the keyboard from sight but keep it accessible, use one_time_keyboard in ReplyKeyboardMarkup)
    selectiveBooleanOptional. Use this parameter if you want to remove the keyboard for specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply (has reply_to_message_id), sender of the original message.

    Example: A user votes in a poll, bot returns confirmation message in reply to the vote and removes the keyboard for that user, while still showing the keyboard with poll options to users who haven't voted yet.
    +

    InlineKeyboardMarkup

    +

    This object represents an inline keyboard that appears right next to the message it belongs to.

    + + + + + + + + + + + + + + + +
    FieldTypeDescription
    inline_keyboardArray of Array of InlineKeyboardButtonArray of button rows, each represented by an Array of InlineKeyboardButton objects
    +

    Note: This will only work in Telegram versions released after 9 April, 2016. Older clients will display unsupported message.

    +

    InlineKeyboardButton

    +

    This object represents one button of an inline keyboard. You must use exactly one of the optional fields.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    textStringLabel text on the button
    urlStringOptional. HTTP or tg:// url to be opened when the button is pressed. Links tg://user?id=<user_id> can be used to mention a user by their ID without using a username, if this is allowed by their privacy settings.
    login_urlLoginUrlOptional. An HTTP URL used to automatically authorize the user. Can be used as a replacement for the Telegram Login Widget.
    callback_dataStringOptional. Data to be sent in a callback query to the bot when button is pressed, 1-64 bytes
    switch_inline_queryStringOptional. If set, pressing the button will prompt the user to select one of their chats, open that chat and insert the bot's username and the specified inline query in the input field. Can be empty, in which case just the bot's username will be inserted.

    Note: This offers an easy way for users to start using your bot in inline mode when they are currently in a private chat with it. Especially useful when combined with switch_pm… actions – in this case the user will be automatically returned to the chat they switched from, skipping the chat selection screen.
    switch_inline_query_current_chatStringOptional. If set, pressing the button will insert the bot's username and the specified inline query in the current chat's input field. Can be empty, in which case only the bot's username will be inserted.

    This offers a quick way for the user to open your bot in inline mode in the same chat – good for selecting something from multiple options.
    callback_gameCallbackGameOptional. Description of the game that will be launched when the user presses the button.

    NOTE: This type of button must always be the first button in the first row.
    payBooleanOptional. Specify True, to send a Pay button.

    NOTE: This type of button must always be the first button in the first row and can only be used in invoice messages.
    +

    LoginUrl

    +

    This object represents a parameter of the inline keyboard button used to automatically authorize a user. Serves as a great replacement for the Telegram Login Widget when the user is coming from Telegram. All the user needs to do is tap/click a button and confirm that they want to log in:

    +
    + TITLE +
    + +

    Telegram apps support these buttons as of version 5.7.

    +
    +

    Sample bot: @discussbot

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    urlStringAn HTTP URL to be opened with user authorization data added to the query string when the button is pressed. If the user refuses to provide authorization data, the original URL without information about the user will be opened. The data added is the same as described in Receiving authorization data.

    NOTE: You must always check the hash of the received data to verify the authentication and the integrity of the data as described in Checking authorization.
    forward_textStringOptional. New text of the button in forwarded messages.
    bot_usernameStringOptional. Username of a bot, which will be used for user authorization. See Setting up a bot for more details. If not specified, the current bot's username will be assumed. The url's domain must be the same as the domain linked with the bot. See Linking your domain to the bot for more details.
    request_write_accessBooleanOptional. Pass True to request the permission for your bot to send messages to the user.
    +

    CallbackQuery

    +

    This object represents an incoming callback query from a callback button in an inline keyboard. If the button that originated the query was attached to a message sent by the bot, the field message will be present. If the button was attached to a message sent via the bot (in inline mode), the field inline_message_id will be present. Exactly one of the fields data or game_short_name will be present.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    idStringUnique identifier for this query
    fromUserSender
    messageMessageOptional. Message with the callback button that originated the query. Note that message content and message date will not be available if the message is too old
    inline_message_idStringOptional. Identifier of the message sent via the bot in inline mode, that originated the query.
    chat_instanceStringGlobal identifier, uniquely corresponding to the chat to which the message with the callback button was sent. Useful for high scores in games.
    dataStringOptional. Data associated with the callback button. Be aware that a bad client can send arbitrary data in this field.
    game_short_nameStringOptional. Short name of a Game to be returned, serves as the unique identifier for the game
    +
    +

    NOTE: After the user presses a callback button, Telegram clients will display a progress bar until you call answerCallbackQuery. It is, therefore, necessary to react by calling answerCallbackQuery even if no notification to the user is needed (e.g., without specifying any of the optional parameters).

    +
    +

    ForceReply

    +

    Upon receiving a message with this object, Telegram clients will display a reply interface to the user (act as if the user has selected the bot's message and tapped 'Reply'). This can be extremely useful if you want to create user-friendly step-by-step interfaces without having to sacrifice privacy mode.

    + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    force_replyTrueShows reply interface to the user, as if they manually selected the bot's message and tapped 'Reply'
    input_field_placeholderStringOptional. The placeholder to be shown in the input field when the reply is active; 1-64 characters
    selectiveBooleanOptional. Use this parameter if you want to force reply from specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply (has reply_to_message_id), sender of the original message.
    +
    +

    Example: A poll bot for groups runs in privacy mode (only receives commands, replies to its messages and mentions). There could be two ways to create a new poll:

    +
      +
    • Explain the user how to send a command with parameters (e.g. /newpoll question answer1 answer2). May be appealing for hardcore users but lacks modern day polish.
    • +
    • Guide the user through a step-by-step process. 'Please send me your question', 'Cool, now let's add the first answer option', 'Great. Keep adding answer options, then send /done when you're ready'.
    • +
    +

    The last option is definitely more attractive. And if you use ForceReply in your bot's questions, it will receive the user's answers even if it only receives replies, commands and mentions — without any extra work for the user.

    +
    +

    ChatPhoto

    +

    This object represents a chat photo.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    small_file_idStringFile identifier of small (160x160) chat photo. This file_id can be used only for photo download and only for as long as the photo is not changed.
    small_file_unique_idStringUnique file identifier of small (160x160) chat photo, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
    big_file_idStringFile identifier of big (640x640) chat photo. This file_id can be used only for photo download and only for as long as the photo is not changed.
    big_file_unique_idStringUnique file identifier of big (640x640) chat photo, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
    +

    ChatInviteLink

    +

    Represents an invite link for a chat.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    invite_linkStringThe invite link. If the link was created by another chat administrator, then the second part of the link will be replaced with “…”.
    creatorUserCreator of the link
    creates_join_requestBooleanTrue, if users joining the chat via the link need to be approved by chat administrators
    is_primaryBooleanTrue, if the link is primary
    is_revokedBooleanTrue, if the link is revoked
    nameStringOptional. Invite link name
    expire_dateIntegerOptional. Point in time (Unix timestamp) when the link will expire or has been expired
    member_limitIntegerOptional. Maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999
    pending_join_request_countIntegerOptional. Number of pending join requests created using this link
    +

    ChatMember

    +

    This object contains information about one member of a chat. Currently, the following 6 types of chat members are supported:

    + +

    ChatMemberOwner

    +

    Represents a chat member that owns the chat and has all administrator privileges.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    statusStringThe member's status in the chat, always “creator”
    userUserInformation about the user
    is_anonymousBooleanTrue, if the user's presence in the chat is hidden
    custom_titleStringOptional. Custom title for this user
    +

    ChatMemberAdministrator

    +

    Represents a chat member that has some additional privileges.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    statusStringThe member's status in the chat, always “administrator”
    userUserInformation about the user
    can_be_editedBooleanTrue, if the bot is allowed to edit administrator privileges of that user
    is_anonymousBooleanTrue, if the user's presence in the chat is hidden
    can_manage_chatBooleanTrue, if the administrator can access the chat event log, chat statistics, message statistics in channels, see channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other administrator privilege
    can_delete_messagesBooleanTrue, if the administrator can delete messages of other users
    can_manage_voice_chatsBooleanTrue, if the administrator can manage voice chats
    can_restrict_membersBooleanTrue, if the administrator can restrict, ban or unban chat members
    can_promote_membersBooleanTrue, if the administrator can add new administrators with a subset of their own privileges or demote administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by the user)
    can_change_infoBooleanTrue, if the user is allowed to change the chat title, photo and other settings
    can_invite_usersBooleanTrue, if the user is allowed to invite new users to the chat
    can_post_messagesBooleanOptional. True, if the administrator can post in the channel; channels only
    can_edit_messagesBooleanOptional. True, if the administrator can edit messages of other users and can pin messages; channels only
    can_pin_messagesBooleanOptional. True, if the user is allowed to pin messages; groups and supergroups only
    custom_titleStringOptional. Custom title for this user
    +

    ChatMemberMember

    +

    Represents a chat member that has no additional privileges or restrictions.

    + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    statusStringThe member's status in the chat, always “member”
    userUserInformation about the user
    +

    ChatMemberRestricted

    +

    Represents a chat member that is under certain restrictions in the chat. Supergroups only.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    statusStringThe member's status in the chat, always “restricted”
    userUserInformation about the user
    is_memberBooleanTrue, if the user is a member of the chat at the moment of the request
    can_change_infoBooleanTrue, if the user is allowed to change the chat title, photo and other settings
    can_invite_usersBooleanTrue, if the user is allowed to invite new users to the chat
    can_pin_messagesBooleanTrue, if the user is allowed to pin messages
    can_send_messagesBooleanTrue, if the user is allowed to send text messages, contacts, locations and venues
    can_send_media_messagesBooleanTrue, if the user is allowed to send audios, documents, photos, videos, video notes and voice notes
    can_send_pollsBooleanTrue, if the user is allowed to send polls
    can_send_other_messagesBooleanTrue, if the user is allowed to send animations, games, stickers and use inline bots
    can_add_web_page_previewsBooleanTrue, if the user is allowed to add web page previews to their messages
    until_dateIntegerDate when restrictions will be lifted for this user; unix time. If 0, then the user is restricted forever
    +

    ChatMemberLeft

    +

    Represents a chat member that isn't currently a member of the chat, but may join it themselves.

    + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    statusStringThe member's status in the chat, always “left”
    userUserInformation about the user
    +

    ChatMemberBanned

    +

    Represents a chat member that was banned in the chat and can't return to the chat or view chat messages.

    + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    statusStringThe member's status in the chat, always “kicked”
    userUserInformation about the user
    until_dateIntegerDate when restrictions will be lifted for this user; unix time. If 0, then the user is banned forever
    +

    ChatMemberUpdated

    +

    This object represents changes in the status of a chat member.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    chatChatChat the user belongs to
    fromUserPerformer of the action, which resulted in the change
    dateIntegerDate the change was done in Unix time
    old_chat_memberChatMemberPrevious information about the chat member
    new_chat_memberChatMemberNew information about the chat member
    invite_linkChatInviteLinkOptional. Chat invite link, which was used by the user to join the chat; for joining by invite link events only.
    +

    ChatJoinRequest

    +

    Represents a join request sent to a chat.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    chatChatChat to which the request was sent
    fromUserUser that sent the join request
    dateIntegerDate the request was sent in Unix time
    bioStringOptional. Bio of the user.
    invite_linkChatInviteLinkOptional. Chat invite link that was used by the user to send the join request
    +

    ChatPermissions

    +

    Describes actions that a non-administrator user is allowed to take in a chat.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    can_send_messagesBooleanOptional. True, if the user is allowed to send text messages, contacts, locations and venues
    can_send_media_messagesBooleanOptional. True, if the user is allowed to send audios, documents, photos, videos, video notes and voice notes, implies can_send_messages
    can_send_pollsBooleanOptional. True, if the user is allowed to send polls, implies can_send_messages
    can_send_other_messagesBooleanOptional. True, if the user is allowed to send animations, games, stickers and use inline bots, implies can_send_media_messages
    can_add_web_page_previewsBooleanOptional. True, if the user is allowed to add web page previews to their messages, implies can_send_media_messages
    can_change_infoBooleanOptional. True, if the user is allowed to change the chat title, photo and other settings. Ignored in public supergroups
    can_invite_usersBooleanOptional. True, if the user is allowed to invite new users to the chat
    can_pin_messagesBooleanOptional. True, if the user is allowed to pin messages. Ignored in public supergroups
    +

    ChatLocation

    +

    Represents a location to which a chat is connected.

    + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    locationLocationThe location to which the supergroup is connected. Can't be a live location.
    addressStringLocation address; 1-64 characters, as defined by the chat owner
    +

    BotCommand

    +

    This object represents a bot command.

    + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    commandStringText of the command; 1-32 characters. Can contain only lowercase English letters, digits and underscores.
    descriptionStringDescription of the command; 1-256 characters.
    +

    BotCommandScope

    +

    This object represents the scope to which bot commands are applied. Currently, the following 7 scopes are supported:

    + +

    Determining list of commands

    +

    The following algorithm is used to determine the list of commands for a particular user viewing the bot menu. The first list of commands which is set is returned:

    +

    Commands in the chat with the bot

    +
      +
    • botCommandScopeChat + language_code
    • +
    • botCommandScopeChat
    • +
    • botCommandScopeAllPrivateChats + language_code
    • +
    • botCommandScopeAllPrivateChats
    • +
    • botCommandScopeDefault + language_code
    • +
    • botCommandScopeDefault
    • +
    +

    Commands in group and supergroup chats

    +
      +
    • botCommandScopeChatMember + language_code
    • +
    • botCommandScopeChatMember
    • +
    • botCommandScopeChatAdministrators + language_code (administrators only)
    • +
    • botCommandScopeChatAdministrators (administrators only)
    • +
    • botCommandScopeChat + language_code
    • +
    • botCommandScopeChat
    • +
    • botCommandScopeAllChatAdministrators + language_code (administrators only)
    • +
    • botCommandScopeAllChatAdministrators (administrators only)
    • +
    • botCommandScopeAllGroupChats + language_code
    • +
    • botCommandScopeAllGroupChats
    • +
    • botCommandScopeDefault + language_code
    • +
    • botCommandScopeDefault
    • +
    +

    BotCommandScopeDefault

    +

    Represents the default scope of bot commands. Default commands are used if no commands with a narrower scope are specified for the user.

    + + + + + + + + + + + + + + + +
    FieldTypeDescription
    typeStringScope type, must be default
    +

    BotCommandScopeAllPrivateChats

    +

    Represents the scope of bot commands, covering all private chats.

    + + + + + + + + + + + + + + + +
    FieldTypeDescription
    typeStringScope type, must be all_private_chats
    +

    BotCommandScopeAllGroupChats

    +

    Represents the scope of bot commands, covering all group and supergroup chats.

    + + + + + + + + + + + + + + + +
    FieldTypeDescription
    typeStringScope type, must be all_group_chats
    +

    BotCommandScopeAllChatAdministrators

    +

    Represents the scope of bot commands, covering all group and supergroup chat administrators.

    + + + + + + + + + + + + + + + +
    FieldTypeDescription
    typeStringScope type, must be all_chat_administrators
    +

    BotCommandScopeChat

    +

    Represents the scope of bot commands, covering a specific chat.

    + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    typeStringScope type, must be chat
    chat_idInteger or StringUnique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
    +

    BotCommandScopeChatAdministrators

    +

    Represents the scope of bot commands, covering all administrators of a specific group or supergroup chat.

    + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    typeStringScope type, must be chat_administrators
    chat_idInteger or StringUnique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
    +

    BotCommandScopeChatMember

    +

    Represents the scope of bot commands, covering a specific member of a group or supergroup chat.

    + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    typeStringScope type, must be chat_member
    chat_idInteger or StringUnique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
    user_idIntegerUnique identifier of the target user
    +

    ResponseParameters

    +

    Contains information about why a request was unsuccessful.

    + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    migrate_to_chat_idIntegerOptional. The group has been migrated to a supergroup with the specified identifier. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier.
    retry_afterIntegerOptional. In case of exceeding flood control, the number of seconds left to wait before the request can be repeated
    +

    InputMedia

    +

    This object represents the content of a media message to be sent. It should be one of

    + +

    InputMediaPhoto

    +

    Represents a photo to be sent.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    typeStringType of the result, must be photo
    mediaStringFile to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. More info on Sending Files »
    captionStringOptional. Caption of the photo to be sent, 0-1024 characters after entities parsing
    parse_modeStringOptional. Mode for parsing entities in the photo caption. See formatting options for more details.
    caption_entitiesArray of MessageEntityOptional. List of special entities that appear in the caption, which can be specified instead of parse_mode
    +

    InputMediaVideo

    +

    Represents a video to be sent.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    typeStringType of the result, must be video
    mediaStringFile to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. More info on Sending Files »
    thumbInputFile or StringOptional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More info on Sending Files »
    captionStringOptional. Caption of the video to be sent, 0-1024 characters after entities parsing
    parse_modeStringOptional. Mode for parsing entities in the video caption. See formatting options for more details.
    caption_entitiesArray of MessageEntityOptional. List of special entities that appear in the caption, which can be specified instead of parse_mode
    widthIntegerOptional. Video width
    heightIntegerOptional. Video height
    durationIntegerOptional. Video duration in seconds
    supports_streamingBooleanOptional. Pass True, if the uploaded video is suitable for streaming
    +

    InputMediaAnimation

    +

    Represents an animation file (GIF or H.264/MPEG-4 AVC video without sound) to be sent.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    typeStringType of the result, must be animation
    mediaStringFile to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. More info on Sending Files »
    thumbInputFile or StringOptional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More info on Sending Files »
    captionStringOptional. Caption of the animation to be sent, 0-1024 characters after entities parsing
    parse_modeStringOptional. Mode for parsing entities in the animation caption. See formatting options for more details.
    caption_entitiesArray of MessageEntityOptional. List of special entities that appear in the caption, which can be specified instead of parse_mode
    widthIntegerOptional. Animation width
    heightIntegerOptional. Animation height
    durationIntegerOptional. Animation duration in seconds
    +

    InputMediaAudio

    +

    Represents an audio file to be treated as music to be sent.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    typeStringType of the result, must be audio
    mediaStringFile to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. More info on Sending Files »
    thumbInputFile or StringOptional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More info on Sending Files »
    captionStringOptional. Caption of the audio to be sent, 0-1024 characters after entities parsing
    parse_modeStringOptional. Mode for parsing entities in the audio caption. See formatting options for more details.
    caption_entitiesArray of MessageEntityOptional. List of special entities that appear in the caption, which can be specified instead of parse_mode
    durationIntegerOptional. Duration of the audio in seconds
    performerStringOptional. Performer of the audio
    titleStringOptional. Title of the audio
    +

    InputMediaDocument

    +

    Represents a general file to be sent.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    typeStringType of the result, must be document
    mediaStringFile to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. More info on Sending Files »
    thumbInputFile or StringOptional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More info on Sending Files »
    captionStringOptional. Caption of the document to be sent, 0-1024 characters after entities parsing
    parse_modeStringOptional. Mode for parsing entities in the document caption. See formatting options for more details.
    caption_entitiesArray of MessageEntityOptional. List of special entities that appear in the caption, which can be specified instead of parse_mode
    disable_content_type_detectionBooleanOptional. Disables automatic server-side content type detection for files uploaded using multipart/form-data. Always True, if the document is sent as part of an album.
    +

    InputFile

    +

    This object represents the contents of a file to be uploaded. Must be posted using multipart/form-data in the usual way that files are uploaded via the browser.

    +

    Sending files

    +

    There are three ways to send files (photos, stickers, audio, media, etc.):

    +
      +
    1. If the file is already stored somewhere on the Telegram servers, you don't need to reupload it: each file object has a file_id field, simply pass this file_id as a parameter instead of uploading. There are no limits for files sent this way.
    2. +
    3. Provide Telegram with an HTTP URL for the file to be sent. Telegram will download and send the file. 5 MB max size for photos and 20 MB max for other types of content.
    4. +
    5. Post the file using multipart/form-data in the usual way that files are uploaded via the browser. 10 MB max size for photos, 50 MB for other files.
    6. +
    +

    Sending by file_id

    +
      +
    • It is not possible to change the file type when resending by file_id. I.e. a video can't be sent as a photo, a photo can't be sent as a document, etc.
    • +
    • It is not possible to resend thumbnails.
    • +
    • Resending a photo by file_id will send all of its sizes.
    • +
    • file_id is unique for each individual bot and can't be transferred from one bot to another.
    • +
    • file_id uniquely identifies a file, but a file can have different valid file_ids even for the same bot.
    • +
    +

    Sending by URL

    +
      +
    • When sending by URL the target file must have the correct MIME type (e.g., audio/mpeg for sendAudio, etc.).
    • +
    • In sendDocument, sending by URL will currently only work for GIF, PDF and ZIP files.
    • +
    • To use sendVoice, the file must have the type audio/ogg and be no more than 1MB in size. 1-20MB voice notes will be sent as files.
    • +
    • Other configurations may work but we can't guarantee that they will.
    • +
    +

    Inline mode objects

    +

    Objects and methods used in the inline mode are described in the Inline mode section.

    +

    Available methods

    +
    +

    All methods in the Bot API are case-insensitive. We support GET and POST HTTP methods. Use either URL query string or application/json or application/x-www-form-urlencoded or multipart/form-data for passing parameters in Bot API requests.
    On successful call, a JSON-object containing the result will be returned.

    +
    +

    getMe

    +

    A simple method for testing your bot's authentication token. Requires no parameters. Returns basic information about the bot in form of a User object.

    +

    logOut

    +

    Use this method to log out from the cloud Bot API server before launching the bot locally. You must log out the bot before running it locally, otherwise there is no guarantee that the bot will receive updates. After a successful call, you can immediately log in on a local server, but will not be able to log in back to the cloud Bot API server for 10 minutes. Returns True on success. Requires no parameters.

    +

    close

    +

    Use this method to close the bot instance before moving it from one local server to another. You need to delete the webhook before calling this method to ensure that the bot isn't launched again after server restart. The method will return error 429 in the first 10 minutes after the bot is launched. Returns True on success. Requires no parameters.

    +

    sendMessage

    +

    Use this method to send text messages. On success, the sent Message is returned.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ParameterTypeRequiredDescription
    chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
    textStringYesText of the message to be sent, 1-4096 characters after entities parsing
    parse_modeStringOptionalMode for parsing entities in the message text. See formatting options for more details.
    entitiesArray of MessageEntityOptionalA JSON-serialized list of special entities that appear in message text, which can be specified instead of parse_mode
    disable_web_page_previewBooleanOptionalDisables link previews for links in this message
    disable_notificationBooleanOptionalSends the message silently. Users will receive a notification with no sound.
    protect_contentBooleanOptionalProtects the contents of the sent message from forwarding and saving
    reply_to_message_idIntegerOptionalIf the message is a reply, ID of the original message
    allow_sending_without_replyBooleanOptionalPass True, if the message should be sent even if the specified replied-to message is not found
    reply_markupInlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReplyOptionalAdditional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.
    +

    Formatting options

    +

    The Bot API supports basic formatting for messages. You can use bold, italic, underlined, strikethrough, and spoiler text, as well as inline links and pre-formatted code in your bots' messages. Telegram clients will render them accordingly. You can use either markdown-style or HTML-style formatting.

    +

    Note that Telegram clients will display an alert to the user before opening an inline link ('Open this link?' together with the full URL).

    +

    Message entities can be nested, providing following restrictions are met:
    - If two entities have common characters then one of them is fully contained inside another.
    - bold, italic, underline, strikethrough, and spoiler entities can contain and can be part of any other entities, except pre and code.
    - All other entities can't contain each other.

    +

    Links tg://user?id=<user_id> can be used to mention a user by their ID without using a username. Please note:

    +
      +
    • These links will work only if they are used inside an inline link or in an inline keyboard button. For example, they will not work, when used in a message text.
    • +
    • These mentions are only guaranteed to work if the user has contacted the bot in the past, has sent a callback query to the bot via an inline button or is a member in the group where he was mentioned.
    • +
    +
    MarkdownV2 style
    +

    To use this mode, pass MarkdownV2 in the parse_mode field. Use the following syntax in your message:

    +
    *bold \*text*
    +_italic \*text_
    +__underline__
    +~strikethrough~
    +||spoiler||
    +*bold _italic bold ~italic bold strikethrough ||italic bold strikethrough spoiler||~ __underline italic bold___ bold*
    +[inline URL](http://www.example.com/)
    +[inline mention of a user](tg://user?id=123456789)
    +`inline fixed-width code`
    +```
    +pre-formatted fixed-width code block
    +```
    +```python
    +pre-formatted fixed-width code block written in the Python programming language
    +```
    +

    Please note:

    +
      +
    • Any character with code between 1 and 126 inclusively can be escaped anywhere with a preceding '\' character, in which case it is treated as an ordinary character and not a part of the markup. This implies that '\' character usually must be escaped with a preceding '\' character.
    • +
    • Inside pre and code entities, all '`' and '\' characters must be escaped with a preceding '\' character.
    • +
    • Inside (...) part of inline link definition, all ')' and '\' must be escaped with a preceding '\' character.
    • +
    • In all other places characters '_', '*', '[', ']', '(', ')', '~', '`', '>', '#', '+', '-', '=', '|', '{', '}', '.', '!' must be escaped with the preceding character '\'.
    • +
    • In case of ambiguity between italic and underline entities __ is always greadily treated from left to right as beginning or end of underline entity, so instead of ___italic underline___ use ___italic underline_\r__, where \r is a character with code 13, which will be ignored.
    • +
    +
    HTML style
    +

    To use this mode, pass HTML in the parse_mode field. The following tags are currently supported:

    +
    <b>bold</b>, <strong>bold</strong>
    +<i>italic</i>, <em>italic</em>
    +<u>underline</u>, <ins>underline</ins>
    +<s>strikethrough</s>, <strike>strikethrough</strike>, <del>strikethrough</del>
    +<span class="tg-spoiler">spoiler</span>, <tg-spoiler>spoiler</tg-spoiler>
    +<b>bold <i>italic bold <s>italic bold strikethrough <span class="tg-spoiler">italic bold strikethrough spoiler</span></s> <u>underline italic bold</u></i> bold</b>
    +<a href="http://www.example.com/">inline URL</a>
    +<a href="tg://user?id=123456789">inline mention of a user</a>
    +<code>inline fixed-width code</code>
    +<pre>pre-formatted fixed-width code block</pre>
    +<pre><code class="language-python">pre-formatted fixed-width code block written in the Python programming language</code></pre>
    +

    Please note:

    +
      +
    • Only the tags mentioned above are currently supported.
    • +
    • All <, > and & symbols that are not a part of a tag or an HTML entity must be replaced with the corresponding HTML entities (< with &lt;, > with &gt; and & with &amp;).
    • +
    • All numerical HTML entities are supported.
    • +
    • The API currently supports only the following named HTML entities: &lt;, &gt;, &amp; and &quot;.
    • +
    • Use nested pre and code tags, to define programming language for pre entity.
    • +
    • Programming language can't be specified for standalone code tags.
    • +
    +
    Markdown style
    +

    This is a legacy mode, retained for backward compatibility. To use this mode, pass Markdown in the parse_mode field. Use the following syntax in your message:

    +
    *bold text*
    +_italic text_
    +[inline URL](http://www.example.com/)
    +[inline mention of a user](tg://user?id=123456789)
    +`inline fixed-width code`
    +```
    +pre-formatted fixed-width code block
    +```
    +```python
    +pre-formatted fixed-width code block written in the Python programming language
    +```
    +

    Please note:

    +
      +
    • Entities must not be nested, use parse mode MarkdownV2 instead.
    • +
    • There is no way to specify underline and strikethrough entities, use parse mode MarkdownV2 instead.
    • +
    • To escape characters '_', '*', '`', '[' outside of an entity, prepend the characters '\' before them.
    • +
    • Escaping inside entities is not allowed, so entity must be closed first and reopened again: use _snake_\__case_ for italic snake_case and *2*\**2=4* for bold 2*2=4.
    • +
    +

    forwardMessage

    +

    Use this method to forward messages of any kind. Service messages can't be forwarded. On success, the sent Message is returned.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ParameterTypeRequiredDescription
    chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
    from_chat_idInteger or StringYesUnique identifier for the chat where the original message was sent (or channel username in the format @channelusername)
    disable_notificationBooleanOptionalSends the message silently. Users will receive a notification with no sound.
    protect_contentBooleanOptionalProtects the contents of the forwarded message from forwarding and saving
    message_idIntegerYesMessage identifier in the chat specified in from_chat_id
    +

    copyMessage

    +

    Use this method to copy messages of any kind. Service messages and invoice messages can't be copied. The method is analogous to the method forwardMessage, but the copied message doesn't have a link to the original message. Returns the MessageId of the sent message on success.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ParameterTypeRequiredDescription
    chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
    from_chat_idInteger or StringYesUnique identifier for the chat where the original message was sent (or channel username in the format @channelusername)
    message_idIntegerYesMessage identifier in the chat specified in from_chat_id
    captionStringOptionalNew caption for media, 0-1024 characters after entities parsing. If not specified, the original caption is kept
    parse_modeStringOptionalMode for parsing entities in the new caption. See formatting options for more details.
    caption_entitiesArray of MessageEntityOptionalA JSON-serialized list of special entities that appear in the new caption, which can be specified instead of parse_mode
    disable_notificationBooleanOptionalSends the message silently. Users will receive a notification with no sound.
    protect_contentBooleanOptionalProtects the contents of the sent message from forwarding and saving
    reply_to_message_idIntegerOptionalIf the message is a reply, ID of the original message
    allow_sending_without_replyBooleanOptionalPass True, if the message should be sent even if the specified replied-to message is not found
    reply_markupInlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReplyOptionalAdditional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.
    +

    sendPhoto

    +

    Use this method to send photos. On success, the sent Message is returned.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ParameterTypeRequiredDescription
    chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
    photoInputFile or StringYesPhoto to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a photo from the Internet, or upload a new photo using multipart/form-data. The photo must be at most 10 MB in size. The photo's width and height must not exceed 10000 in total. Width and height ratio must be at most 20. More info on Sending Files »
    captionStringOptionalPhoto caption (may also be used when resending photos by file_id), 0-1024 characters after entities parsing
    parse_modeStringOptionalMode for parsing entities in the photo caption. See formatting options for more details.
    caption_entitiesArray of MessageEntityOptionalA JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
    disable_notificationBooleanOptionalSends the message silently. Users will receive a notification with no sound.
    protect_contentBooleanOptionalProtects the contents of the sent message from forwarding and saving
    reply_to_message_idIntegerOptionalIf the message is a reply, ID of the original message
    allow_sending_without_replyBooleanOptionalPass True, if the message should be sent even if the specified replied-to message is not found
    reply_markupInlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReplyOptionalAdditional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.
    +

    sendAudio

    +

    Use this method to send audio files, if you want Telegram clients to display them in the music player. Your audio must be in the .MP3 or .M4A format. On success, the sent Message is returned. Bots can currently send audio files of up to 50 MB in size, this limit may be changed in the future.

    +

    For sending voice messages, use the sendVoice method instead.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ParameterTypeRequiredDescription
    chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
    audioInputFile or StringYesAudio file to send. Pass a file_id as String to send an audio file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an audio file from the Internet, or upload a new one using multipart/form-data. More info on Sending Files »
    captionStringOptionalAudio caption, 0-1024 characters after entities parsing
    parse_modeStringOptionalMode for parsing entities in the audio caption. See formatting options for more details.
    caption_entitiesArray of MessageEntityOptionalA JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
    durationIntegerOptionalDuration of the audio in seconds
    performerStringOptionalPerformer
    titleStringOptionalTrack name
    thumbInputFile or StringOptionalThumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More info on Sending Files »
    disable_notificationBooleanOptionalSends the message silently. Users will receive a notification with no sound.
    protect_contentBooleanOptionalProtects the contents of the sent message from forwarding and saving
    reply_to_message_idIntegerOptionalIf the message is a reply, ID of the original message
    allow_sending_without_replyBooleanOptionalPass True, if the message should be sent even if the specified replied-to message is not found
    reply_markupInlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReplyOptionalAdditional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.
    +

    sendDocument

    +

    Use this method to send general files. On success, the sent Message is returned. Bots can currently send files of any type of up to 50 MB in size, this limit may be changed in the future.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ParameterTypeRequiredDescription
    chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
    documentInputFile or StringYesFile to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. More info on Sending Files »
    thumbInputFile or StringOptionalThumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More info on Sending Files »
    captionStringOptionalDocument caption (may also be used when resending documents by file_id), 0-1024 characters after entities parsing
    parse_modeStringOptionalMode for parsing entities in the document caption. See formatting options for more details.
    caption_entitiesArray of MessageEntityOptionalA JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
    disable_content_type_detectionBooleanOptionalDisables automatic server-side content type detection for files uploaded using multipart/form-data
    disable_notificationBooleanOptionalSends the message silently. Users will receive a notification with no sound.
    protect_contentBooleanOptionalProtects the contents of the sent message from forwarding and saving
    reply_to_message_idIntegerOptionalIf the message is a reply, ID of the original message
    allow_sending_without_replyBooleanOptionalPass True, if the message should be sent even if the specified replied-to message is not found
    reply_markupInlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReplyOptionalAdditional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.
    +

    sendVideo

    +

    Use this method to send video files, Telegram clients support mp4 videos (other formats may be sent as Document). On success, the sent Message is returned. Bots can currently send video files of up to 50 MB in size, this limit may be changed in the future.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ParameterTypeRequiredDescription
    chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
    videoInputFile or StringYesVideo to send. Pass a file_id as String to send a video that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a video from the Internet, or upload a new video using multipart/form-data. More info on Sending Files »
    durationIntegerOptionalDuration of sent video in seconds
    widthIntegerOptionalVideo width
    heightIntegerOptionalVideo height
    thumbInputFile or StringOptionalThumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More info on Sending Files »
    captionStringOptionalVideo caption (may also be used when resending videos by file_id), 0-1024 characters after entities parsing
    parse_modeStringOptionalMode for parsing entities in the video caption. See formatting options for more details.
    caption_entitiesArray of MessageEntityOptionalA JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
    supports_streamingBooleanOptionalPass True, if the uploaded video is suitable for streaming
    disable_notificationBooleanOptionalSends the message silently. Users will receive a notification with no sound.
    protect_contentBooleanOptionalProtects the contents of the sent message from forwarding and saving
    reply_to_message_idIntegerOptionalIf the message is a reply, ID of the original message
    allow_sending_without_replyBooleanOptionalPass True, if the message should be sent even if the specified replied-to message is not found
    reply_markupInlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReplyOptionalAdditional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.
    +

    sendAnimation

    +

    Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without sound). On success, the sent Message is returned. Bots can currently send animation files of up to 50 MB in size, this limit may be changed in the future.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ParameterTypeRequiredDescription
    chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
    animationInputFile or StringYesAnimation to send. Pass a file_id as String to send an animation that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an animation from the Internet, or upload a new animation using multipart/form-data. More info on Sending Files »
    durationIntegerOptionalDuration of sent animation in seconds
    widthIntegerOptionalAnimation width
    heightIntegerOptionalAnimation height
    thumbInputFile or StringOptionalThumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More info on Sending Files »
    captionStringOptionalAnimation caption (may also be used when resending animation by file_id), 0-1024 characters after entities parsing
    parse_modeStringOptionalMode for parsing entities in the animation caption. See formatting options for more details.
    caption_entitiesArray of MessageEntityOptionalA JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
    disable_notificationBooleanOptionalSends the message silently. Users will receive a notification with no sound.
    protect_contentBooleanOptionalProtects the contents of the sent message from forwarding and saving
    reply_to_message_idIntegerOptionalIf the message is a reply, ID of the original message
    allow_sending_without_replyBooleanOptionalPass True, if the message should be sent even if the specified replied-to message is not found
    reply_markupInlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReplyOptionalAdditional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.
    +

    sendVoice

    +

    Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .OGG file encoded with OPUS (other formats may be sent as Audio or Document). On success, the sent Message is returned. Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ParameterTypeRequiredDescription
    chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
    voiceInputFile or StringYesAudio file to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. More info on Sending Files »
    captionStringOptionalVoice message caption, 0-1024 characters after entities parsing
    parse_modeStringOptionalMode for parsing entities in the voice message caption. See formatting options for more details.
    caption_entitiesArray of MessageEntityOptionalA JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
    durationIntegerOptionalDuration of the voice message in seconds
    disable_notificationBooleanOptionalSends the message silently. Users will receive a notification with no sound.
    protect_contentBooleanOptionalProtects the contents of the sent message from forwarding and saving
    reply_to_message_idIntegerOptionalIf the message is a reply, ID of the original message
    allow_sending_without_replyBooleanOptionalPass True, if the message should be sent even if the specified replied-to message is not found
    reply_markupInlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReplyOptionalAdditional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.
    +

    sendVideoNote

    +

    As of v.4.0, Telegram clients support rounded square mp4 videos of up to 1 minute long. Use this method to send video messages. On success, the sent Message is returned.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ParameterTypeRequiredDescription
    chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
    video_noteInputFile or StringYesVideo note to send. Pass a file_id as String to send a video note that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. More info on Sending Files ». Sending video notes by a URL is currently unsupported
    durationIntegerOptionalDuration of sent video in seconds
    lengthIntegerOptionalVideo width and height, i.e. diameter of the video message
    thumbInputFile or StringOptionalThumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More info on Sending Files »
    disable_notificationBooleanOptionalSends the message silently. Users will receive a notification with no sound.
    protect_contentBooleanOptionalProtects the contents of the sent message from forwarding and saving
    reply_to_message_idIntegerOptionalIf the message is a reply, ID of the original message
    allow_sending_without_replyBooleanOptionalPass True, if the message should be sent even if the specified replied-to message is not found
    reply_markupInlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReplyOptionalAdditional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.
    +

    sendMediaGroup

    +

    Use this method to send a group of photos, videos, documents or audios as an album. Documents and audio files can be only grouped in an album with messages of the same type. On success, an array of Messages that were sent is returned.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ParameterTypeRequiredDescription
    chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
    mediaArray of InputMediaAudio, InputMediaDocument, InputMediaPhoto and InputMediaVideoYesA JSON-serialized array describing messages to be sent, must include 2-10 items
    disable_notificationBooleanOptionalSends messages silently. Users will receive a notification with no sound.
    protect_contentBooleanOptionalProtects the contents of the sent messages from forwarding and saving
    reply_to_message_idIntegerOptionalIf the messages are a reply, ID of the original message
    allow_sending_without_replyBooleanOptionalPass True, if the message should be sent even if the specified replied-to message is not found
    +

    sendLocation

    +

    Use this method to send point on the map. On success, the sent Message is returned.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ParameterTypeRequiredDescription
    chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
    latitudeFloat numberYesLatitude of the location
    longitudeFloat numberYesLongitude of the location
    horizontal_accuracyFloat numberOptionalThe radius of uncertainty for the location, measured in meters; 0-1500
    live_periodIntegerOptionalPeriod in seconds for which the location will be updated (see Live Locations, should be between 60 and 86400.
    headingIntegerOptionalFor live locations, a direction in which the user is moving, in degrees. Must be between 1 and 360 if specified.
    proximity_alert_radiusIntegerOptionalFor live locations, a maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified.
    disable_notificationBooleanOptionalSends the message silently. Users will receive a notification with no sound.
    protect_contentBooleanOptionalProtects the contents of the sent message from forwarding and saving
    reply_to_message_idIntegerOptionalIf the message is a reply, ID of the original message
    allow_sending_without_replyBooleanOptionalPass True, if the message should be sent even if the specified replied-to message is not found
    reply_markupInlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReplyOptionalAdditional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.
    +

    editMessageLiveLocation

    +

    Use this method to edit live location messages. A location can be edited until its live_period expires or editing is explicitly disabled by a call to stopMessageLiveLocation. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ParameterTypeRequiredDescription
    chat_idInteger or StringOptionalRequired if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername)
    message_idIntegerOptionalRequired if inline_message_id is not specified. Identifier of the message to edit
    inline_message_idStringOptionalRequired if chat_id and message_id are not specified. Identifier of the inline message
    latitudeFloat numberYesLatitude of new location
    longitudeFloat numberYesLongitude of new location
    horizontal_accuracyFloat numberOptionalThe radius of uncertainty for the location, measured in meters; 0-1500
    headingIntegerOptionalDirection in which the user is moving, in degrees. Must be between 1 and 360 if specified.
    proximity_alert_radiusIntegerOptionalMaximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified.
    reply_markupInlineKeyboardMarkupOptionalA JSON-serialized object for a new inline keyboard.
    +

    stopMessageLiveLocation

    +

    Use this method to stop updating a live location message before live_period expires. On success, if the message is not an inline message, the edited Message is returned, otherwise True is returned.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ParameterTypeRequiredDescription
    chat_idInteger or StringOptionalRequired if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername)
    message_idIntegerOptionalRequired if inline_message_id is not specified. Identifier of the message with live location to stop
    inline_message_idStringOptionalRequired if chat_id and message_id are not specified. Identifier of the inline message
    reply_markupInlineKeyboardMarkupOptionalA JSON-serialized object for a new inline keyboard.
    +

    sendVenue

    +

    Use this method to send information about a venue. On success, the sent Message is returned.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ParameterTypeRequiredDescription
    chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
    latitudeFloat numberYesLatitude of the venue
    longitudeFloat numberYesLongitude of the venue
    titleStringYesName of the venue
    addressStringYesAddress of the venue
    foursquare_idStringOptionalFoursquare identifier of the venue
    foursquare_typeStringOptionalFoursquare type of the venue, if known. (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.)
    google_place_idStringOptionalGoogle Places identifier of the venue
    google_place_typeStringOptionalGoogle Places type of the venue. (See supported types.)
    disable_notificationBooleanOptionalSends the message silently. Users will receive a notification with no sound.
    protect_contentBooleanOptionalProtects the contents of the sent message from forwarding and saving
    reply_to_message_idIntegerOptionalIf the message is a reply, ID of the original message
    allow_sending_without_replyBooleanOptionalPass True, if the message should be sent even if the specified replied-to message is not found
    reply_markupInlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReplyOptionalAdditional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.
    +

    sendContact

    +

    Use this method to send phone contacts. On success, the sent Message is returned.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ParameterTypeRequiredDescription
    chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
    phone_numberStringYesContact's phone number
    first_nameStringYesContact's first name
    last_nameStringOptionalContact's last name
    vcardStringOptionalAdditional data about the contact in the form of a vCard, 0-2048 bytes
    disable_notificationBooleanOptionalSends the message silently. Users will receive a notification with no sound.
    protect_contentBooleanOptionalProtects the contents of the sent message from forwarding and saving
    reply_to_message_idIntegerOptionalIf the message is a reply, ID of the original message
    allow_sending_without_replyBooleanOptionalPass True, if the message should be sent even if the specified replied-to message is not found
    reply_markupInlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReplyOptionalAdditional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove keyboard or to force a reply from the user.
    +

    sendPoll

    +

    Use this method to send a native poll. On success, the sent Message is returned.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ParameterTypeRequiredDescription
    chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
    questionStringYesPoll question, 1-300 characters
    optionsArray of StringYesA JSON-serialized list of answer options, 2-10 strings 1-100 characters each
    is_anonymousBooleanOptionalTrue, if the poll needs to be anonymous, defaults to True
    typeStringOptionalPoll type, “quiz” or “regular”, defaults to “regular”
    allows_multiple_answersBooleanOptionalTrue, if the poll allows multiple answers, ignored for polls in quiz mode, defaults to False
    correct_option_idIntegerOptional0-based identifier of the correct answer option, required for polls in quiz mode
    explanationStringOptionalText that is shown when a user chooses an incorrect answer or taps on the lamp icon in a quiz-style poll, 0-200 characters with at most 2 line feeds after entities parsing
    explanation_parse_modeStringOptionalMode for parsing entities in the explanation. See formatting options for more details.
    explanation_entitiesArray of MessageEntityOptionalA JSON-serialized list of special entities that appear in the poll explanation, which can be specified instead of parse_mode
    open_periodIntegerOptionalAmount of time in seconds the poll will be active after creation, 5-600. Can't be used together with close_date.
    close_dateIntegerOptionalPoint in time (Unix timestamp) when the poll will be automatically closed. Must be at least 5 and no more than 600 seconds in the future. Can't be used together with open_period.
    is_closedBooleanOptionalPass True, if the poll needs to be immediately closed. This can be useful for poll preview.
    disable_notificationBooleanOptionalSends the message silently. Users will receive a notification with no sound.
    protect_contentBooleanOptionalProtects the contents of the sent message from forwarding and saving
    reply_to_message_idIntegerOptionalIf the message is a reply, ID of the original message
    allow_sending_without_replyBooleanOptionalPass True, if the message should be sent even if the specified replied-to message is not found
    reply_markupInlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReplyOptionalAdditional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.
    +

    sendDice

    +

    Use this method to send an animated emoji that will display a random value. On success, the sent Message is returned.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ParameterTypeRequiredDescription
    chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
    emojiStringOptionalEmoji on which the dice throw animation is based. Currently, must be one of “🎲”, “🎯”, “🏀”, “⚽”, “🎳”, or “🎰”. Dice can have values 1-6 for “🎲”, “🎯” and “🎳”, values 1-5 for “🏀” and “⚽”, and values 1-64 for “🎰”. Defaults to “🎲
    disable_notificationBooleanOptionalSends the message silently. Users will receive a notification with no sound.
    protect_contentBooleanOptionalProtects the contents of the sent message from forwarding
    reply_to_message_idIntegerOptionalIf the message is a reply, ID of the original message
    allow_sending_without_replyBooleanOptionalPass True, if the message should be sent even if the specified replied-to message is not found
    reply_markupInlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReplyOptionalAdditional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.
    +

    sendChatAction

    +

    Use this method when you need to tell the user that something is happening on the bot's side. The status is set for 5 seconds or less (when a message arrives from your bot, Telegram clients clear its typing status). Returns True on success.

    +
    +

    Example: The ImageBot needs some time to process a request and upload the image. Instead of sending a text message along the lines of “Retrieving image, please wait…”, the bot may use sendChatAction with action = upload_photo. The user will see a “sending photo” status for the bot.

    +
    +

    We only recommend using this method when a response from the bot will take a noticeable amount of time to arrive.

    + + + + + + + + + + + + + + + + + + + + + + + +
    ParameterTypeRequiredDescription
    chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
    actionStringYesType of action to broadcast. Choose one, depending on what the user is about to receive: typing for text messages, upload_photo for photos, record_video or upload_video for videos, record_voice or upload_voice for voice notes, upload_document for general files, choose_sticker for stickers, find_location for location data, record_video_note or upload_video_note for video notes.
    +

    getUserProfilePhotos

    +

    Use this method to get a list of profile pictures for a user. Returns a UserProfilePhotos object.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ParameterTypeRequiredDescription
    user_idIntegerYesUnique identifier of the target user
    offsetIntegerOptionalSequential number of the first photo to be returned. By default, all photos are returned.
    limitIntegerOptionalLimits the number of photos to be retrieved. Values between 1-100 are accepted. Defaults to 100.
    +

    getFile

    +

    Use this method to get basic info about a file and prepare it for downloading. For the moment, bots can download files of up to 20MB in size. On success, a File object is returned. The file can then be downloaded via the link https://api.telegram.org/file/bot<token>/<file_path>, where <file_path> is taken from the response. It is guaranteed that the link will be valid for at least 1 hour. When the link expires, a new one can be requested by calling getFile again.

    + + + + + + + + + + + + + + + + + +
    ParameterTypeRequiredDescription
    file_idStringYesFile identifier to get info about
    +

    Note: This function may not preserve the original file name and MIME type. You should save the file's MIME type and name (if available) when the File object is received.

    +

    banChatMember

    +

    Use this method to ban a user in a group, a supergroup or a channel. In the case of supergroups and channels, the user will not be able to return to the chat on their own using invite links, etc., unless unbanned first. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ParameterTypeRequiredDescription
    chat_idInteger or StringYesUnique identifier for the target group or username of the target supergroup or channel (in the format @channelusername)
    user_idIntegerYesUnique identifier of the target user
    until_dateIntegerOptionalDate when the user will be unbanned, unix time. If user is banned for more than 366 days or less than 30 seconds from the current time they are considered to be banned forever. Applied for supergroups and channels only.
    revoke_messagesBooleanOptionalPass True to delete all messages from the chat for the user that is being removed. If False, the user will be able to see messages in the group that were sent before the user was removed. Always True for supergroups and channels.
    +

    unbanChatMember

    +

    Use this method to unban a previously banned user in a supergroup or channel. The user will not return to the group or channel automatically, but will be able to join via link, etc. The bot must be an administrator for this to work. By default, this method guarantees that after the call the user is not a member of the chat, but will be able to join it. So if the user is a member of the chat they will also be removed from the chat. If you don't want this, use the parameter only_if_banned. Returns True on success.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ParameterTypeRequiredDescription
    chat_idInteger or StringYesUnique identifier for the target group or username of the target supergroup or channel (in the format @channelusername)
    user_idIntegerYesUnique identifier of the target user
    only_if_bannedBooleanOptionalDo nothing if the user is not banned
    +

    restrictChatMember

    +

    Use this method to restrict a user in a supergroup. The bot must be an administrator in the supergroup for this to work and must have the appropriate administrator rights. Pass True for all permissions to lift restrictions from a user. Returns True on success.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ParameterTypeRequiredDescription
    chat_idInteger or StringYesUnique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
    user_idIntegerYesUnique identifier of the target user
    permissionsChatPermissionsYesA JSON-serialized object for new user permissions
    until_dateIntegerOptionalDate when restrictions will be lifted for the user, unix time. If user is restricted for more than 366 days or less than 30 seconds from the current time, they are considered to be restricted forever
    +

    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.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ParameterTypeRequiredDescription
    chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
    user_idIntegerYesUnique identifier of the target user
    is_anonymousBooleanOptionalPass True, if the administrator's presence in the chat is hidden
    can_manage_chatBooleanOptionalPass True, if the administrator can access the chat event log, chat statistics, message statistics in channels, see channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other administrator privilege
    can_post_messagesBooleanOptionalPass True, if the administrator can create channel posts, channels only
    can_edit_messagesBooleanOptionalPass True, if the administrator can edit messages of other users and can pin messages, channels only
    can_delete_messagesBooleanOptionalPass True, if the administrator can delete messages of other users
    can_manage_voice_chatsBooleanOptionalPass True, if the administrator can manage voice chats
    can_restrict_membersBooleanOptionalPass True, if the administrator can restrict, ban or unban chat members
    can_promote_membersBooleanOptionalPass True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by him)
    can_change_infoBooleanOptionalPass True, if the administrator can change chat title, photo and other settings
    can_invite_usersBooleanOptionalPass True, if the administrator can invite new users to the chat
    can_pin_messagesBooleanOptionalPass True, if the administrator can pin messages, supergroups only
    +

    setChatAdministratorCustomTitle

    +

    Use this method to set a custom title for an administrator in a supergroup promoted by the bot. Returns True on success.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ParameterTypeRequiredDescription
    chat_idInteger or StringYesUnique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
    user_idIntegerYesUnique identifier of the target user
    custom_titleStringYesNew custom title for the administrator; 0-16 characters, emoji are not allowed
    +

    banChatSenderChat

    +

    Use this method to ban a channel chat in a supergroup or a channel. Until the chat is unbanned, the owner of the banned chat won't be able to send messages on behalf of any of their channels. The bot must be an administrator in the supergroup or channel for this to work and must have the appropriate administrator rights. Returns True on success.

    + + + + + + + + + + + + + + + + + + + + + + + +
    ParameterTypeRequiredDescription
    chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
    sender_chat_idIntegerYesUnique identifier of the target sender chat
    +

    unbanChatSenderChat

    +

    Use this method to unban a previously banned channel chat in a supergroup or channel. The bot must be an administrator for this to work and must have the appropriate administrator rights. Returns True on success.

    + + + + + + + + + + + + + + + + + + + + + + + +
    ParameterTypeRequiredDescription
    chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
    sender_chat_idIntegerYesUnique identifier of the target sender chat
    +

    setChatPermissions

    +

    Use this method to set default chat permissions for all members. The bot must be an administrator in the group or a supergroup for this to work and must have the can_restrict_members administrator rights. Returns True on success.

    + + + + + + + + + + + + + + + + + + + + + + + +
    ParameterTypeRequiredDescription
    chat_idInteger or StringYesUnique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
    permissionsChatPermissionsYesA JSON-serialized object for new default chat permissions
    +

    exportChatInviteLink

    +

    Use this method to generate a new primary invite link for a chat; any previously generated primary link is revoked. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns the new invite link as String on success.

    + + + + + + + + + + + + + + + + + +
    ParameterTypeRequiredDescription
    chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
    +
    +

    Note: Each administrator in a chat generates their own invite links. Bots can't use invite links generated by other administrators. If you want your bot to work with invite links, it will need to generate its own link using exportChatInviteLink or by calling the getChat method. If your bot needs to generate a new primary invite link replacing its previous one, use exportChatInviteLink again.

    +
    +

    createChatInviteLink

    +

    Use this method to create an additional invite link for a chat. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. The link can be revoked using the method revokeChatInviteLink. Returns the new invite link as ChatInviteLink object.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ParameterTypeRequiredDescription
    chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
    nameStringOptionalInvite link name; 0-32 characters
    expire_dateIntegerOptionalPoint in time (Unix timestamp) when the link will expire
    member_limitIntegerOptionalMaximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999
    creates_join_requestBooleanOptionalTrue, if users joining the chat via the link need to be approved by chat administrators. If True, member_limit can't be specified
    +

    editChatInviteLink

    +

    Use this method to edit a non-primary invite link created by the bot. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns the edited invite link as a ChatInviteLink object.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ParameterTypeRequiredDescription
    chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
    invite_linkStringYesThe invite link to edit
    nameStringOptionalInvite link name; 0-32 characters
    expire_dateIntegerOptionalPoint in time (Unix timestamp) when the link will expire
    member_limitIntegerOptionalMaximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999
    creates_join_requestBooleanOptionalTrue, if users joining the chat via the link need to be approved by chat administrators. If True, member_limit can't be specified
    +

    revokeChatInviteLink

    +

    Use this method to revoke an invite link created by the bot. If the primary link is revoked, a new link is automatically generated. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns the revoked invite link as ChatInviteLink object.

    + + + + + + + + + + + + + + + + + + + + + + + +
    ParameterTypeRequiredDescription
    chat_idInteger or StringYesUnique identifier of the target chat or username of the target channel (in the format @channelusername)
    invite_linkStringYesThe invite link to revoke
    +

    approveChatJoinRequest

    +

    Use this method to approve a chat join request. The bot must be an administrator in the chat for this to work and must have the can_invite_users administrator right. Returns True on success.

    + + + + + + + + + + + + + + + + + + + + + + + +
    ParameterTypeRequiredDescription
    chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
    user_idIntegerYesUnique identifier of the target user
    +

    declineChatJoinRequest

    +

    Use this method to decline a chat join request. The bot must be an administrator in the chat for this to work and must have the can_invite_users administrator right. Returns True on success.

    + + + + + + + + + + + + + + + + + + + + + + + +
    ParameterTypeRequiredDescription
    chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
    user_idIntegerYesUnique identifier of the target user
    +

    setChatPhoto

    +

    Use this method to set a new profile photo for the chat. Photos can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success.

    + + + + + + + + + + + + + + + + + + + + + + + +
    ParameterTypeRequiredDescription
    chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
    photoInputFileYesNew chat photo, uploaded using multipart/form-data
    +

    deleteChatPhoto

    +

    Use this method to delete a chat photo. Photos can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success.

    + + + + + + + + + + + + + + + + + +
    ParameterTypeRequiredDescription
    chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
    +

    setChatTitle

    +

    Use this method to change the title of a chat. Titles can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success.

    + + + + + + + + + + + + + + + + + + + + + + + +
    ParameterTypeRequiredDescription
    chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
    titleStringYesNew chat title, 1-255 characters
    +

    setChatDescription

    +

    Use this method to change the description of a group, 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. Returns True on success.

    + + + + + + + + + + + + + + + + + + + + + + + +
    ParameterTypeRequiredDescription
    chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
    descriptionStringOptionalNew chat description, 0-255 characters
    +

    pinChatMessage

    +

    Use this method to add a message to the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' administrator right in a supergroup or 'can_edit_messages' administrator right in a channel. Returns True on success.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ParameterTypeRequiredDescription
    chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
    message_idIntegerYesIdentifier of a message to pin
    disable_notificationBooleanOptionalPass True, if it is not necessary to send a notification to all chat members about the new pinned message. Notifications are always disabled in channels and private chats.
    +

    unpinChatMessage

    +

    Use this method to remove a message from the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' administrator right in a supergroup or 'can_edit_messages' administrator right in a channel. Returns True on success.

    + + + + + + + + + + + + + + + + + + + + + + + +
    ParameterTypeRequiredDescription
    chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
    message_idIntegerOptionalIdentifier of a message to unpin. If not specified, the most recent pinned message (by sending date) will be unpinned.
    +

    unpinAllChatMessages

    +

    Use this method to clear the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' administrator right in a supergroup or 'can_edit_messages' administrator right in a channel. Returns True on success.

    + + + + + + + + + + + + + + + + + +
    ParameterTypeRequiredDescription
    chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
    +

    leaveChat

    +

    Use this method for your bot to leave a group, supergroup or channel. Returns True on success.

    + + + + + + + + + + + + + + + + + +
    ParameterTypeRequiredDescription
    chat_idInteger or StringYesUnique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername)
    +

    getChat

    +

    Use this method to get up to date information about the chat (current name of the user for one-on-one conversations, current username of a user, group or channel, etc.). Returns a Chat object on success.

    + + + + + + + + + + + + + + + + + +
    ParameterTypeRequiredDescription
    chat_idInteger or StringYesUnique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername)
    +

    getChatAdministrators

    +

    Use this method to get a list of administrators in a chat. On success, returns an Array of ChatMember objects that contains information about all chat administrators except other bots. If the chat is a group or a supergroup and no administrators were appointed, only the creator will be returned.

    + + + + + + + + + + + + + + + + + +
    ParameterTypeRequiredDescription
    chat_idInteger or StringYesUnique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername)
    +

    getChatMemberCount

    +

    Use this method to get the number of members in a chat. Returns Int on success.

    + + + + + + + + + + + + + + + + + +
    ParameterTypeRequiredDescription
    chat_idInteger or StringYesUnique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername)
    +

    getChatMember

    +

    Use this method to get information about a member of a chat. Returns a ChatMember object on success.

    + + + + + + + + + + + + + + + + + + + + + + + +
    ParameterTypeRequiredDescription
    chat_idInteger or StringYesUnique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername)
    user_idIntegerYesUnique identifier of the target user
    +

    setChatStickerSet

    +

    Use this method to set a new group sticker set for a supergroup. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Use the field can_set_sticker_set optionally returned in getChat requests to check if the bot can use this method. Returns True on success.

    + + + + + + + + + + + + + + + + + + + + + + + +
    ParameterTypeRequiredDescription
    chat_idInteger or StringYesUnique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
    sticker_set_nameStringYesName of the sticker set to be set as the group sticker set
    +

    deleteChatStickerSet

    +

    Use this method to delete a group sticker set from a supergroup. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Use the field can_set_sticker_set optionally returned in getChat requests to check if the bot can use this method. Returns True on success.

    + + + + + + + + + + + + + + + + + +
    ParameterTypeRequiredDescription
    chat_idInteger or StringYesUnique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
    +

    answerCallbackQuery

    +

    Use this method to send answers to callback queries sent from inline keyboards. The answer will be displayed to the user as a notification at the top of the chat screen or as an alert. On success, True is returned.

    +
    +

    Alternatively, the user can be redirected to the specified Game URL. For this option to work, you must first create a game for your bot via @Botfather and accept the terms. Otherwise, you may use links like t.me/your_bot?start=XXXX that open your bot with a parameter.

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ParameterTypeRequiredDescription
    callback_query_idStringYesUnique identifier for the query to be answered
    textStringOptionalText of the notification. If not specified, nothing will be shown to the user, 0-200 characters
    show_alertBooleanOptionalIf True, an alert will be shown by the client instead of a notification at the top of the chat screen. Defaults to false.
    urlStringOptionalURL that will be opened by the user's client. If you have created a Game and accepted the conditions via @Botfather, specify the URL that opens your game — note that this will only work if the query comes from a callback_game button.

    Otherwise, you may use links like t.me/your_bot?start=XXXX that open your bot with a parameter.
    cache_timeIntegerOptionalThe maximum amount of time in seconds that the result of the callback query may be cached client-side. Telegram apps will support caching starting in version 3.14. Defaults to 0.
    +

    setMyCommands

    +

    Use this method to change the list of the bot's commands. See https://core.telegram.org/bots#commands for more details about bot commands. Returns True on success.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ParameterTypeRequiredDescription
    commandsArray of BotCommandYesA JSON-serialized list of bot commands to be set as the list of the bot's commands. At most 100 commands can be specified.
    scopeBotCommandScopeOptionalA JSON-serialized object, describing scope of users for which the commands are relevant. Defaults to BotCommandScopeDefault.
    language_codeStringOptionalA two-letter ISO 639-1 language code. If empty, commands will be applied to all users from the given scope, for whose language there are no dedicated commands
    +

    deleteMyCommands

    +

    Use this method to delete the list of the bot's commands for the given scope and user language. After deletion, higher level commands will be shown to affected users. Returns True on success.

    + + + + + + + + + + + + + + + + + + + + + + + +
    ParameterTypeRequiredDescription
    scopeBotCommandScopeOptionalA JSON-serialized object, describing scope of users for which the commands are relevant. Defaults to BotCommandScopeDefault.
    language_codeStringOptionalA two-letter ISO 639-1 language code. If empty, commands will be applied to all users from the given scope, for whose language there are no dedicated commands
    +

    getMyCommands

    +

    Use this method to get the current list of the bot's commands for the given scope and user language. Returns Array of BotCommand on success. If commands aren't set, an empty list is returned.

    + + + + + + + + + + + + + + + + + + + + + + + +
    ParameterTypeRequiredDescription
    scopeBotCommandScopeOptionalA JSON-serialized object, describing scope of users. Defaults to BotCommandScopeDefault.
    language_codeStringOptionalA two-letter ISO 639-1 language code or an empty string
    +

    Inline mode methods

    +

    Methods and objects used in the inline mode are described in the Inline mode section.

    +

    Updating messages

    +

    The following methods allow you to change an existing message in the message history instead of sending a new one with a result of an action. This is most useful for messages with inline keyboards using callback queries, but can also help reduce clutter in conversations with regular chat bots.

    +

    Please note, that it is currently only possible to edit messages without reply_markup or with inline keyboards.

    +

    editMessageText

    +

    Use this method to edit text and game messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ParameterTypeRequiredDescription
    chat_idInteger or StringOptionalRequired if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername)
    message_idIntegerOptionalRequired if inline_message_id is not specified. Identifier of the message to edit
    inline_message_idStringOptionalRequired if chat_id and message_id are not specified. Identifier of the inline message
    textStringYesNew text of the message, 1-4096 characters after entities parsing
    parse_modeStringOptionalMode for parsing entities in the message text. See formatting options for more details.
    entitiesArray of MessageEntityOptionalA JSON-serialized list of special entities that appear in message text, which can be specified instead of parse_mode
    disable_web_page_previewBooleanOptionalDisables link previews for links in this message
    reply_markupInlineKeyboardMarkupOptionalA JSON-serialized object for an inline keyboard.
    +

    editMessageCaption

    +

    Use this method to edit captions of messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ParameterTypeRequiredDescription
    chat_idInteger or StringOptionalRequired if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername)
    message_idIntegerOptionalRequired if inline_message_id is not specified. Identifier of the message to edit
    inline_message_idStringOptionalRequired if chat_id and message_id are not specified. Identifier of the inline message
    captionStringOptionalNew caption of the message, 0-1024 characters after entities parsing
    parse_modeStringOptionalMode for parsing entities in the message caption. See formatting options for more details.
    caption_entitiesArray of MessageEntityOptionalA JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
    reply_markupInlineKeyboardMarkupOptionalA JSON-serialized object for an inline keyboard.
    +

    editMessageMedia

    +

    Use this method to edit animation, audio, document, photo, or video messages. If a message is part of a message album, then it can be edited only to an audio for audio albums, only to a document for document albums and to a photo or a video otherwise. When an inline message is edited, a new file can't be uploaded; use a previously uploaded file via its file_id or specify a URL. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ParameterTypeRequiredDescription
    chat_idInteger or StringOptionalRequired if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername)
    message_idIntegerOptionalRequired if inline_message_id is not specified. Identifier of the message to edit
    inline_message_idStringOptionalRequired if chat_id and message_id are not specified. Identifier of the inline message
    mediaInputMediaYesA JSON-serialized object for a new media content of the message
    reply_markupInlineKeyboardMarkupOptionalA JSON-serialized object for a new inline keyboard.
    +

    editMessageReplyMarkup

    +

    Use this method to edit only the reply markup of messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ParameterTypeRequiredDescription
    chat_idInteger or StringOptionalRequired if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername)
    message_idIntegerOptionalRequired if inline_message_id is not specified. Identifier of the message to edit
    inline_message_idStringOptionalRequired if chat_id and message_id are not specified. Identifier of the inline message
    reply_markupInlineKeyboardMarkupOptionalA JSON-serialized object for an inline keyboard.
    +

    stopPoll

    +

    Use this method to stop a poll which was sent by the bot. On success, the stopped Poll is returned.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ParameterTypeRequiredDescription
    chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
    message_idIntegerYesIdentifier of the original message with the poll
    reply_markupInlineKeyboardMarkupOptionalA JSON-serialized object for a new message inline keyboard.
    +

    deleteMessage

    +

    Use this method to delete a message, including service messages, with the following limitations:
    - A message can only be deleted if it was sent less than 48 hours ago.
    - A dice message in a private chat can only be deleted if it was sent more than 24 hours ago.
    - Bots can delete outgoing messages in private chats, groups, and supergroups.
    - Bots can delete incoming messages in private chats.
    - Bots granted can_post_messages permissions can delete outgoing messages in channels.
    - If the bot is an administrator of a group, it can delete any message there.
    - If the bot has can_delete_messages permission in a supergroup or a channel, it can delete any message there.
    Returns True on success.

    + + + + + + + + + + + + + + + + + + + + + + + +
    ParameterTypeRequiredDescription
    chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
    message_idIntegerYesIdentifier of the message to delete
    +

    Stickers

    +

    The following methods and objects allow your bot to handle stickers and sticker sets.

    +

    Sticker

    +

    This object represents a sticker.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    file_idStringIdentifier for this file, which can be used to download or reuse the file
    file_unique_idStringUnique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
    widthIntegerSticker width
    heightIntegerSticker height
    is_animatedBooleanTrue, if the sticker is animated
    is_videoBooleanTrue, if the sticker is a video sticker
    thumbPhotoSizeOptional. Sticker thumbnail in the .WEBP or .JPG format
    emojiStringOptional. Emoji associated with the sticker
    set_nameStringOptional. Name of the sticker set to which the sticker belongs
    mask_positionMaskPositionOptional. For mask stickers, the position where the mask should be placed
    file_sizeIntegerOptional. File size in bytes
    +

    StickerSet

    +

    This object represents a sticker set.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    nameStringSticker set name
    titleStringSticker set title
    is_animatedBooleanTrue, if the sticker set contains animated stickers
    is_videoBooleanTrue, if the sticker set contains video stickers
    contains_masksBooleanTrue, if the sticker set contains masks
    stickersArray of StickerList of all set stickers
    thumbPhotoSizeOptional. Sticker set thumbnail in the .WEBP, .TGS, or .WEBM format
    +

    MaskPosition

    +

    This object describes the position on faces where a mask should be placed by default.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    pointStringThe part of the face relative to which the mask should be placed. One of “forehead”, “eyes”, “mouth”, or “chin”.
    x_shiftFloat numberShift by X-axis measured in widths of the mask scaled to the face size, from left to right. For example, choosing -1.0 will place mask just to the left of the default mask position.
    y_shiftFloat numberShift by Y-axis measured in heights of the mask scaled to the face size, from top to bottom. For example, 1.0 will place the mask just below the default mask position.
    scaleFloat numberMask scaling coefficient. For example, 2.0 means double size.
    +

    sendSticker

    +

    Use this method to send static .WEBP, animated .TGS, or video .WEBM stickers. On success, the sent Message is returned.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ParameterTypeRequiredDescription
    chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
    stickerInputFile or StringYesSticker to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a .WEBP file from the Internet, or upload a new one using multipart/form-data. More info on Sending Files »
    disable_notificationBooleanOptionalSends the message silently. Users will receive a notification with no sound.
    protect_contentBooleanOptionalProtects the contents of the sent message from forwarding and saving
    reply_to_message_idIntegerOptionalIf the message is a reply, ID of the original message
    allow_sending_without_replyBooleanOptionalPass True, if the message should be sent even if the specified replied-to message is not found
    reply_markupInlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReplyOptionalAdditional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.
    +

    getStickerSet

    +

    Use this method to get a sticker set. On success, a StickerSet object is returned.

    + + + + + + + + + + + + + + + + + +
    ParameterTypeRequiredDescription
    nameStringYesName of the sticker set
    +

    uploadStickerFile

    +

    Use this method to upload a .PNG file with a sticker for later use in createNewStickerSet and addStickerToSet methods (can be used multiple times). Returns the uploaded File on success.

    + + + + + + + + + + + + + + + + + + + + + + + +
    ParameterTypeRequiredDescription
    user_idIntegerYesUser identifier of sticker file owner
    png_stickerInputFileYesPNG image with the sticker, must be up to 512 kilobytes in size, dimensions must not exceed 512px, and either width or height must be exactly 512px. More info on Sending Files »
    +

    createNewStickerSet

    +

    Use this method to create a new sticker set owned by a user. The bot will be able to edit the sticker set thus created. You must use exactly one of the fields png_sticker, tgs_sticker, or webm_sticker. Returns True on success.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ParameterTypeRequiredDescription
    user_idIntegerYesUser identifier of created sticker set owner
    nameStringYesShort name of sticker set, to be used in t.me/addstickers/ URLs (e.g., animals). Can contain only english letters, digits and underscores. Must begin with a letter, can't contain consecutive underscores and must end in “_by_<bot username>”. <bot_username> is case insensitive. 1-64 characters.
    titleStringYesSticker set title, 1-64 characters
    png_stickerInputFile or StringOptionalPNG image with the sticker, must be up to 512 kilobytes in size, dimensions must not exceed 512px, and either width or height must be exactly 512px. Pass a file_id as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. More info on Sending Files »
    tgs_stickerInputFileOptionalTGS animation with the sticker, uploaded using multipart/form-data. See https://core.telegram.org/stickers#animated-sticker-requirements for technical requirements
    webm_stickerInputFileOptionalWEBM video with the sticker, uploaded using multipart/form-data. See https://core.telegram.org/stickers#video-sticker-requirements for technical requirements
    emojisStringYesOne or more emoji corresponding to the sticker
    contains_masksBooleanOptionalPass True, if a set of mask stickers should be created
    mask_positionMaskPositionOptionalA JSON-serialized object for position where the mask should be placed on faces
    +

    addStickerToSet

    +

    Use this method to add a new sticker to a set created by the bot. You must use exactly one of the fields png_sticker, tgs_sticker, or webm_sticker. Animated stickers can be added to animated sticker sets and only to them. Animated sticker sets can have up to 50 stickers. Static sticker sets can have up to 120 stickers. Returns True on success.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ParameterTypeRequiredDescription
    user_idIntegerYesUser identifier of sticker set owner
    nameStringYesSticker set name
    png_stickerInputFile or StringOptionalPNG image with the sticker, must be up to 512 kilobytes in size, dimensions must not exceed 512px, and either width or height must be exactly 512px. Pass a file_id as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. More info on Sending Files »
    tgs_stickerInputFileOptionalTGS animation with the sticker, uploaded using multipart/form-data. See https://core.telegram.org/stickers#animated-sticker-requirements for technical requirements
    webm_stickerInputFileOptionalWEBM video with the sticker, uploaded using multipart/form-data. See https://core.telegram.org/stickers#video-sticker-requirements for technical requirements
    emojisStringYesOne or more emoji corresponding to the sticker
    mask_positionMaskPositionOptionalA JSON-serialized object for position where the mask should be placed on faces
    +

    setStickerPositionInSet

    +

    Use this method to move a sticker in a set created by the bot to a specific position. Returns True on success.

    + + + + + + + + + + + + + + + + + + + + + + + +
    ParameterTypeRequiredDescription
    stickerStringYesFile identifier of the sticker
    positionIntegerYesNew sticker position in the set, zero-based
    +

    deleteStickerFromSet

    +

    Use this method to delete a sticker from a set created by the bot. Returns True on success.

    + + + + + + + + + + + + + + + + + +
    ParameterTypeRequiredDescription
    stickerStringYesFile identifier of the sticker
    +

    setStickerSetThumb

    +

    Use this method to set the thumbnail of a sticker set. Animated thumbnails can be set for animated sticker sets only. Video thumbnails can be set only for video sticker sets only. Returns True on success.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ParameterTypeRequiredDescription
    nameStringYesSticker set name
    user_idIntegerYesUser identifier of the sticker set owner
    thumbInputFile or StringOptionalA PNG image with the thumbnail, must be up to 128 kilobytes in size and have width and height exactly 100px, or a TGS animation with the thumbnail up to 32 kilobytes in size; see https://core.telegram.org/stickers#animated-sticker-requirements for animated sticker technical requirements, or a WEBM video with the thumbnail up to 32 kilobytes in size; see https://core.telegram.org/stickers#video-sticker-requirements for video sticker technical requirements. Pass a file_id as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. More info on Sending Files ». Animated sticker set thumbnails can't be uploaded via HTTP URL.
    +

    Inline mode

    +

    The following methods and objects allow your bot to work in inline mode.
    Please see our Introduction to Inline bots for more details.

    +

    To enable this option, send the /setinline command to @BotFather and provide the placeholder text that the user will see in the input field after typing your bot's name.

    +

    InlineQuery

    +

    This object represents an incoming inline query. When the user sends an empty query, your bot could return some default or trending results.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    idStringUnique identifier for this query
    fromUserSender
    queryStringText of the query (up to 256 characters)
    offsetStringOffset of the results to be returned, can be controlled by the bot
    chat_typeStringOptional. Type of the chat, from which the inline query was sent. Can be either “sender” for a private chat with the inline query sender, “private”, “group”, “supergroup”, or “channel”. The chat type should be always known for requests sent from official clients and most third-party clients, unless the request was sent from a secret chat
    locationLocationOptional. Sender location, only for bots that request user location
    +

    answerInlineQuery

    +

    Use this method to send answers to an inline query. On success, True is returned.
    No more than 50 results per query are allowed.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ParameterTypeRequiredDescription
    inline_query_idStringYesUnique identifier for the answered query
    resultsArray of InlineQueryResultYesA JSON-serialized array of results for the inline query
    cache_timeIntegerOptionalThe maximum amount of time in seconds that the result of the inline query may be cached on the server. Defaults to 300.
    is_personalBooleanOptionalPass True, if results may be cached on the server side only for the user that sent the query. By default, results may be returned to any user who sends the same query
    next_offsetStringOptionalPass the offset that a client should send in the next query with the same text to receive more results. Pass an empty string if there are no more results or if you don't support pagination. Offset length can't exceed 64 bytes.
    switch_pm_textStringOptionalIf passed, clients will display a button with specified text that switches the user to a private chat with the bot and sends the bot a start message with the parameter switch_pm_parameter
    switch_pm_parameterStringOptionalDeep-linking parameter for the /start message sent to the bot when user presses the switch button. 1-64 characters, only A-Z, a-z, 0-9, _ and - are allowed.

    Example: An inline bot that sends YouTube videos can ask the user to connect the bot to their YouTube account to adapt search results accordingly. To do this, it displays a 'Connect your YouTube account' button above the results, or even before showing any. The user presses the button, switches to a private chat with the bot and, in doing so, passes a start parameter that instructs the bot to return an OAuth link. Once done, the bot can offer a switch_inline button so that the user can easily return to the chat where they wanted to use the bot's inline capabilities.
    +

    InlineQueryResult

    +

    This object represents one result of an inline query. Telegram clients currently support results of the following 20 types:

    + +

    Note: All URLs passed in inline query results will be available to end users and therefore must be assumed to be public.

    +

    InlineQueryResultArticle

    +

    Represents a link to an article or web page.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    typeStringType of the result, must be article
    idStringUnique identifier for this result, 1-64 Bytes
    titleStringTitle of the result
    input_message_contentInputMessageContentContent of the message to be sent
    reply_markupInlineKeyboardMarkupOptional. Inline keyboard attached to the message
    urlStringOptional. URL of the result
    hide_urlBooleanOptional. Pass True, if you don't want the URL to be shown in the message
    descriptionStringOptional. Short description of the result
    thumb_urlStringOptional. Url of the thumbnail for the result
    thumb_widthIntegerOptional. Thumbnail width
    thumb_heightIntegerOptional. Thumbnail height
    +

    InlineQueryResultPhoto

    +

    Represents a link to a photo. By default, this photo will be sent by the user with optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the photo.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    typeStringType of the result, must be photo
    idStringUnique identifier for this result, 1-64 bytes
    photo_urlStringA valid URL of the photo. Photo must be in JPEG format. Photo size must not exceed 5MB
    thumb_urlStringURL of the thumbnail for the photo
    photo_widthIntegerOptional. Width of the photo
    photo_heightIntegerOptional. Height of the photo
    titleStringOptional. Title for the result
    descriptionStringOptional. Short description of the result
    captionStringOptional. Caption of the photo to be sent, 0-1024 characters after entities parsing
    parse_modeStringOptional. Mode for parsing entities in the photo caption. See formatting options for more details.
    caption_entitiesArray of MessageEntityOptional. List of special entities that appear in the caption, which can be specified instead of parse_mode
    reply_markupInlineKeyboardMarkupOptional. Inline keyboard attached to the message
    input_message_contentInputMessageContentOptional. Content of the message to be sent instead of the photo
    +

    InlineQueryResultGif

    +

    Represents a link to an animated GIF file. By default, this animated GIF file will be sent by the user with optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the animation.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    typeStringType of the result, must be gif
    idStringUnique identifier for this result, 1-64 bytes
    gif_urlStringA valid URL for the GIF file. File size must not exceed 1MB
    gif_widthIntegerOptional. Width of the GIF
    gif_heightIntegerOptional. Height of the GIF
    gif_durationIntegerOptional. Duration of the GIF in seconds
    thumb_urlStringURL of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result
    thumb_mime_typeStringOptional. MIME type of the thumbnail, must be one of “image/jpeg”, “image/gif”, or “video/mp4”. Defaults to “image/jpeg”
    titleStringOptional. Title for the result
    captionStringOptional. Caption of the GIF file to be sent, 0-1024 characters after entities parsing
    parse_modeStringOptional. Mode for parsing entities in the caption. See formatting options for more details.
    caption_entitiesArray of MessageEntityOptional. List of special entities that appear in the caption, which can be specified instead of parse_mode
    reply_markupInlineKeyboardMarkupOptional. Inline keyboard attached to the message
    input_message_contentInputMessageContentOptional. Content of the message to be sent instead of the GIF animation
    +

    InlineQueryResultMpeg4Gif

    +

    Represents a link to a video animation (H.264/MPEG-4 AVC video without sound). By default, this animated MPEG-4 file will be sent by the user with optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the animation.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    typeStringType of the result, must be mpeg4_gif
    idStringUnique identifier for this result, 1-64 bytes
    mpeg4_urlStringA valid URL for the MP4 file. File size must not exceed 1MB
    mpeg4_widthIntegerOptional. Video width
    mpeg4_heightIntegerOptional. Video height
    mpeg4_durationIntegerOptional. Video duration in seconds
    thumb_urlStringURL of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result
    thumb_mime_typeStringOptional. MIME type of the thumbnail, must be one of “image/jpeg”, “image/gif”, or “video/mp4”. Defaults to “image/jpeg”
    titleStringOptional. Title for the result
    captionStringOptional. Caption of the MPEG-4 file to be sent, 0-1024 characters after entities parsing
    parse_modeStringOptional. Mode for parsing entities in the caption. See formatting options for more details.
    caption_entitiesArray of MessageEntityOptional. List of special entities that appear in the caption, which can be specified instead of parse_mode
    reply_markupInlineKeyboardMarkupOptional. Inline keyboard attached to the message
    input_message_contentInputMessageContentOptional. Content of the message to be sent instead of the video animation
    +

    InlineQueryResultVideo

    +

    Represents a link to a page containing an embedded video player or a video file. By default, this video file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the video.

    +
    +

    If an InlineQueryResultVideo message contains an embedded video (e.g., YouTube), you must replace its content using input_message_content.

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    typeStringType of the result, must be video
    idStringUnique identifier for this result, 1-64 bytes
    video_urlStringA valid URL for the embedded video player or video file
    mime_typeStringMime type of the content of video url, “text/html” or “video/mp4”
    thumb_urlStringURL of the thumbnail (JPEG only) for the video
    titleStringTitle for the result
    captionStringOptional. Caption of the video to be sent, 0-1024 characters after entities parsing
    parse_modeStringOptional. Mode for parsing entities in the video caption. See formatting options for more details.
    caption_entitiesArray of MessageEntityOptional. List of special entities that appear in the caption, which can be specified instead of parse_mode
    video_widthIntegerOptional. Video width
    video_heightIntegerOptional. Video height
    video_durationIntegerOptional. Video duration in seconds
    descriptionStringOptional. Short description of the result
    reply_markupInlineKeyboardMarkupOptional. Inline keyboard attached to the message
    input_message_contentInputMessageContentOptional. Content of the message to be sent instead of the video. This field is required if InlineQueryResultVideo is used to send an HTML-page as a result (e.g., a YouTube video).
    +

    InlineQueryResultAudio

    +

    Represents a link to an MP3 audio file. By default, this audio file will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the audio.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    typeStringType of the result, must be audio
    idStringUnique identifier for this result, 1-64 bytes
    audio_urlStringA valid URL for the audio file
    titleStringTitle
    captionStringOptional. Caption, 0-1024 characters after entities parsing
    parse_modeStringOptional. Mode for parsing entities in the audio caption. See formatting options for more details.
    caption_entitiesArray of MessageEntityOptional. List of special entities that appear in the caption, which can be specified instead of parse_mode
    performerStringOptional. Performer
    audio_durationIntegerOptional. Audio duration in seconds
    reply_markupInlineKeyboardMarkupOptional. Inline keyboard attached to the message
    input_message_contentInputMessageContentOptional. Content of the message to be sent instead of the audio
    +

    Note: This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them.

    +

    InlineQueryResultVoice

    +

    Represents a link to a voice recording in an .OGG container encoded with OPUS. By default, this voice recording will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the the voice message.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    typeStringType of the result, must be voice
    idStringUnique identifier for this result, 1-64 bytes
    voice_urlStringA valid URL for the voice recording
    titleStringRecording title
    captionStringOptional. Caption, 0-1024 characters after entities parsing
    parse_modeStringOptional. Mode for parsing entities in the voice message caption. See formatting options for more details.
    caption_entitiesArray of MessageEntityOptional. List of special entities that appear in the caption, which can be specified instead of parse_mode
    voice_durationIntegerOptional. Recording duration in seconds
    reply_markupInlineKeyboardMarkupOptional. Inline keyboard attached to the message
    input_message_contentInputMessageContentOptional. Content of the message to be sent instead of the voice recording
    +

    Note: This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them.

    +

    InlineQueryResultDocument

    +

    Represents a link to a file. By default, this file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the file. Currently, only .PDF and .ZIP files can be sent using this method.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    typeStringType of the result, must be document
    idStringUnique identifier for this result, 1-64 bytes
    titleStringTitle for the result
    captionStringOptional. Caption of the document to be sent, 0-1024 characters after entities parsing
    parse_modeStringOptional. Mode for parsing entities in the document caption. See formatting options for more details.
    caption_entitiesArray of MessageEntityOptional. List of special entities that appear in the caption, which can be specified instead of parse_mode
    document_urlStringA valid URL for the file
    mime_typeStringMime type of the content of the file, either “application/pdf” or “application/zip”
    descriptionStringOptional. Short description of the result
    reply_markupInlineKeyboardMarkupOptional. Inline keyboard attached to the message
    input_message_contentInputMessageContentOptional. Content of the message to be sent instead of the file
    thumb_urlStringOptional. URL of the thumbnail (JPEG only) for the file
    thumb_widthIntegerOptional. Thumbnail width
    thumb_heightIntegerOptional. Thumbnail height
    +

    Note: This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them.

    +

    InlineQueryResultLocation

    +

    Represents a location on a map. By default, the location will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the location.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    typeStringType of the result, must be location
    idStringUnique identifier for this result, 1-64 Bytes
    latitudeFloat numberLocation latitude in degrees
    longitudeFloat numberLocation longitude in degrees
    titleStringLocation title
    horizontal_accuracyFloat numberOptional. The radius of uncertainty for the location, measured in meters; 0-1500
    live_periodIntegerOptional. Period in seconds for which the location can be updated, should be between 60 and 86400.
    headingIntegerOptional. For live locations, a direction in which the user is moving, in degrees. Must be between 1 and 360 if specified.
    proximity_alert_radiusIntegerOptional. For live locations, a maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified.
    reply_markupInlineKeyboardMarkupOptional. Inline keyboard attached to the message
    input_message_contentInputMessageContentOptional. Content of the message to be sent instead of the location
    thumb_urlStringOptional. Url of the thumbnail for the result
    thumb_widthIntegerOptional. Thumbnail width
    thumb_heightIntegerOptional. Thumbnail height
    +

    Note: This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them.

    +

    InlineQueryResultVenue

    +

    Represents a venue. By default, the venue will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the venue.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    typeStringType of the result, must be venue
    idStringUnique identifier for this result, 1-64 Bytes
    latitudeFloatLatitude of the venue location in degrees
    longitudeFloatLongitude of the venue location in degrees
    titleStringTitle of the venue
    addressStringAddress of the venue
    foursquare_idStringOptional. Foursquare identifier of the venue if known
    foursquare_typeStringOptional. Foursquare type of the venue, if known. (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.)
    google_place_idStringOptional. Google Places identifier of the venue
    google_place_typeStringOptional. Google Places type of the venue. (See supported types.)
    reply_markupInlineKeyboardMarkupOptional. Inline keyboard attached to the message
    input_message_contentInputMessageContentOptional. Content of the message to be sent instead of the venue
    thumb_urlStringOptional. Url of the thumbnail for the result
    thumb_widthIntegerOptional. Thumbnail width
    thumb_heightIntegerOptional. Thumbnail height
    +

    Note: This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them.

    +

    InlineQueryResultContact

    +

    Represents a contact with a phone number. By default, this contact will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the contact.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    typeStringType of the result, must be contact
    idStringUnique identifier for this result, 1-64 Bytes
    phone_numberStringContact's phone number
    first_nameStringContact's first name
    last_nameStringOptional. Contact's last name
    vcardStringOptional. Additional data about the contact in the form of a vCard, 0-2048 bytes
    reply_markupInlineKeyboardMarkupOptional. Inline keyboard attached to the message
    input_message_contentInputMessageContentOptional. Content of the message to be sent instead of the contact
    thumb_urlStringOptional. Url of the thumbnail for the result
    thumb_widthIntegerOptional. Thumbnail width
    thumb_heightIntegerOptional. Thumbnail height
    +

    Note: This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them.

    +

    InlineQueryResultGame

    +

    Represents a Game.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    typeStringType of the result, must be game
    idStringUnique identifier for this result, 1-64 bytes
    game_short_nameStringShort name of the game
    reply_markupInlineKeyboardMarkupOptional. Inline keyboard attached to the message
    +

    Note: This will only work in Telegram versions released after October 1, 2016. Older clients will not display any inline results if a game result is among them.

    +

    InlineQueryResultCachedPhoto

    +

    Represents a link to a photo stored on the Telegram servers. By default, this photo will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the photo.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    typeStringType of the result, must be photo
    idStringUnique identifier for this result, 1-64 bytes
    photo_file_idStringA valid file identifier of the photo
    titleStringOptional. Title for the result
    descriptionStringOptional. Short description of the result
    captionStringOptional. Caption of the photo to be sent, 0-1024 characters after entities parsing
    parse_modeStringOptional. Mode for parsing entities in the photo caption. See formatting options for more details.
    caption_entitiesArray of MessageEntityOptional. List of special entities that appear in the caption, which can be specified instead of parse_mode
    reply_markupInlineKeyboardMarkupOptional. Inline keyboard attached to the message
    input_message_contentInputMessageContentOptional. Content of the message to be sent instead of the photo
    +

    InlineQueryResultCachedGif

    +

    Represents a link to an animated GIF file stored on the Telegram servers. By default, this animated GIF file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with specified content instead of the animation.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    typeStringType of the result, must be gif
    idStringUnique identifier for this result, 1-64 bytes
    gif_file_idStringA valid file identifier for the GIF file
    titleStringOptional. Title for the result
    captionStringOptional. Caption of the GIF file to be sent, 0-1024 characters after entities parsing
    parse_modeStringOptional. Mode for parsing entities in the caption. See formatting options for more details.
    caption_entitiesArray of MessageEntityOptional. List of special entities that appear in the caption, which can be specified instead of parse_mode
    reply_markupInlineKeyboardMarkupOptional. Inline keyboard attached to the message
    input_message_contentInputMessageContentOptional. Content of the message to be sent instead of the GIF animation
    +

    InlineQueryResultCachedMpeg4Gif

    +

    Represents a link to a video animation (H.264/MPEG-4 AVC video without sound) stored on the Telegram servers. By default, this animated MPEG-4 file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the animation.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    typeStringType of the result, must be mpeg4_gif
    idStringUnique identifier for this result, 1-64 bytes
    mpeg4_file_idStringA valid file identifier for the MP4 file
    titleStringOptional. Title for the result
    captionStringOptional. Caption of the MPEG-4 file to be sent, 0-1024 characters after entities parsing
    parse_modeStringOptional. Mode for parsing entities in the caption. See formatting options for more details.
    caption_entitiesArray of MessageEntityOptional. List of special entities that appear in the caption, which can be specified instead of parse_mode
    reply_markupInlineKeyboardMarkupOptional. Inline keyboard attached to the message
    input_message_contentInputMessageContentOptional. Content of the message to be sent instead of the video animation
    +

    InlineQueryResultCachedSticker

    +

    Represents a link to a sticker stored on the Telegram servers. By default, this sticker will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the sticker.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    typeStringType of the result, must be sticker
    idStringUnique identifier for this result, 1-64 bytes
    sticker_file_idStringA valid file identifier of the sticker
    reply_markupInlineKeyboardMarkupOptional. Inline keyboard attached to the message
    input_message_contentInputMessageContentOptional. Content of the message to be sent instead of the sticker
    +

    Note: This will only work in Telegram versions released after 9 April, 2016 for static stickers and after 06 July, 2019 for animated stickers. Older clients will ignore them.

    +

    InlineQueryResultCachedDocument

    +

    Represents a link to a file stored on the Telegram servers. By default, this file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the file.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    typeStringType of the result, must be document
    idStringUnique identifier for this result, 1-64 bytes
    titleStringTitle for the result
    document_file_idStringA valid file identifier for the file
    descriptionStringOptional. Short description of the result
    captionStringOptional. Caption of the document to be sent, 0-1024 characters after entities parsing
    parse_modeStringOptional. Mode for parsing entities in the document caption. See formatting options for more details.
    caption_entitiesArray of MessageEntityOptional. List of special entities that appear in the caption, which can be specified instead of parse_mode
    reply_markupInlineKeyboardMarkupOptional. Inline keyboard attached to the message
    input_message_contentInputMessageContentOptional. Content of the message to be sent instead of the file
    +

    Note: This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them.

    +

    InlineQueryResultCachedVideo

    +

    Represents a link to a video file stored on the Telegram servers. By default, this video file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the video.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    typeStringType of the result, must be video
    idStringUnique identifier for this result, 1-64 bytes
    video_file_idStringA valid file identifier for the video file
    titleStringTitle for the result
    descriptionStringOptional. Short description of the result
    captionStringOptional. Caption of the video to be sent, 0-1024 characters after entities parsing
    parse_modeStringOptional. Mode for parsing entities in the video caption. See formatting options for more details.
    caption_entitiesArray of MessageEntityOptional. List of special entities that appear in the caption, which can be specified instead of parse_mode
    reply_markupInlineKeyboardMarkupOptional. Inline keyboard attached to the message
    input_message_contentInputMessageContentOptional. Content of the message to be sent instead of the video
    +

    InlineQueryResultCachedVoice

    +

    Represents a link to a voice message stored on the Telegram servers. By default, this voice message will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the voice message.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    typeStringType of the result, must be voice
    idStringUnique identifier for this result, 1-64 bytes
    voice_file_idStringA valid file identifier for the voice message
    titleStringVoice message title
    captionStringOptional. Caption, 0-1024 characters after entities parsing
    parse_modeStringOptional. Mode for parsing entities in the voice message caption. See formatting options for more details.
    caption_entitiesArray of MessageEntityOptional. List of special entities that appear in the caption, which can be specified instead of parse_mode
    reply_markupInlineKeyboardMarkupOptional. Inline keyboard attached to the message
    input_message_contentInputMessageContentOptional. Content of the message to be sent instead of the voice message
    +

    Note: This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them.

    +

    InlineQueryResultCachedAudio

    +

    Represents a link to an MP3 audio file stored on the Telegram servers. By default, this audio file will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the audio.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    typeStringType of the result, must be audio
    idStringUnique identifier for this result, 1-64 bytes
    audio_file_idStringA valid file identifier for the audio file
    captionStringOptional. Caption, 0-1024 characters after entities parsing
    parse_modeStringOptional. Mode for parsing entities in the audio caption. See formatting options for more details.
    caption_entitiesArray of MessageEntityOptional. List of special entities that appear in the caption, which can be specified instead of parse_mode
    reply_markupInlineKeyboardMarkupOptional. Inline keyboard attached to the message
    input_message_contentInputMessageContentOptional. Content of the message to be sent instead of the audio
    +

    Note: This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them.

    +

    InputMessageContent

    +

    This object represents the content of a message to be sent as a result of an inline query. Telegram clients currently support the following 5 types:

    + +

    InputTextMessageContent

    +

    Represents the content of a text message to be sent as the result of an inline query.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    message_textStringText of the message to be sent, 1-4096 characters
    parse_modeStringOptional. Mode for parsing entities in the message text. See formatting options for more details.
    entitiesArray of MessageEntityOptional. List of special entities that appear in message text, which can be specified instead of parse_mode
    disable_web_page_previewBooleanOptional. Disables link previews for links in the sent message
    +

    InputLocationMessageContent

    +

    Represents the content of a location message to be sent as the result of an inline query.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    latitudeFloatLatitude of the location in degrees
    longitudeFloatLongitude of the location in degrees
    horizontal_accuracyFloat numberOptional. The radius of uncertainty for the location, measured in meters; 0-1500
    live_periodIntegerOptional. Period in seconds for which the location can be updated, should be between 60 and 86400.
    headingIntegerOptional. For live locations, a direction in which the user is moving, in degrees. Must be between 1 and 360 if specified.
    proximity_alert_radiusIntegerOptional. For live locations, a maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified.
    +

    InputVenueMessageContent

    +

    Represents the content of a venue message to be sent as the result of an inline query.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    latitudeFloatLatitude of the venue in degrees
    longitudeFloatLongitude of the venue in degrees
    titleStringName of the venue
    addressStringAddress of the venue
    foursquare_idStringOptional. Foursquare identifier of the venue, if known
    foursquare_typeStringOptional. Foursquare type of the venue, if known. (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.)
    google_place_idStringOptional. Google Places identifier of the venue
    google_place_typeStringOptional. Google Places type of the venue. (See supported types.)
    +

    InputContactMessageContent

    +

    Represents the content of a contact message to be sent as the result of an inline query.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    phone_numberStringContact's phone number
    first_nameStringContact's first name
    last_nameStringOptional. Contact's last name
    vcardStringOptional. Additional data about the contact in the form of a vCard, 0-2048 bytes
    +

    InputInvoiceMessageContent

    +

    Represents the content of an invoice message to be sent as the result of an inline query.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    titleStringProduct name, 1-32 characters
    descriptionStringProduct description, 1-255 characters
    payloadStringBot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes.
    provider_tokenStringPayment provider token, obtained via Botfather
    currencyStringThree-letter ISO 4217 currency code, see more on currencies
    pricesArray of LabeledPricePrice breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.)
    max_tip_amountIntegerOptional. The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass max_tip_amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0
    suggested_tip_amountsArray of IntegerOptional. A JSON-serialized array of suggested amounts of tip in the smallest units of the currency (integer, not float/double). At most 4 suggested tip amounts can be specified. The suggested tip amounts must be positive, passed in a strictly increased order and must not exceed max_tip_amount.
    provider_dataStringOptional. A JSON-serialized object for data about the invoice, which will be shared with the payment provider. A detailed description of the required fields should be provided by the payment provider.
    photo_urlStringOptional. URL of the product photo for the invoice. Can be a photo of the goods or a marketing image for a service. People like it better when they see what they are paying for.
    photo_sizeIntegerOptional. Photo size
    photo_widthIntegerOptional. Photo width
    photo_heightIntegerOptional. Photo height
    need_nameBooleanOptional. Pass True, if you require the user's full name to complete the order
    need_phone_numberBooleanOptional. Pass True, if you require the user's phone number to complete the order
    need_emailBooleanOptional. Pass True, if you require the user's email address to complete the order
    need_shipping_addressBooleanOptional. Pass True, if you require the user's shipping address to complete the order
    send_phone_number_to_providerBooleanOptional. Pass True, if user's phone number should be sent to provider
    send_email_to_providerBooleanOptional. Pass True, if user's email address should be sent to provider
    is_flexibleBooleanOptional. Pass True, if the final price depends on the shipping method
    +

    ChosenInlineResult

    +

    Represents a result of an inline query that was chosen by the user and sent to their chat partner.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    result_idStringThe unique identifier for the result that was chosen
    fromUserThe user that chose the result
    locationLocationOptional. Sender location, only for bots that require user location
    inline_message_idStringOptional. Identifier of the sent inline message. Available only if there is an inline keyboard attached to the message. Will be also received in callback queries and can be used to edit the message.
    queryStringThe query that was used to obtain the result
    +

    Note: It is necessary to enable inline feedback via @Botfather in order to receive these objects in updates.

    +

    Payments

    +

    Your bot can accept payments from Telegram users. Please see the introduction to payments for more details on the process and how to set up payments for your bot. Please note that users will need Telegram v.4.0 or higher to use payments (released on May 18, 2017).

    +

    sendInvoice

    +

    Use this method to send invoices. On success, the sent Message is returned.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ParameterTypeRequiredDescription
    chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
    titleStringYesProduct name, 1-32 characters
    descriptionStringYesProduct description, 1-255 characters
    payloadStringYesBot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes.
    provider_tokenStringYesPayments provider token, obtained via Botfather
    currencyStringYesThree-letter ISO 4217 currency code, see more on currencies
    pricesArray of LabeledPriceYesPrice breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.)
    max_tip_amountIntegerOptionalThe maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass max_tip_amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0
    suggested_tip_amountsArray of IntegerOptionalA JSON-serialized array of suggested amounts of tips in the smallest units of the currency (integer, not float/double). At most 4 suggested tip amounts can be specified. The suggested tip amounts must be positive, passed in a strictly increased order and must not exceed max_tip_amount.
    start_parameterStringOptionalUnique deep-linking parameter. If left empty, forwarded copies of the sent message will have a Pay button, allowing multiple users to pay directly from the forwarded message, using the same invoice. If non-empty, forwarded copies of the sent message will have a URL button with a deep link to the bot (instead of a Pay button), with the value used as the start parameter
    provider_dataStringOptionalA JSON-serialized data about the invoice, which will be shared with the payment provider. A detailed description of required fields should be provided by the payment provider.
    photo_urlStringOptionalURL of the product photo for the invoice. Can be a photo of the goods or a marketing image for a service. People like it better when they see what they are paying for.
    photo_sizeIntegerOptionalPhoto size
    photo_widthIntegerOptionalPhoto width
    photo_heightIntegerOptionalPhoto height
    need_nameBooleanOptionalPass True, if you require the user's full name to complete the order
    need_phone_numberBooleanOptionalPass True, if you require the user's phone number to complete the order
    need_emailBooleanOptionalPass True, if you require the user's email address to complete the order
    need_shipping_addressBooleanOptionalPass True, if you require the user's shipping address to complete the order
    send_phone_number_to_providerBooleanOptionalPass True, if user's phone number should be sent to provider
    send_email_to_providerBooleanOptionalPass True, if user's email address should be sent to provider
    is_flexibleBooleanOptionalPass True, if the final price depends on the shipping method
    disable_notificationBooleanOptionalSends the message silently. Users will receive a notification with no sound.
    protect_contentBooleanOptionalProtects the contents of the sent message from forwarding and saving
    reply_to_message_idIntegerOptionalIf the message is a reply, ID of the original message
    allow_sending_without_replyBooleanOptionalPass True, if the message should be sent even if the specified replied-to message is not found
    reply_markupInlineKeyboardMarkupOptionalA JSON-serialized object for an inline keyboard. If empty, one 'Pay total price' button will be shown. If not empty, the first button must be a Pay button.
    +

    answerShippingQuery

    +

    If you sent an invoice requesting a shipping address and the parameter is_flexible was specified, the Bot API will send an Update with a shipping_query field to the bot. Use this method to reply to shipping queries. On success, True is returned.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ParameterTypeRequiredDescription
    shipping_query_idStringYesUnique identifier for the query to be answered
    okBooleanYesSpecify True if delivery to the specified address is possible and False if there are any problems (for example, if delivery to the specified address is not possible)
    shipping_optionsArray of ShippingOptionOptionalRequired if ok is True. A JSON-serialized array of available shipping options.
    error_messageStringOptionalRequired if ok is False. Error message in human readable form that explains why it is impossible to complete the order (e.g. "Sorry, delivery to your desired address is unavailable'). Telegram will display this message to the user.
    +

    answerPreCheckoutQuery

    +

    Once the user has confirmed their payment and shipping details, the Bot API sends the final confirmation in the form of an Update with the field pre_checkout_query. Use this method to respond to such pre-checkout queries. On success, True is returned. Note: The Bot API must receive an answer within 10 seconds after the pre-checkout query was sent.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ParameterTypeRequiredDescription
    pre_checkout_query_idStringYesUnique identifier for the query to be answered
    okBooleanYesSpecify True if everything is alright (goods are available, etc.) and the bot is ready to proceed with the order. Use False if there are any problems.
    error_messageStringOptionalRequired if ok is False. Error message in human readable form that explains the reason for failure to proceed with the checkout (e.g. "Sorry, somebody just bought the last of our amazing black T-shirts while you were busy filling out your payment details. Please choose a different color or garment!"). Telegram will display this message to the user.
    +

    LabeledPrice

    +

    This object represents a portion of the price for goods or services.

    + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    labelStringPortion label
    amountIntegerPrice of the product in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies).
    +

    Invoice

    +

    This object contains basic information about an invoice.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    titleStringProduct name
    descriptionStringProduct description
    start_parameterStringUnique bot deep-linking parameter that can be used to generate this invoice
    currencyStringThree-letter ISO 4217 currency code
    total_amountIntegerTotal price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies).
    +

    ShippingAddress

    +

    This object represents a shipping address.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    country_codeStringISO 3166-1 alpha-2 country code
    stateStringState, if applicable
    cityStringCity
    street_line1StringFirst line for the address
    street_line2StringSecond line for the address
    post_codeStringAddress post code
    +

    OrderInfo

    +

    This object represents information about an order.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    nameStringOptional. User name
    phone_numberStringOptional. User's phone number
    emailStringOptional. User email
    shipping_addressShippingAddressOptional. User shipping address
    +

    ShippingOption

    +

    This object represents one shipping option.

    + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    idStringShipping option identifier
    titleStringOption title
    pricesArray of LabeledPriceList of price portions
    +

    SuccessfulPayment

    +

    This object contains basic information about a successful payment.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    currencyStringThree-letter ISO 4217 currency code
    total_amountIntegerTotal price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies).
    invoice_payloadStringBot specified invoice payload
    shipping_option_idStringOptional. Identifier of the shipping option chosen by the user
    order_infoOrderInfoOptional. Order info provided by the user
    telegram_payment_charge_idStringTelegram payment identifier
    provider_payment_charge_idStringProvider payment identifier
    +

    ShippingQuery

    +

    This object contains information about an incoming shipping query.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    idStringUnique query identifier
    fromUserUser who sent the query
    invoice_payloadStringBot specified invoice payload
    shipping_addressShippingAddressUser specified shipping address
    +

    PreCheckoutQuery

    +

    This object contains information about an incoming pre-checkout query.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    idStringUnique query identifier
    fromUserUser who sent the query
    currencyStringThree-letter ISO 4217 currency code
    total_amountIntegerTotal price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies).
    invoice_payloadStringBot specified invoice payload
    shipping_option_idStringOptional. Identifier of the shipping option chosen by the user
    order_infoOrderInfoOptional. Order info provided by the user
    +

    Telegram Passport

    +

    Telegram Passport is a unified authorization method for services that require personal identification. Users can upload their documents once, then instantly share their data with services that require real-world ID (finance, ICOs, etc.). Please see the manual for details.

    +

    PassportData

    +

    Contains information about Telegram Passport data shared with the bot by the user.

    + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    dataArray of EncryptedPassportElementArray with information about documents and other Telegram Passport elements that was shared with the bot
    credentialsEncryptedCredentialsEncrypted credentials required to decrypt the data
    +

    PassportFile

    +

    This object represents a file uploaded to Telegram Passport. Currently all Telegram Passport files are in JPEG format when decrypted and don't exceed 10MB.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    file_idStringIdentifier for this file, which can be used to download or reuse the file
    file_unique_idStringUnique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
    file_sizeIntegerFile size in bytes
    file_dateIntegerUnix time when the file was uploaded
    +

    EncryptedPassportElement

    +

    Contains information about documents or other Telegram Passport elements shared with the bot by the user.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    typeStringElement type. One of “personal_details”, “passport”, “driver_license”, “identity_card”, “internal_passport”, “address”, “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration”, “temporary_registration”, “phone_number”, “email”.
    dataStringOptional. Base64-encoded encrypted Telegram Passport element data provided by the user, available for “personal_details”, “passport”, “driver_license”, “identity_card”, “internal_passport” and “address” types. Can be decrypted and verified using the accompanying EncryptedCredentials.
    phone_numberStringOptional. User's verified phone number, available only for “phone_number” type
    emailStringOptional. User's verified email address, available only for “email” type
    filesArray of PassportFileOptional. Array of encrypted files with documents provided by the user, available for “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration” and “temporary_registration” types. Files can be decrypted and verified using the accompanying EncryptedCredentials.
    front_sidePassportFileOptional. Encrypted file with the front side of the document, provided by the user. Available for “passport”, “driver_license”, “identity_card” and “internal_passport”. The file can be decrypted and verified using the accompanying EncryptedCredentials.
    reverse_sidePassportFileOptional. Encrypted file with the reverse side of the document, provided by the user. Available for “driver_license” and “identity_card”. The file can be decrypted and verified using the accompanying EncryptedCredentials.
    selfiePassportFileOptional. Encrypted file with the selfie of the user holding a document, provided by the user; available for “passport”, “driver_license”, “identity_card” and “internal_passport”. The file can be decrypted and verified using the accompanying EncryptedCredentials.
    translationArray of PassportFileOptional. Array of encrypted files with translated versions of documents provided by the user. Available if requested for “passport”, “driver_license”, “identity_card”, “internal_passport”, “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration” and “temporary_registration” types. Files can be decrypted and verified using the accompanying EncryptedCredentials.
    hashStringBase64-encoded element hash for using in PassportElementErrorUnspecified
    +

    EncryptedCredentials

    +

    Contains data required for decrypting and authenticating EncryptedPassportElement. See the Telegram Passport Documentation for a complete description of the data decryption and authentication processes.

    + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    dataStringBase64-encoded encrypted JSON-serialized data with unique user's payload, data hashes and secrets required for EncryptedPassportElement decryption and authentication
    hashStringBase64-encoded data hash for data authentication
    secretStringBase64-encoded secret, encrypted with the bot's public RSA key, required for data decryption
    +

    setPassportDataErrors

    +

    Informs a user that some of the Telegram Passport elements they provided contains errors. The user will not be able to re-submit their Passport to you until the errors are fixed (the contents of the field for which you returned the error must change). Returns True on success.

    +

    Use this if the data submitted by the user doesn't satisfy the standards your service requires for any reason. For example, if a birthday date seems invalid, a submitted document is blurry, a scan shows evidence of tampering, etc. Supply some details in the error message to make sure the user knows how to correct the issues.

    + + + + + + + + + + + + + + + + + + + + + + + +
    ParameterTypeRequiredDescription
    user_idIntegerYesUser identifier
    errorsArray of PassportElementErrorYesA JSON-serialized array describing the errors
    +

    PassportElementError

    +

    This object represents an error in the Telegram Passport element which was submitted that should be resolved by the user. It should be one of:

    + +

    PassportElementErrorDataField

    +

    Represents an issue in one of the data fields that was provided by the user. The error is considered resolved when the field's value changes.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    sourceStringError source, must be data
    typeStringThe section of the user's Telegram Passport which has the error, one of “personal_details”, “passport”, “driver_license”, “identity_card”, “internal_passport”, “address”
    field_nameStringName of the data field which has the error
    data_hashStringBase64-encoded data hash
    messageStringError message
    +

    PassportElementErrorFrontSide

    +

    Represents an issue with the front side of a document. The error is considered resolved when the file with the front side of the document changes.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    sourceStringError source, must be front_side
    typeStringThe section of the user's Telegram Passport which has the issue, one of “passport”, “driver_license”, “identity_card”, “internal_passport”
    file_hashStringBase64-encoded hash of the file with the front side of the document
    messageStringError message
    +

    PassportElementErrorReverseSide

    +

    Represents an issue with the reverse side of a document. The error is considered resolved when the file with reverse side of the document changes.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    sourceStringError source, must be reverse_side
    typeStringThe section of the user's Telegram Passport which has the issue, one of “driver_license”, “identity_card”
    file_hashStringBase64-encoded hash of the file with the reverse side of the document
    messageStringError message
    +

    PassportElementErrorSelfie

    +

    Represents an issue with the selfie with a document. The error is considered resolved when the file with the selfie changes.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    sourceStringError source, must be selfie
    typeStringThe section of the user's Telegram Passport which has the issue, one of “passport”, “driver_license”, “identity_card”, “internal_passport”
    file_hashStringBase64-encoded hash of the file with the selfie
    messageStringError message
    +

    PassportElementErrorFile

    +

    Represents an issue with a document scan. The error is considered resolved when the file with the document scan changes.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    sourceStringError source, must be file
    typeStringThe section of the user's Telegram Passport which has the issue, one of “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration”, “temporary_registration”
    file_hashStringBase64-encoded file hash
    messageStringError message
    +

    PassportElementErrorFiles

    +

    Represents an issue with a list of scans. The error is considered resolved when the list of files containing the scans changes.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    sourceStringError source, must be files
    typeStringThe section of the user's Telegram Passport which has the issue, one of “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration”, “temporary_registration”
    file_hashesArray of StringList of base64-encoded file hashes
    messageStringError message
    +

    PassportElementErrorTranslationFile

    +

    Represents an issue with one of the files that constitute the translation of a document. The error is considered resolved when the file changes.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    sourceStringError source, must be translation_file
    typeStringType of element of the user's Telegram Passport which has the issue, one of “passport”, “driver_license”, “identity_card”, “internal_passport”, “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration”, “temporary_registration”
    file_hashStringBase64-encoded file hash
    messageStringError message
    +

    PassportElementErrorTranslationFiles

    +

    Represents an issue with the translated version of a document. The error is considered resolved when a file with the document translation change.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    sourceStringError source, must be translation_files
    typeStringType of element of the user's Telegram Passport which has the issue, one of “passport”, “driver_license”, “identity_card”, “internal_passport”, “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration”, “temporary_registration”
    file_hashesArray of StringList of base64-encoded file hashes
    messageStringError message
    +

    PassportElementErrorUnspecified

    +

    Represents an issue in an unspecified place. The error is considered resolved when new data is added.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    sourceStringError source, must be unspecified
    typeStringType of element of the user's Telegram Passport which has the issue
    element_hashStringBase64-encoded element hash
    messageStringError message
    +

    Games

    +

    Your bot can offer users HTML5 games to play solo or to compete against each other in groups and one-on-one chats. Create games via @BotFather using the /newgame command. Please note that this kind of power requires responsibility: you will need to accept the terms for each game that your bots will be offering.

    +
      +
    • Games are a new type of content on Telegram, represented by the Game and InlineQueryResultGame objects.
    • +
    • Once you've created a game via BotFather, you can send games to chats as regular messages using the sendGame method, or use inline mode with InlineQueryResultGame.
    • +
    • If you send the game message without any buttons, it will automatically have a 'Play GameName' button. When this button is pressed, your bot gets a CallbackQuery with the game_short_name of the requested game. You provide the correct URL for this particular user and the app opens the game in the in-app browser.
    • +
    • You can manually add multiple buttons to your game message. Please note that the first button in the first row must always launch the game, using the field callback_game in InlineKeyboardButton. You can add extra buttons according to taste: e.g., for a description of the rules, or to open the game's official community.
    • +
    • To make your game more attractive, you can upload a GIF animation that demostrates the game to the users via BotFather (see Lumberjack for example).
    • +
    • A game message will also display high scores for the current chat. Use setGameScore to post high scores to the chat with the game, add the edit_message parameter to automatically update the message with the current scoreboard.
    • +
    • Use getGameHighScores to get data for in-game high score tables.
    • +
    • You can also add an extra sharing button for users to share their best score to different chats.
    • +
    • For examples of what can be done using this new stuff, check the @gamebot and @gamee bots.
    • +
    +

    sendGame

    +

    Use this method to send a game. On success, the sent Message is returned.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ParameterTypeRequiredDescription
    chat_idIntegerYesUnique identifier for the target chat
    game_short_nameStringYesShort name of the game, serves as the unique identifier for the game. Set up your games via Botfather.
    disable_notificationBooleanOptionalSends the message silently. Users will receive a notification with no sound.
    protect_contentBooleanOptionalProtects the contents of the sent message from forwarding and saving
    reply_to_message_idIntegerOptionalIf the message is a reply, ID of the original message
    allow_sending_without_replyBooleanOptionalPass True, if the message should be sent even if the specified replied-to message is not found
    reply_markupInlineKeyboardMarkupOptionalA JSON-serialized object for an inline keyboard. If empty, one 'Play game_title' button will be shown. If not empty, the first button must launch the game.
    +

    Game

    +

    This object represents a game. Use BotFather to create and edit games, their short names will act as unique identifiers.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    titleStringTitle of the game
    descriptionStringDescription of the game
    photoArray of PhotoSizePhoto that will be displayed in the game message in chats.
    textStringOptional. Brief description of the game or high scores included in the game message. Can be automatically edited to include current high scores for the game when the bot calls setGameScore, or manually edited using editMessageText. 0-4096 characters.
    text_entitiesArray of MessageEntityOptional. Special entities that appear in text, such as usernames, URLs, bot commands, etc.
    animationAnimationOptional. Animation that will be displayed in the game message in chats. Upload via BotFather
    +

    CallbackGame

    +

    A placeholder, currently holds no information. Use BotFather to set up your game.

    +

    setGameScore

    +

    Use this method to set the score of the specified user in a game message. On success, if the message is not an inline message, the Message is returned, otherwise True is returned. Returns an error, if the new score is not greater than the user's current score in the chat and force is False.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ParameterTypeRequiredDescription
    user_idIntegerYesUser identifier
    scoreIntegerYesNew score, must be non-negative
    forceBooleanOptionalPass True, if the high score is allowed to decrease. This can be useful when fixing mistakes or banning cheaters
    disable_edit_messageBooleanOptionalPass True, if the game message should not be automatically edited to include the current scoreboard
    chat_idIntegerOptionalRequired if inline_message_id is not specified. Unique identifier for the target chat
    message_idIntegerOptionalRequired if inline_message_id is not specified. Identifier of the sent message
    inline_message_idStringOptionalRequired if chat_id and message_id are not specified. Identifier of the inline message
    +

    getGameHighScores

    +

    Use this method to get data for high score tables. Will return the score of the specified user and several of their neighbors in a game. On success, returns an Array of GameHighScore objects.

    +
    +

    This method will currently return scores for the target user, plus two of their closest neighbors on each side. Will also return the top three users if the user and his neighbors are not among them. Please note that this behavior is subject to change.

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ParameterTypeRequiredDescription
    user_idIntegerYesTarget user id
    chat_idIntegerOptionalRequired if inline_message_id is not specified. Unique identifier for the target chat
    message_idIntegerOptionalRequired if inline_message_id is not specified. Identifier of the sent message
    inline_message_idStringOptionalRequired if chat_id and message_id are not specified. Identifier of the inline message
    +

    GameHighScore

    +

    This object represents one row of the high scores table for a game.

    + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    positionIntegerPosition in high score table for the game
    userUserUser
    scoreIntegerScore
    +
    +

    And that's about all we've got for now.
    If you've got any questions, please check out our Bot FAQ »

    +
    + +
    + +
    +
    + +
    + + + + + + + + diff --git a/data/core.telegram.org/bots/inline.html b/data/core.telegram.org/bots/inline.html new file mode 100644 index 0000000000..3bf2192115 --- /dev/null +++ b/data/core.telegram.org/bots/inline.html @@ -0,0 +1,182 @@ + + + + + Inline Bots + + + + + + + + + + + + + +
    + +
    +
    +
    + +

    Inline Bots

    + +
    + +
    + +
    + +

    Beyond sending commands in private messages or groups, users can interact with your bot via inline queries. If inline queries are enabled, users can call your bot by typing its username and a query in the text input field in any chat. The query is sent to your bot in an update. This way, people can request content from your bot in any of their chats, groups, or channels without sending any messages at all.

    +
    +
    +
    + + +

    To enable this option, send the /setinline command to @BotFather and provide the placeholder text that the user will see in the input field after typing your bot’s name.

    +
    +

    See the Bot API Manual for the relevant methods and objects.

    +
    +

    Inline results

    +

    Inline bots support all types of content available in Telegram (20 in all). They are capable of sending stickers, videos, music, locations, documents and more.

    +
    +

    +
    + +

    Clients can display the results with vertical or horizontal scrolling, depending on the type of content:

    +
    + + + + + +
    +
    + +

    As soon as the user taps on an item, it's immediately sent to the recipient, and the input field is cleared.

    +

    Switching inline/PM modes

    +

    Some inline bots can benefit from an initial setup process, like connecting them to an account on an external service (e.g., YouTube). We've added an easy way of switching between the private chat with a bot and whatever chat the user wants to share inline results in.

    +
    +

    +
    + +

    You can display a special ‘Switch to PM’ button above the inline results (or instead of them). This button will open a private chat with the bot and pass a parameter of your choosing, so that you can prompt the user for the relevant setup actions. Once done, you can use an inline keyboard with a switch_inline_query button to send the user back to the original chat.

    +

    Sample bots
    @youtube – Shows a ‘Sign in to YouTube’ button, then suggests personalized results.

    +
    +

    Manual: Switch to PM

    +
    +

    Location-based results

    +

    Inline bots can request location data from their users. Use the /setinlinegeo command with @BotFather to enable this. Your bot will ask the user for permission to access their location whenever they send an inline request.

    +

    Sample bot
    @foursquare – This bot will ask for permission to access the user's location, then provide geo-targeted results.

    +

    Spreading virally

    +

    Messages sent with the help of your bot will show its username next to the sender's name.

    +
    + + + + + +

    + +

    When a user taps on the bot username in the message header, the mention is automatically inserted into the input field. Entering the @ symbol in the input field brings up a list of suggestions, featuring recently used inline bots.

    +

    Collecting feedback

    +

    To know which of the provided results your users are sending to their chat partners, send @Botfather the /setinlinefeedback command. With this enabled, you will receive updates on the results chosen by your users.

    +

    Please note that this can create load issues for popular bots – you may receive more results than actual requests due to caching (see the cache_time parameter in answerInlineQuery). For these cases, we recommend adjusting the probability setting to receive 1/10, 1/100 or 1/1000 of the results.

    +

    Inline bot samples

    +

    Here are some sample inline bots, in case you’re curious to see one in action. Try any of these:
    @gif – GIF search
    @vid – Video search
    @pic – Yandex image search
    @bing – Bing image search
    @wiki – Wikipedia search
    @imdb – IMDB search
    @bold – Make bold, italic or fixed sys text

    +

    NEW
    @youtube - Connect your account for personalized results
    @music - Search and send classical music
    @foursquare – Find and send venue addresses
    @sticker – Find and send stickers based on emoji

    +
    + +
    + +
    +
    + +
    + + + + + + + + diff --git a/data/core.telegram.org/constructor/account.authorizationForm b/data/core.telegram.org/constructor/account.authorizationForm deleted file mode 100644 index f12161fe65..0000000000 --- a/data/core.telegram.org/constructor/account.authorizationForm +++ /dev/null @@ -1,174 +0,0 @@ - - - - - account.authorizationForm - - - - - - - - - - - - - -
    - -
    -
    -
    - -

    account.authorizationForm

    - -

    Telegram Passport authorization form

    -

    - -
    -
    account.authorizationForm#ad2e1cd8 flags:# required_types:Vector<SecureRequiredType> values:Vector<SecureValue> errors:Vector<SecureValueError> users:Vector<User> privacy_policy_url:flags.0?string = account.AuthorizationForm;

    -

    Parameters

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeDescription
    flags#Flags, see TL conditional fields
    required_typesVector<SecureRequiredType>Required Telegram Passport documents
    valuesVector<SecureValue>Already submitted Telegram Passport documents
    errorsVector<SecureValueError>Telegram Passport errors
    usersVector<User>Info about the bot to which the form will be submitted
    privacy_policy_urlflags.0?stringURL of the service's privacy policy
    -

    Type

    -

    account.AuthorizationForm

    -

    Related pages

    -

    Telegram Passport Manual

    - -
    - -
    -
    - -
    - - - - - - diff --git a/data/core.telegram.org/constructor/auth.codeTypeCall b/data/core.telegram.org/constructor/auth.codeTypeCall deleted file mode 100644 index bceaa717e7..0000000000 --- a/data/core.telegram.org/constructor/auth.codeTypeCall +++ /dev/null @@ -1,132 +0,0 @@ - - - - - auth.codeTypeCall - - - - - - - - - - - - - -
    - -
    -
    -
    - -

    auth.codeTypeCall

    - -

    Type of verification code that will be sent next if you call the resendCode method: SMS code

    -

    - -
    -
    auth.codeTypeCall#741cd3e3 = auth.CodeType;

    -

    Parameters

    -

    This constructor does not require any parameters.

    -

    Type

    -

    auth.CodeType

    - -
    - -
    -
    - -
    - - - - - - diff --git a/data/core.telegram.org/constructor/auth.passwordRecovery b/data/core.telegram.org/constructor/auth.passwordRecovery deleted file mode 100644 index be4437c0a7..0000000000 --- a/data/core.telegram.org/constructor/auth.passwordRecovery +++ /dev/null @@ -1,152 +0,0 @@ - - - - - auth.passwordRecovery - - - - - - - - - - - - - -
    - -
    -
    -
    - -

    auth.passwordRecovery

    - -

    Recovery info of a 2FA password, only for accounts with a recovery email configured.

    -

    - -
    -
    auth.passwordRecovery#137948a5 email_pattern:string = auth.PasswordRecovery;

    -

    Parameters

    - - - - - - - - - - - - - - - -
    NameTypeDescription
    email_patternstringThe email to which the recovery code was sent must match this pattern.
    -

    Type

    -

    auth.PasswordRecovery

    -

    Related pages

    -

    Pattern matching

    -

    Some methods require the client to verify if the data obtained from an external source matches a certain pattern.

    -

    Two-factor authentication

    -

    How to login to a user's account if they have enabled 2FA, how to change password.

    - -
    - -
    -
    - -
    - - - - - - diff --git a/data/core.telegram.org/constructor/baseThemeTinted.html b/data/core.telegram.org/constructor/baseThemeTinted.html deleted file mode 100644 index bc4dea5385..0000000000 --- a/data/core.telegram.org/constructor/baseThemeTinted.html +++ /dev/null @@ -1,132 +0,0 @@ - - - - - baseThemeTinted - - - - - - - - - - - - - -
    - -
    -
    -
    - -

    baseThemeTinted

    - -

    Tinted theme

    -

    - -
    -
    baseThemeTinted#6d5f77ee = BaseTheme;

    -

    Parameters

    -

    This constructor does not require any parameters.

    -

    Type

    -

    BaseTheme

    - -
    - -
    -
    - -
    - - - - - - diff --git a/data/core.telegram.org/constructor/boolTrue.html b/data/core.telegram.org/constructor/boolTrue.html deleted file mode 100644 index 76b69b97b1..0000000000 --- a/data/core.telegram.org/constructor/boolTrue.html +++ /dev/null @@ -1,132 +0,0 @@ - - - - - boolTrue - - - - - - - - - - - - - -
    - -
    -
    -
    - -

    boolTrue

    - -

    The constructor can be interpreted as a booleantrue value.

    -

    - -
    -
    boolTrue#997275b5 = Bool;

    -

    Parameters

    -

    This constructor does not require any parameters.

    -

    Type

    -

    Bool

    - -
    - -
    -
    - -
    - - - - - - diff --git a/data/core.telegram.org/constructor/botCommandScopePeerAdmins.html b/data/core.telegram.org/constructor/botCommandScopePeerAdmins.html deleted file mode 100644 index 09ed3db8d4..0000000000 --- a/data/core.telegram.org/constructor/botCommandScopePeerAdmins.html +++ /dev/null @@ -1,150 +0,0 @@ - - - - - botCommandScopePeerAdmins - - - - - - - - - - - - - -
    - -
    -
    -
    - -

    botCommandScopePeerAdmins

    - -

    The specified bot commands will be valid for all admins of the specified group or supergroup.

    -

    - -
    -
    botCommandScopePeerAdmins#3fd863d1 peer:InputPeer = BotCommandScope;

    -

    Parameters

    - - - - - - - - - - - - - - - -
    NameTypeDescription
    peerInputPeerThe chat
    -

    Type

    -

    BotCommandScope

    -

    Related pages

    -

    Channels

    -

    How to handle channels, supergroups, groups, and what's the difference between them.

    - -
    - -
    -
    - -
    - - - - - - diff --git a/data/core.telegram.org/constructor/channel.html b/data/core.telegram.org/constructor/channel.html deleted file mode 100644 index 73ec97d243..0000000000 --- a/data/core.telegram.org/constructor/channel.html +++ /dev/null @@ -1,289 +0,0 @@ - - - - - channel - - - - - - - - - - - - - -
    - -
    -
    -
    - -

    channel

    - -

    Channel/supergroup info

    -

    - -
    -
    channel#8261ac61 flags:# creator:flags.0?true left:flags.2?true broadcast:flags.5?true verified:flags.7?true megagroup:flags.8?true restricted:flags.9?true signatures:flags.11?true min:flags.12?true scam:flags.19?true has_link:flags.20?true has_geo:flags.21?true slowmode_enabled:flags.22?true call_active:flags.23?true call_not_empty:flags.24?true fake:flags.25?true gigagroup:flags.26?true noforwards:flags.27?true id:long access_hash:flags.13?long title:string username:flags.6?string photo:ChatPhoto date:int restriction_reason:flags.9?Vector<RestrictionReason> admin_rights:flags.14?ChatAdminRights banned_rights:flags.15?ChatBannedRights default_banned_rights:flags.18?ChatBannedRights participants_count:flags.17?int = Chat;

    -

    Parameters

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeDescription
    flags#Flags, see TL conditional fields
    creatorflags.0?trueWhether the current user is the creator of this channel
    leftflags.2?trueWhether the current user has left this channel
    broadcastflags.5?trueIs this a channel?
    verifiedflags.7?trueIs this channel verified by telegram?
    megagroupflags.8?trueIs this a supergroup?
    restrictedflags.9?trueWhether viewing/writing in this channel for a reason (see restriction_reason
    signaturesflags.11?trueWhether signatures are enabled (channels)
    minflags.12?trueSee min
    scamflags.19?trueThis channel/supergroup is probably a scam
    has_linkflags.20?trueWhether this channel has a private join link
    has_geoflags.21?trueWhether this chanel has a geoposition
    slowmode_enabledflags.22?trueWhether slow mode is enabled for groups to prevent flood in chat
    call_activeflags.23?trueWhether a group call or livestream is currently active
    call_not_emptyflags.24?trueWhether there's anyone in the group call or livestream
    fakeflags.25?trueIf set, this supergroup/channel was reported by many users as a fake or scam: be careful when interacting with it.
    gigagroupflags.26?trueWhether this supergroup is a gigagroup
    idlongID of the channel
    access_hashflags.13?longAccess hash
    titlestringTitle
    usernameflags.6?stringUsername
    photoChatPhotoProfile photo
    dateintDate when the user joined the supergroup/channel, or if the user isn't a member, its creation date
    restriction_reasonflags.9?Vector<RestrictionReason>Contains the reason why access to this channel must be restricted.
    admin_rightsflags.14?ChatAdminRightsAdmin rights of the user in this channel (see rights)
    banned_rightsflags.15?ChatBannedRightsBanned rights of the user in this channel (see rights)
    default_banned_rightsflags.18?ChatBannedRightsDefault chat rights (see rights)
    participants_countflags.17?intParticipant count
    -

    Type

    -

    Chat

    -

    Related pages

    -

    Min constructors

    -

    In some situations user and channel constructors have reduced set of fields present (although id is always there) and min flag set.

    -

    Channels

    -

    How to handle channels, supergroups, groups, and what's the difference between them.

    -

    Admin, banned, default rights

    -

    How to handle admin permissions, granular bans and global permissions in channels, groups and supergroups.

    - -
    - -
    -
    - -
    - - - - - - diff --git a/data/core.telegram.org/constructor/channelAdminLogEventActionChangeLocation.html b/data/core.telegram.org/constructor/channelAdminLogEventActionChangeLocation.html deleted file mode 100644 index 827058690a..0000000000 --- a/data/core.telegram.org/constructor/channelAdminLogEventActionChangeLocation.html +++ /dev/null @@ -1,152 +0,0 @@ - - - - - channelAdminLogEventActionChangeLocation - - - - - - - - - - - - - -
    - -
    -
    -
    - -

    channelAdminLogEventActionChangeLocation

    - -

    The geogroup location was changed

    -

    - -
    -
    channelAdminLogEventActionChangeLocation#e6b76ae prev_value:ChannelLocation new_value:ChannelLocation = ChannelAdminLogEventAction;

    -

    Parameters

    - - - - - - - - - - - - - - - - - - - - -
    NameTypeDescription
    prev_valueChannelLocationPrevious location
    new_valueChannelLocationNew location
    -

    Type

    -

    ChannelAdminLogEventAction

    - -
    - -
    -
    - -
    - - - - - - diff --git a/data/core.telegram.org/constructor/contacts.contactsNotModified b/data/core.telegram.org/constructor/contacts.contactsNotModified deleted file mode 100644 index bb513a2e67..0000000000 --- a/data/core.telegram.org/constructor/contacts.contactsNotModified +++ /dev/null @@ -1,132 +0,0 @@ - - - - - contacts.contactsNotModified - - - - - - - - - - - - - -
    - -
    -
    -
    - -

    contacts.contactsNotModified

    - -

    Contact list on the server is the same as the list on the client.

    -

    - -
    -
    contacts.contactsNotModified#b74ba9d2 = contacts.Contacts;

    -

    Parameters

    -

    This constructor does not require any parameters.

    -

    Type

    -

    contacts.Contacts

    - -
    - -
    -
    - -
    - - - - - - diff --git a/data/core.telegram.org/constructor/decryptedMessageMediaAudio.html b/data/core.telegram.org/constructor/decryptedMessageMediaAudio.html deleted file mode 100644 index 8bd08c313d..0000000000 --- a/data/core.telegram.org/constructor/decryptedMessageMediaAudio.html +++ /dev/null @@ -1,174 +0,0 @@ - - - - - decryptedMessageMediaAudio - - - - - - - - - - - - - -
    - -
    -
    -
    - -

    decryptedMessageMediaAudio

    - -

    Audio file attached to a secret chat message.

    -

    - -
    -
    ===8===
    -decryptedMessageMediaAudio#6080758f duration:int size:int key:bytes iv:bytes = DecryptedMessageMedia;
    -
    -===17===
    -decryptedMessageMediaAudio#57e0a9cb duration:int mime_type:string size:int key:bytes iv:bytes = DecryptedMessageMedia;

    -

    Parameters

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeDescription
    durationintAudio duration in seconds
    mime_typestringMIME-type of the audio file
    Parameter added in Layer 13.
    sizeintFile size
    keybytesKey to decrypt the attached media file
    ivbytesInitialization vector
    -

    Type

    -

    DecryptedMessageMedia

    -

    Related pages

    -

    Layers

    -

    Below you will find information on schema changes. For more details on the use of layers, see Invoking API methods.

    - -
    - -
    -
    - -
    - - - - - - diff --git a/data/core.telegram.org/constructor/inlineQueryPeerTypePM.html b/data/core.telegram.org/constructor/inlineQueryPeerTypePM.html deleted file mode 100644 index fde1ebb46c..0000000000 --- a/data/core.telegram.org/constructor/inlineQueryPeerTypePM.html +++ /dev/null @@ -1,132 +0,0 @@ - - - - - inlineQueryPeerTypePM - - - - - - - - - - - - - -
    - -
    -
    -
    - -

    inlineQueryPeerTypePM

    - -

    The inline query was sent in a private chat

    -

    - -
    -
    inlineQueryPeerTypePM#833c0fac = InlineQueryPeerType;

    -

    Parameters

    -

    This constructor does not require any parameters.

    -

    Type

    -

    InlineQueryPeerType

    - -
    - -
    -
    - -
    - - - - - - diff --git a/data/core.telegram.org/constructor/inputFileLocation.html b/data/core.telegram.org/constructor/inputFileLocation.html deleted file mode 100644 index 80d6f2e22e..0000000000 --- a/data/core.telegram.org/constructor/inputFileLocation.html +++ /dev/null @@ -1,165 +0,0 @@ - - - - - inputFileLocation - - - - - - - - - - - - - -
    - -
    -
    -
    - -

    inputFileLocation

    - -

    DEPRECATED location of a photo

    -

    - -
    -
    inputFileLocation#dfdaabe1 volume_id:long local_id:int secret:long file_reference:bytes = InputFileLocation;

    -

    Parameters

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeDescription
    volume_idlongServer volume
    local_idintFile identifier
    secretlongCheck sum to access the file
    file_referencebytesFile reference
    -

    Type

    -

    InputFileLocation

    -

    Related pages

    -

    File references

    -

    How to handle file references.

    - -
    - -
    -
    - -
    - - - - - - diff --git a/data/core.telegram.org/constructor/inputKeyboardButtonUrlAuth.html b/data/core.telegram.org/constructor/inputKeyboardButtonUrlAuth.html deleted file mode 100644 index 2de7853f5c..0000000000 --- a/data/core.telegram.org/constructor/inputKeyboardButtonUrlAuth.html +++ /dev/null @@ -1,176 +0,0 @@ - - - - - inputKeyboardButtonUrlAuth - - - - - - - - - - - - - -
    - -
    -
    -
    - -

    inputKeyboardButtonUrlAuth

    - -

    Button to request a user to authorize via URL using Seamless Telegram Login.

    -

    - -
    -
    inputKeyboardButtonUrlAuth#d02e7fd4 flags:# request_write_access:flags.0?true text:string fwd_text:flags.1?string url:string bot:InputUser = KeyboardButton;

    -

    Parameters

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeDescription
    flags#Flags, see TL conditional fields
    request_write_accessflags.0?trueSet this flag to request the permission for your bot to send messages to the user.
    textstringButton text
    fwd_textflags.1?stringNew text of the button in forwarded messages.
    urlstringAn HTTP URL to be opened with user authorization data added to the query string when the button is pressed. If the user refuses to provide authorization data, the original URL without information about the user will be opened. The data added is the same as described in Receiving authorization data.
    NOTE: You must always check the hash of the received data to verify the authentication and the integrity of the data as described in Checking authorization.
    botInputUserUsername of a bot, which will be used for user authorization. See Setting up a bot for more details. If not specified, the current bot's username will be assumed. The url's domain must be the same as the domain linked with the bot. See Linking your domain to the bot for more details.
    -

    Type

    -

    KeyboardButton

    -

    Related pages

    -

    Telegram Login Widget

    -

    messages.acceptUrlAuth

    -

    Use this to accept a Seamless Telegram Login authorization request, for more info click here »

    - -
    - -
    -
    - -
    - - - - - - diff --git a/data/core.telegram.org/constructor/userEmpty.html b/data/core.telegram.org/constructor/inputMediaGeoPoint.html similarity index 91% rename from data/core.telegram.org/constructor/userEmpty.html rename to data/core.telegram.org/constructor/inputMediaGeoPoint.html index 191eeda7c8..5a5dc83319 100644 --- a/data/core.telegram.org/constructor/userEmpty.html +++ b/data/core.telegram.org/constructor/inputMediaGeoPoint.html @@ -2,12 +2,12 @@ - userEmpty + inputMediaGeoPoint - - + + - + @@ -36,10 +36,10 @@
    - -

    userEmpty

    + +

    inputMediaGeoPoint

    -

    Empty constructor, non-existent user.

    +

    Map.

    -
    userEmpty#d3bc4b7a id:long = User;

    +
    inputMediaGeoPoint#f9c44144 geo_point:InputGeoPoint = InputMedia;

    Parameters

    @@ -64,14 +64,14 @@ - - - + + +
    idlongUser identifier or 0geo_pointInputGeoPointGeoPoint

    Type

    -

    User

    +

    InputMedia

    diff --git a/data/core.telegram.org/constructor/privacyValueDisallowContacts.html b/data/core.telegram.org/constructor/inputReportReasonPornography.html similarity index 91% rename from data/core.telegram.org/constructor/privacyValueDisallowContacts.html rename to data/core.telegram.org/constructor/inputReportReasonPornography.html index 40cb335dcd..daa10d7d5c 100644 --- a/data/core.telegram.org/constructor/privacyValueDisallowContacts.html +++ b/data/core.telegram.org/constructor/inputReportReasonPornography.html @@ -2,12 +2,12 @@ - privacyValueDisallowContacts + inputReportReasonPornography - - + + - + @@ -36,10 +36,10 @@
    - -

    privacyValueDisallowContacts

    + +

    inputReportReasonPornography

    -

    Disallow only contacts

    +

    Report for pornography

    -
    privacyValueDisallowContacts#f888fa1a = PrivacyRule;

    +
    inputReportReasonPornography#2e59d922 = ReportReason;

    Parameters

    This constructor does not require any parameters.

    Type

    -

    PrivacyRule

    +

    ReportReason

    diff --git a/data/core.telegram.org/constructor/messageActionInviteToGroupCall.html b/data/core.telegram.org/constructor/messageActionInviteToGroupCall.html deleted file mode 100644 index 84c058c54f..0000000000 --- a/data/core.telegram.org/constructor/messageActionInviteToGroupCall.html +++ /dev/null @@ -1,152 +0,0 @@ - - - - - messageActionInviteToGroupCall - - - - - - - - - - - - - -
    - -
    -
    -
    - -

    messageActionInviteToGroupCall

    - -

    A set of users was invited to the group call

    -

    - -
    -
    messageActionInviteToGroupCall#502f92f7 call:InputGroupCall users:Vector<long> = MessageAction;

    -

    Parameters

    - - - - - - - - - - - - - - - - - - - - -
    NameTypeDescription
    callInputGroupCallThe group call
    usersVector<long>The invited users
    -

    Type

    -

    MessageAction

    - -
    - -
    -
    - -
    - - - - - - diff --git a/data/core.telegram.org/constructor/messageActionPaymentSentMe.html b/data/core.telegram.org/constructor/messageActionPaymentSentMe.html deleted file mode 100644 index ad0a6554e0..0000000000 --- a/data/core.telegram.org/constructor/messageActionPaymentSentMe.html +++ /dev/null @@ -1,179 +0,0 @@ - - - - - messageActionPaymentSentMe - - - - - - - - - - - - - -
    - -
    -
    -
    - -

    messageActionPaymentSentMe

    - -

    A user just sent a payment to me (a bot)

    -

    - -
    -
    messageActionPaymentSentMe#8f31b327 flags:# currency:string total_amount:long payload:bytes info:flags.0?PaymentRequestedInfo shipping_option_id:flags.1?string charge:PaymentCharge = MessageAction;

    -

    Parameters

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeDescription
    flags#Flags, see TL conditional fields
    currencystringThree-letter ISO 4217 currency code
    total_amountlongPrice of the product in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies).
    payloadbytesBot specified invoice payload
    infoflags.0?PaymentRequestedInfoOrder info provided by the user
    shipping_option_idflags.1?stringIdentifier of the shipping option chosen by the user
    chargePaymentChargeProvider payment identifier
    -

    Type

    -

    MessageAction

    -

    Related pages

    -

    Bot Payments API

    - -
    - -
    -
    - -
    - - - - - - diff --git a/data/core.telegram.org/constructor/messages.allStickersNotModified b/data/core.telegram.org/constructor/messages.allStickersNotModified deleted file mode 100644 index 180d8a43b8..0000000000 --- a/data/core.telegram.org/constructor/messages.allStickersNotModified +++ /dev/null @@ -1,132 +0,0 @@ - - - - - messages.allStickersNotModified - - - - - - - - - - - - - -
    - -
    -
    -
    - -

    messages.allStickersNotModified

    - -

    Info about all installed stickers hasn't changed

    -

    - -
    -
    messages.allStickersNotModified#e86602c3 = messages.AllStickers;

    -

    Parameters

    -

    This constructor does not require any parameters.

    -

    Type

    -

    messages.AllStickers

    - -
    - -
    -
    - -
    - - - - - - diff --git a/data/core.telegram.org/constructor/messages.exportedChatInvite b/data/core.telegram.org/constructor/messages.exportedChatInvite deleted file mode 100644 index 8d965aabd0..0000000000 --- a/data/core.telegram.org/constructor/messages.exportedChatInvite +++ /dev/null @@ -1,152 +0,0 @@ - - - - - messages.exportedChatInvite - - - - - - - - - - - - - -
    - -
    -
    -
    - -

    messages.exportedChatInvite

    - -

    Info about a chat invite

    -

    - -
    -
    messages.exportedChatInvite#1871be50 invite:ExportedChatInvite users:Vector<User> = messages.ExportedChatInvite;

    -

    Parameters

    - - - - - - - - - - - - - - - - - - - - -
    NameTypeDescription
    inviteExportedChatInviteInfo about the chat invite
    usersVector<User>Mentioned users
    -

    Type

    -

    messages.ExportedChatInvite

    - -
    - -
    -
    - -
    - - - - - - diff --git a/data/core.telegram.org/constructor/peerNotifySettings.html b/data/core.telegram.org/constructor/peerNotifySettings.html deleted file mode 100644 index 1a8febde59..0000000000 --- a/data/core.telegram.org/constructor/peerNotifySettings.html +++ /dev/null @@ -1,182 +0,0 @@ - - - - - peerNotifySettings - - - - - - - - - - - - - -
    - -
    -
    -
    - -

    peerNotifySettings

    - -

    Notification settings.

    -

    - -
    -
    peerNotifySettings#af509d20 flags:# show_previews:flags.0?Bool silent:flags.1?Bool mute_until:flags.2?int sound:flags.3?string = PeerNotifySettings;

    -

    Parameters

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeDescription
    flags#Flags, see TL conditional fields
    show_previewsflags.0?BoolDisplay text in notifications
    silentflags.1?BoolMute peer?
    mute_untilflags.2?intMute all notifications until this date
    soundflags.3?stringAudio file name for notifications
    -

    Type

    -

    PeerNotifySettings

    -

    Event flags (events_mask)

    - - - - - - - - - - - - - -
    0x00000001Profile photo update notification
    - -
    - -
    -
    - -
    - - - - - - diff --git a/data/core.telegram.org/constructor/secureValueTypeAddress.html b/data/core.telegram.org/constructor/secureValueTypeAddress.html deleted file mode 100644 index d83a0b1593..0000000000 --- a/data/core.telegram.org/constructor/secureValueTypeAddress.html +++ /dev/null @@ -1,132 +0,0 @@ - - - - - secureValueTypeAddress - - - - - - - - - - - - - -
    - -
    -
    -
    - -

    secureValueTypeAddress

    - -

    Address

    -

    - -
    -
    secureValueTypeAddress#cbe31e26 = SecureValueType;

    -

    Parameters

    -

    This constructor does not require any parameters.

    -

    Type

    -

    SecureValueType

    - -
    - -
    -
    - -
    - - - - - - diff --git a/data/core.telegram.org/constructor/secureValueTypeTemporaryRegistration.html b/data/core.telegram.org/constructor/secureValueTypeTemporaryRegistration.html deleted file mode 100644 index 7312f9e65f..0000000000 --- a/data/core.telegram.org/constructor/secureValueTypeTemporaryRegistration.html +++ /dev/null @@ -1,132 +0,0 @@ - - - - - secureValueTypeTemporaryRegistration - - - - - - - - - - - - - -
    - -
    -
    -
    - -

    secureValueTypeTemporaryRegistration

    - -

    Temporary registration

    -

    - -
    -
    secureValueTypeTemporaryRegistration#ea02ec33 = SecureValueType;

    -

    Parameters

    -

    This constructor does not require any parameters.

    -

    Type

    -

    SecureValueType

    - -
    - -
    -
    - -
    - - - - - - diff --git a/data/core.telegram.org/constructor/textUnderline.html b/data/core.telegram.org/constructor/statsURL.html similarity index 91% rename from data/core.telegram.org/constructor/textUnderline.html rename to data/core.telegram.org/constructor/statsURL.html index 3ad40497c0..896601ca9f 100644 --- a/data/core.telegram.org/constructor/textUnderline.html +++ b/data/core.telegram.org/constructor/statsURL.html @@ -2,12 +2,12 @@ - textUnderline + statsURL - - + + - + @@ -36,10 +36,10 @@
    - -

    textUnderline

    + +

    statsURL

    -

    Underlined text

    +

    URL with chat statistics

    -
    textUnderline#c12622c4 text:RichText = RichText;

    +
    statsURL#47a971e0 url:string = StatsURL;

    Parameters

    @@ -64,14 +64,14 @@ - - - + + +
    textRichTextTexturlstringChat statistics

    Type

    -

    RichText

    +

    StatsURL

    diff --git a/data/corefork.telegram.org/constructor/langPackLanguage.html b/data/core.telegram.org/constructor/stickerSet.html similarity index 73% rename from data/corefork.telegram.org/constructor/langPackLanguage.html rename to data/core.telegram.org/constructor/stickerSet.html index 4494b0d4a7..df7e9e3c08 100644 --- a/data/corefork.telegram.org/constructor/langPackLanguage.html +++ b/data/core.telegram.org/constructor/stickerSet.html @@ -2,12 +2,12 @@ - langPackLanguage + stickerSet - - + + - + @@ -36,10 +36,10 @@
    - -

    langPackLanguage

    + +

    stickerSet

    -

    Identifies a localization pack

    +

    Represents a stickerset (stickerpack)

    -
    langPackLanguage#eeca5ce3 flags:# official:flags.0?true rtl:flags.2?true beta:flags.3?true name:string native_name:string lang_code:string base_lang_code:flags.1?string plural_code:string strings_count:int translated_count:int translations_url:string = LangPackLanguage;

    +
    stickerSet#d7df217a flags:# archived:flags.1?true official:flags.2?true masks:flags.3?true animated:flags.5?true videos:flags.6?true installed_date:flags.0?int id:long access_hash:long title:string short_name:string thumbs:flags.4?Vector<PhotoSize> thumb_dc_id:flags.4?int thumb_version:flags.4?int count:int hash:int = StickerSet;

    Parameters

    @@ -69,64 +69,79 @@ + + + + + - - - - - - + - + - + - + + + + + + + + + + + + + + + + + + + + + - + - + - + - - - + + + - - - + + + - - - + + + - + - + - + - - - - - - +
    Flags, see TL conditional fields
    archivedflags.1?trueWhether this stickerset was archived (due to too many saved stickers in the current account)
    officialflags.0?trueWhether the language pack is official
    rtl flags.2?trueIs this a localization pack for an RTL languageIs this stickerset official
    betamasks flags.3?trueIs this a beta localization pack?Is this a mask stickerset
    nameanimatedflags.5?trueIs this an animated stickerpack
    installed_dateflags.0?intWhen was this stickerset installed
    idlongID of the stickerset
    access_hashlongAccess hash of stickerset
    title stringLanguage nameTitle of stickerset
    native_nameshort_name stringLanguage name in the language itselfShort name of stickerset to use in tg://addstickers?set=short_name
    lang_codestringLanguage code (pack identifier)thumbsflags.4?Vector<PhotoSize>Stickerset thumbnail
    base_lang_codeflags.1?stringIdentifier of a base language pack; may be empty. If a string is missed in the language pack, then it should be fetched from base language pack. Unsupported in custom language packsthumb_dc_idflags.4?intDC ID of thumbnail
    plural_codestringA language code to be used to apply plural forms. See https://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html for more infothumb_versionflags.4?intThumbnail version
    strings_countcount intTotal number of non-deleted strings from the language packNumber of stickers in pack
    translated_counthash intTotal number of translated strings from the language pack
    translations_urlstringLink to language translation interface; empty for custom local language packsHash

    Type

    -

    LangPackLanguage

    +

    StickerSet

    @@ -165,9 +180,9 @@