node-telegram-bot-api - API reference
August 24, 2026 ยท View on GitHub
Auto-generated by scripts/generate-docs.ts from the TypeScript source via TypeDoc. Regenerate with npm run generate:docs. Every Api method links to its Bot API page.
Contents
Classes
AnimatedProfilePhotoBuilder
An animated profile photo (a video); main_frame_timestamp picks the still frame.
Methods
| Method | Params | Returns | Description |
|---|---|---|---|
build | - | InputProfilePhoto | - |
Api
Methods
| Method | Params | Returns | Description |
|---|---|---|---|
addStickerToSet | params: AddStickerToSetParams, signal?: AbortSignal | Promise | addStickerToSet |
answerCallbackQuery | params: AnswerCallbackQueryParams, signal?: AbortSignal | Promise | answerCallbackQuery |
answerChatJoinRequestQuery | params: AnswerChatJoinRequestQueryParams, signal?: AbortSignal | Promise | answerChatJoinRequestQuery |
answerGuestQuery | params: AnswerGuestQueryParams, signal?: AbortSignal | Promise<SentGuestMessage> | answerGuestQuery |
answerInlineQuery | params: AnswerInlineQueryParams, signal?: AbortSignal | Promise | answerInlineQuery |
answerPreCheckoutQuery | params: AnswerPreCheckoutQueryParams, signal?: AbortSignal | Promise | answerPreCheckoutQuery |
answerShippingQuery | params: AnswerShippingQueryParams, signal?: AbortSignal | Promise | answerShippingQuery |
answerWebAppQuery | params: AnswerWebAppQueryParams, signal?: AbortSignal | Promise<SentWebAppMessage> | answerWebAppQuery |
approveChatJoinRequest | params: ApproveChatJoinRequestParams, signal?: AbortSignal | Promise | approveChatJoinRequest |
approveSuggestedPost | params: ApproveSuggestedPostParams, signal?: AbortSignal | Promise | approveSuggestedPost |
banChatMember | params: BanChatMemberParams, signal?: AbortSignal | Promise | banChatMember |
banChatSenderChat | params: BanChatSenderChatParams, signal?: AbortSignal | Promise | banChatSenderChat |
close | signal?: AbortSignal | Promise | close |
closeForumTopic | params: CloseForumTopicParams, signal?: AbortSignal | Promise | closeForumTopic |
closeGeneralForumTopic | params: CloseGeneralForumTopicParams, signal?: AbortSignal | Promise | closeGeneralForumTopic |
convertGiftToStars | params: ConvertGiftToStarsParams, signal?: AbortSignal | Promise | convertGiftToStars |
copyMessage | params: CopyMessageParams, signal?: AbortSignal | Promise<MessageId> | copyMessage |
copyMessages | params: CopyMessagesParams, signal?: AbortSignal | Promise<CopyMessagesResult> | copyMessages |
createChatInviteLink | params: CreateChatInviteLinkParams, signal?: AbortSignal | Promise<ChatInviteLink> | createChatInviteLink |
createChatSubscriptionInviteLink | params: CreateChatSubscriptionInviteLinkParams, signal?: AbortSignal | Promise<ChatInviteLink> | createChatSubscriptionInviteLink |
createForumTopic | params: CreateForumTopicParams, signal?: AbortSignal | Promise<ForumTopic> | createForumTopic |
createInvoiceLink | params: CreateInvoiceLinkParams, signal?: AbortSignal | Promise | createInvoiceLink |
createNewStickerSet | params: CreateNewStickerSetParams, signal?: AbortSignal | Promise | createNewStickerSet |
declineChatJoinRequest | params: DeclineChatJoinRequestParams, signal?: AbortSignal | Promise | declineChatJoinRequest |
declineSuggestedPost | params: DeclineSuggestedPostParams, signal?: AbortSignal | Promise | declineSuggestedPost |
deleteAllMessageReactions | params: DeleteAllMessageReactionsParams, signal?: AbortSignal | Promise | deleteAllMessageReactions |
deleteBusinessMessages | params: DeleteBusinessMessagesParams, signal?: AbortSignal | Promise | deleteBusinessMessages |
deleteChatPhoto | params: DeleteChatPhotoParams, signal?: AbortSignal | Promise | deleteChatPhoto |
deleteChatStickerSet | params: DeleteChatStickerSetParams, signal?: AbortSignal | Promise | deleteChatStickerSet |
deleteEphemeralMessage | params: DeleteEphemeralMessageParams, signal?: AbortSignal | Promise | deleteEphemeralMessage |
deleteForumTopic | params: DeleteForumTopicParams, signal?: AbortSignal | Promise | deleteForumTopic |
deleteMessage | params: DeleteMessageParams, signal?: AbortSignal | Promise | deleteMessage |
deleteMessageReaction | params: DeleteMessageReactionParams, signal?: AbortSignal | Promise | deleteMessageReaction |
deleteMessages | params: DeleteMessagesParams, signal?: AbortSignal | Promise | deleteMessages |
deleteMyCommands | params?: DeleteMyCommandsParams, signal?: AbortSignal | Promise | deleteMyCommands |
deleteStickerFromSet | params: DeleteStickerFromSetParams, signal?: AbortSignal | Promise | deleteStickerFromSet |
deleteStickerSet | params: DeleteStickerSetParams, signal?: AbortSignal | Promise | deleteStickerSet |
deleteStory | params: DeleteStoryParams, signal?: AbortSignal | Promise | deleteStory |
deleteWebhook | params?: DeleteWebhookParams, signal?: AbortSignal | Promise | deleteWebhook |
editChatInviteLink | params: EditChatInviteLinkParams, signal?: AbortSignal | Promise<ChatInviteLink> | editChatInviteLink |
editChatSubscriptionInviteLink | params: EditChatSubscriptionInviteLinkParams, signal?: AbortSignal | Promise<ChatInviteLink> | editChatSubscriptionInviteLink |
editEphemeralMessageCaption | params: EditEphemeralMessageCaptionParams, signal?: AbortSignal | Promise | editEphemeralMessageCaption |
editEphemeralMessageMedia | params: EditEphemeralMessageMediaParams, signal?: AbortSignal | Promise | editEphemeralMessageMedia |
editEphemeralMessageReplyMarkup | params: EditEphemeralMessageReplyMarkupParams, signal?: AbortSignal | Promise | editEphemeralMessageReplyMarkup |
editEphemeralMessageText | params: EditEphemeralMessageTextParams, signal?: AbortSignal | Promise | editEphemeralMessageText |
editForumTopic | params: EditForumTopicParams, signal?: AbortSignal | Promise | editForumTopic |
editGeneralForumTopic | params: EditGeneralForumTopicParams, signal?: AbortSignal | Promise | editGeneralForumTopic |
editMessageCaption | params?: EditMessageCaptionParams, signal?: AbortSignal | Promise<EditMessageCaptionResult> | editMessageCaption |
editMessageChecklist | params: EditMessageChecklistParams, signal?: AbortSignal | Promise<Message> | editMessageChecklist |
editMessageLiveLocation | params: EditMessageLiveLocationParams, signal?: AbortSignal | Promise<EditMessageLiveLocationResult> | editMessageLiveLocation |
editMessageMedia | params: EditMessageMediaParams, signal?: AbortSignal | Promise<EditMessageMediaResult> | editMessageMedia |
editMessageReplyMarkup | params?: EditMessageReplyMarkupParams, signal?: AbortSignal | Promise<EditMessageReplyMarkupResult> | editMessageReplyMarkup |
editMessageText | params?: EditMessageTextParams, signal?: AbortSignal | Promise<EditMessageTextResult> | editMessageText |
editStory | params: EditStoryParams, signal?: AbortSignal | Promise<Story> | editStory |
editUserStarSubscription | params: EditUserStarSubscriptionParams, signal?: AbortSignal | Promise | editUserStarSubscription |
exportChatInviteLink | params: ExportChatInviteLinkParams, signal?: AbortSignal | Promise | exportChatInviteLink |
forwardMessage | params: ForwardMessageParams, signal?: AbortSignal | Promise<Message> | forwardMessage |
forwardMessages | params: ForwardMessagesParams, signal?: AbortSignal | Promise<ForwardMessagesResult> | forwardMessages |
getAvailableGifts | signal?: AbortSignal | Promise<Gifts> | getAvailableGifts |
getBusinessAccountGifts | params: GetBusinessAccountGiftsParams, signal?: AbortSignal | Promise<OwnedGifts> | getBusinessAccountGifts |
getBusinessAccountStarBalance | params: GetBusinessAccountStarBalanceParams, signal?: AbortSignal | Promise<StarAmount> | getBusinessAccountStarBalance |
getBusinessConnection | params: GetBusinessConnectionParams, signal?: AbortSignal | Promise<BusinessConnection> | getBusinessConnection |
getChat | params: GetChatParams, signal?: AbortSignal | Promise<ChatFullInfo> | getChat |
getChatAdministrators | params: GetChatAdministratorsParams, signal?: AbortSignal | Promise<GetChatAdministratorsResult> | getChatAdministrators |
getChatGifts | params: GetChatGiftsParams, signal?: AbortSignal | Promise<OwnedGifts> | getChatGifts |
getChatMember | params: GetChatMemberParams, signal?: AbortSignal | Promise<ChatMember> | getChatMember |
getChatMemberCount | params: GetChatMemberCountParams, signal?: AbortSignal | Promise | getChatMemberCount |
getChatMenuButton | params?: GetChatMenuButtonParams, signal?: AbortSignal | Promise<MenuButton> | getChatMenuButton |
getCustomEmojiStickers | params: GetCustomEmojiStickersParams, signal?: AbortSignal | Promise<GetCustomEmojiStickersResult> | getCustomEmojiStickers |
getFile | params: GetFileParams, signal?: AbortSignal | Promise<File> | getFile |
getForumTopicIconStickers | signal?: AbortSignal | Promise<GetForumTopicIconStickersResult> | getForumTopicIconStickers |
getGameHighScores | params: GetGameHighScoresParams, signal?: AbortSignal | Promise<GetGameHighScoresResult> | getGameHighScores |
getManagedBotAccessSettings | params: GetManagedBotAccessSettingsParams, signal?: AbortSignal | Promise<BotAccessSettings> | getManagedBotAccessSettings |
getManagedBotToken | params: GetManagedBotTokenParams, signal?: AbortSignal | Promise<BusinessConnection> | getManagedBotToken |
getMe | signal?: AbortSignal | Promise<User> | getMe |
getMyCommands | params?: GetMyCommandsParams, signal?: AbortSignal | Promise<GetMyCommandsResult> | getMyCommands |
getMyDefaultAdministratorRights | params?: GetMyDefaultAdministratorRightsParams, signal?: AbortSignal | Promise<ChatAdministratorRights> | getMyDefaultAdministratorRights |
getMyDescription | params?: GetMyDescriptionParams, signal?: AbortSignal | Promise<BotDescription> | getMyDescription |
getMyName | params?: GetMyNameParams, signal?: AbortSignal | Promise<BotName> | getMyName |
getMyShortDescription | params?: GetMyShortDescriptionParams, signal?: AbortSignal | Promise<BotShortDescription> | getMyShortDescription |
getMyStarBalance | signal?: AbortSignal | Promise<StarAmount> | getMyStarBalance |
getStarTransactions | params?: GetStarTransactionsParams, signal?: AbortSignal | Promise<StarTransactions> | getStarTransactions |
getStickerSet | params: GetStickerSetParams, signal?: AbortSignal | Promise<StickerSet> | getStickerSet |
getUpdates | params?: GetUpdatesParams, signal?: AbortSignal | Promise<GetUpdatesResult> | getUpdates |
getUserChatBoosts | params: GetUserChatBoostsParams, signal?: AbortSignal | Promise<UserChatBoosts> | getUserChatBoosts |
getUserGifts | params: GetUserGiftsParams, signal?: AbortSignal | Promise<OwnedGifts> | getUserGifts |
getUserPersonalChatMessages | params: GetUserPersonalChatMessagesParams, signal?: AbortSignal | Promise<GetUserPersonalChatMessagesResult> | getUserPersonalChatMessages |
getUserProfileAudios | params: GetUserProfileAudiosParams, signal?: AbortSignal | Promise<UserProfileAudios> | getUserProfileAudios |
getUserProfilePhotos | params: GetUserProfilePhotosParams, signal?: AbortSignal | Promise<UserProfilePhotos> | getUserProfilePhotos |
getWebhookInfo | signal?: AbortSignal | Promise<WebhookInfo> | getWebhookInfo |
giftPremiumSubscription | params: GiftPremiumSubscriptionParams, signal?: AbortSignal | Promise | giftPremiumSubscription |
hideGeneralForumTopic | params: HideGeneralForumTopicParams, signal?: AbortSignal | Promise | hideGeneralForumTopic |
leaveChat | params: LeaveChatParams, signal?: AbortSignal | Promise | leaveChat |
logOut | signal?: AbortSignal | Promise | logOut |
pinChatMessage | params: PinChatMessageParams, signal?: AbortSignal | Promise | pinChatMessage |
postStory | params: PostStoryParams, signal?: AbortSignal | Promise<Story> | postStory |
promoteChatMember | params: PromoteChatMemberParams, signal?: AbortSignal | Promise | promoteChatMember |
readBusinessMessage | params: ReadBusinessMessageParams, signal?: AbortSignal | Promise | readBusinessMessage |
refundStarPayment | params: RefundStarPaymentParams, signal?: AbortSignal | Promise | refundStarPayment |
removeBusinessAccountProfilePhoto | params: RemoveBusinessAccountProfilePhotoParams, signal?: AbortSignal | Promise | removeBusinessAccountProfilePhoto |
removeChatVerification | params: RemoveChatVerificationParams, signal?: AbortSignal | Promise | removeChatVerification |
removeMyProfilePhoto | signal?: AbortSignal | Promise | removeMyProfilePhoto |
removeUserVerification | params: RemoveUserVerificationParams, signal?: AbortSignal | Promise | removeUserVerification |
reopenForumTopic | params: ReopenForumTopicParams, signal?: AbortSignal | Promise | reopenForumTopic |
reopenGeneralForumTopic | params: ReopenGeneralForumTopicParams, signal?: AbortSignal | Promise | reopenGeneralForumTopic |
replaceManagedBotToken | params: ReplaceManagedBotTokenParams, signal?: AbortSignal | Promise | replaceManagedBotToken |
replaceStickerInSet | params: ReplaceStickerInSetParams, signal?: AbortSignal | Promise | replaceStickerInSet |
repostStory | params: RepostStoryParams, signal?: AbortSignal | Promise<Story> | repostStory |
restrictChatMember | params: RestrictChatMemberParams, signal?: AbortSignal | Promise | restrictChatMember |
revokeChatInviteLink | params: RevokeChatInviteLinkParams, signal?: AbortSignal | Promise<ChatInviteLink> | revokeChatInviteLink |
savePreparedInlineMessage | params: SavePreparedInlineMessageParams, signal?: AbortSignal | Promise<PreparedInlineMessage> | savePreparedInlineMessage |
savePreparedKeyboardButton | params: SavePreparedKeyboardButtonParams, signal?: AbortSignal | Promise<PreparedInlineMessage> | savePreparedKeyboardButton |
sendAnimation | params: SendAnimationParams, signal?: AbortSignal | Promise<Message> | sendAnimation |
sendAudio | params: SendAudioParams, signal?: AbortSignal | Promise<Message> | sendAudio |
sendChatAction | params: SendChatActionParams, signal?: AbortSignal | Promise | sendChatAction |
sendChatJoinRequestWebApp | params: SendChatJoinRequestWebAppParams, signal?: AbortSignal | Promise | sendChatJoinRequestWebApp |
sendChecklist | params: SendChecklistParams, signal?: AbortSignal | Promise<Message> | sendChecklist |
sendContact | params: SendContactParams, signal?: AbortSignal | Promise<Message> | sendContact |
sendDice | params: SendDiceParams, signal?: AbortSignal | Promise<Message> | sendDice |
sendDocument | params: SendDocumentParams, signal?: AbortSignal | Promise<Message> | sendDocument |
sendGame | params: SendGameParams, signal?: AbortSignal | Promise<Message> | sendGame |
sendGift | params: SendGiftParams, signal?: AbortSignal | Promise | sendGift |
sendInvoice | params: SendInvoiceParams, signal?: AbortSignal | Promise<Message> | sendInvoice |
sendLivePhoto | params: SendLivePhotoParams, signal?: AbortSignal | Promise<Message> | sendLivePhoto |
sendLocation | params: SendLocationParams, signal?: AbortSignal | Promise<Message> | sendLocation |
sendMediaGroup | params: SendMediaGroupParams, signal?: AbortSignal | Promise<SendMediaGroupResult> | sendMediaGroup |
sendMessage | params: SendMessageParams, signal?: AbortSignal | Promise<Message> | sendMessage |
sendMessageDraft | params: SendMessageDraftParams, signal?: AbortSignal | Promise | sendMessageDraft |
sendPaidMedia | params: SendPaidMediaParams, signal?: AbortSignal | Promise<Message> | sendPaidMedia |
sendPhoto | params: SendPhotoParams, signal?: AbortSignal | Promise<Message> | sendPhoto |
sendPoll | params: SendPollParams, signal?: AbortSignal | Promise<Message> | sendPoll |
sendRichMessage | params: SendRichMessageParams, signal?: AbortSignal | Promise<Message> | sendRichMessage |
sendRichMessageDraft | params: SendRichMessageDraftParams, signal?: AbortSignal | Promise | sendRichMessageDraft |
sendSticker | params: SendStickerParams, signal?: AbortSignal | Promise<Message> | sendSticker |
sendVenue | params: SendVenueParams, signal?: AbortSignal | Promise<Message> | sendVenue |
sendVideo | params: SendVideoParams, signal?: AbortSignal | Promise<Message> | sendVideo |
sendVideoNote | params: SendVideoNoteParams, signal?: AbortSignal | Promise<Message> | sendVideoNote |
sendVoice | params: SendVoiceParams, signal?: AbortSignal | Promise<Message> | sendVoice |
setBusinessAccountBio | params: SetBusinessAccountBioParams, signal?: AbortSignal | Promise | setBusinessAccountBio |
setBusinessAccountGiftSettings | params: SetBusinessAccountGiftSettingsParams, signal?: AbortSignal | Promise | setBusinessAccountGiftSettings |
setBusinessAccountName | params: SetBusinessAccountNameParams, signal?: AbortSignal | Promise | setBusinessAccountName |
setBusinessAccountProfilePhoto | params: SetBusinessAccountProfilePhotoParams, signal?: AbortSignal | Promise | setBusinessAccountProfilePhoto |
setBusinessAccountUsername | params: SetBusinessAccountUsernameParams, signal?: AbortSignal | Promise | setBusinessAccountUsername |
setChatAdministratorCustomTitle | params: SetChatAdministratorCustomTitleParams, signal?: AbortSignal | Promise | setChatAdministratorCustomTitle |
setChatDescription | params: SetChatDescriptionParams, signal?: AbortSignal | Promise | setChatDescription |
setChatMemberTag | params: SetChatMemberTagParams, signal?: AbortSignal | Promise | setChatMemberTag |
setChatMenuButton | params?: SetChatMenuButtonParams, signal?: AbortSignal | Promise | setChatMenuButton |
setChatPermissions | params: SetChatPermissionsParams, signal?: AbortSignal | Promise | setChatPermissions |
setChatPhoto | params: SetChatPhotoParams, signal?: AbortSignal | Promise | setChatPhoto |
setChatStickerSet | params: SetChatStickerSetParams, signal?: AbortSignal | Promise | setChatStickerSet |
setChatTitle | params: SetChatTitleParams, signal?: AbortSignal | Promise | setChatTitle |
setCustomEmojiStickerSetThumbnail | params: SetCustomEmojiStickerSetThumbnailParams, signal?: AbortSignal | Promise | setCustomEmojiStickerSetThumbnail |
setGameScore | params: SetGameScoreParams, signal?: AbortSignal | Promise<SetGameScoreResult> | setGameScore |
setManagedBotAccessSettings | params: SetManagedBotAccessSettingsParams, signal?: AbortSignal | Promise | setManagedBotAccessSettings |
setMessageReaction | params: SetMessageReactionParams, signal?: AbortSignal | Promise | setMessageReaction |
setMyCommands | params: SetMyCommandsParams, signal?: AbortSignal | Promise | setMyCommands |
setMyDefaultAdministratorRights | params?: SetMyDefaultAdministratorRightsParams, signal?: AbortSignal | Promise | setMyDefaultAdministratorRights |
setMyDescription | params?: SetMyDescriptionParams, signal?: AbortSignal | Promise | setMyDescription |
setMyName | params?: SetMyNameParams, signal?: AbortSignal | Promise | setMyName |
setMyProfilePhoto | params: SetMyProfilePhotoParams, signal?: AbortSignal | Promise | setMyProfilePhoto |
setMyShortDescription | params?: SetMyShortDescriptionParams, signal?: AbortSignal | Promise | setMyShortDescription |
setPassportDataErrors | params: SetPassportDataErrorsParams, signal?: AbortSignal | Promise | setPassportDataErrors |
setStickerEmojiList | params: SetStickerEmojiListParams, signal?: AbortSignal | Promise | setStickerEmojiList |
setStickerKeywords | params: SetStickerKeywordsParams, signal?: AbortSignal | Promise | setStickerKeywords |
setStickerMaskPosition | params: SetStickerMaskPositionParams, signal?: AbortSignal | Promise | setStickerMaskPosition |
setStickerPositionInSet | params: SetStickerPositionInSetParams, signal?: AbortSignal | Promise | setStickerPositionInSet |
setStickerSetThumbnail | params: SetStickerSetThumbnailParams, signal?: AbortSignal | Promise | setStickerSetThumbnail |
setStickerSetTitle | params: SetStickerSetTitleParams, signal?: AbortSignal | Promise | setStickerSetTitle |
setUserEmojiStatus | params: SetUserEmojiStatusParams, signal?: AbortSignal | Promise | setUserEmojiStatus |
setWebhook | params: SetWebhookParams, signal?: AbortSignal | Promise | setWebhook |
stopMessageLiveLocation | params?: StopMessageLiveLocationParams, signal?: AbortSignal | Promise<StopMessageLiveLocationResult> | stopMessageLiveLocation |
stopPoll | params: StopPollParams, signal?: AbortSignal | Promise<Poll> | stopPoll |
transferBusinessAccountStars | params: TransferBusinessAccountStarsParams, signal?: AbortSignal | Promise | transferBusinessAccountStars |
transferGift | params: TransferGiftParams, signal?: AbortSignal | Promise | transferGift |
unbanChatMember | params: UnbanChatMemberParams, signal?: AbortSignal | Promise | unbanChatMember |
unbanChatSenderChat | params: UnbanChatSenderChatParams, signal?: AbortSignal | Promise | unbanChatSenderChat |
unhideGeneralForumTopic | params: UnhideGeneralForumTopicParams, signal?: AbortSignal | Promise | unhideGeneralForumTopic |
unpinAllChatMessages | params: UnpinAllChatMessagesParams, signal?: AbortSignal | Promise | unpinAllChatMessages |
unpinAllForumTopicMessages | params: UnpinAllForumTopicMessagesParams, signal?: AbortSignal | Promise | unpinAllForumTopicMessages |
unpinAllGeneralForumTopicMessages | params: UnpinAllGeneralForumTopicMessagesParams, signal?: AbortSignal | Promise | unpinAllGeneralForumTopicMessages |
unpinChatMessage | params: UnpinChatMessageParams, signal?: AbortSignal | Promise | unpinChatMessage |
upgradeGift | params: UpgradeGiftParams, signal?: AbortSignal | Promise | upgradeGift |
uploadStickerFile | params: UploadStickerFileParams, signal?: AbortSignal | Promise<File> | uploadStickerFile |
verifyChat | params: VerifyChatParams, signal?: AbortSignal | Promise | verifyChat |
verifyUser | params: VerifyUserParams, signal?: AbortSignal | Promise | verifyUser |
Bot
Methods
| Method | Params | Returns | Description |
|---|---|---|---|
catch | handler: (err: unknown, ctx: Context) => unknown | this | Replace the error boundary. The default logs via console.error and consumes the update, so a handler error never stops startPolling() or fails a webhook delivery. A throw from the installed handler opts back into fail-loud: startPolling() rejects and webhookCallback responds 500, so Telegram redelivers the update. |
command | name: string | string[], ...handlers: Middleware<Context>[] | this | Match a message/channel-post text starting with /name (also /name@bot and trailing args). Sets ctx.match to the trimmed args string ("" if none). |
handleUpdate | update: Update | Promise | Build a Context and run the composed chain; route errors to the catch boundary (default: log and continue). Rejects only when that boundary itself throws. |
hears | trigger: string | RegExp | (string | RegExp)[], ...handlers: Middleware<Context>[] | this | Match message text: a string matches exactly (sets ctx.match to the text); a RegExp matches when text.match(re) is non-null (sets ctx.match to the RegExpMatchArray). |
isRunning | - | boolean | - |
on | kind: "message" | "edited_message" | "channel_post" | "edited_channel_post" | "business_connection" | "business_message" | "edited_business_message" | "deleted_business_messages" | "guest_message" | "message_reaction" | "message_reaction_count" | "inline_query" | "chosen_inline_result" | "callback_query" | "shipping_query" | "pre_checkout_query" | "purchased_paid_media" | "poll" | "poll_answer" | "my_chat_member" | "chat_member" | "chat_join_request" | "chat_boost" | "removed_chat_boost" | "managed_bot" | "subscription" | "stopped_message_generation" | ("message" | "edited_message" | "channel_post" | "edited_channel_post" | "business_connection" | "business_message" | "edited_business_message" | "deleted_business_messages" | "guest_message" | "message_reaction" | "message_reaction_count" | "inline_query" | "chosen_inline_result" | "callback_query" | "shipping_query" | "pre_checkout_query" | "purchased_paid_media" | "poll" | "poll_answer" | "my_chat_member" | "chat_member" | "chat_join_request" | "chat_boost" | "removed_chat_boost" | "managed_bot" | "subscription" | "stopped_message_generation")[], ...handlers: Middleware<Context>[] | this | Run handlers only when the given payload key (e.g. "message", "callback_query") is present on the update. |
startPolling | source?: AsyncIterable<Update, any, any>, options?: LongPollOptions | Promise | Pump an update source (default longPoll) through handleUpdate until stop() aborts. Resolves when the source is exhausted or aborted. This is long-poll mode; for webhooks use webhookCallback/createWebhookServer. A handler error does not stop the pump: it is routed to the catch boundary (default: log and continue). The promise rejects only when that boundary itself throws - the fail-loud opt-in (see catch). Not re-entrant: calling it while a previous pump is still active throws, so isRunning() stays truthful and the prior AbortController is never orphaned. Stop the running loop (stop(), then await its promise) first. |
stop | - | void | Abort the running pump loop. |
use | ...mw: Middleware<Context>[] | this | Register one or more middleware to run on every update. |
Properties
| Property | Type |
|---|---|
api | Api |
Context
Methods
| Method | Params | Returns | Description |
|---|---|---|---|
answerCallbackQuery | other?: Omit<AnswerCallbackQueryParams, "callback_query_id"> | Promise | Answer the callback query that triggered this update. Throws if the update is not a callback query. |
reply | text: string, other?: Omit<SendMessageParams, "chat_id" | "text"> | Promise<Message> | Send a message to the inferred chat. Throws if no chat id can be derived from the update (e.g. an inline query carries no chat). |
Properties
| Property | Type |
|---|---|
api | Api |
match? | string | RegExpMatchArray |
state | Record<string, unknown> |
update | Update |
callbackQuery | CallbackQuery | undefined |
channelPost | Message | undefined |
chat | Chat | undefined |
chatId | number | undefined |
editedChannelPost | Message | undefined |
editedMessage | Message | undefined |
from | User | undefined |
inlineQuery | InlineQuery | undefined |
message | Message | undefined |
EntityBuilder
Accumulates styled text and the entities covering each styled segment, in
UTF-16 code units (JS string .length).
Methods
| Method | Params | Returns | Description |
|---|---|---|---|
blockquote | s: string | this | - |
bold | s: string | this | - |
build | - | BuiltEntities | The accumulated text plus the plain MessageEntity[] covering each segment. |
code | s: string | this | - |
customEmoji | s: string, customEmojiId: string | this | - |
italic | s: string | this | - |
link | s: string, url: string | this | A text_link entity pointing at url. |
plain | s: string | this | Append unstyled text. |
pre | s: string, language?: string | this | - |
spoiler | s: string | this | - |
strikethrough | s: string | this | - |
textMention | s: string, user: User | this | A text_mention entity for a user without a username. |
underline | s: string | this | - |
InlineKeyboardBuilder
Fluent inline-keyboard builder. Buttons append to the current row; row()
starts a new one.
Methods
| Method | Params | Returns | Description |
|---|---|---|---|
build | - | InlineKeyboardMarkup | The keyboard as a plain InlineKeyboardMarkup, dropping trailing empty rows. |
copyText | label: string, text: string | this | A button that copies text to the clipboard. |
loginUrl | label: string, url: string | this | A Login URL button. |
pay | label: string | this | A pay button. |
row | - | this | Start a new (empty) row. |
switchInline | label: string, query: string | this | Switch to inline mode in another chat. |
switchInlineCurrent | label: string, query: string | this | Switch to inline mode in the current chat. |
text | label: string, callbackData: string | this | A callback button. |
url | label: string, url: string | this | An HTTP/tg:// URL button. |
webApp | label: string, url: string | this | A Web App button. |
InputFile
Explicit, web-standard wrapper for uploadable bytes.
Methods
| Method | Params | Returns | Description |
|---|---|---|---|
build | index: number | string | This file's wire reference when it occupies attach slot index: attach://media_<index>. The matching multipart part is keyed media_<index> (the ref without the scheme). InputFile owns the naming convention; the slot index is allocated by AttachedMedia during its build pass (ADR-011). |
Properties
| Property | Type |
|---|---|
data | InputFileData |
meta? | InputFileMeta |
MediaGroupBuilder
Collects items for sendMediaGroup's media. Each method takes one
Omit<InputMedia*, "type"> and .build() returns the plain InputMedia array
(with raw InputFiles embedded). The cast bridges the builder's item union (which
offers animation) to the field's wire union; both are interchangeable at the wire
level once serializeParams resolves the files.
Methods
| Method | Params | Returns | Description |
|---|---|---|---|
animation | item: Omit<InputMediaAnimation, "type"> | this | - |
audio | item: Omit<InputMediaAudio, "type"> | this | - |
build | - | (InputMediaLivePhoto | InputMediaPhoto | InputMediaVideo | InputMediaAudio | InputMediaDocument)[] | - |
document | item: Omit<InputMediaDocument, "type"> | this | - |
livePhoto | item: Omit<InputMediaLivePhoto, "type"> | this | A live photo: media is the live photo, photo the still cover. Both upload. |
photo | item: Omit<InputMediaPhoto, "type"> | this | - |
video | item: Omit<InputMediaVideo, "type"> | this | - |
NetworkError
A transport-level failure: DNS, connection reset, fetch threw, etc.
Methods
| Method | Params | Returns | Description |
|---|---|---|---|
captureStackTrace | targetObject: object, constructorOpt?: Function | void | Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called. js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}. The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace. The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance: js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); |
prepareStackTrace | err: Error, stackTraces: CallSite[] | any | - |
Properties
| Property | Type |
|---|---|
cause? | unknown |
code | string |
message | string |
name | string |
stack? | string |
stackTraceLimit | number |
PaidMediaGroupBuilder
Collects items for sendPaidMedia's media (InputPaidMedia[]). The peer of
MediaGroupBuilder (named ...Group because PaidMedia is already a Bot API
response type). .build() returns the plain array with raw InputFiles embedded.
Methods
| Method | Params | Returns | Description |
|---|---|---|---|
build | - | InputPaidMedia[] | - |
livePhoto | item: Omit<InputPaidMediaLivePhoto, "type"> | this | A live photo: media is the live photo, photo the still cover. Both upload. |
photo | item: Omit<InputPaidMediaPhoto, "type"> | this | - |
video | item: Omit<InputPaidMediaVideo, "type"> | this | - |
ParseError
The response body could not be parsed as the expected JSON envelope.
Methods
| Method | Params | Returns | Description |
|---|---|---|---|
captureStackTrace | targetObject: object, constructorOpt?: Function | void | Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called. js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}. The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace. The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance: js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); |
prepareStackTrace | err: Error, stackTraces: CallSite[] | any | - |
Properties
| Property | Type |
|---|---|
cause? | unknown |
code | string |
message | string |
name | string |
responseText? | string |
stack? | string |
stackTraceLimit | number |
PhotoStoryBuilder
A photo story for postStory/editStory. .build() returns the InputStoryContent.
Methods
| Method | Params | Returns | Description |
|---|---|---|---|
build | - | InputStoryContent | - |
RateLimiter
Combines a global token bucket with per-chat buckets. acquire() awaits the
global bucket (when configured) and, when a chatId is present and perChat
is set, the bucket for that chat (created on first use, keyed by string id).
Per-chat buckets are cached as a bounded LRU: a chat that is accessed is moved
to most-recently-used, and once maxChatBuckets is reached the
least-recently-used chat's bucket is evicted, so the map cannot grow without
bound for long-lived bots that talk to many distinct chats.
Methods
| Method | Params | Returns | Description |
|---|---|---|---|
acquire | chatId: string | number | undefined, signal?: AbortSignal | Promise | - |
ReplyKeyboardBuilder
Fluent reply-keyboard builder. Buttons append to the current row; row()
starts a new one.
Methods
| Method | Params | Returns | Description |
|---|---|---|---|
build | options?: ReplyKeyboardBuildOptions | ReplyKeyboardMarkup | The keyboard as a plain ReplyKeyboardMarkup, dropping trailing empty rows. |
requestContact | label: string | this | Request the user's phone number. |
requestLocation | label: string | this | Request the user's location. |
row | - | this | Start a new (empty) row. |
text | label: string | this | A plain text button. |
webApp | label: string, url: string | this | A Web App button. |
RichMessageBuilder
Fluent builder for the blocks form of an InputRichMessage.
Methods
| Method | Params | Returns | Description |
|---|---|---|---|
anchor | name: string | this | An anchor target the message can link back to. |
animation | animation: InputMediaAnimation, caption?: RichBlockCaption | this | An animation block. Its caption is ignored - use the caption argument. |
audio | audio: InputMediaAudio, caption?: RichBlockCaption | this | An audio block. |
blockquote | blocks: BlockContent, credit?: RichTextContent | this | A block quotation wrapping nested blocks, with an optional credit. |
build | options?: RichMessageBuildOptions | InputRichMessage | The plain InputRichMessage (blocks form) ready for rich_message. |
buildBlocks | - | InputRichBlock[] | The accumulated blocks as a plain InputRichBlock[]. |
buttons | buttons: RichMessageButton[], align?: string | this | A row of 1-8 buttons; build them with richMessageButton. |
collage | blocks: BlockContent, caption?: RichBlockCaption | this | A collage of nested media blocks. |
details | summary: RichTextContent, blocks: BlockContent, isOpen?: true | this | A details/disclosure block with an always-shown summary. |
divider | - | this | A horizontal divider. |
document | document: InputMediaDocument, caption?: RichBlockCaption | this | A document block. |
expandableBlockquote | text: RichTextContent, credit?: RichTextContent | this | An expandable (collapsed) block quotation. |
footer | text: RichTextContent | this | A footer block. |
heading | text: RichTextContent, size: number | this | A section heading; size is 1 (largest) to 6 (smallest). |
list | items: InputRichBlockListItem[] | this | An ordered/unordered list; build items with richListItem. |
map | location: Location, options: { caption?: RichBlockCaption; height?: number; width?: number; zoom?: number } | this | A map centered on location. |
mathExpression | expression: string | this | A block-level mathematical expression in LaTeX format. |
media | id: string, media: InputMediaAnimation | InputMediaPhoto | InputMediaVideo | InputMediaAudio | InputMediaDocument | InputMediaVoiceNote | this | Register a media element referenced from the blocks by id (a tg://photo?id= / tg://video?id= / ... link). media may embed a raw InputFile; the pipeline hoists it to an attach:// part. |
paragraph | text: RichTextContent | this | A text paragraph. |
photo | photo: InputMediaPhoto, caption?: RichBlockCaption | this | A photo block. |
preformatted | text: RichTextContent, language?: string | this | A preformatted (code) block, optionally tagged with a language. |
pullQuote | text: RichTextContent, credit?: RichTextContent | this | A pull quotation (centered text). |
slideshow | blocks: BlockContent, caption?: RichBlockCaption | this | A slideshow of nested media blocks. |
table | cells: RichBlockTableCell[][], options: RichTableOptions | this | A table; cells is a rows-of-cells grid (see richTableCell). |
thinking | text: RichTextContent | this | A "Thinking..." placeholder (only valid in sendRichMessageDraft). |
video | video: InputMediaVideo, caption?: RichBlockCaption | this | A video block. |
voiceNote | voiceNote: InputMediaVoiceNote, caption?: RichBlockCaption | this | A voice-note block. |
RichMessageButtonBuilder
Fluent builder for a single RichMessageButton. Set the rich label (in the
constructor or via text), an optional style, then exactly one action
(url, callbackData, webApp, ...). .build() returns the plain button,
ready for RichMessageBuilder.buttons or a RichTextBuilder.button.
Methods
| Method | Params | Returns | Description |
|---|---|---|---|
build | - | RichMessageButton | The plain RichMessageButton (a fresh copy per call). |
callbackData | data: string | this | A callback button. |
copyText | text: string | this | A button that copies text to the clipboard. |
disabled | - | this | Mark the button disabled (shown, but not pressable). |
loginUrl | loginUrl: string | LoginUrl | this | A Login URL button; pass a URL or a full LoginUrl. |
style | style: string | this | Visual style: "danger", "success", "primary", or "link" (callback-only). |
switchInline | query: string | this | Switch to inline mode in another chat. |
switchInlineChosen | chosen: SwitchInlineQueryChosenChat | this | Switch to inline mode in a chat chosen by the user. |
switchInlineCurrent | query: string | this | Switch to inline mode in the current chat. |
text | text: RichTextContent | this | Replace the rich label. |
url | url: string | this | An HTTP/tg:// URL button. |
webApp | url: string | this | A Web App button. |
RichTextBuilder
Fluent builder for a RichText tree. Wrapping methods take rich content;
leaf methods (customEmoji, mathExpression, anchor, button) take their
own data. .build() returns the plain RichText (its accumulated sequence).
Methods
| Method | Params | Returns | Description |
|---|---|---|---|
anchor | name: string | this | An anchor target (an empty span the message can link back to). |
anchorLink | content: RichTextContent, anchorName: string | this | A link to a named anchor in the same message. |
bankCard | content: RichTextContent, bankCardNumber: string | this | - |
bold | content: RichTextContent | this | - |
botCommand | content: RichTextContent, botCommand: string | this | - |
build | - | RichText | The accumulated sequence as a plain RichText. |
button | button: RichMessageButton | this | An inline button. |
cashtag | content: RichTextContent, cashtag: string | this | - |
code | content: RichTextContent | this | Monowidth (inline code) text. |
customEmoji | customEmojiId: string, alternativeText: string | this | A custom emoji; alternativeText is the fallback emoji. |
dateTime | content: RichTextContent, unixTime: number, dateTimeFormat: string | this | A date/time; dateTimeFormat follows Telegram's date-time entity formatting. |
email | content: RichTextContent, emailAddress: string | this | - |
hashtag | content: RichTextContent, hashtag: string | this | - |
italic | content: RichTextContent | this | - |
marked | content: RichTextContent | this | Highlighted (marked) text. |
mathExpression | expression: string | this | A mathematical expression in LaTeX format. |
mention | content: RichTextContent, username: string | this | A mention by username (the @handle form). |
phone | content: RichTextContent, phoneNumber: string | this | - |
plain | text: string | this | Append plain, unstyled text. |
reference | content: RichTextContent, name: string | this | A named reference (footnote-style). |
referenceLink | content: RichTextContent, referenceName: string | this | A link to a reference by name. |
spoiler | content: RichTextContent | this | - |
strikethrough | content: RichTextContent | this | - |
subscript | content: RichTextContent | this | - |
superscript | content: RichTextContent | this | - |
textMention | content: RichTextContent, user: User | this | A text_mention of a user (works without a username). |
underline | content: RichTextContent | this | - |
url | content: RichTextContent, url: string | this | A hyperlink to url. |
StaticProfilePhotoBuilder
A static profile photo (a still image). .build() returns the InputProfilePhoto.
Methods
| Method | Params | Returns | Description |
|---|---|---|---|
build | - | InputProfilePhoto | - |
StickerSetBuilder
Collects the stickers array for createNewStickerSet. Mirrors MediaGroupBuilder;
each .add() takes one InputSticker ({ sticker, format, emoji_list, ... }). Named
StickerSetBuilder (not StickerSet) because StickerSet is a Bot API type. There is
no single-sticker builder - an InputSticker has no discriminant for a builder to add,
so addStickerToSet/replaceStickerInSet take that plain object directly.
Methods
| Method | Params | Returns | Description |
|---|---|---|---|
add | sticker: InputSticker | this | - |
build | - | InputSticker[] | - |
TelegramApiError
Telegram answered with { ok: false }. Carries the structured error fields.
Methods
| Method | Params | Returns | Description |
|---|---|---|---|
captureStackTrace | targetObject: object, constructorOpt?: Function | void | Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called. js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}. The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace. The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance: js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); |
prepareStackTrace | err: Error, stackTraces: CallSite[] | any | - |
Properties
| Property | Type |
|---|---|
cause? | unknown |
code | string |
description | string |
errorCode | number |
message | string |
name | string |
parameters? | ApiErrorParameters |
stack? | string |
stackTraceLimit | number |
migrateToChatId | number | undefined |
retryAfter | number | undefined |
TelegramBotError
Methods
| Method | Params | Returns | Description |
|---|---|---|---|
captureStackTrace | targetObject: object, constructorOpt?: Function | void | Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called. js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}. The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace. The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance: js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); |
prepareStackTrace | err: Error, stackTraces: CallSite[] | any | - |
Properties
| Property | Type |
|---|---|
cause? | unknown |
code | string |
message | string |
name | string |
stack? | string |
stackTraceLimit | number |
TimeoutError
The request exceeded the configured client timeout.
Methods
| Method | Params | Returns | Description |
|---|---|---|---|
captureStackTrace | targetObject: object, constructorOpt?: Function | void | Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called. js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}. The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace. The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance: js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); |
prepareStackTrace | err: Error, stackTraces: CallSite[] | any | - |
Properties
| Property | Type |
|---|---|
cause? | unknown |
code | string |
message | string |
name | string |
stack? | string |
stackTraceLimit | number |
TokenBucket
A continuous-refill token bucket. Tokens regenerate at ratePerSec, capped at
burst. take() resolves immediately when a token is available, otherwise
waits exactly long enough for one to refill (abortable).
Methods
| Method | Params | Returns | Description |
|---|---|---|---|
take | signal?: AbortSignal | Promise | Wait until a token is available, then consume one. The post-wait recheck closes the concurrent-oversell race: two take()s that both see an empty bucket compute the same wait, but on wake the first refills+decrements and the second's recheck sees the empty bucket again and waits another cycle - so the configured rate is never exceeded even under burst contention. The decrement happens only once the wait is in the past, so an aborted take consumes no token. |
Transport
Methods
| Method | Params | Returns | Description |
|---|---|---|---|
request | method: string, params?: Record<string, WireValue>, signal?: AbortSignal | Promise | - |
Properties
| Property | Type |
|---|---|
apiRoot | string |
VideoStoryBuilder
A video story for postStory/editStory. .build() returns the InputStoryContent.
Methods
| Method | Params | Returns | Description |
|---|---|---|---|
build | - | InputStoryContent | - |
Functions
asRichText()
Resolve content to a plain RichText (unwrapping a nested builder).
| Param | Type |
|---|---|
content | RichTextContent |
Returns: RichText
compileDebugFilter()
Compile a DEBUG-style filter string into an enabled(namespace) predicate.
Comma/space-separated patterns; * is a wildcard; a leading - skips. A
namespace is on when it matches a positive pattern and no skip. An empty
string matches nothing.
| Param | Type |
|---|---|
env | string |
Returns: (namespace: string) => boolean
compose()
Compose middleware into one function with standard koa-compose semantics.
The composed function resolves when the whole chain (including the optional
trailing next) has settled.
| Param | Type |
|---|---|
middleware | readonly Middleware |
Returns: (ctx: C, next?: NextFn) => Promise
createWebhookServer()
Create (but do not start) a node:http server that handles Telegram webhook
requests. Requests whose path differs from options.path (default /) get a
404; matching requests are delegated to the core (req, res) handler.
const server = createWebhookServer(bot, { path: "/telegram", secretToken });
server.listen(8443);
| Param | Type |
|---|---|
bot | Bot |
options | WebhookServerOptions |
Returns: Server
enableDebugFromEnv()
Read DEBUG (defaulting to process.env.DEBUG) and install a stderr-writing
sink for the namespaces it enables. With nothing enabled, the sink is cleared
so tracing stays a no-op.
| Param | Type |
|---|---|
env | string |
Returns: void
encodeForm()
| Param | Type |
|---|---|
fields | Record<string, WireValue> |
streaming | boolean |
Returns: Promise<EncodedRequest>
formPart()
Build a FormPart from a serialized JSON string and the files its refs point at.
| Param | Type |
|---|---|
json | string |
files | readonly readonly [string, InputFile][] |
Returns: FormPart
fromPath()
Wrap the file at path as an InputFile that streams from disk, reopening
the file for each transport retry. The default filename is the path's
basename; pass meta.filename / meta.contentType to override.
| Param | Type |
|---|---|
path | string |
meta? | { contentType?: string; filename?: string } |
Returns: Promise<InputFile>
isAbortError()
True for an AbortController/timeout abort, across runtimes. Matches both the
classic AbortError name and the TimeoutError DOMException that
AbortSignal.timeout() aborts with (per the HTML spec; Node >=18, Deno,
Cloudflare Workers), so the transport classifies our own client timeout as a
TimeoutError rather than falling through to NetworkError.
| Param | Type |
|---|---|
err | unknown |
Returns: boolean
isFormPart()
| Param | Type |
|---|---|
value | unknown |
Returns: value is FormPart
isInputFile()
| Param | Type |
|---|---|
value | unknown |
Returns: value is InputFile
isTransientError()
Classifies an error as transient (worth retrying) vs fatal.
True for a NetworkError, a TimeoutError, or a TelegramApiError that is a
429 (rate limit) or errorCode >= 500 (server-side failure). When retrying,
honor err.retryAfter if present (a 429 carries it), else fall back to a
default delay.
| Param | Type |
|---|---|
err | unknown |
Returns: boolean
longPoll()
Async-generator update source (ADR-004): long-polls getUpdates and yields each update until the signal aborts.
| Param | Type |
|---|---|
api | Api |
options | LongPollOptions |
signal? | AbortSignal |
Returns: AsyncGenerator<Update>
nextAppWebhook()
Next.js App Router handler. The App Router speaks Web Request/Response
natively, so this is the core webhookCallback verbatim:
export const POST = nextAppWebhook(bot);
| Param | Type |
|---|---|
bot | Bot |
options? | WebhookOptions |
Returns: (request: Request) => Promise
nodeFrameworkWebhook()
An (req, res) => Promise<void> handler for Express / Connect / Next.js Pages
API. Reads the request body, builds a Web Request, runs the core callback, and
writes the Web Response back onto res.
Body source: if a parser already populated req.body (e.g. express.json(),
which also consumes the stream) it is used directly; otherwise the raw stream
is drained. This works whether or not a body parser ran upstream - draining
unconditionally would yield an empty body behind a global express.json().
| Param | Type |
|---|---|
bot | Bot |
options? | WebhookOptions |
Returns: (req: NodeLikeRequest, res: NodeLikeResponse) => Promise
registerExpressWebhook()
Register the webhook route on an already-instantiated Express app. app is
typed structurally so Express is never a dependency:
registerExpressWebhook(bot, app, { path: "/telegram", secretToken });
| Param | Type |
|---|---|
bot | Bot |
app | { post: } |
options | WebhookOptions & { path: string } |
Returns: void
richCaption()
A block caption (text, optional credit) with rich text.
| Param | Type |
|---|---|
text | RichTextContent |
credit? | RichTextContent |
Returns: RichBlockCaption
richListItem()
A list item; blocks accept a nested builder or callback.
| Param | Type |
|---|---|
blocks | BlockContent |
options | Omit<InputRichBlockListItem, "blocks"> |
Returns: InputRichBlockListItem
richMessageButton()
Build a RichMessageButton with a rich text label. options carries the
button action (url, callback_data, web_app, ...) and optional style.
For a fluent form, see RichMessageButtonBuilder.
| Param | Type |
|---|---|
text | RichTextContent |
options | Omit<RichMessageButton, "text"> |
Returns: RichMessageButton
richTableCell()
A table cell; align defaults to "left", valign to "top".
| Param | Type |
|---|---|
text? | RichTextContent |
options | Omit<RichBlockTableCell, "text"> |
Returns: RichBlockTableCell
run()
Start the bot's long-poll loop and resolve when it stops. Installs
SIGINT/SIGTERM handlers that trigger bot.stop() for a clean shutdown,
cleaned up in a finally so repeated runs don't leak listeners.
| Param | Type |
|---|---|
bot | Bot |
options? | LongPollOptions |
Returns: Promise
safeEqual()
Constant-time string comparison. Does not early-out on content: a length
difference may be revealed (via the loop bound), but for a given length the
comparison always inspects every position, so it leaks no information about
where two equal-length strings differ. Pure JS - no node:crypto - to keep
src/core edge-safe.
| Param | Type |
|---|---|
a | string |
b | string |
Returns: boolean
startWebhook()
Managed webhook runner: create a node:http webhook server, start listening,
and resolve when it shuts down. Installs SIGINT/SIGTERM handlers that close
the server for a graceful exit (cleaned up in a finally), mirroring run() for
long polling. Rejects if the server fails (e.g. the port is in use).
You still register the webhook with Telegram yourself, pointing at this server's public URL (terminate TLS at a proxy/tunnel in front of it): api.setWebhook({ url, secret_token })
await startWebhook(bot, { port: 8443, path: "/telegram", secretToken });
| Param | Type |
|---|---|
bot | Bot |
options | StartWebhookOptions |
Returns: Promise
webhookCallback()
| Param | Type |
|---|---|
bot | Bot |
options | WebhookOptions |
Returns: (request: Request) => Promise
Interfaces
ApiErrorParameters
Subset of Telegram's ResponseParameters carried on API errors.
| Property | Type |
|---|---|
migrate_to_chat_id? | number |
retry_after? | number |
BotOptions
| Property | Type |
|---|---|
apiRoot? | string |
fetch? | (input: string | URL | Request, init?: RequestInit) => Promise |
maxRetries? | number |
maxRetryAfterMs? | number |
rateLimit? | RateLimitOptions |
retryBackoffMs? | number |
timeoutMs? | number |
BuiltEntities
| Property | Type |
|---|---|
entities | MessageEntity[] |
text | string |
EncodedRequest
| Property | Type |
|---|---|
body | () => Blob | ReadableStream<Uint8Array |
headers | Record<string, string> |
replayable | boolean |
FormPart
A file-carrying composite produced by serializeParams for a structured field
that contained nested InputFiles: the already-serialized JSON (with attach://
refs) plus the keyed parts those refs point at. The encoder sets json under the
field name and attaches each part - it still stringifies nothing (ADR-011).
| Property | Type |
|---|---|
__formPart | true |
files | readonly readonly [string, InputFile][] |
json | string |
InputFileMeta
| Property | Type |
|---|---|
contentType? | string |
filename? | string |
LongPollOptions
| Property | Type |
|---|---|
allowedUpdates? | string[] |
limit? | number |
offset? | number |
onError? | (err: unknown) => void |
retry? | boolean |
retryDelayMs? | number |
timeout? | number |
NodeLikeRequest
Minimal structural shape of a Node-style request (Express / Connect / Node http).
Typed here so core never imports node:http.
| Property | Type |
|---|---|
body? | unknown |
headers | Record<string, string | string[] | undefined> |
method? | string |
url? | string |
NodeLikeResponse
Minimal structural shape of a Node-style response.
| Property | Type |
|---|---|
statusCode | number |
RateLimitOptions
Requests-per-second limits. Either field may be omitted to disable that tier.
| Property | Type |
|---|---|
global? | number |
maxChatBuckets? | number |
perChat? | number |
ReplyKeyboardBuildOptions
| Property | Type |
|---|---|
input_field_placeholder? | string |
is_persistent? | boolean |
one_time_keyboard? | boolean |
resize_keyboard? | boolean |
selective? | boolean |
RichMessageBuildOptions
Options shared by RichMessageBuilder.build() beyond the blocks.
| Property | Type |
|---|---|
is_rtl? | boolean |
skip_entity_detection? | boolean |
RichTableOptions
Options for a table block; caption is rich text.
| Property | Type |
|---|---|
caption? | RichTextContent |
is_bordered? | true |
is_compact? | true |
is_striped? | true |
StartWebhookOptions
| Property | Type |
|---|---|
allowUnauthenticated? | boolean |
fastAck? | boolean |
hostname? | string |
path? | string |
port | number |
secretToken? | string |
waitUntil? | (promise: Promise |
TransportOptions
| Property | Type |
|---|---|
apiRoot? | string |
fetch? | (input: string | URL | Request, init?: RequestInit) => Promise |
maxRetries? | number |
maxRetryAfterMs? | number |
rateLimit? | RateLimitOptions |
retryBackoffMs? | number |
timeoutMs? | number |
WebhookOptions
| Property | Type |
|---|---|
allowUnauthenticated? | boolean |
fastAck? | boolean |
secretToken? | string |
waitUntil? | (promise: Promise |
WebhookServerOptions
| Property | Type |
|---|---|
allowUnauthenticated? | boolean |
fastAck? | boolean |
path? | string |
secretToken? | string |
waitUntil? | (promise: Promise |
Type aliases
AcceptedGiftTypes
type AcceptedGiftTypes = {
gifts_from_channels: boolean;
limited_gifts: boolean;
premium_subscription: boolean;
unique_gifts: boolean;
unlimited_gifts: boolean;
};
AddStickerToSetParams
type AddStickerToSetParams = {
name: string;
sticker: [InputSticker](#inputsticker);
user_id: number;
};
AddStickerToSetResult
type AddStickerToSetResult = boolean;
AffiliateInfo
type AffiliateInfo = {
affiliate_chat?: [Chat](#chat);
affiliate_user?: [User](#user);
amount: number;
commission_per_mille: number;
nanostar_amount?: number;
};
Animation
type Animation = {
duration: number;
file_id: string;
file_name?: string;
file_size?: number;
file_unique_id: string;
height: number;
mime_type?: string;
thumbnail?: [PhotoSize](#photosize);
width: number;
};
AnswerCallbackQueryParams
type AnswerCallbackQueryParams = {
cache_time?: number;
callback_query_id: string;
show_alert?: boolean;
text?: string;
url?: string;
};
AnswerCallbackQueryResult
type AnswerCallbackQueryResult = boolean;
AnswerChatJoinRequestQueryParams
type AnswerChatJoinRequestQueryParams = {
chat_join_request_query_id: string;
result: string;
};
AnswerChatJoinRequestQueryResult
type AnswerChatJoinRequestQueryResult = boolean;
AnswerGuestQueryParams
type AnswerGuestQueryParams = {
guest_query_id: string;
result: [InlineQueryResult](#inlinequeryresult);
};
AnswerGuestQueryResult
type AnswerGuestQueryResult = [SentGuestMessage](#sentguestmessage);
AnswerInlineQueryParams
type AnswerInlineQueryParams = {
button?: [InlineQueryResultsButton](#inlinequeryresultsbutton);
cache_time?: number;
inline_query_id: string;
is_personal?: boolean;
next_offset?: string;
results: [InlineQueryResult](#inlinequeryresult)[];
};
AnswerInlineQueryResult
type AnswerInlineQueryResult = boolean;
AnswerPreCheckoutQueryParams
type AnswerPreCheckoutQueryParams = {
error_message?: string;
ok: boolean;
pre_checkout_query_id: string;
};
AnswerPreCheckoutQueryResult
type AnswerPreCheckoutQueryResult = boolean;
AnswerShippingQueryParams
type AnswerShippingQueryParams = {
error_message?: string;
ok: boolean;
shipping_options?: [ShippingOption](#shippingoption)[];
shipping_query_id: string;
};
AnswerShippingQueryResult
type AnswerShippingQueryResult = boolean;
AnswerWebAppQueryParams
type AnswerWebAppQueryParams = {
result: [InlineQueryResult](#inlinequeryresult);
web_app_query_id: string;
};
AnswerWebAppQueryResult
type AnswerWebAppQueryResult = [SentWebAppMessage](#sentwebappmessage);
ApproveChatJoinRequestParams
type ApproveChatJoinRequestParams = {
chat_id: number | string;
user_id: number;
};
ApproveChatJoinRequestResult
type ApproveChatJoinRequestResult = boolean;
ApproveSuggestedPostParams
type ApproveSuggestedPostParams = {
chat_id: number;
message_id: number;
send_date?: number;
};
ApproveSuggestedPostResult
type ApproveSuggestedPostResult = boolean;
Audio
type Audio = {
duration: number;
file_id: string;
file_name?: string;
file_size?: number;
file_unique_id: string;
mime_type?: string;
performer?: string;
thumbnail?: [PhotoSize](#photosize);
title?: string;
};
BackgroundFill
type BackgroundFill = [BackgroundFillSolid](#backgroundfillsolid) | [BackgroundFillGradient](#backgroundfillgradient) | [BackgroundFillFreeformGradient](#backgroundfillfreeformgradient);
BackgroundFillFreeformGradient
type BackgroundFillFreeformGradient = {
colors: number[];
type: string;
};
BackgroundFillGradient
type BackgroundFillGradient = {
bottom_color: number;
rotation_angle: number;
top_color: number;
type: string;
};
BackgroundFillSolid
type BackgroundFillSolid = {
color: number;
type: string;
};
BackgroundType
type BackgroundType = [BackgroundTypeFill](#backgroundtypefill) | [BackgroundTypeWallpaper](#backgroundtypewallpaper) | [BackgroundTypePattern](#backgroundtypepattern) | [BackgroundTypeChatTheme](#backgroundtypechattheme);
BackgroundTypeChatTheme
type BackgroundTypeChatTheme = {
theme_name: string;
type: string;
};
BackgroundTypeFill
type BackgroundTypeFill = {
dark_theme_dimming: number;
fill: [BackgroundFill](#backgroundfill);
type: string;
};
BackgroundTypePattern
type BackgroundTypePattern = {
document: [Document](#document);
fill: [BackgroundFill](#backgroundfill);
intensity: number;
is_inverted?: true;
is_moving?: true;
type: string;
};
BackgroundTypeWallpaper
type BackgroundTypeWallpaper = {
dark_theme_dimming: number;
document: [Document](#document);
is_blurred?: true;
is_moving?: true;
type: string;
};
BanChatMemberParams
type BanChatMemberParams = {
chat_id: number | string;
revoke_messages?: boolean;
until_date?: number;
user_id: number;
};
BanChatMemberResult
type BanChatMemberResult = boolean;
BanChatSenderChatParams
type BanChatSenderChatParams = {
chat_id: number | string;
sender_chat_id: number;
};
BanChatSenderChatResult
type BanChatSenderChatResult = boolean;
Birthdate
type Birthdate = {
day: number;
month: number;
year?: number;
};
BlockContent
A nested-blocks argument: a plain array, a nested builder, or a callback.
type BlockContent = [InputRichBlock](#inputrichblock)[] | [RichMessageBuilder](#richmessagebuilder) | (builder: [RichMessageBuilder](#richmessagebuilder)) => void;
BotAccessSettings
type BotAccessSettings = {
added_users?: [User](#user)[];
is_access_restricted: boolean;
};
BotCommand
type BotCommand = {
command: string;
description: string;
is_ephemeral?: boolean;
};
BotCommandScope
type BotCommandScope = [BotCommandScopeDefault](#botcommandscopedefault) | [BotCommandScopeAllPrivateChats](#botcommandscopeallprivatechats) | [BotCommandScopeAllGroupChats](#botcommandscopeallgroupchats) | [BotCommandScopeAllChatAdministrators](#botcommandscopeallchatadministrators) | [BotCommandScopeChat](#botcommandscopechat) | [BotCommandScopeChatAdministrators](#botcommandscopechatadministrators) | [BotCommandScopeChatMember](#botcommandscopechatmember);
BotCommandScopeAllChatAdministrators
type BotCommandScopeAllChatAdministrators = {
type: string;
};
BotCommandScopeAllGroupChats
type BotCommandScopeAllGroupChats = {
type: string;
};
BotCommandScopeAllPrivateChats
type BotCommandScopeAllPrivateChats = {
type: string;
};
BotCommandScopeChat
type BotCommandScopeChat = {
chat_id: number | string;
type: string;
};
BotCommandScopeChatAdministrators
type BotCommandScopeChatAdministrators = {
chat_id: number | string;
type: string;
};
BotCommandScopeChatMember
type BotCommandScopeChatMember = {
chat_id: number | string;
type: string;
user_id: number;
};
BotCommandScopeDefault
type BotCommandScopeDefault = {
type: string;
};
BotDescription
type BotDescription = {
description: string;
};
BotName
type BotName = {
name: string;
};
BotShortDescription
type BotShortDescription = {
short_description: string;
};
BotSubscriptionUpdated
type BotSubscriptionUpdated = {
invoice_payload: string;
state: string;
user: [User](#user);
};
BusinessBotRights
type BusinessBotRights = {
can_change_gift_settings?: true;
can_convert_gifts_to_stars?: true;
can_delete_all_messages?: true;
can_delete_sent_messages?: true;
can_edit_bio?: true;
can_edit_name?: true;
can_edit_profile_photo?: true;
can_edit_username?: true;
can_manage_stories?: true;
can_read_messages?: true;
can_reply?: true;
can_transfer_and_upgrade_gifts?: true;
can_transfer_stars?: true;
can_view_gifts_and_stars?: true;
};
BusinessConnection
type BusinessConnection = {
date: number;
id: string;
is_enabled: boolean;
rights?: [BusinessBotRights](#businessbotrights);
user: [User](#user);
user_chat_id: number;
};
BusinessIntro
type BusinessIntro = {
message?: string;
sticker?: [Sticker](#sticker);
title?: string;
};
BusinessLocation
type BusinessLocation = {
address: string;
location?: [Location](#location);
};
BusinessMessagesDeleted
type BusinessMessagesDeleted = {
business_connection_id: string;
chat: [Chat](#chat);
message_ids: number[];
};
BusinessOpeningHours
type BusinessOpeningHours = {
opening_hours: [BusinessOpeningHoursInterval](#businessopeninghoursinterval)[];
time_zone_name: string;
};
BusinessOpeningHoursInterval
type BusinessOpeningHoursInterval = {
closing_minute: number;
opening_minute: number;
};
CallbackGame
type CallbackGame = Record<string, never>;
CallbackQuery
type CallbackQuery = {
chat_instance: string;
data?: string;
from: [User](#user);
game_short_name?: string;
id: string;
inline_message_id?: string;
message?: [MaybeInaccessibleMessage](#maybeinaccessiblemessage);
};
Chat
type Chat = {
first_name?: string;
id: number;
is_direct_messages?: true;
is_forum?: true;
last_name?: string;
title?: string;
type: string;
username?: string;
};
ChatAdministratorRights
type ChatAdministratorRights = {
can_change_info: boolean;
can_delete_messages: boolean;
can_delete_stories: boolean;
can_edit_messages?: boolean;
can_edit_stories: boolean;
can_invite_users: boolean;
can_manage_chat: boolean;
can_manage_direct_messages?: boolean;
can_manage_tags?: boolean;
can_manage_topics?: boolean;
can_manage_video_chats: boolean;
can_pin_messages?: boolean;
can_post_messages?: boolean;
can_post_stories: boolean;
can_promote_members: boolean;
can_restrict_members: boolean;
can_send_welcome_messages: boolean;
is_anonymous: boolean;
};
ChatBackground
type ChatBackground = {
type: [BackgroundType](#backgroundtype);
};
ChatBoost
type ChatBoost = {
add_date: number;
boost_id: string;
expiration_date: number;
source: [ChatBoostSource](#chatboostsource);
};
ChatBoostAdded
type ChatBoostAdded = {
boost_count: number;
};
ChatBoostRemoved
type ChatBoostRemoved = {
boost_id: string;
chat: [Chat](#chat);
remove_date: number;
source: [ChatBoostSource](#chatboostsource);
};
ChatBoostSource
type ChatBoostSource = [ChatBoostSourcePremium](#chatboostsourcepremium) | [ChatBoostSourceGiftCode](#chatboostsourcegiftcode) | [ChatBoostSourceGiveaway](#chatboostsourcegiveaway);
ChatBoostSourceGiftCode
type ChatBoostSourceGiftCode = {
source: string;
user: [User](#user);
};
ChatBoostSourceGiveaway
type ChatBoostSourceGiveaway = {
giveaway_message_id: number;
is_unclaimed?: true;
prize_star_count?: number;
source: string;
user?: [User](#user);
};
ChatBoostSourcePremium
type ChatBoostSourcePremium = {
source: string;
user: [User](#user);
};
ChatBoostUpdated
type ChatBoostUpdated = {
boost: [ChatBoost](#chatboost);
chat: [Chat](#chat);
};
ChatFullInfo
type ChatFullInfo = {
accent_color_id: number;
accepted_gift_types: [AcceptedGiftTypes](#acceptedgifttypes);
active_usernames?: string[];
available_reactions?: [ReactionType](#reactiontype)[];
background_custom_emoji_id?: string;
bio?: string;
birthdate?: [Birthdate](#birthdate);
business_intro?: [BusinessIntro](#businessintro);
business_location?: [BusinessLocation](#businesslocation);
business_opening_hours?: [BusinessOpeningHours](#businessopeninghours);
can_send_paid_media?: true;
can_set_sticker_set?: true;
community?: [Community](#community);
custom_emoji_sticker_set_name?: string;
description?: string;
emoji_status_custom_emoji_id?: string;
emoji_status_expiration_date?: number;
first_name?: string;
first_profile_audio?: [Audio](#audio);
guard_bot?: [User](#user);
has_aggressive_anti_spam_enabled?: true;
has_hidden_members?: true;
has_private_forwards?: true;
has_protected_content?: true;
has_restricted_voice_and_video_messages?: true;
has_visible_history?: true;
id: number;
invite_link?: string;
is_direct_messages?: true;
is_forum?: true;
join_by_request?: true;
join_to_send_messages?: true;
last_name?: string;
linked_chat_id?: number;
location?: [ChatLocation](#chatlocation);
max_reaction_count: number;
message_auto_delete_time?: number;
paid_message_star_count?: number;
parent_chat?: [Chat](#chat);
permissions?: [ChatPermissions](#chatpermissions);
personal_chat?: [Chat](#chat);
photo?: [ChatPhoto](#chatphoto);
pinned_message?: [Message](#message);
profile_accent_color_id?: number;
profile_background_custom_emoji_id?: string;
rating?: [UserRating](#userrating);
slow_mode_delay?: number;
sticker_set_name?: string;
title?: string;
type: string;
unique_gift_colors?: [UniqueGiftColors](#uniquegiftcolors);
unrestrict_boost_count?: number;
username?: string;
};
ChatId
Chat identifier: numeric id or @username.
type ChatId = number | string;
ChatInviteLink
type ChatInviteLink = {
creates_join_request: boolean;
creator: [User](#user);
expire_date?: number;
invite_link: string;
is_primary: boolean;
is_revoked: boolean;
member_limit?: number;
name?: string;
pending_join_request_count?: number;
subscription_period?: number;
subscription_price?: number;
};
ChatJoinRequest
type ChatJoinRequest = {
bio?: string;
chat: [Chat](#chat);
date: number;
from: [User](#user);
invite_link?: [ChatInviteLink](#chatinvitelink);
query_id?: string;
user_chat_id: number;
};
ChatLocation
type ChatLocation = {
address: string;
location: [Location](#location);
};
ChatMember
type ChatMember = [ChatMemberOwner](#chatmemberowner) | [ChatMemberAdministrator](#chatmemberadministrator) | [ChatMemberMember](#chatmembermember) | [ChatMemberRestricted](#chatmemberrestricted) | [ChatMemberLeft](#chatmemberleft) | [ChatMemberBanned](#chatmemberbanned);
ChatMemberAdministrator
type ChatMemberAdministrator = {
can_be_edited: boolean;
can_change_info: boolean;
can_delete_messages: boolean;
can_delete_stories: boolean;
can_edit_messages?: boolean;
can_edit_stories: boolean;
can_invite_users: boolean;
can_manage_chat: boolean;
can_manage_direct_messages?: boolean;
can_manage_tags?: boolean;
can_manage_topics?: boolean;
can_manage_video_chats: boolean;
can_pin_messages?: boolean;
can_post_messages?: boolean;
can_post_stories: boolean;
can_promote_members: boolean;
can_restrict_members: boolean;
can_send_welcome_messages: boolean;
custom_title?: string;
is_anonymous: boolean;
status: string;
user: [User](#user);
};
ChatMemberBanned
type ChatMemberBanned = {
status: string;
until_date: number;
user: [User](#user);
};
ChatMemberLeft
type ChatMemberLeft = {
status: string;
user: [User](#user);
};
ChatMemberMember
type ChatMemberMember = {
status: string;
tag?: string;
until_date?: number;
user: [User](#user);
};
ChatMemberOwner
type ChatMemberOwner = {
custom_title?: string;
is_anonymous: boolean;
status: string;
user: [User](#user);
};
ChatMemberRestricted
type ChatMemberRestricted = {
can_add_web_page_previews: boolean;
can_change_info: boolean;
can_edit_tag: boolean;
can_invite_users: boolean;
can_manage_topics: boolean;
can_pin_messages: boolean;
can_react_to_messages: boolean;
can_send_audios: boolean;
can_send_documents: boolean;
can_send_messages: boolean;
can_send_other_messages: boolean;
can_send_photos: boolean;
can_send_polls: boolean;
can_send_video_notes: boolean;
can_send_videos: boolean;
can_send_voice_notes: boolean;
is_member: boolean;
status: string;
tag?: string;
until_date: number;
user: [User](#user);
};
ChatMemberUpdated
type ChatMemberUpdated = {
chat: [Chat](#chat);
date: number;
from: [User](#user);
invite_link?: [ChatInviteLink](#chatinvitelink);
new_chat_member: [ChatMember](#chatmember);
old_chat_member: [ChatMember](#chatmember);
via_chat_folder_invite_link?: boolean;
via_join_request?: boolean;
};
ChatOwnerChanged
type ChatOwnerChanged = {
new_owner: [User](#user);
};
ChatOwnerLeft
type ChatOwnerLeft = {
new_owner?: [User](#user);
};
ChatPermissions
type ChatPermissions = {
can_add_web_page_previews?: boolean;
can_change_info?: boolean;
can_edit_tag?: boolean;
can_invite_users?: boolean;
can_manage_topics?: boolean;
can_pin_messages?: boolean;
can_react_to_messages?: boolean;
can_send_audios?: boolean;
can_send_documents?: boolean;
can_send_messages?: boolean;
can_send_other_messages?: boolean;
can_send_photos?: boolean;
can_send_polls?: boolean;
can_send_video_notes?: boolean;
can_send_videos?: boolean;
can_send_voice_notes?: boolean;
};
ChatPhoto
type ChatPhoto = {
big_file_id: string;
big_file_unique_id: string;
small_file_id: string;
small_file_unique_id: string;
};
ChatShared
type ChatShared = {
chat_id: number;
photo?: [PhotoSize](#photosize)[];
request_id: number;
title?: string;
username?: string;
};
Checklist
type Checklist = {
others_can_add_tasks?: true;
others_can_mark_tasks_as_done?: true;
tasks: [ChecklistTask](#checklisttask)[];
title: string;
title_entities?: [MessageEntity](#messageentity)[];
};
ChecklistTask
type ChecklistTask = {
completed_by_chat?: [Chat](#chat);
completed_by_user?: [User](#user);
completion_date?: number;
id: number;
text: string;
text_entities?: [MessageEntity](#messageentity)[];
};
ChecklistTasksAdded
type ChecklistTasksAdded = {
checklist_message?: [Message](#message);
tasks: [ChecklistTask](#checklisttask)[];
};
ChecklistTasksDone
type ChecklistTasksDone = {
checklist_message?: [Message](#message);
marked_as_done_task_ids?: number[];
marked_as_not_done_task_ids?: number[];
};
ChosenInlineResult
type ChosenInlineResult = {
from: [User](#user);
inline_message_id?: string;
location?: [Location](#location);
query: string;
result_id: string;
};
CloseForumTopicParams
type CloseForumTopicParams = {
chat_id: number | string;
message_thread_id: number;
};
CloseForumTopicResult
type CloseForumTopicResult = boolean;
CloseGeneralForumTopicParams
type CloseGeneralForumTopicParams = {
chat_id: number | string;
};
CloseGeneralForumTopicResult
type CloseGeneralForumTopicResult = boolean;
CloseParams
type CloseParams = Record<string, never>;
CloseResult
type CloseResult = boolean;
Community
type Community = {
id: number;
name: string;
};
CommunityChatAdded
type CommunityChatAdded = {
community: [Community](#community);
};
CommunityChatJoined
type CommunityChatJoined = {
community: [Community](#community);
};
CommunityChatRemoved
type CommunityChatRemoved = Record<string, never>;
Contact
type Contact = {
first_name: string;
last_name?: string;
phone_number: string;
user_id?: number;
vcard?: string;
};
ConvertGiftToStarsParams
type ConvertGiftToStarsParams = {
business_connection_id: string;
owned_gift_id: string;
};
ConvertGiftToStarsResult
type ConvertGiftToStarsResult = boolean;
CopyMessageParams
type CopyMessageParams = {
allow_paid_broadcast?: boolean;
caption?: string;
caption_entities?: [MessageEntity](#messageentity)[];
chat_id: number | string;
direct_messages_topic_id?: number;
disable_notification?: boolean;
from_chat_id: number | string;
message_effect_id?: string;
message_id: number;
message_thread_id?: number;
parse_mode?: string;
protect_content?: boolean;
reply_markup?: [InlineKeyboardMarkup](#inlinekeyboardmarkup) | [ReplyKeyboardMarkup](#replykeyboardmarkup) | [ReplyKeyboardRemove](#replykeyboardremove) | [ForceReply](#forcereply);
reply_parameters?: [ReplyParameters](#replyparameters);
show_caption_above_media?: boolean;
suggested_post_parameters?: [SuggestedPostParameters](#suggestedpostparameters);
video_start_timestamp?: number;
};
CopyMessageResult
type CopyMessageResult = [MessageId](#messageid);
CopyMessagesParams
type CopyMessagesParams = {
chat_id: number | string;
direct_messages_topic_id?: number;
disable_notification?: boolean;
from_chat_id: number | string;
message_ids: number[];
message_thread_id?: number;
protect_content?: boolean;
remove_caption?: boolean;
};
CopyMessagesResult
type CopyMessagesResult = [MessageId](#messageid)[];
CopyTextButton
type CopyTextButton = {
text: string;
};
CreateChatInviteLinkParams
type CreateChatInviteLinkParams = {
chat_id: number | string;
creates_join_request?: boolean;
expire_date?: number;
member_limit?: number;
name?: string;
};
CreateChatInviteLinkResult
type CreateChatInviteLinkResult = [ChatInviteLink](#chatinvitelink);
CreateChatSubscriptionInviteLinkParams
type CreateChatSubscriptionInviteLinkParams = {
chat_id: number | string;
name?: string;
subscription_period: number;
subscription_price: number;
};
CreateChatSubscriptionInviteLinkResult
type CreateChatSubscriptionInviteLinkResult = [ChatInviteLink](#chatinvitelink);
CreateForumTopicParams
type CreateForumTopicParams = {
chat_id: number | string;
icon_color?: number;
icon_custom_emoji_id?: string;
name: string;
};
CreateForumTopicResult
type CreateForumTopicResult = [ForumTopic](#forumtopic);
CreateInvoiceLinkParams
type CreateInvoiceLinkParams = {
business_connection_id?: string;
currency: string;
description: string;
is_flexible?: boolean;
max_tip_amount?: number;
need_email?: boolean;
need_name?: boolean;
need_phone_number?: boolean;
need_shipping_address?: boolean;
payload: string;
photo_height?: number;
photo_size?: number;
photo_url?: string;
photo_width?: number;
prices: [LabeledPrice](#labeledprice)[];
provider_data?: string;
provider_token?: string;
send_email_to_provider?: boolean;
send_phone_number_to_provider?: boolean;
subscription_period?: number;
suggested_tip_amounts?: number[];
title: string;
};
CreateInvoiceLinkResult
type CreateInvoiceLinkResult = string;
CreateNewStickerSetParams
type CreateNewStickerSetParams = {
name: string;
needs_repainting?: boolean;
sticker_type?: string;
stickers: [InputSticker](#inputsticker)[];
title: string;
user_id: number;
};
CreateNewStickerSetResult
type CreateNewStickerSetResult = boolean;
DeclineChatJoinRequestParams
type DeclineChatJoinRequestParams = {
chat_id: number | string;
user_id: number;
};
DeclineChatJoinRequestResult
type DeclineChatJoinRequestResult = boolean;
DeclineSuggestedPostParams
type DeclineSuggestedPostParams = {
chat_id: number;
comment?: string;
message_id: number;
};
DeclineSuggestedPostResult
type DeclineSuggestedPostResult = boolean;
DeleteAllMessageReactionsParams
type DeleteAllMessageReactionsParams = {
actor_chat_id?: number;
chat_id: number | string;
user_id?: number;
};
DeleteAllMessageReactionsResult
type DeleteAllMessageReactionsResult = boolean;
DeleteBusinessMessagesParams
type DeleteBusinessMessagesParams = {
business_connection_id: string;
message_ids: number[];
};
DeleteBusinessMessagesResult
type DeleteBusinessMessagesResult = boolean;
DeleteChatPhotoParams
type DeleteChatPhotoParams = {
chat_id: number | string;
};
DeleteChatPhotoResult
type DeleteChatPhotoResult = boolean;
DeleteChatStickerSetParams
type DeleteChatStickerSetParams = {
chat_id: number | string;
};
DeleteChatStickerSetResult
type DeleteChatStickerSetResult = boolean;
DeleteEphemeralMessageParams
type DeleteEphemeralMessageParams = {
chat_id: number | string;
ephemeral_message_id: number;
receiver_user_id: number;
};
DeleteEphemeralMessageResult
type DeleteEphemeralMessageResult = boolean;
DeleteForumTopicParams
type DeleteForumTopicParams = {
chat_id: number | string;
message_thread_id: number;
};
DeleteForumTopicResult
type DeleteForumTopicResult = boolean;
DeleteMessageParams
type DeleteMessageParams = {
chat_id: number | string;
message_id: number;
};
DeleteMessageReactionParams
type DeleteMessageReactionParams = {
actor_chat_id?: number;
chat_id: number | string;
message_id: number;
user_id?: number;
};
DeleteMessageReactionResult
type DeleteMessageReactionResult = boolean;
DeleteMessageResult
type DeleteMessageResult = boolean;
DeleteMessagesParams
type DeleteMessagesParams = {
chat_id: number | string;
message_ids: number[];
};
DeleteMessagesResult
type DeleteMessagesResult = boolean;
DeleteMyCommandsParams
type DeleteMyCommandsParams = {
language_code?: string;
scope?: [BotCommandScope](#botcommandscope);
};
DeleteMyCommandsResult
type DeleteMyCommandsResult = boolean;
DeleteStickerFromSetParams
type DeleteStickerFromSetParams = {
sticker: string;
};
DeleteStickerFromSetResult
type DeleteStickerFromSetResult = boolean;
DeleteStickerSetParams
type DeleteStickerSetParams = {
name: string;
};
DeleteStickerSetResult
type DeleteStickerSetResult = boolean;
DeleteStoryParams
type DeleteStoryParams = {
business_connection_id: string;
story_id: number;
};
DeleteStoryResult
type DeleteStoryResult = boolean;
DeleteWebhookParams
type DeleteWebhookParams = {
drop_pending_updates?: boolean;
};
DeleteWebhookResult
type DeleteWebhookResult = boolean;
Dice
type Dice = {
emoji: string;
value: number;
};
DirectMessagePriceChanged
type DirectMessagePriceChanged = {
are_direct_messages_enabled: boolean;
direct_message_star_count?: number;
};
DirectMessagesTopic
type DirectMessagesTopic = {
topic_id: number;
user?: [User](#user);
};
DisabledButton
type DisabledButton = Record<string, never>;
Document
type Document = {
file_id: string;
file_name?: string;
file_size?: number;
file_unique_id: string;
mime_type?: string;
thumbnail?: [PhotoSize](#photosize);
};
EditChatInviteLinkParams
type EditChatInviteLinkParams = {
chat_id: number | string;
creates_join_request?: boolean;
expire_date?: number;
invite_link: string;
member_limit?: number;
name?: string;
};
EditChatInviteLinkResult
type EditChatInviteLinkResult = [ChatInviteLink](#chatinvitelink);
EditChatSubscriptionInviteLinkParams
type EditChatSubscriptionInviteLinkParams = {
chat_id: number | string;
invite_link: string;
name?: string;
};
EditChatSubscriptionInviteLinkResult
type EditChatSubscriptionInviteLinkResult = [ChatInviteLink](#chatinvitelink);
EditEphemeralMessageCaptionParams
type EditEphemeralMessageCaptionParams = {
caption?: string;
caption_entities?: [MessageEntity](#messageentity)[];
chat_id: number | string;
ephemeral_message_id: number;
parse_mode?: string;
receiver_user_id: number;
reply_markup?: [InlineKeyboardMarkup](#inlinekeyboardmarkup);
show_caption_above_media?: boolean;
};
EditEphemeralMessageCaptionResult
type EditEphemeralMessageCaptionResult = boolean;
EditEphemeralMessageMediaParams
type EditEphemeralMessageMediaParams = {
chat_id: number | string;
ephemeral_message_id: number;
media: [InputMedia](#inputmedia);
receiver_user_id: number;
reply_markup?: [InlineKeyboardMarkup](#inlinekeyboardmarkup);
};
EditEphemeralMessageMediaResult
type EditEphemeralMessageMediaResult = boolean;
EditEphemeralMessageReplyMarkupParams
type EditEphemeralMessageReplyMarkupParams = {
chat_id: number | string;
ephemeral_message_id: number;
receiver_user_id: number;
reply_markup?: [InlineKeyboardMarkup](#inlinekeyboardmarkup);
};
EditEphemeralMessageReplyMarkupResult
type EditEphemeralMessageReplyMarkupResult = boolean;
EditEphemeralMessageTextParams
type EditEphemeralMessageTextParams = {
chat_id: number | string;
entities?: [MessageEntity](#messageentity)[];
ephemeral_message_id: number;
link_preview_options?: [LinkPreviewOptions](#linkpreviewoptions);
parse_mode?: string;
receiver_user_id: number;
reply_markup?: [InlineKeyboardMarkup](#inlinekeyboardmarkup);
rich_message?: [InputRichMessage](#inputrichmessage);
text?: string;
};
EditEphemeralMessageTextResult
type EditEphemeralMessageTextResult = boolean;
EditForumTopicParams
type EditForumTopicParams = {
chat_id: number | string;
icon_custom_emoji_id?: string;
message_thread_id: number;
name?: string;
};
EditForumTopicResult
type EditForumTopicResult = boolean;
EditGeneralForumTopicParams
type EditGeneralForumTopicParams = {
chat_id: number | string;
name: string;
};
EditGeneralForumTopicResult
type EditGeneralForumTopicResult = boolean;
EditMessageCaptionParams
type EditMessageCaptionParams = {
business_connection_id?: string;
caption?: string;
caption_entities?: [MessageEntity](#messageentity)[];
chat_id?: number | string;
inline_message_id?: string;
message_id?: number;
parse_mode?: string;
reply_markup?: [InlineKeyboardMarkup](#inlinekeyboardmarkup);
show_caption_above_media?: boolean;
};
EditMessageCaptionResult
type EditMessageCaptionResult = [Message](#message) | boolean;
EditMessageChecklistParams
type EditMessageChecklistParams = {
business_connection_id: string;
chat_id: number | string;
checklist: [InputChecklist](#inputchecklist);
message_id: number;
reply_markup?: [InlineKeyboardMarkup](#inlinekeyboardmarkup);
};
EditMessageChecklistResult
type EditMessageChecklistResult = [Message](#message);
EditMessageLiveLocationParams
type EditMessageLiveLocationParams = {
business_connection_id?: string;
chat_id?: number | string;
heading?: number;
horizontal_accuracy?: number;
inline_message_id?: string;
latitude: number;
live_period?: number;
longitude: number;
message_id?: number;
proximity_alert_radius?: number;
reply_markup?: [InlineKeyboardMarkup](#inlinekeyboardmarkup);
};
EditMessageLiveLocationResult
type EditMessageLiveLocationResult = [Message](#message) | boolean;
EditMessageMediaParams
type EditMessageMediaParams = {
business_connection_id?: string;
chat_id?: number | string;
inline_message_id?: string;
media: [InputMedia](#inputmedia);
message_id?: number;
reply_markup?: [InlineKeyboardMarkup](#inlinekeyboardmarkup);
};
EditMessageMediaResult
type EditMessageMediaResult = [Message](#message) | boolean;
EditMessageReplyMarkupParams
type EditMessageReplyMarkupParams = {
business_connection_id?: string;
chat_id?: number | string;
inline_message_id?: string;
message_id?: number;
reply_markup?: [InlineKeyboardMarkup](#inlinekeyboardmarkup);
};
EditMessageReplyMarkupResult
type EditMessageReplyMarkupResult = [Message](#message) | boolean;
EditMessageTextParams
type EditMessageTextParams = {
business_connection_id?: string;
chat_id?: number | string;
entities?: [MessageEntity](#messageentity)[];
inline_message_id?: string;
link_preview_options?: [LinkPreviewOptions](#linkpreviewoptions);
message_id?: number;
parse_mode?: string;
reply_markup?: [InlineKeyboardMarkup](#inlinekeyboardmarkup);
rich_message?: [InputRichMessage](#inputrichmessage);
text?: string;
};
EditMessageTextResult
type EditMessageTextResult = [Message](#message) | boolean;
EditStoryParams
type EditStoryParams = {
areas?: [StoryArea](#storyarea)[];
business_connection_id: string;
caption?: string;
caption_entities?: [MessageEntity](#messageentity)[];
content: [InputStoryContent](#inputstorycontent);
parse_mode?: string;
story_id: number;
};
EditStoryResult
type EditStoryResult = [Story](#story);
EditUserStarSubscriptionParams
type EditUserStarSubscriptionParams = {
is_canceled: boolean;
telegram_payment_charge_id: string;
user_id: number;
};
EditUserStarSubscriptionResult
type EditUserStarSubscriptionResult = boolean;
EncryptedCredentials
type EncryptedCredentials = {
data: string;
hash: string;
secret: string;
};
EncryptedPassportElement
type EncryptedPassportElement = {
data?: string;
email?: string;
files?: [PassportFile](#passportfile)[];
front_side?: [PassportFile](#passportfile);
hash: string;
phone_number?: string;
reverse_side?: [PassportFile](#passportfile);
selfie?: [PassportFile](#passportfile);
translation?: [PassportFile](#passportfile)[];
type: string;
};
EphemeralMessageParameters
type EphemeralMessageParameters = {
callback_query_id?: string;
receiver_user_id: number;
replace_callback_query_message?: boolean;
};
ExportChatInviteLinkParams
type ExportChatInviteLinkParams = {
chat_id: number | string;
};
ExportChatInviteLinkResult
type ExportChatInviteLinkResult = string;
ExternalReplyInfo
type ExternalReplyInfo = {
animation?: [Animation](#animation);
audio?: [Audio](#audio);
chat?: [Chat](#chat);
checklist?: [Checklist](#checklist);
contact?: [Contact](#contact);
dice?: [Dice](#dice);
document?: [Document](#document);
game?: [Game](#game);
giveaway?: [Giveaway](#giveaway);
giveaway_winners?: [GiveawayWinners](#giveawaywinners);
has_media_spoiler?: true;
invoice?: [Invoice](#invoice);
link_preview_options?: [LinkPreviewOptions](#linkpreviewoptions);
live_photo?: [LivePhoto](#livephoto);
location?: [Location](#location);
message_id?: number;
origin: [MessageOrigin](#messageorigin);
paid_media?: [PaidMediaInfo](#paidmediainfo);
photo?: [PhotoSize](#photosize)[];
poll?: [Poll](#poll);
sticker?: [Sticker](#sticker);
story?: [Story](#story);
venue?: [Venue](#venue);
video?: [Video](#video);
video_note?: [VideoNote](#videonote);
voice?: [Voice](#voice);
};
File
type File = {
file_id: string;
file_path?: string;
file_size?: number;
file_unique_id: string;
};
ForceReply
type ForceReply = {
force_reply: true;
input_field_placeholder?: string;
selective?: boolean;
};
ForumTopic
type ForumTopic = {
icon_color: number;
icon_custom_emoji_id?: string;
is_name_implicit?: true;
message_thread_id: number;
name: string;
};
ForumTopicClosed
type ForumTopicClosed = Record<string, never>;
ForumTopicCreated
type ForumTopicCreated = {
icon_color: number;
icon_custom_emoji_id?: string;
is_name_implicit?: true;
name: string;
};
ForumTopicEdited
type ForumTopicEdited = {
icon_custom_emoji_id?: string;
name?: string;
};
ForumTopicReopened
type ForumTopicReopened = Record<string, never>;
ForwardMessageParams
type ForwardMessageParams = {
chat_id: number | string;
direct_messages_topic_id?: number;
disable_notification?: boolean;
from_chat_id: number | string;
message_effect_id?: string;
message_id: number;
message_thread_id?: number;
protect_content?: boolean;
suggested_post_parameters?: [SuggestedPostParameters](#suggestedpostparameters);
video_start_timestamp?: number;
};
ForwardMessageResult
type ForwardMessageResult = [Message](#message);
ForwardMessagesParams
type ForwardMessagesParams = {
chat_id: number | string;
direct_messages_topic_id?: number;
disable_notification?: boolean;
from_chat_id: number | string;
message_ids: number[];
message_thread_id?: number;
protect_content?: boolean;
};
ForwardMessagesResult
type ForwardMessagesResult = [MessageId](#messageid)[];
Game
type Game = {
animation?: [Animation](#animation);
description: string;
photo: [PhotoSize](#photosize)[];
text?: string;
text_entities?: [MessageEntity](#messageentity)[];
title: string;
};
GameHighScore
type GameHighScore = {
position: number;
score: number;
user: [User](#user);
};
GeneralForumTopicHidden
type GeneralForumTopicHidden = Record<string, never>;
GeneralForumTopicUnhidden
type GeneralForumTopicUnhidden = Record<string, never>;
GetAvailableGiftsParams
type GetAvailableGiftsParams = Record<string, never>;
GetAvailableGiftsResult
type GetAvailableGiftsResult = [Gifts](#gifts);
GetBusinessAccountGiftsParams
type GetBusinessAccountGiftsParams = {
business_connection_id: string;
exclude_from_blockchain?: boolean;
exclude_limited_non_upgradable?: boolean;
exclude_limited_upgradable?: boolean;
exclude_saved?: boolean;
exclude_unique?: boolean;
exclude_unlimited?: boolean;
exclude_unsaved?: boolean;
limit?: number;
offset?: string;
sort_by_price?: boolean;
};
GetBusinessAccountGiftsResult
type GetBusinessAccountGiftsResult = [OwnedGifts](#ownedgifts);
GetBusinessAccountStarBalanceParams
type GetBusinessAccountStarBalanceParams = {
business_connection_id: string;
};
GetBusinessAccountStarBalanceResult
type GetBusinessAccountStarBalanceResult = [StarAmount](#staramount);
GetBusinessConnectionParams
type GetBusinessConnectionParams = {
business_connection_id: string;
};
GetBusinessConnectionResult
type GetBusinessConnectionResult = [BusinessConnection](#businessconnection);
GetChatAdministratorsParams
type GetChatAdministratorsParams = {
chat_id: number | string;
return_bots?: boolean;
};
GetChatAdministratorsResult
type GetChatAdministratorsResult = [ChatMember](#chatmember)[];
GetChatGiftsParams
type GetChatGiftsParams = {
chat_id: number | string;
exclude_from_blockchain?: boolean;
exclude_limited_non_upgradable?: boolean;
exclude_limited_upgradable?: boolean;
exclude_saved?: boolean;
exclude_unique?: boolean;
exclude_unlimited?: boolean;
exclude_unsaved?: boolean;
limit?: number;
offset?: string;
sort_by_price?: boolean;
};
GetChatGiftsResult
type GetChatGiftsResult = [OwnedGifts](#ownedgifts);
GetChatMemberCountParams
type GetChatMemberCountParams = {
chat_id: number | string;
};
GetChatMemberCountResult
type GetChatMemberCountResult = number;
GetChatMemberParams
type GetChatMemberParams = {
chat_id: number | string;
user_id: number;
};
GetChatMemberResult
type GetChatMemberResult = [ChatMember](#chatmember);
GetChatMenuButtonParams
type GetChatMenuButtonParams = {
chat_id?: number;
};
GetChatMenuButtonResult
type GetChatMenuButtonResult = [MenuButton](#menubutton);
GetChatParams
type GetChatParams = {
chat_id: number | string;
};
GetChatResult
type GetChatResult = [ChatFullInfo](#chatfullinfo);
GetCustomEmojiStickersParams
type GetCustomEmojiStickersParams = {
custom_emoji_ids: string[];
};
GetCustomEmojiStickersResult
type GetCustomEmojiStickersResult = [Sticker](#sticker)[];
GetFileParams
type GetFileParams = {
file_id: string;
};
GetFileResult
type GetFileResult = [File](#file);
GetForumTopicIconStickersParams
type GetForumTopicIconStickersParams = Record<string, never>;
GetForumTopicIconStickersResult
type GetForumTopicIconStickersResult = [Sticker](#sticker)[];
GetGameHighScoresParams
type GetGameHighScoresParams = {
chat_id?: number;
inline_message_id?: string;
message_id?: number;
user_id: number;
};
GetGameHighScoresResult
type GetGameHighScoresResult = [GameHighScore](#gamehighscore)[];
GetManagedBotAccessSettingsParams
type GetManagedBotAccessSettingsParams = {
user_id: number;
};
GetManagedBotAccessSettingsResult
type GetManagedBotAccessSettingsResult = [BotAccessSettings](#botaccesssettings);
GetManagedBotTokenParams
type GetManagedBotTokenParams = {
user_id: number;
};
GetManagedBotTokenResult
type GetManagedBotTokenResult = [BusinessConnection](#businessconnection);
GetMeParams
type GetMeParams = Record<string, never>;
GetMeResult
type GetMeResult = [User](#user);
GetMyCommandsParams
type GetMyCommandsParams = {
language_code?: string;
scope?: [BotCommandScope](#botcommandscope);
};
GetMyCommandsResult
type GetMyCommandsResult = [BotCommand](#botcommand)[];
GetMyDefaultAdministratorRightsParams
type GetMyDefaultAdministratorRightsParams = {
for_channels?: boolean;
};
GetMyDefaultAdministratorRightsResult
type GetMyDefaultAdministratorRightsResult = [ChatAdministratorRights](#chatadministratorrights);
GetMyDescriptionParams
type GetMyDescriptionParams = {
language_code?: string;
};
GetMyDescriptionResult
type GetMyDescriptionResult = [BotDescription](#botdescription);
GetMyNameParams
type GetMyNameParams = {
language_code?: string;
};
GetMyNameResult
type GetMyNameResult = [BotName](#botname);
GetMyShortDescriptionParams
type GetMyShortDescriptionParams = {
language_code?: string;
};
GetMyShortDescriptionResult
type GetMyShortDescriptionResult = [BotShortDescription](#botshortdescription);
GetMyStarBalanceParams
type GetMyStarBalanceParams = Record<string, never>;
GetMyStarBalanceResult
type GetMyStarBalanceResult = [StarAmount](#staramount);
GetStarTransactionsParams
type GetStarTransactionsParams = {
limit?: number;
offset?: number;
};
GetStarTransactionsResult
type GetStarTransactionsResult = [StarTransactions](#startransactions);
GetStickerSetParams
type GetStickerSetParams = {
name: string;
};
GetStickerSetResult
type GetStickerSetResult = [StickerSet](#stickerset);
GetUpdatesParams
type GetUpdatesParams = {
allowed_updates?: string[];
limit?: number;
offset?: number;
timeout?: number;
};
GetUpdatesResult
type GetUpdatesResult = [Update](#update)[];
GetUserChatBoostsParams
type GetUserChatBoostsParams = {
chat_id: number | string;
user_id: number;
};
GetUserChatBoostsResult
type GetUserChatBoostsResult = [UserChatBoosts](#userchatboosts);
GetUserGiftsParams
type GetUserGiftsParams = {
exclude_from_blockchain?: boolean;
exclude_limited_non_upgradable?: boolean;
exclude_limited_upgradable?: boolean;
exclude_unique?: boolean;
exclude_unlimited?: boolean;
limit?: number;
offset?: string;
sort_by_price?: boolean;
user_id: number;
};
GetUserGiftsResult
type GetUserGiftsResult = [OwnedGifts](#ownedgifts);
GetUserPersonalChatMessagesParams
type GetUserPersonalChatMessagesParams = {
limit: number;
user_id: number;
};
GetUserPersonalChatMessagesResult
type GetUserPersonalChatMessagesResult = [Message](#message)[];
GetUserProfileAudiosParams
type GetUserProfileAudiosParams = {
limit?: number;
offset?: number;
user_id: number;
};
GetUserProfileAudiosResult
type GetUserProfileAudiosResult = [UserProfileAudios](#userprofileaudios);
GetUserProfilePhotosParams
type GetUserProfilePhotosParams = {
limit?: number;
offset?: number;
user_id: number;
};
GetUserProfilePhotosResult
type GetUserProfilePhotosResult = [UserProfilePhotos](#userprofilephotos);
GetWebhookInfoParams
type GetWebhookInfoParams = Record<string, never>;
GetWebhookInfoResult
type GetWebhookInfoResult = [WebhookInfo](#webhookinfo);
Gift
type Gift = {
background?: [GiftBackground](#giftbackground);
has_colors?: true;
id: string;
is_premium?: true;
personal_remaining_count?: number;
personal_total_count?: number;
publisher_chat?: [Chat](#chat);
remaining_count?: number;
star_count: number;
sticker: [Sticker](#sticker);
total_count?: number;
unique_gift_variant_count?: number;
upgrade_star_count?: number;
};
GiftBackground
type GiftBackground = {
center_color: number;
edge_color: number;
text_color: number;
};
GiftInfo
type GiftInfo = {
can_be_upgraded?: true;
convert_star_count?: number;
entities?: [MessageEntity](#messageentity)[];
gift: [Gift](#gift);
is_private?: true;
is_upgrade_separate?: true;
owned_gift_id?: string;
prepaid_upgrade_star_count?: number;
text?: string;
unique_gift_number?: number;
};
GiftPremiumSubscriptionParams
type GiftPremiumSubscriptionParams = {
month_count: number;
star_count: number;
text?: string;
text_entities?: [MessageEntity](#messageentity)[];
text_parse_mode?: string;
user_id: number;
};
GiftPremiumSubscriptionResult
type GiftPremiumSubscriptionResult = boolean;
Gifts
type Gifts = {
gifts: [Gift](#gift)[];
};
Giveaway
type Giveaway = {
chats: [Chat](#chat)[];
country_codes?: string[];
has_public_winners?: true;
only_new_members?: true;
premium_subscription_month_count?: number;
prize_description?: string;
prize_star_count?: number;
winner_count: number;
winners_selection_date: number;
};
GiveawayCompleted
type GiveawayCompleted = {
giveaway_message?: [Message](#message);
is_star_giveaway?: true;
unclaimed_prize_count?: number;
winner_count: number;
};
GiveawayCreated
type GiveawayCreated = {
prize_star_count?: number;
};
GiveawayWinners
type GiveawayWinners = {
additional_chat_count?: number;
chat: [Chat](#chat);
giveaway_message_id: number;
only_new_members?: true;
premium_subscription_month_count?: number;
prize_description?: string;
prize_star_count?: number;
unclaimed_prize_count?: number;
was_refunded?: true;
winner_count: number;
winners: [User](#user)[];
winners_selection_date: number;
};
HideGeneralForumTopicParams
type HideGeneralForumTopicParams = {
chat_id: number | string;
};
HideGeneralForumTopicResult
type HideGeneralForumTopicResult = boolean;
InaccessibleMessage
type InaccessibleMessage = {
chat: [Chat](#chat);
date: number;
message_id: number;
};
InlineKeyboardButton
type InlineKeyboardButton = {
callback_data?: string;
callback_game?: [CallbackGame](#callbackgame);
copy_text?: [CopyTextButton](#copytextbutton);
disabled?: [DisabledButton](#disabledbutton);
icon_custom_emoji_id?: string;
login_url?: [LoginUrl](#loginurl);
pay?: boolean;
style?: string;
switch_inline_query?: string;
switch_inline_query_chosen_chat?: [SwitchInlineQueryChosenChat](#switchinlinequerychosenchat);
switch_inline_query_current_chat?: string;
text: string;
url?: string;
web_app?: [WebAppInfo](#webappinfo);
};
InlineKeyboardMarkup
type InlineKeyboardMarkup = {
force_reply?: boolean;
inline_keyboard: [InlineKeyboardButton](#inlinekeyboardbutton)[][];
};
InlineQuery
type InlineQuery = {
chat_type?: string;
from: [User](#user);
id: string;
location?: [Location](#location);
offset: string;
query: string;
};
InlineQueryResult
type InlineQueryResult = [InlineQueryResultCachedAudio](#inlinequeryresultcachedaudio) | [InlineQueryResultCachedDocument](#inlinequeryresultcacheddocument) | [InlineQueryResultCachedGif](#inlinequeryresultcachedgif) | [InlineQueryResultCachedMpeg4Gif](#inlinequeryresultcachedmpeg4gif) | [InlineQueryResultCachedPhoto](#inlinequeryresultcachedphoto) | [InlineQueryResultCachedSticker](#inlinequeryresultcachedsticker) | [InlineQueryResultCachedVideo](#inlinequeryresultcachedvideo) | [InlineQueryResultCachedVoice](#inlinequeryresultcachedvoice) | [InlineQueryResultArticle](#inlinequeryresultarticle) | [InlineQueryResultAudio](#inlinequeryresultaudio) | [InlineQueryResultContact](#inlinequeryresultcontact) | [InlineQueryResultGame](#inlinequeryresultgame) | [InlineQueryResultDocument](#inlinequeryresultdocument) | [InlineQueryResultGif](#inlinequeryresultgif) | [InlineQueryResultLocation](#inlinequeryresultlocation) | [InlineQueryResultMpeg4Gif](#inlinequeryresultmpeg4gif) | [InlineQueryResultPhoto](#inlinequeryresultphoto) | [InlineQueryResultVenue](#inlinequeryresultvenue) | [InlineQueryResultVideo](#inlinequeryresultvideo) | [InlineQueryResultVoice](#inlinequeryresultvoice);
InlineQueryResultArticle
type InlineQueryResultArticle = {
description?: string;
id: string;
input_message_content: [InputMessageContent](#inputmessagecontent);
reply_markup?: [InlineKeyboardMarkup](#inlinekeyboardmarkup);
thumbnail_height?: number;
thumbnail_url?: string;
thumbnail_width?: number;
title: string;
type: string;
url?: string;
};
InlineQueryResultAudio
type InlineQueryResultAudio = {
audio_duration?: number;
audio_url: string;
caption?: string;
caption_entities?: [MessageEntity](#messageentity)[];
id: string;
input_message_content?: [InputMessageContent](#inputmessagecontent);
parse_mode?: string;
performer?: string;
reply_markup?: [InlineKeyboardMarkup](#inlinekeyboardmarkup);
title: string;
type: string;
};
InlineQueryResultCachedAudio
type InlineQueryResultCachedAudio = {
audio_file_id: string;
caption?: string;
caption_entities?: [MessageEntity](#messageentity)[];
id: string;
input_message_content?: [InputMessageContent](#inputmessagecontent);
parse_mode?: string;
reply_markup?: [InlineKeyboardMarkup](#inlinekeyboardmarkup);
type: string;
};
InlineQueryResultCachedDocument
type InlineQueryResultCachedDocument = {
caption?: string;
caption_entities?: [MessageEntity](#messageentity)[];
description?: string;
document_file_id: string;
id: string;
input_message_content?: [InputMessageContent](#inputmessagecontent);
parse_mode?: string;
reply_markup?: [InlineKeyboardMarkup](#inlinekeyboardmarkup);
title: string;
type: string;
};
InlineQueryResultCachedGif
type InlineQueryResultCachedGif = {
caption?: string;
caption_entities?: [MessageEntity](#messageentity)[];
gif_file_id: string;
id: string;
input_message_content?: [InputMessageContent](#inputmessagecontent);
parse_mode?: string;
reply_markup?: [InlineKeyboardMarkup](#inlinekeyboardmarkup);
show_caption_above_media?: boolean;
title?: string;
type: string;
};
InlineQueryResultCachedMpeg4Gif
type InlineQueryResultCachedMpeg4Gif = {
caption?: string;
caption_entities?: [MessageEntity](#messageentity)[];
id: string;
input_message_content?: [InputMessageContent](#inputmessagecontent);
mpeg4_file_id: string;
parse_mode?: string;
reply_markup?: [InlineKeyboardMarkup](#inlinekeyboardmarkup);
show_caption_above_media?: boolean;
title?: string;
type: string;
};
InlineQueryResultCachedPhoto
type InlineQueryResultCachedPhoto = {
caption?: string;
caption_entities?: [MessageEntity](#messageentity)[];
description?: string;
id: string;
input_message_content?: [InputMessageContent](#inputmessagecontent);
parse_mode?: string;
photo_file_id: string;
reply_markup?: [InlineKeyboardMarkup](#inlinekeyboardmarkup);
show_caption_above_media?: boolean;
title?: string;
type: string;
};
InlineQueryResultCachedSticker
type InlineQueryResultCachedSticker = {
id: string;
input_message_content?: [InputMessageContent](#inputmessagecontent);
reply_markup?: [InlineKeyboardMarkup](#inlinekeyboardmarkup);
sticker_file_id: string;
type: string;
};
InlineQueryResultCachedVideo
type InlineQueryResultCachedVideo = {
caption?: string;
caption_entities?: [MessageEntity](#messageentity)[];
description?: string;
id: string;
input_message_content?: [InputMessageContent](#inputmessagecontent);
parse_mode?: string;
reply_markup?: [InlineKeyboardMarkup](#inlinekeyboardmarkup);
show_caption_above_media?: boolean;
title: string;
type: string;
video_file_id: string;
};
InlineQueryResultCachedVoice
type InlineQueryResultCachedVoice = {
caption?: string;
caption_entities?: [MessageEntity](#messageentity)[];
id: string;
input_message_content?: [InputMessageContent](#inputmessagecontent);
parse_mode?: string;
reply_markup?: [InlineKeyboardMarkup](#inlinekeyboardmarkup);
title: string;
type: string;
voice_file_id: string;
};
InlineQueryResultContact
type InlineQueryResultContact = {
first_name: string;
id: string;
input_message_content?: [InputMessageContent](#inputmessagecontent);
last_name?: string;
phone_number: string;
reply_markup?: [InlineKeyboardMarkup](#inlinekeyboardmarkup);
thumbnail_height?: number;
thumbnail_url?: string;
thumbnail_width?: number;
type: string;
vcard?: string;
};
InlineQueryResultDocument
type InlineQueryResultDocument = {
caption?: string;
caption_entities?: [MessageEntity](#messageentity)[];
description?: string;
document_url: string;
id: string;
input_message_content?: [InputMessageContent](#inputmessagecontent);
mime_type: string;
parse_mode?: string;
reply_markup?: [InlineKeyboardMarkup](#inlinekeyboardmarkup);
thumbnail_height?: number;
thumbnail_url?: string;
thumbnail_width?: number;
title: string;
type: string;
};
InlineQueryResultGame
type InlineQueryResultGame = {
game_short_name: string;
id: string;
reply_markup?: [InlineKeyboardMarkup](#inlinekeyboardmarkup);
type: string;
};
InlineQueryResultGif
type InlineQueryResultGif = {
caption?: string;
caption_entities?: [MessageEntity](#messageentity)[];
gif_duration?: number;
gif_height?: number;
gif_url: string;
gif_width?: number;
id: string;
input_message_content?: [InputMessageContent](#inputmessagecontent);
parse_mode?: string;
reply_markup?: [InlineKeyboardMarkup](#inlinekeyboardmarkup);
show_caption_above_media?: boolean;
thumbnail_mime_type?: string;
thumbnail_url: string;
title?: string;
type: string;
};
InlineQueryResultLocation
type InlineQueryResultLocation = {
heading?: number;
horizontal_accuracy?: number;
id: string;
input_message_content?: [InputMessageContent](#inputmessagecontent);
latitude: number;
live_period?: number;
longitude: number;
proximity_alert_radius?: number;
reply_markup?: [InlineKeyboardMarkup](#inlinekeyboardmarkup);
thumbnail_height?: number;
thumbnail_url?: string;
thumbnail_width?: number;
title: string;
type: string;
};
InlineQueryResultMpeg4Gif
type InlineQueryResultMpeg4Gif = {
caption?: string;
caption_entities?: [MessageEntity](#messageentity)[];
id: string;
input_message_content?: [InputMessageContent](#inputmessagecontent);
mpeg4_duration?: number;
mpeg4_height?: number;
mpeg4_url: string;
mpeg4_width?: number;
parse_mode?: string;
reply_markup?: [InlineKeyboardMarkup](#inlinekeyboardmarkup);
show_caption_above_media?: boolean;
thumbnail_mime_type?: string;
thumbnail_url: string;
title?: string;
type: string;
};
InlineQueryResultPhoto
type InlineQueryResultPhoto = {
caption?: string;
caption_entities?: [MessageEntity](#messageentity)[];
description?: string;
id: string;
input_message_content?: [InputMessageContent](#inputmessagecontent);
parse_mode?: string;
photo_height?: number;
photo_url: string;
photo_width?: number;
reply_markup?: [InlineKeyboardMarkup](#inlinekeyboardmarkup);
show_caption_above_media?: boolean;
thumbnail_url: string;
title?: string;
type: string;
};
InlineQueryResultVenue
type InlineQueryResultVenue = {
address: string;
foursquare_id?: string;
foursquare_type?: string;
google_place_id?: string;
google_place_type?: string;
id: string;
input_message_content?: [InputMessageContent](#inputmessagecontent);
latitude: number;
longitude: number;
reply_markup?: [InlineKeyboardMarkup](#inlinekeyboardmarkup);
thumbnail_height?: number;
thumbnail_url?: string;
thumbnail_width?: number;
title: string;
type: string;
};
InlineQueryResultVideo
type InlineQueryResultVideo = {
caption?: string;
caption_entities?: [MessageEntity](#messageentity)[];
description?: string;
id: string;
input_message_content?: [InputMessageContent](#inputmessagecontent);
mime_type: string;
parse_mode?: string;
reply_markup?: [InlineKeyboardMarkup](#inlinekeyboardmarkup);
show_caption_above_media?: boolean;
thumbnail_url: string;
title: string;
type: string;
video_duration?: number;
video_height?: number;
video_url: string;
video_width?: number;
};
InlineQueryResultVoice
type InlineQueryResultVoice = {
caption?: string;
caption_entities?: [MessageEntity](#messageentity)[];
id: string;
input_message_content?: [InputMessageContent](#inputmessagecontent);
parse_mode?: string;
reply_markup?: [InlineKeyboardMarkup](#inlinekeyboardmarkup);
title: string;
type: string;
voice_duration?: number;
voice_url: string;
};
InlineQueryResultsButton
type InlineQueryResultsButton = {
start_parameter?: string;
text: string;
web_app?: [WebAppInfo](#webappinfo);
};
InputChecklist
type InputChecklist = {
others_can_add_tasks?: boolean;
others_can_mark_tasks_as_done?: boolean;
parse_mode?: string;
tasks: [InputChecklistTask](#inputchecklisttask)[];
title: string;
title_entities?: [MessageEntity](#messageentity)[];
};
InputChecklistTask
type InputChecklistTask = {
id: number;
parse_mode?: string;
text: string;
text_entities?: [MessageEntity](#messageentity)[];
};
InputContactMessageContent
type InputContactMessageContent = {
first_name: string;
last_name?: string;
phone_number: string;
vcard?: string;
};
InputFileData
The bytes behind an InputFile. Every variant streams into the request
without being buffered. A Blob (e.g. a disk-backed one from fromPath),
a Uint8Array, or a stream factory can be re-read, so transport retries
stay possible; a bare ReadableStream is one-shot - it is sent exactly
once and a failure surfaces immediately instead of retrying.
type InputFileData = Blob | Uint8Array | ReadableStream<Uint8Array> | [InputFileStreamFactory](#inputfilestreamfactory);
InputFileStreamFactory
A replayable stream source: return a fresh, unread stream on every call. The upload stays retryable - each send attempt opens a new stream.
type InputFileStreamFactory = () => ReadableStream<Uint8Array> | Promise<ReadableStream<Uint8Array>>;
InputInvoiceMessageContent
type InputInvoiceMessageContent = {
currency: string;
description: string;
is_flexible?: boolean;
max_tip_amount?: number;
need_email?: boolean;
need_name?: boolean;
need_phone_number?: boolean;
need_shipping_address?: boolean;
payload: string;
photo_height?: number;
photo_size?: number;
photo_url?: string;
photo_width?: number;
prices: [LabeledPrice](#labeledprice)[];
provider_data?: string;
provider_token?: string;
send_email_to_provider?: boolean;
send_phone_number_to_provider?: boolean;
suggested_tip_amounts?: number[];
title: string;
};
InputLocationMessageContent
type InputLocationMessageContent = {
heading?: number;
horizontal_accuracy?: number;
latitude: number;
live_period?: number;
longitude: number;
proximity_alert_radius?: number;
};
InputMedia
type InputMedia = [InputMediaAnimation](#inputmediaanimation) | [InputMediaAudio](#inputmediaaudio) | [InputMediaDocument](#inputmediadocument) | [InputMediaLivePhoto](#inputmedialivephoto) | [InputMediaPhoto](#inputmediaphoto) | [InputMediaVideo](#inputmediavideo);
InputMediaAnimation
type InputMediaAnimation = {
caption?: string;
caption_entities?: [MessageEntity](#messageentity)[];
duration?: number;
has_spoiler?: boolean;
height?: number;
media: [InputFile](#inputfile) | string;
parse_mode?: string;
show_caption_above_media?: boolean;
thumbnail?: [InputFile](#inputfile) | string;
type: string;
width?: number;
};
InputMediaAudio
type InputMediaAudio = {
caption?: string;
caption_entities?: [MessageEntity](#messageentity)[];
duration?: number;
media: [InputFile](#inputfile) | string;
parse_mode?: string;
performer?: string;
thumbnail?: [InputFile](#inputfile) | string;
title?: string;
type: string;
};
InputMediaDocument
type InputMediaDocument = {
caption?: string;
caption_entities?: [MessageEntity](#messageentity)[];
disable_content_type_detection?: boolean;
media: [InputFile](#inputfile) | string;
parse_mode?: string;
thumbnail?: [InputFile](#inputfile) | string;
type: string;
};
InputMediaLink
type InputMediaLink = {
type: string;
url: string;
};
InputMediaLivePhoto
type InputMediaLivePhoto = {
caption?: string;
caption_entities?: [MessageEntity](#messageentity)[];
has_spoiler?: boolean;
media: [InputFile](#inputfile) | string;
parse_mode?: string;
photo: [InputFile](#inputfile) | string;
show_caption_above_media?: boolean;
type: string;
};
InputMediaLocation
type InputMediaLocation = {
horizontal_accuracy?: number;
latitude: number;
longitude: number;
type: string;
};
InputMediaPhoto
type InputMediaPhoto = {
caption?: string;
caption_entities?: [MessageEntity](#messageentity)[];
has_spoiler?: boolean;
media: [InputFile](#inputfile) | string;
parse_mode?: string;
show_caption_above_media?: boolean;
type: string;
};
InputMediaSticker
type InputMediaSticker = {
emoji?: string;
media: [InputFile](#inputfile) | string;
type: string;
};
InputMediaVenue
type InputMediaVenue = {
address: string;
foursquare_id?: string;
foursquare_type?: string;
google_place_id?: string;
google_place_type?: string;
latitude: number;
longitude: number;
title: string;
type: string;
};
InputMediaVideo
type InputMediaVideo = {
caption?: string;
caption_entities?: [MessageEntity](#messageentity)[];
cover?: [InputFile](#inputfile) | string;
duration?: number;
has_spoiler?: boolean;
height?: number;
media: [InputFile](#inputfile) | string;
parse_mode?: string;
show_caption_above_media?: boolean;
start_timestamp?: number;
supports_streaming?: boolean;
thumbnail?: [InputFile](#inputfile) | string;
type: string;
width?: number;
};
InputMediaVoiceNote
type InputMediaVoiceNote = {
caption?: string;
caption_entities?: [MessageEntity](#messageentity)[];
duration?: number;
media: [InputFile](#inputfile) | string;
parse_mode?: string;
type: string;
};
InputMessageContent
type InputMessageContent = [InputTextMessageContent](#inputtextmessagecontent) | [InputRichMessageContent](#inputrichmessagecontent) | [InputLocationMessageContent](#inputlocationmessagecontent) | [InputVenueMessageContent](#inputvenuemessagecontent) | [InputContactMessageContent](#inputcontactmessagecontent) | [InputInvoiceMessageContent](#inputinvoicemessagecontent);
InputPaidMedia
type InputPaidMedia = [InputPaidMediaLivePhoto](#inputpaidmedialivephoto) | [InputPaidMediaPhoto](#inputpaidmediaphoto) | [InputPaidMediaVideo](#inputpaidmediavideo);
InputPaidMediaLivePhoto
type InputPaidMediaLivePhoto = {
media: [InputFile](#inputfile) | string;
photo: [InputFile](#inputfile) | string;
type: string;
};
InputPaidMediaPhoto
type InputPaidMediaPhoto = {
media: [InputFile](#inputfile) | string;
type: string;
};
InputPaidMediaVideo
type InputPaidMediaVideo = {
cover?: [InputFile](#inputfile) | string;
duration?: number;
height?: number;
media: [InputFile](#inputfile) | string;
start_timestamp?: number;
supports_streaming?: boolean;
thumbnail?: [InputFile](#inputfile) | string;
type: string;
width?: number;
};
InputPollMedia
type InputPollMedia = [InputMediaAnimation](#inputmediaanimation) | [InputMediaAudio](#inputmediaaudio) | [InputMediaDocument](#inputmediadocument) | [InputMediaLivePhoto](#inputmedialivephoto) | [InputMediaLocation](#inputmedialocation) | [InputMediaPhoto](#inputmediaphoto) | [InputMediaVenue](#inputmediavenue) | [InputMediaVideo](#inputmediavideo);
InputPollOption
type InputPollOption = {
media?: [InputPollOptionMedia](#inputpolloptionmedia);
text: string;
text_entities?: [MessageEntity](#messageentity)[];
text_parse_mode?: string;
};
InputPollOptionMedia
type InputPollOptionMedia = [InputMediaAnimation](#inputmediaanimation) | [InputMediaLink](#inputmedialink) | [InputMediaLivePhoto](#inputmedialivephoto) | [InputMediaLocation](#inputmedialocation) | [InputMediaPhoto](#inputmediaphoto) | [InputMediaSticker](#inputmediasticker) | [InputMediaVenue](#inputmediavenue) | [InputMediaVideo](#inputmediavideo);
InputProfilePhoto
type InputProfilePhoto = [InputProfilePhotoStatic](#inputprofilephotostatic) | [InputProfilePhotoAnimated](#inputprofilephotoanimated);
InputProfilePhotoAnimated
type InputProfilePhotoAnimated = {
animation: [InputFile](#inputfile) | string;
main_frame_timestamp?: number;
type: string;
};
InputProfilePhotoStatic
type InputProfilePhotoStatic = {
photo: [InputFile](#inputfile) | string;
type: string;
};
InputRichBlock
type InputRichBlock = [InputRichBlockParagraph](#inputrichblockparagraph) | [InputRichBlockSectionHeading](#inputrichblocksectionheading) | [InputRichBlockPreformatted](#inputrichblockpreformatted) | [InputRichBlockFooter](#inputrichblockfooter) | [InputRichBlockDivider](#inputrichblockdivider) | [InputRichBlockMathematicalExpression](#inputrichblockmathematicalexpression) | [InputRichBlockAnchor](#inputrichblockanchor) | [InputRichBlockList](#inputrichblocklist) | [InputRichBlockBlockQuotation](#inputrichblockblockquotation) | [InputRichBlockExpandableBlockQuotation](#inputrichblockexpandableblockquotation) | [InputRichBlockPullQuotation](#inputrichblockpullquotation) | [InputRichBlockCollage](#inputrichblockcollage) | [InputRichBlockSlideshow](#inputrichblockslideshow) | [InputRichBlockTable](#inputrichblocktable) | [InputRichBlockDetails](#inputrichblockdetails) | [InputRichBlockMap](#inputrichblockmap) | [InputRichBlockButtons](#inputrichblockbuttons) | [InputRichBlockAnimation](#inputrichblockanimation) | [InputRichBlockAudio](#inputrichblockaudio) | [InputRichBlockDocument](#inputrichblockdocument) | [InputRichBlockPhoto](#inputrichblockphoto) | [InputRichBlockVideo](#inputrichblockvideo) | [InputRichBlockVoiceNote](#inputrichblockvoicenote) | [InputRichBlockThinking](#inputrichblockthinking);
InputRichBlockAnchor
type InputRichBlockAnchor = {
name: string;
type: string;
};
InputRichBlockAnimation
type InputRichBlockAnimation = {
animation: [InputMediaAnimation](#inputmediaanimation);
caption?: [RichBlockCaption](#richblockcaption);
type: string;
};
InputRichBlockAudio
type InputRichBlockAudio = {
audio: [InputMediaAudio](#inputmediaaudio);
caption?: [RichBlockCaption](#richblockcaption);
type: string;
};
InputRichBlockBlockQuotation
type InputRichBlockBlockQuotation = {
blocks: [InputRichBlock](#inputrichblock)[];
credit?: [RichText](#richtext);
type: string;
};
InputRichBlockButtons
type InputRichBlockButtons = {
align?: string;
buttons: [RichMessageButton](#richmessagebutton)[];
type: string;
};
InputRichBlockCollage
type InputRichBlockCollage = {
blocks: [InputRichBlock](#inputrichblock)[];
caption?: [RichBlockCaption](#richblockcaption);
type: string;
};
InputRichBlockDetails
type InputRichBlockDetails = {
blocks: [InputRichBlock](#inputrichblock)[];
is_open?: true;
summary: [RichText](#richtext);
type: string;
};
InputRichBlockDivider
type InputRichBlockDivider = {
type: string;
};
InputRichBlockDocument
type InputRichBlockDocument = {
caption?: [RichBlockCaption](#richblockcaption);
document: [InputMediaDocument](#inputmediadocument);
type: string;
};
InputRichBlockExpandableBlockQuotation
type InputRichBlockExpandableBlockQuotation = {
credit?: [RichText](#richtext);
text: [RichText](#richtext);
type: string;
};
InputRichBlockFooter
type InputRichBlockFooter = {
text: [RichText](#richtext);
type: string;
};
InputRichBlockList
type InputRichBlockList = {
items: [InputRichBlockListItem](#inputrichblocklistitem)[];
type: string;
};
InputRichBlockListItem
type InputRichBlockListItem = {
blocks: [InputRichBlock](#inputrichblock)[];
has_checkbox?: true;
is_checked?: true;
type?: string;
value?: number;
};
InputRichBlockMap
type InputRichBlockMap = {
caption?: [RichBlockCaption](#richblockcaption);
height?: number;
location: [Location](#location);
type: string;
width?: number;
zoom?: number;
};
InputRichBlockMathematicalExpression
type InputRichBlockMathematicalExpression = {
expression: string;
type: string;
};
InputRichBlockParagraph
type InputRichBlockParagraph = {
text: [RichText](#richtext);
type: string;
};
InputRichBlockPhoto
type InputRichBlockPhoto = {
caption?: [RichBlockCaption](#richblockcaption);
photo: [InputMediaPhoto](#inputmediaphoto);
type: string;
};
InputRichBlockPreformatted
type InputRichBlockPreformatted = {
language?: string;
text: [RichText](#richtext);
type: string;
};
InputRichBlockPullQuotation
type InputRichBlockPullQuotation = {
credit?: [RichText](#richtext);
text: [RichText](#richtext);
type: string;
};
InputRichBlockSectionHeading
type InputRichBlockSectionHeading = {
size: number;
text: [RichText](#richtext);
type: string;
};
InputRichBlockSlideshow
type InputRichBlockSlideshow = {
blocks: [InputRichBlock](#inputrichblock)[];
caption?: [RichBlockCaption](#richblockcaption);
type: string;
};
InputRichBlockTable
type InputRichBlockTable = {
caption?: [RichText](#richtext);
cells: [RichBlockTableCell](#richblocktablecell)[][];
is_bordered?: true;
is_compact?: true;
is_striped?: true;
type: string;
};
InputRichBlockThinking
type InputRichBlockThinking = {
text: [RichText](#richtext);
type: string;
};
InputRichBlockVideo
type InputRichBlockVideo = {
caption?: [RichBlockCaption](#richblockcaption);
type: string;
video: [InputMediaVideo](#inputmediavideo);
};
InputRichBlockVoiceNote
type InputRichBlockVoiceNote = {
caption?: [RichBlockCaption](#richblockcaption);
type: string;
voice_note: [InputMediaVoiceNote](#inputmediavoicenote);
};
InputRichMessage
type InputRichMessage = {
blocks?: [InputRichBlock](#inputrichblock)[];
html?: string;
is_rtl?: boolean;
markdown?: string;
media?: [InputRichMessageMedia](#inputrichmessagemedia)[];
skip_entity_detection?: boolean;
};
InputRichMessageContent
type InputRichMessageContent = {
rich_message: [InputRichMessage](#inputrichmessage);
};
InputRichMessageMedia
type InputRichMessageMedia = {
id: string;
media: [InputMediaAnimation](#inputmediaanimation) | [InputMediaAudio](#inputmediaaudio) | [InputMediaDocument](#inputmediadocument) | [InputMediaPhoto](#inputmediaphoto) | [InputMediaVideo](#inputmediavideo) | [InputMediaVoiceNote](#inputmediavoicenote);
};
InputSticker
type InputSticker = {
emoji_list: string[];
format: string;
keywords?: string[];
mask_position?: [MaskPosition](#maskposition);
sticker: [InputFile](#inputfile) | string;
};
InputStoryContent
type InputStoryContent = [InputStoryContentPhoto](#inputstorycontentphoto) | [InputStoryContentVideo](#inputstorycontentvideo);
InputStoryContentPhoto
type InputStoryContentPhoto = {
photo: [InputFile](#inputfile) | string;
type: string;
};
InputStoryContentVideo
type InputStoryContentVideo = {
cover_frame_timestamp?: number;
duration?: number;
is_animation?: boolean;
type: string;
video: [InputFile](#inputfile) | string;
};
InputTextMessageContent
type InputTextMessageContent = {
entities?: [MessageEntity](#messageentity)[];
link_preview_options?: [LinkPreviewOptions](#linkpreviewoptions);
message_text: string;
parse_mode?: string;
};
InputVenueMessageContent
type InputVenueMessageContent = {
address: string;
foursquare_id?: string;
foursquare_type?: string;
google_place_id?: string;
google_place_type?: string;
latitude: number;
longitude: number;
title: string;
};
Invoice
type Invoice = {
currency: string;
description: string;
start_parameter: string;
title: string;
total_amount: number;
};
KeyboardButton
type KeyboardButton = {
icon_custom_emoji_id?: string;
request_chat?: [KeyboardButtonRequestChat](#keyboardbuttonrequestchat);
request_contact?: boolean;
request_location?: boolean;
request_managed_bot?: [KeyboardButtonRequestManagedBot](#keyboardbuttonrequestmanagedbot);
request_poll?: [KeyboardButtonPollType](#keyboardbuttonpolltype);
request_users?: [KeyboardButtonRequestUsers](#keyboardbuttonrequestusers);
style?: string;
text: string;
web_app?: [WebAppInfo](#webappinfo);
};
KeyboardButtonPollType
type KeyboardButtonPollType = {
type?: string;
};
KeyboardButtonRequestChat
type KeyboardButtonRequestChat = {
bot_administrator_rights?: [ChatAdministratorRights](#chatadministratorrights);
bot_is_member?: boolean;
chat_has_username?: boolean;
chat_is_channel: boolean;
chat_is_created?: boolean;
chat_is_forum?: boolean;
request_id: number;
request_photo?: boolean;
request_title?: boolean;
request_username?: boolean;
user_administrator_rights?: [ChatAdministratorRights](#chatadministratorrights);
};
KeyboardButtonRequestManagedBot
type KeyboardButtonRequestManagedBot = {
request_id: number;
suggested_name?: string;
suggested_username?: string;
};
KeyboardButtonRequestUsers
type KeyboardButtonRequestUsers = {
max_quantity?: number;
request_id: number;
request_name?: boolean;
request_photo?: boolean;
request_username?: boolean;
user_is_bot?: boolean;
user_is_premium?: boolean;
};
LabeledPrice
type LabeledPrice = {
amount: number;
label: string;
};
LeaveChatParams
type LeaveChatParams = {
chat_id: number | string;
};
LeaveChatResult
type LeaveChatResult = boolean;
Link
type Link = {
url: string;
};
LinkPreviewOptions
type LinkPreviewOptions = {
is_disabled?: boolean;
prefer_large_media?: boolean;
prefer_small_media?: boolean;
show_above_text?: boolean;
url?: string;
};
LivePhoto
type LivePhoto = {
duration: number;
file_id: string;
file_size?: number;
file_unique_id: string;
height: number;
mime_type?: string;
photo?: [PhotoSize](#photosize)[];
width: number;
};
Location
type Location = {
heading?: number;
horizontal_accuracy?: number;
latitude: number;
live_period?: number;
longitude: number;
proximity_alert_radius?: number;
};
LocationAddress
type LocationAddress = {
city?: string;
country_code: string;
state?: string;
street?: string;
};
LogOutParams
type LogOutParams = Record<string, never>;
LogOutResult
type LogOutResult = boolean;
LoginUrl
type LoginUrl = {
bot_username?: string;
forward_text?: string;
request_write_access?: boolean;
url: string;
};
ManagedBotCreated
type ManagedBotCreated = {
bot: [User](#user);
};
ManagedBotUpdated
type ManagedBotUpdated = {
bot: [User](#user);
user: [User](#user);
};
MaskPosition
type MaskPosition = {
point: string;
scale: number;
x_shift: number;
y_shift: number;
};
MaybeInaccessibleMessage
type MaybeInaccessibleMessage = [Message](#message) | [InaccessibleMessage](#inaccessiblemessage);
MenuButton
type MenuButton = [MenuButtonCommands](#menubuttoncommands) | [MenuButtonWebApp](#menubuttonwebapp) | [MenuButtonDefault](#menubuttondefault);
MenuButtonCommands
type MenuButtonCommands = {
type: string;
};
MenuButtonDefault
type MenuButtonDefault = {
type: string;
};
MenuButtonWebApp
type MenuButtonWebApp = {
text: string;
type: string;
web_app: [WebAppInfo](#webappinfo);
};
Message
type Message = {
animation?: [Animation](#animation);
audio?: [Audio](#audio);
author_signature?: string;
boost_added?: [ChatBoostAdded](#chatboostadded);
business_connection_id?: string;
caption?: string;
caption_entities?: [MessageEntity](#messageentity)[];
channel_chat_created?: true;
chat: [Chat](#chat);
chat_background_set?: [ChatBackground](#chatbackground);
chat_owner_changed?: [ChatOwnerChanged](#chatownerchanged);
chat_owner_left?: [ChatOwnerLeft](#chatownerleft);
chat_shared?: [ChatShared](#chatshared);
checklist?: [Checklist](#checklist);
checklist_tasks_added?: [ChecklistTasksAdded](#checklisttasksadded);
checklist_tasks_done?: [ChecklistTasksDone](#checklisttasksdone);
community_chat_added?: [CommunityChatAdded](#communitychatadded);
community_chat_joined?: [CommunityChatJoined](#communitychatjoined);
community_chat_removed?: [CommunityChatRemoved](#communitychatremoved);
connected_website?: string;
contact?: [Contact](#contact);
date: number;
delete_chat_photo?: true;
dice?: [Dice](#dice);
direct_message_price_changed?: [DirectMessagePriceChanged](#directmessagepricechanged);
direct_messages_topic?: [DirectMessagesTopic](#directmessagestopic);
document?: [Document](#document);
edit_date?: number;
effect_id?: string;
entities?: [MessageEntity](#messageentity)[];
ephemeral_message_id?: number;
external_reply?: [ExternalReplyInfo](#externalreplyinfo);
forum_topic_closed?: [ForumTopicClosed](#forumtopicclosed);
forum_topic_created?: [ForumTopicCreated](#forumtopiccreated);
forum_topic_edited?: [ForumTopicEdited](#forumtopicedited);
forum_topic_reopened?: [ForumTopicReopened](#forumtopicreopened);
forward_origin?: [MessageOrigin](#messageorigin);
from?: [User](#user);
game?: [Game](#game);
general_forum_topic_hidden?: [GeneralForumTopicHidden](#generalforumtopichidden);
general_forum_topic_unhidden?: [GeneralForumTopicUnhidden](#generalforumtopicunhidden);
gift?: [GiftInfo](#giftinfo);
gift_upgrade_sent?: [GiftInfo](#giftinfo);
giveaway?: [Giveaway](#giveaway);
giveaway_completed?: [GiveawayCompleted](#giveawaycompleted);
giveaway_created?: [GiveawayCreated](#giveawaycreated);
giveaway_winners?: [GiveawayWinners](#giveawaywinners);
group_chat_created?: true;
guest_bot_caller_chat?: [Chat](#chat);
guest_bot_caller_user?: [User](#user);
guest_query_id?: string;
has_media_spoiler?: true;
has_protected_content?: true;
invoice?: [Invoice](#invoice);
is_automatic_forward?: true;
is_from_offline?: true;
is_paid_post?: true;
is_topic_message?: true;
left_chat_member?: [User](#user);
link_preview_options?: [LinkPreviewOptions](#linkpreviewoptions);
live_photo?: [LivePhoto](#livephoto);
location?: [Location](#location);
managed_bot_created?: [ManagedBotCreated](#managedbotcreated);
media_group_id?: string;
message_auto_delete_timer_changed?: [MessageAutoDeleteTimerChanged](#messageautodeletetimerchanged);
message_id: number;
message_thread_id?: number;
migrate_from_chat_id?: number;
migrate_to_chat_id?: number;
new_chat_members?: [User](#user)[];
new_chat_photo?: [PhotoSize](#photosize)[];
new_chat_title?: string;
paid_media?: [PaidMediaInfo](#paidmediainfo);
paid_message_price_changed?: [PaidMessagePriceChanged](#paidmessagepricechanged);
paid_star_count?: number;
passport_data?: [PassportData](#passportdata);
photo?: [PhotoSize](#photosize)[];
pinned_message?: [MaybeInaccessibleMessage](#maybeinaccessiblemessage);
poll?: [Poll](#poll);
poll_option_added?: [PollOptionAdded](#polloptionadded);
poll_option_deleted?: [PollOptionDeleted](#polloptiondeleted);
proximity_alert_triggered?: [ProximityAlertTriggered](#proximityalerttriggered);
quote?: [TextQuote](#textquote);
receiver_user?: [User](#user);
refunded_payment?: [RefundedPayment](#refundedpayment);
reply_markup?: [InlineKeyboardMarkup](#inlinekeyboardmarkup);
reply_to_checklist_task_id?: number;
reply_to_message?: [Message](#message);
reply_to_poll_option_id?: string;
reply_to_story?: [Story](#story);
rich_message?: [RichMessage](#richmessage);
sender_boost_count?: number;
sender_business_bot?: [User](#user);
sender_chat?: [Chat](#chat);
sender_tag?: string;
show_caption_above_media?: true;
sticker?: [Sticker](#sticker);
story?: [Story](#story);
successful_payment?: [SuccessfulPayment](#successfulpayment);
suggested_post_approval_failed?: [SuggestedPostApprovalFailed](#suggestedpostapprovalfailed);
suggested_post_approved?: [SuggestedPostApproved](#suggestedpostapproved);
suggested_post_declined?: [SuggestedPostDeclined](#suggestedpostdeclined);
suggested_post_info?: [SuggestedPostInfo](#suggestedpostinfo);
suggested_post_paid?: [SuggestedPostPaid](#suggestedpostpaid);
suggested_post_refunded?: [SuggestedPostRefunded](#suggestedpostrefunded);
supergroup_chat_created?: true;
text?: string;
unique_gift?: [UniqueGiftInfo](#uniquegiftinfo);
users_shared?: [UsersShared](#usersshared);
venue?: [Venue](#venue);
via_bot?: [User](#user);
video?: [Video](#video);
video_chat_ended?: [VideoChatEnded](#videochatended);
video_chat_participants_invited?: [VideoChatParticipantsInvited](#videochatparticipantsinvited);
video_chat_scheduled?: [VideoChatScheduled](#videochatscheduled);
video_chat_started?: [VideoChatStarted](#videochatstarted);
video_note?: [VideoNote](#videonote);
voice?: [Voice](#voice);
web_app_data?: [WebAppData](#webappdata);
write_access_allowed?: [WriteAccessAllowed](#writeaccessallowed);
};
MessageAutoDeleteTimerChanged
type MessageAutoDeleteTimerChanged = {
message_auto_delete_time: number;
};
MessageEntity
type MessageEntity = {
custom_emoji_id?: string;
date_time_format?: string;
language?: string;
length: number;
offset: number;
type: string;
unix_time?: number;
url?: string;
user?: [User](#user);
};
MessageGenerationStopped
type MessageGenerationStopped = {
chat: [Chat](#chat);
draft_id: number;
message_thread_id?: number;
};
MessageId
type MessageId = {
message_id: number;
};
MessageOrigin
type MessageOrigin = [MessageOriginUser](#messageoriginuser) | [MessageOriginHiddenUser](#messageoriginhiddenuser) | [MessageOriginChat](#messageoriginchat) | [MessageOriginChannel](#messageoriginchannel);
MessageOriginChannel
type MessageOriginChannel = {
author_signature?: string;
chat: [Chat](#chat);
date: number;
message_id: number;
type: string;
};
MessageOriginChat
type MessageOriginChat = {
author_signature?: string;
date: number;
sender_chat: [Chat](#chat);
type: string;
};
MessageOriginHiddenUser
type MessageOriginHiddenUser = {
date: number;
sender_user_name: string;
type: string;
};
MessageOriginUser
type MessageOriginUser = {
date: number;
sender_user: [User](#user);
type: string;
};
MessageReactionCountUpdated
type MessageReactionCountUpdated = {
chat: [Chat](#chat);
date: number;
message_id: number;
reactions: [ReactionCount](#reactioncount)[];
};
MessageReactionUpdated
type MessageReactionUpdated = {
actor_chat?: [Chat](#chat);
chat: [Chat](#chat);
date: number;
message_id: number;
new_reaction: [ReactionType](#reactiontype)[];
old_reaction: [ReactionType](#reactiontype)[];
user?: [User](#user);
};
Middleware
A middleware over context C. Return value is ignored.
type Middleware = (ctx: C, next: [NextFn](#nextfn)) => unknown | Promise<unknown>;
NextFn
Continuation passed to a middleware; awaiting it runs the rest of the chain.
type NextFn = () => Promise<void>;
OrderInfo
type OrderInfo = {
email?: string;
name?: string;
phone_number?: string;
shipping_address?: [ShippingAddress](#shippingaddress);
};
OwnedGift
type OwnedGift = [OwnedGiftRegular](#ownedgiftregular) | [OwnedGiftUnique](#ownedgiftunique);
OwnedGiftRegular
type OwnedGiftRegular = {
can_be_upgraded?: true;
convert_star_count?: number;
entities?: [MessageEntity](#messageentity)[];
gift: [Gift](#gift);
is_private?: true;
is_saved?: true;
is_upgrade_separate?: true;
owned_gift_id?: string;
prepaid_upgrade_star_count?: number;
send_date: number;
sender_user?: [User](#user);
text?: string;
type: string;
unique_gift_number?: number;
was_refunded?: true;
};
OwnedGiftUnique
type OwnedGiftUnique = {
can_be_transferred?: true;
gift: [UniqueGift](#uniquegift);
is_saved?: true;
next_transfer_date?: number;
owned_gift_id?: string;
send_date: number;
sender_user?: [User](#user);
transfer_star_count?: number;
type: string;
};
OwnedGifts
type OwnedGifts = {
gifts: [OwnedGift](#ownedgift)[];
next_offset?: string;
total_count: number;
};
PaidMedia
type PaidMedia = [PaidMediaLivePhoto](#paidmedialivephoto) | [PaidMediaPhoto](#paidmediaphoto) | [PaidMediaPreview](#paidmediapreview) | [PaidMediaVideo](#paidmediavideo);
PaidMediaInfo
type PaidMediaInfo = {
paid_media: [PaidMedia](#paidmedia)[];
star_count: number;
};
PaidMediaLivePhoto
type PaidMediaLivePhoto = {
live_photo: [LivePhoto](#livephoto);
type: string;
};
PaidMediaPhoto
type PaidMediaPhoto = {
photo: [PhotoSize](#photosize)[];
type: string;
};
PaidMediaPreview
type PaidMediaPreview = {
duration?: number;
height?: number;
type: string;
width?: number;
};
PaidMediaPurchased
type PaidMediaPurchased = {
from: [User](#user);
paid_media_payload: string;
};
PaidMediaVideo
type PaidMediaVideo = {
type: string;
video: [Video](#video);
};
PaidMessagePriceChanged
type PaidMessagePriceChanged = {
paid_message_star_count: number;
};
ParseMode
Text formatting mode accepted by parse_mode fields.
type ParseMode = "Markdown" | "MarkdownV2" | "HTML";
PassportData
type PassportData = {
credentials: [EncryptedCredentials](#encryptedcredentials);
data: [EncryptedPassportElement](#encryptedpassportelement)[];
};
PassportElementError
type PassportElementError = [PassportElementErrorDataField](#passportelementerrordatafield) | [PassportElementErrorFrontSide](#passportelementerrorfrontside) | [PassportElementErrorReverseSide](#passportelementerrorreverseside) | [PassportElementErrorSelfie](#passportelementerrorselfie) | [PassportElementErrorFile](#passportelementerrorfile) | [PassportElementErrorFiles](#passportelementerrorfiles) | [PassportElementErrorTranslationFile](#passportelementerrortranslationfile) | [PassportElementErrorTranslationFiles](#passportelementerrortranslationfiles) | [PassportElementErrorUnspecified](#passportelementerrorunspecified);
PassportElementErrorDataField
type PassportElementErrorDataField = {
data_hash: string;
field_name: string;
message: string;
source: string;
type: string;
};
PassportElementErrorFile
type PassportElementErrorFile = {
file_hash: string;
message: string;
source: string;
type: string;
};
PassportElementErrorFiles
type PassportElementErrorFiles = {
file_hashes: string[];
message: string;
source: string;
type: string;
};
PassportElementErrorFrontSide
type PassportElementErrorFrontSide = {
file_hash: string;
message: string;
source: string;
type: string;
};
PassportElementErrorReverseSide
type PassportElementErrorReverseSide = {
file_hash: string;
message: string;
source: string;
type: string;
};
PassportElementErrorSelfie
type PassportElementErrorSelfie = {
file_hash: string;
message: string;
source: string;
type: string;
};
PassportElementErrorTranslationFile
type PassportElementErrorTranslationFile = {
file_hash: string;
message: string;
source: string;
type: string;
};
PassportElementErrorTranslationFiles
type PassportElementErrorTranslationFiles = {
file_hashes: string[];
message: string;
source: string;
type: string;
};
PassportElementErrorUnspecified
type PassportElementErrorUnspecified = {
element_hash: string;
message: string;
source: string;
type: string;
};
PassportFile
type PassportFile = {
file_date: number;
file_id: string;
file_size: number;
file_unique_id: string;
};
PhotoSize
type PhotoSize = {
file_id: string;
file_size?: number;
file_unique_id: string;
height: number;
width: number;
};
PinChatMessageParams
type PinChatMessageParams = {
business_connection_id?: string;
chat_id: number | string;
disable_notification?: boolean;
message_id: number;
};
PinChatMessageResult
type PinChatMessageResult = boolean;
Poll
type Poll = {
allows_multiple_answers: boolean;
allows_revoting: boolean;
close_date?: number;
correct_option_ids?: number[];
country_codes?: string[];
description?: string;
description_entities?: [MessageEntity](#messageentity)[];
explanation?: string;
explanation_entities?: [MessageEntity](#messageentity)[];
explanation_media?: [PollMedia](#pollmedia);
id: string;
is_anonymous: boolean;
is_closed: boolean;
media?: [PollMedia](#pollmedia);
members_only: boolean;
open_period?: number;
options: [PollOption](#polloption)[];
question: string;
question_entities?: [MessageEntity](#messageentity)[];
total_voter_count: number;
type: string;
};
PollAnswer
type PollAnswer = {
option_ids: number[];
option_persistent_ids: string[];
poll_id: string;
user?: [User](#user);
voter_chat?: [Chat](#chat);
};
PollMedia
type PollMedia = {
animation?: [Animation](#animation);
audio?: [Audio](#audio);
document?: [Document](#document);
link?: [Link](#link);
live_photo?: [LivePhoto](#livephoto);
location?: [Location](#location);
photo?: [PhotoSize](#photosize)[];
sticker?: [Sticker](#sticker);
venue?: [Venue](#venue);
video?: [Video](#video);
};
PollOption
type PollOption = {
added_by_chat?: [Chat](#chat);
added_by_user?: [User](#user);
addition_date?: number;
media?: [PollMedia](#pollmedia);
persistent_id: string;
text: string;
text_entities?: [MessageEntity](#messageentity)[];
voter_count: number;
};
PollOptionAdded
type PollOptionAdded = {
option_persistent_id: string;
option_text: string;
option_text_entities?: [MessageEntity](#messageentity)[];
poll_message?: [MaybeInaccessibleMessage](#maybeinaccessiblemessage);
};
PollOptionDeleted
type PollOptionDeleted = {
option_persistent_id: string;
option_text: string;
option_text_entities?: [MessageEntity](#messageentity)[];
poll_message?: [MaybeInaccessibleMessage](#maybeinaccessiblemessage);
};
PostStoryParams
type PostStoryParams = {
active_period: number;
areas?: [StoryArea](#storyarea)[];
business_connection_id: string;
caption?: string;
caption_entities?: [MessageEntity](#messageentity)[];
content: [InputStoryContent](#inputstorycontent);
parse_mode?: string;
post_to_chat_page?: boolean;
protect_content?: boolean;
};
PostStoryResult
type PostStoryResult = [Story](#story);
PreCheckoutQuery
type PreCheckoutQuery = {
currency: string;
from: [User](#user);
id: string;
invoice_payload: string;
order_info?: [OrderInfo](#orderinfo);
shipping_option_id?: string;
total_amount: number;
};
PreparedInlineMessage
type PreparedInlineMessage = {
expiration_date: number;
id: string;
};
PreparedKeyboardButton
type PreparedKeyboardButton = {
id: string;
};
PromoteChatMemberParams
type PromoteChatMemberParams = {
can_change_info?: boolean;
can_delete_messages?: boolean;
can_delete_stories?: boolean;
can_edit_messages?: boolean;
can_edit_stories?: boolean;
can_invite_users?: boolean;
can_manage_chat?: boolean;
can_manage_direct_messages?: boolean;
can_manage_tags?: boolean;
can_manage_topics?: boolean;
can_manage_video_chats?: boolean;
can_pin_messages?: boolean;
can_post_messages?: boolean;
can_post_stories?: boolean;
can_promote_members?: boolean;
can_restrict_members?: boolean;
can_send_welcome_messages?: boolean;
chat_id: number | string;
is_anonymous?: boolean;
user_id: number;
};
PromoteChatMemberResult
type PromoteChatMemberResult = boolean;
ProximityAlertTriggered
type ProximityAlertTriggered = {
distance: number;
traveler: [User](#user);
watcher: [User](#user);
};
ReactionCount
type ReactionCount = {
total_count: number;
type: [ReactionType](#reactiontype);
};
ReactionType
type ReactionType = [ReactionTypeEmoji](#reactiontypeemoji) | [ReactionTypeCustomEmoji](#reactiontypecustomemoji) | [ReactionTypePaid](#reactiontypepaid);
ReactionTypeCustomEmoji
type ReactionTypeCustomEmoji = {
custom_emoji_id: string;
type: string;
};
ReactionTypeEmoji
type ReactionTypeEmoji = {
emoji: string;
type: string;
};
ReactionTypePaid
type ReactionTypePaid = {
type: string;
};
ReadBusinessMessageParams
type ReadBusinessMessageParams = {
business_connection_id: string;
chat_id: number;
message_id: number;
};
ReadBusinessMessageResult
type ReadBusinessMessageResult = boolean;
RefundStarPaymentParams
type RefundStarPaymentParams = {
telegram_payment_charge_id: string;
user_id: number;
};
RefundStarPaymentResult
type RefundStarPaymentResult = boolean;
RefundedPayment
type RefundedPayment = {
currency: string;
invoice_payload: string;
provider_payment_charge_id?: string;
telegram_payment_charge_id: string;
total_amount: number;
};
RemoveBusinessAccountProfilePhotoParams
type RemoveBusinessAccountProfilePhotoParams = {
business_connection_id: string;
is_public?: boolean;
};
RemoveBusinessAccountProfilePhotoResult
type RemoveBusinessAccountProfilePhotoResult = boolean;
RemoveChatVerificationParams
type RemoveChatVerificationParams = {
chat_id: number | string;
};
RemoveChatVerificationResult
type RemoveChatVerificationResult = boolean;
RemoveMyProfilePhotoParams
type RemoveMyProfilePhotoParams = Record<string, never>;
RemoveMyProfilePhotoResult
type RemoveMyProfilePhotoResult = boolean;
RemoveUserVerificationParams
type RemoveUserVerificationParams = {
user_id: number;
};
RemoveUserVerificationResult
type RemoveUserVerificationResult = boolean;
ReopenForumTopicParams
type ReopenForumTopicParams = {
chat_id: number | string;
message_thread_id: number;
};
ReopenForumTopicResult
type ReopenForumTopicResult = boolean;
ReopenGeneralForumTopicParams
type ReopenGeneralForumTopicParams = {
chat_id: number | string;
};
ReopenGeneralForumTopicResult
type ReopenGeneralForumTopicResult = boolean;
ReplaceManagedBotTokenParams
type ReplaceManagedBotTokenParams = {
user_id: number;
};
ReplaceManagedBotTokenResult
type ReplaceManagedBotTokenResult = string;
ReplaceStickerInSetParams
type ReplaceStickerInSetParams = {
name: string;
old_sticker: string;
sticker: [InputSticker](#inputsticker);
user_id: number;
};
ReplaceStickerInSetResult
type ReplaceStickerInSetResult = boolean;
ReplyKeyboardMarkup
type ReplyKeyboardMarkup = {
force_reply?: boolean;
input_field_placeholder?: string;
is_persistent?: boolean;
keyboard: [KeyboardButton](#keyboardbutton)[][];
one_time_keyboard?: boolean;
resize_keyboard?: boolean;
selective?: boolean;
};
ReplyKeyboardRemove
type ReplyKeyboardRemove = {
remove_keyboard: true;
selective?: boolean;
};
ReplyMarkup
Union of the four reply-markup objects.
type ReplyMarkup = [InlineKeyboardMarkup](#inlinekeyboardmarkup) | [ReplyKeyboardMarkup](#replykeyboardmarkup) | [ReplyKeyboardRemove](#replykeyboardremove) | [ForceReply](#forcereply);
ReplyParameters
type ReplyParameters = {
allow_sending_without_reply?: boolean;
chat_id?: number | string;
checklist_task_id?: number;
ephemeral_message_id?: number;
message_id?: number;
poll_option_id?: string;
quote?: string;
quote_entities?: [MessageEntity](#messageentity)[];
quote_parse_mode?: string;
quote_position?: number;
};
RepostStoryParams
type RepostStoryParams = {
active_period: number;
business_connection_id: string;
from_chat_id: number;
from_story_id: number;
post_to_chat_page?: boolean;
protect_content?: boolean;
};
RepostStoryResult
type RepostStoryResult = [Story](#story);
ResponseParameters
type ResponseParameters = {
migrate_to_chat_id?: number;
retry_after?: number;
};
RestrictChatMemberParams
type RestrictChatMemberParams = {
chat_id: number | string;
permissions: [ChatPermissions](#chatpermissions);
until_date?: number;
use_independent_chat_permissions?: boolean;
user_id: number;
};
RestrictChatMemberResult
type RestrictChatMemberResult = boolean;
RevenueWithdrawalState
type RevenueWithdrawalState = [RevenueWithdrawalStatePending](#revenuewithdrawalstatepending) | [RevenueWithdrawalStateSucceeded](#revenuewithdrawalstatesucceeded) | [RevenueWithdrawalStateFailed](#revenuewithdrawalstatefailed);
RevenueWithdrawalStateFailed
type RevenueWithdrawalStateFailed = {
type: string;
};
RevenueWithdrawalStatePending
type RevenueWithdrawalStatePending = {
type: string;
};
RevenueWithdrawalStateSucceeded
type RevenueWithdrawalStateSucceeded = {
date: number;
type: string;
url: string;
};
RevokeChatInviteLinkParams
type RevokeChatInviteLinkParams = {
chat_id: number | string;
invite_link: string;
};
RevokeChatInviteLinkResult
type RevokeChatInviteLinkResult = [ChatInviteLink](#chatinvitelink);
RichBlock
type RichBlock = [RichBlockParagraph](#richblockparagraph) | [RichBlockSectionHeading](#richblocksectionheading) | [RichBlockPreformatted](#richblockpreformatted) | [RichBlockFooter](#richblockfooter) | [RichBlockDivider](#richblockdivider) | [RichBlockMathematicalExpression](#richblockmathematicalexpression) | [RichBlockAnchor](#richblockanchor) | [RichBlockList](#richblocklist) | [RichBlockBlockQuotation](#richblockblockquotation) | [RichBlockExpandableBlockQuotation](#richblockexpandableblockquotation) | [RichBlockPullQuotation](#richblockpullquotation) | [RichBlockCollage](#richblockcollage) | [RichBlockSlideshow](#richblockslideshow) | [RichBlockTable](#richblocktable) | [RichBlockDetails](#richblockdetails) | [RichBlockMap](#richblockmap) | [RichBlockButtons](#richblockbuttons) | [RichBlockAnimation](#richblockanimation) | [RichBlockAudio](#richblockaudio) | [RichBlockDocument](#richblockdocument) | [RichBlockPhoto](#richblockphoto) | [RichBlockVideo](#richblockvideo) | [RichBlockVoiceNote](#richblockvoicenote) | [RichBlockThinking](#richblockthinking);
RichBlockAnchor
type RichBlockAnchor = {
name: string;
type: string;
};
RichBlockAnimation
type RichBlockAnimation = {
animation: [Animation](#animation);
caption?: [RichBlockCaption](#richblockcaption);
has_spoiler?: true;
type: string;
};
RichBlockAudio
type RichBlockAudio = {
audio: [Audio](#audio);
caption?: [RichBlockCaption](#richblockcaption);
type: string;
};
RichBlockBlockQuotation
type RichBlockBlockQuotation = {
blocks: [RichBlock](#richblock)[];
credit?: [RichText](#richtext);
type: string;
};
RichBlockButtons
type RichBlockButtons = {
align?: string;
buttons: [RichMessageButton](#richmessagebutton)[];
type: string;
};
RichBlockCaption
type RichBlockCaption = {
credit?: [RichText](#richtext);
text: [RichText](#richtext);
};
RichBlockCollage
type RichBlockCollage = {
blocks: [RichBlock](#richblock)[];
caption?: [RichBlockCaption](#richblockcaption);
type: string;
};
RichBlockDetails
type RichBlockDetails = {
blocks: [RichBlock](#richblock)[];
is_open?: true;
summary: [RichText](#richtext);
type: string;
};
RichBlockDivider
type RichBlockDivider = {
type: string;
};
RichBlockDocument
type RichBlockDocument = {
caption?: [RichBlockCaption](#richblockcaption);
document: [Document](#document);
type: string;
};
RichBlockExpandableBlockQuotation
type RichBlockExpandableBlockQuotation = {
credit?: [RichText](#richtext);
text: [RichText](#richtext);
type: string;
};
RichBlockFooter
type RichBlockFooter = {
text: [RichText](#richtext);
type: string;
};
RichBlockList
type RichBlockList = {
items: [RichBlockListItem](#richblocklistitem)[];
type: string;
};
RichBlockListItem
type RichBlockListItem = {
blocks: [RichBlock](#richblock)[];
has_checkbox?: true;
is_checked?: true;
label: string;
type?: string;
value?: number;
};
RichBlockMap
type RichBlockMap = {
caption?: [RichBlockCaption](#richblockcaption);
height: number;
location: [Location](#location);
type: string;
width: number;
zoom: number;
};
RichBlockMathematicalExpression
type RichBlockMathematicalExpression = {
expression: string;
type: string;
};
RichBlockParagraph
type RichBlockParagraph = {
text: [RichText](#richtext);
type: string;
};
RichBlockPhoto
type RichBlockPhoto = {
caption?: [RichBlockCaption](#richblockcaption);
has_spoiler?: true;
photo: [PhotoSize](#photosize)[];
type: string;
};
RichBlockPreformatted
type RichBlockPreformatted = {
language?: string;
text: [RichText](#richtext);
type: string;
};
RichBlockPullQuotation
type RichBlockPullQuotation = {
credit?: [RichText](#richtext);
text: [RichText](#richtext);
type: string;
};
RichBlockSectionHeading
type RichBlockSectionHeading = {
size: number;
text: [RichText](#richtext);
type: string;
};
RichBlockSlideshow
type RichBlockSlideshow = {
blocks: [RichBlock](#richblock)[];
caption?: [RichBlockCaption](#richblockcaption);
type: string;
};
RichBlockTable
type RichBlockTable = {
caption?: [RichText](#richtext);
cells: [RichBlockTableCell](#richblocktablecell)[][];
is_bordered?: true;
is_compact?: true;
is_striped?: true;
type: string;
};
RichBlockTableCell
type RichBlockTableCell = {
align: string;
colspan?: number;
is_header?: true;
rowspan?: number;
text?: [RichText](#richtext);
valign: string;
};
RichBlockThinking
type RichBlockThinking = {
text: [RichText](#richtext);
type: string;
};
RichBlockVideo
type RichBlockVideo = {
caption?: [RichBlockCaption](#richblockcaption);
has_spoiler?: true;
type: string;
video: [Video](#video);
};
RichBlockVoiceNote
type RichBlockVoiceNote = {
caption?: [RichBlockCaption](#richblockcaption);
type: string;
voice_note: [Voice](#voice);
};
RichMessage
type RichMessage = {
blocks: [RichBlock](#richblock)[];
is_rtl?: boolean;
};
RichMessageButton
type RichMessageButton = {
callback_data?: string;
copy_text?: [CopyTextButton](#copytextbutton);
disabled?: [DisabledButton](#disabledbutton);
login_url?: [LoginUrl](#loginurl);
style?: string;
switch_inline_query?: string;
switch_inline_query_chosen_chat?: [SwitchInlineQueryChosenChat](#switchinlinequerychosenchat);
switch_inline_query_current_chat?: string;
text: [RichText](#richtext);
url?: string;
web_app?: [WebAppInfo](#webappinfo);
};
RichText
type RichText = string | [RichText](#richtext)[] | [RichTextBold](#richtextbold) | [RichTextItalic](#richtextitalic) | [RichTextUnderline](#richtextunderline) | [RichTextStrikethrough](#richtextstrikethrough) | [RichTextSpoiler](#richtextspoiler) | [RichTextDateTime](#richtextdatetime) | [RichTextTextMention](#richtexttextmention) | [RichTextSubscript](#richtextsubscript) | [RichTextSuperscript](#richtextsuperscript) | [RichTextMarked](#richtextmarked) | [RichTextCode](#richtextcode) | [RichTextCustomEmoji](#richtextcustomemoji) | [RichTextMathematicalExpression](#richtextmathematicalexpression) | [RichTextUrl](#richtexturl) | [RichTextEmailAddress](#richtextemailaddress) | [RichTextPhoneNumber](#richtextphonenumber) | [RichTextBankCardNumber](#richtextbankcardnumber) | [RichTextMention](#richtextmention) | [RichTextHashtag](#richtexthashtag) | [RichTextCashtag](#richtextcashtag) | [RichTextBotCommand](#richtextbotcommand) | [RichTextButton](#richtextbutton) | [RichTextAnchor](#richtextanchor) | [RichTextAnchorLink](#richtextanchorlink) | [RichTextReference](#richtextreference) | [RichTextReferenceLink](#richtextreferencelink);
RichTextAnchor
type RichTextAnchor = {
name: string;
type: string;
};
RichTextAnchorLink
type RichTextAnchorLink = {
anchor_name: string;
text: [RichText](#richtext);
type: string;
};
RichTextBankCardNumber
type RichTextBankCardNumber = {
bank_card_number: string;
text: [RichText](#richtext);
type: string;
};
RichTextBold
type RichTextBold = {
text: [RichText](#richtext);
type: string;
};
RichTextBotCommand
type RichTextBotCommand = {
bot_command: string;
text: [RichText](#richtext);
type: string;
};
RichTextButton
type RichTextButton = {
button: [RichMessageButton](#richmessagebutton);
type: string;
};
RichTextCashtag
type RichTextCashtag = {
cashtag: string;
text: [RichText](#richtext);
type: string;
};
RichTextCode
type RichTextCode = {
text: [RichText](#richtext);
type: string;
};
RichTextContent
Anything a rich-text content parameter accepts.
type RichTextContent = [RichText](#richtext) | [RichTextBuilder](#richtextbuilder);
RichTextCustomEmoji
type RichTextCustomEmoji = {
alternative_text: string;
custom_emoji_id: string;
type: string;
};
RichTextDateTime
type RichTextDateTime = {
date_time_format: string;
text: [RichText](#richtext);
type: string;
unix_time: number;
};
RichTextEmailAddress
type RichTextEmailAddress = {
email_address: string;
text: [RichText](#richtext);
type: string;
};
RichTextHashtag
type RichTextHashtag = {
hashtag: string;
text: [RichText](#richtext);
type: string;
};
RichTextItalic
type RichTextItalic = {
text: [RichText](#richtext);
type: string;
};
RichTextMarked
type RichTextMarked = {
text: [RichText](#richtext);
type: string;
};
RichTextMathematicalExpression
type RichTextMathematicalExpression = {
expression: string;
type: string;
};
RichTextMention
type RichTextMention = {
text: [RichText](#richtext);
type: string;
username: string;
};
RichTextPhoneNumber
type RichTextPhoneNumber = {
phone_number: string;
text: [RichText](#richtext);
type: string;
};
RichTextReference
type RichTextReference = {
name: string;
text: [RichText](#richtext);
type: string;
};
RichTextReferenceLink
type RichTextReferenceLink = {
reference_name: string;
text: [RichText](#richtext);
type: string;
};
RichTextSpoiler
type RichTextSpoiler = {
text: [RichText](#richtext);
type: string;
};
RichTextStrikethrough
type RichTextStrikethrough = {
text: [RichText](#richtext);
type: string;
};
RichTextSubscript
type RichTextSubscript = {
text: [RichText](#richtext);
type: string;
};
RichTextSuperscript
type RichTextSuperscript = {
text: [RichText](#richtext);
type: string;
};
RichTextTextMention
type RichTextTextMention = {
text: [RichText](#richtext);
type: string;
user: [User](#user);
};
RichTextUnderline
type RichTextUnderline = {
text: [RichText](#richtext);
type: string;
};
RichTextUrl
type RichTextUrl = {
text: [RichText](#richtext);
type: string;
url: string;
};
SavePreparedInlineMessageParams
type SavePreparedInlineMessageParams = {
allow_bot_chats?: boolean;
allow_channel_chats?: boolean;
allow_group_chats?: boolean;
allow_user_chats?: boolean;
result: [InlineQueryResult](#inlinequeryresult);
user_id: number;
};
SavePreparedInlineMessageResult
type SavePreparedInlineMessageResult = [PreparedInlineMessage](#preparedinlinemessage);
SavePreparedKeyboardButtonParams
type SavePreparedKeyboardButtonParams = {
button: [KeyboardButton](#keyboardbutton);
user_id: number;
};
SavePreparedKeyboardButtonResult
type SavePreparedKeyboardButtonResult = [PreparedInlineMessage](#preparedinlinemessage);
SendAnimationParams
type SendAnimationParams = {
allow_paid_broadcast?: boolean;
animation: [InputFile](#inputfile) | string;
business_connection_id?: string;
caption?: string;
caption_entities?: [MessageEntity](#messageentity)[];
chat_id: number | string;
direct_messages_topic_id?: number;
disable_notification?: boolean;
duration?: number;
ephemeral_message_parameters?: [EphemeralMessageParameters](#ephemeralmessageparameters);
has_spoiler?: boolean;
height?: number;
message_effect_id?: string;
message_thread_id?: number;
parse_mode?: string;
protect_content?: boolean;
reply_markup?: [InlineKeyboardMarkup](#inlinekeyboardmarkup) | [ReplyKeyboardMarkup](#replykeyboardmarkup) | [ReplyKeyboardRemove](#replykeyboardremove) | [ForceReply](#forcereply);
reply_parameters?: [ReplyParameters](#replyparameters);
show_caption_above_media?: boolean;
suggested_post_parameters?: [SuggestedPostParameters](#suggestedpostparameters);
thumbnail?: [InputFile](#inputfile) | string;
width?: number;
};
SendAnimationResult
type SendAnimationResult = [Message](#message);
SendAudioParams
type SendAudioParams = {
allow_paid_broadcast?: boolean;
audio: [InputFile](#inputfile) | string;
business_connection_id?: string;
caption?: string;
caption_entities?: [MessageEntity](#messageentity)[];
chat_id: number | string;
direct_messages_topic_id?: number;
disable_notification?: boolean;
duration?: number;
ephemeral_message_parameters?: [EphemeralMessageParameters](#ephemeralmessageparameters);
message_effect_id?: string;
message_thread_id?: number;
parse_mode?: string;
performer?: string;
protect_content?: boolean;
reply_markup?: [InlineKeyboardMarkup](#inlinekeyboardmarkup) | [ReplyKeyboardMarkup](#replykeyboardmarkup) | [ReplyKeyboardRemove](#replykeyboardremove) | [ForceReply](#forcereply);
reply_parameters?: [ReplyParameters](#replyparameters);
suggested_post_parameters?: [SuggestedPostParameters](#suggestedpostparameters);
thumbnail?: [InputFile](#inputfile) | string;
title?: string;
};
SendAudioResult
type SendAudioResult = [Message](#message);
SendChatActionParams
type SendChatActionParams = {
action: string;
business_connection_id?: string;
chat_id: number | string;
message_thread_id?: number;
};
SendChatActionResult
type SendChatActionResult = boolean;
SendChatJoinRequestWebAppParams
type SendChatJoinRequestWebAppParams = {
chat_join_request_query_id: string;
web_app_url: string;
};
SendChatJoinRequestWebAppResult
type SendChatJoinRequestWebAppResult = boolean;
SendChecklistParams
type SendChecklistParams = {
business_connection_id: string;
chat_id: number | string;
checklist: [InputChecklist](#inputchecklist);
disable_notification?: boolean;
message_effect_id?: string;
protect_content?: boolean;
reply_markup?: [InlineKeyboardMarkup](#inlinekeyboardmarkup);
reply_parameters?: [ReplyParameters](#replyparameters);
};
SendChecklistResult
type SendChecklistResult = [Message](#message);
SendContactParams
type SendContactParams = {
allow_paid_broadcast?: boolean;
business_connection_id?: string;
chat_id: number | string;
direct_messages_topic_id?: number;
disable_notification?: boolean;
ephemeral_message_parameters?: [EphemeralMessageParameters](#ephemeralmessageparameters);
first_name: string;
last_name?: string;
message_effect_id?: string;
message_thread_id?: number;
phone_number: string;
protect_content?: boolean;
reply_markup?: [InlineKeyboardMarkup](#inlinekeyboardmarkup) | [ReplyKeyboardMarkup](#replykeyboardmarkup) | [ReplyKeyboardRemove](#replykeyboardremove) | [ForceReply](#forcereply);
reply_parameters?: [ReplyParameters](#replyparameters);
suggested_post_parameters?: [SuggestedPostParameters](#suggestedpostparameters);
vcard?: string;
};
SendContactResult
type SendContactResult = [Message](#message);
SendDiceParams
type SendDiceParams = {
allow_paid_broadcast?: boolean;
business_connection_id?: string;
chat_id: number | string;
direct_messages_topic_id?: number;
disable_notification?: boolean;
emoji?: string;
message_effect_id?: string;
message_thread_id?: number;
protect_content?: boolean;
reply_markup?: [InlineKeyboardMarkup](#inlinekeyboardmarkup) | [ReplyKeyboardMarkup](#replykeyboardmarkup) | [ReplyKeyboardRemove](#replykeyboardremove) | [ForceReply](#forcereply);
reply_parameters?: [ReplyParameters](#replyparameters);
suggested_post_parameters?: [SuggestedPostParameters](#suggestedpostparameters);
};
SendDiceResult
type SendDiceResult = [Message](#message);
SendDocumentParams
type SendDocumentParams = {
allow_paid_broadcast?: boolean;
business_connection_id?: string;
caption?: string;
caption_entities?: [MessageEntity](#messageentity)[];
chat_id: number | string;
direct_messages_topic_id?: number;
disable_content_type_detection?: boolean;
disable_notification?: boolean;
document: [InputFile](#inputfile) | string;
ephemeral_message_parameters?: [EphemeralMessageParameters](#ephemeralmessageparameters);
message_effect_id?: string;
message_thread_id?: number;
parse_mode?: string;
protect_content?: boolean;
reply_markup?: [InlineKeyboardMarkup](#inlinekeyboardmarkup) | [ReplyKeyboardMarkup](#replykeyboardmarkup) | [ReplyKeyboardRemove](#replykeyboardremove) | [ForceReply](#forcereply);
reply_parameters?: [ReplyParameters](#replyparameters);
suggested_post_parameters?: [SuggestedPostParameters](#suggestedpostparameters);
thumbnail?: [InputFile](#inputfile) | string;
};
SendDocumentResult
type SendDocumentResult = [Message](#message);
SendGameParams
type SendGameParams = {
allow_paid_broadcast?: boolean;
business_connection_id?: string;
chat_id: number | string;
disable_notification?: boolean;
game_short_name: string;
message_effect_id?: string;
message_thread_id?: number;
protect_content?: boolean;
reply_markup?: [InlineKeyboardMarkup](#inlinekeyboardmarkup);
reply_parameters?: [ReplyParameters](#replyparameters);
};
SendGameResult
type SendGameResult = [Message](#message);
SendGiftParams
type SendGiftParams = {
chat_id?: number | string;
gift_id: string;
pay_for_upgrade?: boolean;
text?: string;
text_entities?: [MessageEntity](#messageentity)[];
text_parse_mode?: string;
user_id?: number;
};
SendGiftResult
type SendGiftResult = boolean;
SendInvoiceParams
type SendInvoiceParams = {
allow_paid_broadcast?: boolean;
chat_id: number | string;
currency: string;
description: string;
direct_messages_topic_id?: number;
disable_notification?: boolean;
is_flexible?: boolean;
max_tip_amount?: number;
message_effect_id?: string;
message_thread_id?: number;
need_email?: boolean;
need_name?: boolean;
need_phone_number?: boolean;
need_shipping_address?: boolean;
payload: string;
photo_height?: number;
photo_size?: number;
photo_url?: string;
photo_width?: number;
prices: [LabeledPrice](#labeledprice)[];
protect_content?: boolean;
provider_data?: string;
provider_token?: string;
reply_markup?: [InlineKeyboardMarkup](#inlinekeyboardmarkup);
reply_parameters?: [ReplyParameters](#replyparameters);
send_email_to_provider?: boolean;
send_phone_number_to_provider?: boolean;
start_parameter?: string;
suggested_post_parameters?: [SuggestedPostParameters](#suggestedpostparameters);
suggested_tip_amounts?: number[];
title: string;
};
SendInvoiceResult
type SendInvoiceResult = [Message](#message);
SendLivePhotoParams
type SendLivePhotoParams = {
allow_paid_broadcast?: boolean;
business_connection_id?: string;
caption?: string;
caption_entities?: [MessageEntity](#messageentity)[];
chat_id: number | string;
direct_messages_topic_id?: number;
disable_notification?: boolean;
ephemeral_message_parameters?: [EphemeralMessageParameters](#ephemeralmessageparameters);
has_spoiler?: boolean;
live_photo: [InputFile](#inputfile) | string;
message_effect_id?: string;
message_thread_id?: number;
parse_mode?: string;
photo: [InputFile](#inputfile) | string;
protect_content?: boolean;
reply_markup?: [InlineKeyboardMarkup](#inlinekeyboardmarkup) | [ReplyKeyboardMarkup](#replykeyboardmarkup) | [ReplyKeyboardRemove](#replykeyboardremove) | [ForceReply](#forcereply);
reply_parameters?: [ReplyParameters](#replyparameters);
show_caption_above_media?: boolean;
suggested_post_parameters?: [SuggestedPostParameters](#suggestedpostparameters);
};
SendLivePhotoResult
type SendLivePhotoResult = [Message](#message);
SendLocationParams
type SendLocationParams = {
allow_paid_broadcast?: boolean;
business_connection_id?: string;
chat_id: number | string;
direct_messages_topic_id?: number;
disable_notification?: boolean;
ephemeral_message_parameters?: [EphemeralMessageParameters](#ephemeralmessageparameters);
heading?: number;
horizontal_accuracy?: number;
latitude: number;
live_period?: number;
longitude: number;
message_effect_id?: string;
message_thread_id?: number;
protect_content?: boolean;
proximity_alert_radius?: number;
reply_markup?: [InlineKeyboardMarkup](#inlinekeyboardmarkup) | [ReplyKeyboardMarkup](#replykeyboardmarkup) | [ReplyKeyboardRemove](#replykeyboardremove) | [ForceReply](#forcereply);
reply_parameters?: [ReplyParameters](#replyparameters);
suggested_post_parameters?: [SuggestedPostParameters](#suggestedpostparameters);
};
SendLocationResult
type SendLocationResult = [Message](#message);
SendMediaGroupParams
type SendMediaGroupParams = {
allow_paid_broadcast?: boolean;
business_connection_id?: string;
chat_id: number | string;
direct_messages_topic_id?: number;
disable_notification?: boolean;
media: ([InputMediaAudio](#inputmediaaudio) | [InputMediaDocument](#inputmediadocument) | [InputMediaLivePhoto](#inputmedialivephoto) | [InputMediaPhoto](#inputmediaphoto) | [InputMediaVideo](#inputmediavideo))[];
message_effect_id?: string;
message_thread_id?: number;
protect_content?: boolean;
reply_parameters?: [ReplyParameters](#replyparameters);
};
SendMediaGroupResult
type SendMediaGroupResult = [Message](#message)[];
SendMessageDraftParams
type SendMessageDraftParams = {
can_stop?: boolean;
chat_id: number;
draft_id: number;
entities?: [MessageEntity](#messageentity)[];
keep_on_stop?: boolean;
message_thread_id?: number;
parse_mode?: string;
text?: string;
};
SendMessageDraftResult
type SendMessageDraftResult = boolean;
SendMessageParams
type SendMessageParams = {
allow_paid_broadcast?: boolean;
business_connection_id?: string;
chat_id: number | string;
direct_messages_topic_id?: number;
disable_notification?: boolean;
entities?: [MessageEntity](#messageentity)[];
ephemeral_message_parameters?: [EphemeralMessageParameters](#ephemeralmessageparameters);
link_preview_options?: [LinkPreviewOptions](#linkpreviewoptions);
message_effect_id?: string;
message_thread_id?: number;
parse_mode?: string;
protect_content?: boolean;
reply_markup?: [InlineKeyboardMarkup](#inlinekeyboardmarkup) | [ReplyKeyboardMarkup](#replykeyboardmarkup) | [ReplyKeyboardRemove](#replykeyboardremove) | [ForceReply](#forcereply);
reply_parameters?: [ReplyParameters](#replyparameters);
suggested_post_parameters?: [SuggestedPostParameters](#suggestedpostparameters);
text: string;
};
SendMessageResult
type SendMessageResult = [Message](#message);
SendPaidMediaParams
type SendPaidMediaParams = {
allow_paid_broadcast?: boolean;
business_connection_id?: string;
caption?: string;
caption_entities?: [MessageEntity](#messageentity)[];
chat_id: number | string;
direct_messages_topic_id?: number;
disable_notification?: boolean;
media: [InputPaidMedia](#inputpaidmedia)[];
message_thread_id?: number;
parse_mode?: string;
payload?: string;
protect_content?: boolean;
reply_markup?: [InlineKeyboardMarkup](#inlinekeyboardmarkup) | [ReplyKeyboardMarkup](#replykeyboardmarkup) | [ReplyKeyboardRemove](#replykeyboardremove) | [ForceReply](#forcereply);
reply_parameters?: [ReplyParameters](#replyparameters);
show_caption_above_media?: boolean;
star_count: number;
suggested_post_parameters?: [SuggestedPostParameters](#suggestedpostparameters);
};
SendPaidMediaResult
type SendPaidMediaResult = [Message](#message);
SendPhotoParams
type SendPhotoParams = {
allow_paid_broadcast?: boolean;
business_connection_id?: string;
caption?: string;
caption_entities?: [MessageEntity](#messageentity)[];
chat_id: number | string;
direct_messages_topic_id?: number;
disable_notification?: boolean;
ephemeral_message_parameters?: [EphemeralMessageParameters](#ephemeralmessageparameters);
has_spoiler?: boolean;
message_effect_id?: string;
message_thread_id?: number;
parse_mode?: string;
photo: [InputFile](#inputfile) | string;
protect_content?: boolean;
reply_markup?: [InlineKeyboardMarkup](#inlinekeyboardmarkup) | [ReplyKeyboardMarkup](#replykeyboardmarkup) | [ReplyKeyboardRemove](#replykeyboardremove) | [ForceReply](#forcereply);
reply_parameters?: [ReplyParameters](#replyparameters);
show_caption_above_media?: boolean;
suggested_post_parameters?: [SuggestedPostParameters](#suggestedpostparameters);
};
SendPhotoResult
type SendPhotoResult = [Message](#message);
SendPollParams
type SendPollParams = {
allow_adding_options?: boolean;
allow_paid_broadcast?: boolean;
allows_multiple_answers?: boolean;
allows_revoting?: boolean;
business_connection_id?: string;
chat_id: number | string;
close_date?: number;
correct_option_ids?: number[];
country_codes?: string[];
description?: string;
description_entities?: [MessageEntity](#messageentity)[];
description_parse_mode?: string;
disable_notification?: boolean;
explanation?: string;
explanation_entities?: [MessageEntity](#messageentity)[];
explanation_media?: [InputPollMedia](#inputpollmedia);
explanation_parse_mode?: string;
hide_results_until_closes?: boolean;
is_anonymous?: boolean;
is_closed?: boolean;
media?: [InputPollMedia](#inputpollmedia);
members_only?: boolean;
message_effect_id?: string;
message_thread_id?: number;
open_period?: number;
options: [InputPollOption](#inputpolloption)[];
protect_content?: boolean;
question: string;
question_entities?: [MessageEntity](#messageentity)[];
question_parse_mode?: string;
reply_markup?: [InlineKeyboardMarkup](#inlinekeyboardmarkup) | [ReplyKeyboardMarkup](#replykeyboardmarkup) | [ReplyKeyboardRemove](#replykeyboardremove) | [ForceReply](#forcereply);
reply_parameters?: [ReplyParameters](#replyparameters);
shuffle_options?: boolean;
type?: string;
};
SendPollResult
type SendPollResult = [Message](#message);
SendRichMessageDraftParams
type SendRichMessageDraftParams = {
can_stop?: boolean;
chat_id: number;
draft_id: number;
keep_on_stop?: boolean;
message_thread_id?: number;
rich_message: [InputRichMessage](#inputrichmessage);
};
SendRichMessageDraftResult
type SendRichMessageDraftResult = boolean;
SendRichMessageParams
type SendRichMessageParams = {
allow_paid_broadcast?: boolean;
business_connection_id?: string;
chat_id: number | string;
direct_messages_topic_id?: number;
disable_notification?: boolean;
ephemeral_message_parameters?: [EphemeralMessageParameters](#ephemeralmessageparameters);
message_effect_id?: string;
message_thread_id?: number;
protect_content?: boolean;
reply_markup?: [InlineKeyboardMarkup](#inlinekeyboardmarkup) | [ReplyKeyboardMarkup](#replykeyboardmarkup) | [ReplyKeyboardRemove](#replykeyboardremove) | [ForceReply](#forcereply);
reply_parameters?: [ReplyParameters](#replyparameters);
rich_message: [InputRichMessage](#inputrichmessage);
suggested_post_parameters?: [SuggestedPostParameters](#suggestedpostparameters);
};
SendRichMessageResult
type SendRichMessageResult = [Message](#message);
SendStickerParams
type SendStickerParams = {
allow_paid_broadcast?: boolean;
business_connection_id?: string;
chat_id: number | string;
direct_messages_topic_id?: number;
disable_notification?: boolean;
emoji?: string;
ephemeral_message_parameters?: [EphemeralMessageParameters](#ephemeralmessageparameters);
message_effect_id?: string;
message_thread_id?: number;
protect_content?: boolean;
reply_markup?: [InlineKeyboardMarkup](#inlinekeyboardmarkup) | [ReplyKeyboardMarkup](#replykeyboardmarkup) | [ReplyKeyboardRemove](#replykeyboardremove) | [ForceReply](#forcereply);
reply_parameters?: [ReplyParameters](#replyparameters);
sticker: [InputFile](#inputfile) | string;
suggested_post_parameters?: [SuggestedPostParameters](#suggestedpostparameters);
};
SendStickerResult
type SendStickerResult = [Message](#message);
SendVenueParams
type SendVenueParams = {
address: string;
allow_paid_broadcast?: boolean;
business_connection_id?: string;
chat_id: number | string;
direct_messages_topic_id?: number;
disable_notification?: boolean;
ephemeral_message_parameters?: [EphemeralMessageParameters](#ephemeralmessageparameters);
foursquare_id?: string;
foursquare_type?: string;
google_place_id?: string;
google_place_type?: string;
latitude: number;
longitude: number;
message_effect_id?: string;
message_thread_id?: number;
protect_content?: boolean;
reply_markup?: [InlineKeyboardMarkup](#inlinekeyboardmarkup) | [ReplyKeyboardMarkup](#replykeyboardmarkup) | [ReplyKeyboardRemove](#replykeyboardremove) | [ForceReply](#forcereply);
reply_parameters?: [ReplyParameters](#replyparameters);
suggested_post_parameters?: [SuggestedPostParameters](#suggestedpostparameters);
title: string;
};
SendVenueResult
type SendVenueResult = [Message](#message);
SendVideoNoteParams
type SendVideoNoteParams = {
allow_paid_broadcast?: boolean;
business_connection_id?: string;
chat_id: number | string;
direct_messages_topic_id?: number;
disable_notification?: boolean;
duration?: number;
ephemeral_message_parameters?: [EphemeralMessageParameters](#ephemeralmessageparameters);
length?: number;
message_effect_id?: string;
message_thread_id?: number;
protect_content?: boolean;
reply_markup?: [InlineKeyboardMarkup](#inlinekeyboardmarkup) | [ReplyKeyboardMarkup](#replykeyboardmarkup) | [ReplyKeyboardRemove](#replykeyboardremove) | [ForceReply](#forcereply);
reply_parameters?: [ReplyParameters](#replyparameters);
suggested_post_parameters?: [SuggestedPostParameters](#suggestedpostparameters);
thumbnail?: [InputFile](#inputfile) | string;
video_note: [InputFile](#inputfile) | string;
};
SendVideoNoteResult
type SendVideoNoteResult = [Message](#message);
SendVideoParams
type SendVideoParams = {
allow_paid_broadcast?: boolean;
business_connection_id?: string;
caption?: string;
caption_entities?: [MessageEntity](#messageentity)[];
chat_id: number | string;
cover?: [InputFile](#inputfile) | string;
direct_messages_topic_id?: number;
disable_notification?: boolean;
duration?: number;
ephemeral_message_parameters?: [EphemeralMessageParameters](#ephemeralmessageparameters);
has_spoiler?: boolean;
height?: number;
message_effect_id?: string;
message_thread_id?: number;
parse_mode?: string;
protect_content?: boolean;
reply_markup?: [InlineKeyboardMarkup](#inlinekeyboardmarkup) | [ReplyKeyboardMarkup](#replykeyboardmarkup) | [ReplyKeyboardRemove](#replykeyboardremove) | [ForceReply](#forcereply);
reply_parameters?: [ReplyParameters](#replyparameters);
show_caption_above_media?: boolean;
start_timestamp?: number;
suggested_post_parameters?: [SuggestedPostParameters](#suggestedpostparameters);
supports_streaming?: boolean;
thumbnail?: [InputFile](#inputfile) | string;
video: [InputFile](#inputfile) | string;
width?: number;
};
SendVideoResult
type SendVideoResult = [Message](#message);
SendVoiceParams
type SendVoiceParams = {
allow_paid_broadcast?: boolean;
business_connection_id?: string;
caption?: string;
caption_entities?: [MessageEntity](#messageentity)[];
chat_id: number | string;
direct_messages_topic_id?: number;
disable_notification?: boolean;
duration?: number;
ephemeral_message_parameters?: [EphemeralMessageParameters](#ephemeralmessageparameters);
message_effect_id?: string;
message_thread_id?: number;
parse_mode?: string;
protect_content?: boolean;
reply_markup?: [InlineKeyboardMarkup](#inlinekeyboardmarkup) | [ReplyKeyboardMarkup](#replykeyboardmarkup) | [ReplyKeyboardRemove](#replykeyboardremove) | [ForceReply](#forcereply);
reply_parameters?: [ReplyParameters](#replyparameters);
suggested_post_parameters?: [SuggestedPostParameters](#suggestedpostparameters);
voice: [InputFile](#inputfile) | string;
};
SendVoiceResult
type SendVoiceResult = [Message](#message);
SentGuestMessage
type SentGuestMessage = {
inline_message_id: string;
};
SentWebAppMessage
type SentWebAppMessage = {
inline_message_id?: string;
};
SetBusinessAccountBioParams
type SetBusinessAccountBioParams = {
bio?: string;
business_connection_id: string;
};
SetBusinessAccountBioResult
type SetBusinessAccountBioResult = boolean;
SetBusinessAccountGiftSettingsParams
type SetBusinessAccountGiftSettingsParams = {
accepted_gift_types: [AcceptedGiftTypes](#acceptedgifttypes);
business_connection_id: string;
show_gift_button: boolean;
};
SetBusinessAccountGiftSettingsResult
type SetBusinessAccountGiftSettingsResult = boolean;
SetBusinessAccountNameParams
type SetBusinessAccountNameParams = {
business_connection_id: string;
first_name: string;
last_name?: string;
};
SetBusinessAccountNameResult
type SetBusinessAccountNameResult = boolean;
SetBusinessAccountProfilePhotoParams
type SetBusinessAccountProfilePhotoParams = {
business_connection_id: string;
is_public?: boolean;
photo: [InputProfilePhoto](#inputprofilephoto);
};
SetBusinessAccountProfilePhotoResult
type SetBusinessAccountProfilePhotoResult = boolean;
SetBusinessAccountUsernameParams
type SetBusinessAccountUsernameParams = {
business_connection_id: string;
username?: string;
};
SetBusinessAccountUsernameResult
type SetBusinessAccountUsernameResult = boolean;
SetChatAdministratorCustomTitleParams
type SetChatAdministratorCustomTitleParams = {
chat_id: number | string;
custom_title: string;
user_id: number;
};
SetChatAdministratorCustomTitleResult
type SetChatAdministratorCustomTitleResult = boolean;
SetChatDescriptionParams
type SetChatDescriptionParams = {
chat_id: number | string;
description?: string;
};
SetChatDescriptionResult
type SetChatDescriptionResult = boolean;
SetChatMemberTagParams
type SetChatMemberTagParams = {
chat_id: number | string;
tag?: string;
user_id: number;
};
SetChatMemberTagResult
type SetChatMemberTagResult = boolean;
SetChatMenuButtonParams
type SetChatMenuButtonParams = {
chat_id?: number;
menu_button?: [MenuButton](#menubutton);
};
SetChatMenuButtonResult
type SetChatMenuButtonResult = boolean;
SetChatPermissionsParams
type SetChatPermissionsParams = {
chat_id: number | string;
permissions: [ChatPermissions](#chatpermissions);
use_independent_chat_permissions?: boolean;
};
SetChatPermissionsResult
type SetChatPermissionsResult = boolean;
SetChatPhotoParams
type SetChatPhotoParams = {
chat_id: number | string;
photo: [InputFile](#inputfile) | string;
};
SetChatPhotoResult
type SetChatPhotoResult = boolean;
SetChatStickerSetParams
type SetChatStickerSetParams = {
chat_id: number | string;
sticker_set_name: string;
};
SetChatStickerSetResult
type SetChatStickerSetResult = boolean;
SetChatTitleParams
type SetChatTitleParams = {
chat_id: number | string;
title: string;
};
SetChatTitleResult
type SetChatTitleResult = boolean;
SetCustomEmojiStickerSetThumbnailParams
type SetCustomEmojiStickerSetThumbnailParams = {
custom_emoji_id?: string;
name: string;
};
SetCustomEmojiStickerSetThumbnailResult
type SetCustomEmojiStickerSetThumbnailResult = boolean;
SetGameScoreParams
type SetGameScoreParams = {
chat_id?: number;
disable_edit_message?: boolean;
force?: boolean;
inline_message_id?: string;
message_id?: number;
score: number;
user_id: number;
};
SetGameScoreResult
type SetGameScoreResult = [Message](#message) | boolean;
SetManagedBotAccessSettingsParams
type SetManagedBotAccessSettingsParams = {
added_user_ids?: number[];
is_access_restricted: boolean;
user_id: number;
};
SetManagedBotAccessSettingsResult
type SetManagedBotAccessSettingsResult = boolean;
SetMessageReactionParams
type SetMessageReactionParams = {
chat_id: number | string;
is_big?: boolean;
message_id: number;
reaction?: [ReactionType](#reactiontype)[];
};
SetMessageReactionResult
type SetMessageReactionResult = boolean;
SetMyCommandsParams
type SetMyCommandsParams = {
commands: [BotCommand](#botcommand)[];
language_code?: string;
scope?: [BotCommandScope](#botcommandscope);
};
SetMyCommandsResult
type SetMyCommandsResult = boolean;
SetMyDefaultAdministratorRightsParams
type SetMyDefaultAdministratorRightsParams = {
for_channels?: boolean;
rights?: [ChatAdministratorRights](#chatadministratorrights);
};
SetMyDefaultAdministratorRightsResult
type SetMyDefaultAdministratorRightsResult = boolean;
SetMyDescriptionParams
type SetMyDescriptionParams = {
description?: string;
language_code?: string;
};
SetMyDescriptionResult
type SetMyDescriptionResult = boolean;
SetMyNameParams
type SetMyNameParams = {
language_code?: string;
name?: string;
};
SetMyNameResult
type SetMyNameResult = boolean;
SetMyProfilePhotoParams
type SetMyProfilePhotoParams = {
photo: [InputProfilePhoto](#inputprofilephoto);
};
SetMyProfilePhotoResult
type SetMyProfilePhotoResult = boolean;
SetMyShortDescriptionParams
type SetMyShortDescriptionParams = {
language_code?: string;
short_description?: string;
};
SetMyShortDescriptionResult
type SetMyShortDescriptionResult = boolean;
SetPassportDataErrorsParams
type SetPassportDataErrorsParams = {
errors: [PassportElementError](#passportelementerror)[];
user_id: number;
};
SetPassportDataErrorsResult
type SetPassportDataErrorsResult = boolean;
SetStickerEmojiListParams
type SetStickerEmojiListParams = {
emoji_list: string[];
sticker: string;
};
SetStickerEmojiListResult
type SetStickerEmojiListResult = boolean;
SetStickerKeywordsParams
type SetStickerKeywordsParams = {
keywords?: string[];
sticker: string;
};
SetStickerKeywordsResult
type SetStickerKeywordsResult = boolean;
SetStickerMaskPositionParams
type SetStickerMaskPositionParams = {
mask_position?: [MaskPosition](#maskposition);
sticker: string;
};
SetStickerMaskPositionResult
type SetStickerMaskPositionResult = boolean;
SetStickerPositionInSetParams
type SetStickerPositionInSetParams = {
position: number;
sticker: string;
};
SetStickerPositionInSetResult
type SetStickerPositionInSetResult = boolean;
SetStickerSetThumbnailParams
type SetStickerSetThumbnailParams = {
format: string;
name: string;
thumbnail?: [InputFile](#inputfile) | string;
user_id: number;
};
SetStickerSetThumbnailResult
type SetStickerSetThumbnailResult = boolean;
SetStickerSetTitleParams
type SetStickerSetTitleParams = {
name: string;
title: string;
};
SetStickerSetTitleResult
type SetStickerSetTitleResult = boolean;
SetUserEmojiStatusParams
type SetUserEmojiStatusParams = {
emoji_status_custom_emoji_id?: string;
emoji_status_expiration_date?: number;
user_id: number;
};
SetUserEmojiStatusResult
type SetUserEmojiStatusResult = boolean;
SetWebhookParams
type SetWebhookParams = {
allowed_updates?: string[];
certificate?: [InputFile](#inputfile) | string;
drop_pending_updates?: boolean;
ip_address?: string;
max_connections?: number;
secret_token?: string;
url: string;
};
SetWebhookResult
type SetWebhookResult = boolean;
SharedUser
type SharedUser = {
first_name?: string;
last_name?: string;
photo?: [PhotoSize](#photosize)[];
user_id: number;
username?: string;
};
ShippingAddress
type ShippingAddress = {
city: string;
country_code: string;
post_code: string;
state: string;
street_line1: string;
street_line2: string;
};
ShippingOption
type ShippingOption = {
id: string;
prices: [LabeledPrice](#labeledprice)[];
title: string;
};
ShippingQuery
type ShippingQuery = {
from: [User](#user);
id: string;
invoice_payload: string;
shipping_address: [ShippingAddress](#shippingaddress);
};
StarAmount
type StarAmount = {
amount: number;
nanostar_amount?: number;
};
StarTransaction
type StarTransaction = {
amount: number;
date: number;
id: string;
nanostar_amount?: number;
receiver?: [TransactionPartner](#transactionpartner);
source?: [TransactionPartner](#transactionpartner);
};
StarTransactions
type StarTransactions = {
transactions: [StarTransaction](#startransaction)[];
};
Sticker
type Sticker = {
custom_emoji_id?: string;
emoji?: string;
file_id: string;
file_size?: number;
file_unique_id: string;
height: number;
is_animated: boolean;
is_video: boolean;
mask_position?: [MaskPosition](#maskposition);
needs_repainting?: true;
premium_animation?: [File](#file);
set_name?: string;
thumbnail?: [PhotoSize](#photosize);
type: string;
width: number;
};
StickerSet
type StickerSet = {
name: string;
sticker_type: string;
stickers: [Sticker](#sticker)[];
thumbnail?: [PhotoSize](#photosize);
title: string;
};
StopMessageLiveLocationParams
type StopMessageLiveLocationParams = {
business_connection_id?: string;
chat_id?: number | string;
inline_message_id?: string;
message_id?: number;
reply_markup?: [InlineKeyboardMarkup](#inlinekeyboardmarkup);
};
StopMessageLiveLocationResult
type StopMessageLiveLocationResult = [Message](#message) | boolean;
StopPollParams
type StopPollParams = {
business_connection_id?: string;
chat_id: number | string;
message_id: number;
reply_markup?: [InlineKeyboardMarkup](#inlinekeyboardmarkup);
};
StopPollResult
type StopPollResult = [Poll](#poll);
Story
type Story = {
chat: [Chat](#chat);
id: number;
};
StoryArea
type StoryArea = {
position: [StoryAreaPosition](#storyareaposition);
type: [StoryAreaType](#storyareatype);
};
StoryAreaPosition
type StoryAreaPosition = {
corner_radius_percentage: number;
height_percentage: number;
rotation_angle: number;
width_percentage: number;
x_percentage: number;
y_percentage: number;
};
StoryAreaType
type StoryAreaType = [StoryAreaTypeLocation](#storyareatypelocation) | [StoryAreaTypeSuggestedReaction](#storyareatypesuggestedreaction) | [StoryAreaTypeLink](#storyareatypelink) | [StoryAreaTypeWeather](#storyareatypeweather) | [StoryAreaTypeUniqueGift](#storyareatypeuniquegift);
StoryAreaTypeLink
type StoryAreaTypeLink = {
type: string;
url: string;
};
StoryAreaTypeLocation
type StoryAreaTypeLocation = {
address?: [LocationAddress](#locationaddress);
latitude: number;
longitude: number;
type: string;
};
StoryAreaTypeSuggestedReaction
type StoryAreaTypeSuggestedReaction = {
is_dark?: boolean;
is_flipped?: boolean;
reaction_type: [ReactionType](#reactiontype);
type: string;
};
StoryAreaTypeUniqueGift
type StoryAreaTypeUniqueGift = {
name: string;
type: string;
};
StoryAreaTypeWeather
type StoryAreaTypeWeather = {
background_color: number;
emoji: string;
temperature: number;
type: string;
};
SuccessfulPayment
type SuccessfulPayment = {
currency: string;
invoice_payload: string;
is_first_recurring?: true;
is_recurring?: true;
order_info?: [OrderInfo](#orderinfo);
provider_payment_charge_id: string;
shipping_option_id?: string;
subscription_expiration_date?: number;
telegram_payment_charge_id: string;
total_amount: number;
};
SuggestedPostApprovalFailed
type SuggestedPostApprovalFailed = {
price: [SuggestedPostPrice](#suggestedpostprice);
suggested_post_message?: [Message](#message);
};
SuggestedPostApproved
type SuggestedPostApproved = {
price?: [SuggestedPostPrice](#suggestedpostprice);
send_date: number;
suggested_post_message?: [Message](#message);
};
SuggestedPostDeclined
type SuggestedPostDeclined = {
comment?: string;
suggested_post_message?: [Message](#message);
};
SuggestedPostInfo
type SuggestedPostInfo = {
price?: [SuggestedPostPrice](#suggestedpostprice);
send_date?: number;
state: string;
};
SuggestedPostPaid
type SuggestedPostPaid = {
amount?: number;
currency: string;
star_amount?: [StarAmount](#staramount);
suggested_post_message?: [Message](#message);
};
SuggestedPostParameters
type SuggestedPostParameters = {
price?: [SuggestedPostPrice](#suggestedpostprice);
send_date?: number;
};
SuggestedPostPrice
type SuggestedPostPrice = {
amount: number;
currency: string;
};
SuggestedPostRefunded
type SuggestedPostRefunded = {
reason: string;
suggested_post_message?: [Message](#message);
};
SwitchInlineQueryChosenChat
type SwitchInlineQueryChosenChat = {
allow_bot_chats?: boolean;
allow_channel_chats?: boolean;
allow_group_chats?: boolean;
allow_user_chats?: boolean;
query?: string;
};
TextQuote
type TextQuote = {
entities?: [MessageEntity](#messageentity)[];
is_manual?: true;
position: number;
text: string;
};
TransactionPartner
type TransactionPartner = [TransactionPartnerUser](#transactionpartneruser) | [TransactionPartnerChat](#transactionpartnerchat) | [TransactionPartnerAffiliateProgram](#transactionpartneraffiliateprogram) | [TransactionPartnerFragment](#transactionpartnerfragment) | [TransactionPartnerTelegramAds](#transactionpartnertelegramads) | [TransactionPartnerTelegramApi](#transactionpartnertelegramapi) | [TransactionPartnerOther](#transactionpartnerother);
TransactionPartnerAffiliateProgram
type TransactionPartnerAffiliateProgram = {
commission_per_mille: number;
sponsor_user?: [User](#user);
type: string;
};
TransactionPartnerChat
type TransactionPartnerChat = {
chat: [Chat](#chat);
gift?: [Gift](#gift);
type: string;
};
TransactionPartnerFragment
type TransactionPartnerFragment = {
type: string;
withdrawal_state?: [RevenueWithdrawalState](#revenuewithdrawalstate);
};
TransactionPartnerOther
type TransactionPartnerOther = {
type: string;
};
TransactionPartnerTelegramAds
type TransactionPartnerTelegramAds = {
type: string;
};
TransactionPartnerTelegramApi
type TransactionPartnerTelegramApi = {
request_count: number;
type: string;
};
TransactionPartnerUser
type TransactionPartnerUser = {
affiliate?: [AffiliateInfo](#affiliateinfo);
gift?: [Gift](#gift);
invoice_payload?: string;
paid_media?: [PaidMedia](#paidmedia)[];
paid_media_payload?: string;
premium_subscription_duration?: number;
subscription_period?: number;
transaction_type: string;
type: string;
user: [User](#user);
};
TransferBusinessAccountStarsParams
type TransferBusinessAccountStarsParams = {
business_connection_id: string;
star_count: number;
};
TransferBusinessAccountStarsResult
type TransferBusinessAccountStarsResult = boolean;
TransferGiftParams
type TransferGiftParams = {
business_connection_id: string;
new_owner_chat_id: number;
owned_gift_id: string;
star_count?: number;
};
TransferGiftResult
type TransferGiftResult = boolean;
UnbanChatMemberParams
type UnbanChatMemberParams = {
chat_id: number | string;
only_if_banned?: boolean;
user_id: number;
};
UnbanChatMemberResult
type UnbanChatMemberResult = boolean;
UnbanChatSenderChatParams
type UnbanChatSenderChatParams = {
chat_id: number | string;
sender_chat_id: number;
};
UnbanChatSenderChatResult
type UnbanChatSenderChatResult = boolean;
UnhideGeneralForumTopicParams
type UnhideGeneralForumTopicParams = {
chat_id: number | string;
};
UnhideGeneralForumTopicResult
type UnhideGeneralForumTopicResult = boolean;
UniqueGift
type UniqueGift = {
backdrop: [UniqueGiftBackdrop](#uniquegiftbackdrop);
base_name: string;
colors?: [UniqueGiftColors](#uniquegiftcolors);
gift_id: string;
is_burned?: true;
is_from_blockchain?: true;
is_premium?: true;
model: [UniqueGiftModel](#uniquegiftmodel);
name: string;
number: number;
publisher_chat?: [Chat](#chat);
symbol: [UniqueGiftSymbol](#uniquegiftsymbol);
};
UniqueGiftBackdrop
type UniqueGiftBackdrop = {
colors: [UniqueGiftBackdropColors](#uniquegiftbackdropcolors);
name: string;
rarity_per_mille: number;
};
UniqueGiftBackdropColors
type UniqueGiftBackdropColors = {
center_color: number;
edge_color: number;
symbol_color: number;
text_color: number;
};
UniqueGiftColors
type UniqueGiftColors = {
dark_theme_main_color: number;
dark_theme_other_colors: number[];
light_theme_main_color: number;
light_theme_other_colors: number[];
model_custom_emoji_id: string;
symbol_custom_emoji_id: string;
};
UniqueGiftInfo
type UniqueGiftInfo = {
entities?: [MessageEntity](#messageentity)[];
gift: [UniqueGift](#uniquegift);
is_private?: true;
last_resale_amount?: number;
last_resale_currency?: string;
next_transfer_date?: number;
origin: string;
owned_gift_id?: string;
text?: string;
transfer_star_count?: number;
};
UniqueGiftModel
type UniqueGiftModel = {
name: string;
rarity?: string;
rarity_per_mille: number;
sticker: [Sticker](#sticker);
};
UniqueGiftSymbol
type UniqueGiftSymbol = {
name: string;
rarity_per_mille: number;
sticker: [Sticker](#sticker);
};
UnpinAllChatMessagesParams
type UnpinAllChatMessagesParams = {
chat_id: number | string;
};
UnpinAllChatMessagesResult
type UnpinAllChatMessagesResult = boolean;
UnpinAllForumTopicMessagesParams
type UnpinAllForumTopicMessagesParams = {
chat_id: number | string;
message_thread_id: number;
};
UnpinAllForumTopicMessagesResult
type UnpinAllForumTopicMessagesResult = boolean;
UnpinAllGeneralForumTopicMessagesParams
type UnpinAllGeneralForumTopicMessagesParams = {
chat_id: number | string;
};
UnpinAllGeneralForumTopicMessagesResult
type UnpinAllGeneralForumTopicMessagesResult = boolean;
UnpinChatMessageParams
type UnpinChatMessageParams = {
business_connection_id?: string;
chat_id: number | string;
message_id?: number;
};
UnpinChatMessageResult
type UnpinChatMessageResult = boolean;
Update
type Update = {
update_id: number;
} & {
message: [Message](#message);
} | {
update_id: number;
} & {
edited_message: [Message](#message);
} | {
update_id: number;
} & {
channel_post: [Message](#message);
} | {
update_id: number;
} & {
edited_channel_post: [Message](#message);
} | {
update_id: number;
} & {
business_connection: [BusinessConnection](#businessconnection);
} | {
update_id: number;
} & {
business_message: [Message](#message);
} | {
update_id: number;
} & {
edited_business_message: [Message](#message);
} | {
update_id: number;
} & {
deleted_business_messages: [BusinessMessagesDeleted](#businessmessagesdeleted);
} | {
update_id: number;
} & {
guest_message: [Message](#message);
} | {
update_id: number;
} & {
message_reaction: [MessageReactionUpdated](#messagereactionupdated);
} | {
update_id: number;
} & {
message_reaction_count: [MessageReactionCountUpdated](#messagereactioncountupdated);
} | {
update_id: number;
} & {
inline_query: [InlineQuery](#inlinequery);
} | {
update_id: number;
} & {
chosen_inline_result: [ChosenInlineResult](#choseninlineresult);
} | {
update_id: number;
} & {
callback_query: [CallbackQuery](#callbackquery);
} | {
update_id: number;
} & {
shipping_query: [ShippingQuery](#shippingquery);
} | {
update_id: number;
} & {
pre_checkout_query: [PreCheckoutQuery](#precheckoutquery);
} | {
update_id: number;
} & {
purchased_paid_media: [PaidMediaPurchased](#paidmediapurchased);
} | {
update_id: number;
} & {
poll: [Poll](#poll);
} | {
update_id: number;
} & {
poll_answer: [PollAnswer](#pollanswer);
} | {
update_id: number;
} & {
my_chat_member: [ChatMemberUpdated](#chatmemberupdated);
} | {
update_id: number;
} & {
chat_member: [ChatMemberUpdated](#chatmemberupdated);
} | {
update_id: number;
} & {
chat_join_request: [ChatJoinRequest](#chatjoinrequest);
} | {
update_id: number;
} & {
chat_boost: [ChatBoostUpdated](#chatboostupdated);
} | {
update_id: number;
} & {
removed_chat_boost: [ChatBoostRemoved](#chatboostremoved);
} | {
update_id: number;
} & {
managed_bot: [ManagedBotUpdated](#managedbotupdated);
} | {
update_id: number;
} & {
subscription: [BotSubscriptionUpdated](#botsubscriptionupdated);
} | {
update_id: number;
} & {
stopped_message_generation: [MessageGenerationStopped](#messagegenerationstopped);
};
UpdateType
type UpdateType = typeof [UPDATE_TYPES](#update_types)[number];
UpgradeGiftParams
type UpgradeGiftParams = {
business_connection_id: string;
keep_original_details?: boolean;
owned_gift_id: string;
star_count?: number;
};
UpgradeGiftResult
type UpgradeGiftResult = boolean;
UploadStickerFileParams
type UploadStickerFileParams = {
sticker: [InputFile](#inputfile) | string;
sticker_format: string;
user_id: number;
};
UploadStickerFileResult
type UploadStickerFileResult = [File](#file);
User
type User = {
added_to_attachment_menu?: true;
allows_users_to_create_topics?: boolean;
can_connect_to_business?: boolean;
can_join_groups?: boolean;
can_manage_bots?: boolean;
can_read_all_group_messages?: boolean;
first_name: string;
has_main_web_app?: boolean;
has_topics_enabled?: boolean;
id: number;
is_bot: boolean;
is_premium?: true;
language_code?: string;
last_name?: string;
supports_guest_queries?: boolean;
supports_inline_queries?: boolean;
supports_join_request_queries?: boolean;
username?: string;
};
UserChatBoosts
type UserChatBoosts = {
boosts: [ChatBoost](#chatboost)[];
};
UserProfileAudios
type UserProfileAudios = {
audios: [Audio](#audio)[];
total_count: number;
};
UserProfilePhotos
type UserProfilePhotos = {
photos: [PhotoSize](#photosize)[][];
total_count: number;
};
UserRating
type UserRating = {
current_level_rating: number;
level: number;
next_level_rating?: number;
rating: number;
};
UsersShared
type UsersShared = {
request_id: number;
users: [SharedUser](#shareduser)[];
};
Venue
type Venue = {
address: string;
foursquare_id?: string;
foursquare_type?: string;
google_place_id?: string;
google_place_type?: string;
location: [Location](#location);
title: string;
};
VerifyChatParams
type VerifyChatParams = {
chat_id: number | string;
custom_description?: string;
};
VerifyChatResult
type VerifyChatResult = boolean;
VerifyUserParams
type VerifyUserParams = {
custom_description?: string;
user_id: number;
};
VerifyUserResult
type VerifyUserResult = boolean;
Video
type Video = {
cover?: [PhotoSize](#photosize)[];
duration: number;
file_id: string;
file_name?: string;
file_size?: number;
file_unique_id: string;
height: number;
mime_type?: string;
qualities?: [VideoQuality](#videoquality)[];
start_timestamp?: number;
thumbnail?: [PhotoSize](#photosize);
width: number;
};
VideoChatEnded
type VideoChatEnded = {
duration: number;
};
VideoChatParticipantsInvited
type VideoChatParticipantsInvited = {
users: [User](#user)[];
};
VideoChatScheduled
type VideoChatScheduled = {
start_date: number;
};
VideoChatStarted
type VideoChatStarted = Record<string, never>;
VideoNote
type VideoNote = {
duration: number;
file_id: string;
file_size?: number;
file_unique_id: string;
length: number;
thumbnail?: [PhotoSize](#photosize);
};
VideoQuality
type VideoQuality = {
codec: string;
file_id: string;
file_size?: number;
file_unique_id: string;
height: number;
width: number;
};
Voice
type Voice = {
duration: number;
file_id: string;
file_size?: number;
file_unique_id: string;
mime_type?: string;
};
WebAppData
type WebAppData = {
button_text: string;
data: string;
};
WebAppInfo
type WebAppInfo = {
url: string;
};
WebhookInfo
type WebhookInfo = {
allowed_updates?: string[];
has_custom_certificate: boolean;
ip_address?: string;
last_error_date?: number;
last_error_message?: string;
last_synchronization_error_date?: number;
max_connections?: number;
pending_update_count: number;
url: string;
};
WriteAccessAllowed
type WriteAccessAllowed = {
from_attachment_menu?: boolean;
from_request?: boolean;
web_app_name?: string;
};
Variables
ATTACH_PREFIX
The attach:// URI scheme the Bot API uses to reference a multipart part
from inside a JSON structure (ADR-011).
const ATTACH_PREFIX: "attach://";
EntityType
Every documented MessageEntity kind, typo-proof versus raw strings.
const EntityType: {
readonly Blockquote: "blockquote";
readonly Bold: "bold";
readonly BotCommand: "bot_command";
readonly Cashtag: "cashtag";
readonly Code: "code";
readonly CustomEmoji: "custom_emoji";
readonly Email: "email";
readonly ExpandableBlockquote: "expandable_blockquote";
readonly Hashtag: "hashtag";
readonly Italic: "italic";
readonly Mention: "mention";
readonly PhoneNumber: "phone_number";
readonly Pre: "pre";
readonly Spoiler: "spoiler";
readonly Strikethrough: "strikethrough";
readonly TextLink: "text_link";
readonly TextMention: "text_mention";
readonly Underline: "underline";
readonly Url: "url";
};
HTTP_STATUS_TOO_MANY_REQUESTS
HTTP 429 "Too Many Requests". Mirrors node:http2's
constants.HTTP_STATUS_TOO_MANY_REQUESTS, redefined here because src/core
stays Node-free (no node:* imports).
const HTTP_STATUS_TOO_MANY_REQUESTS: 429;
UPDATE_TYPES
Update field names dispatched as events (every Update payload key except update_id).
const UPDATE_TYPES: readonly ["message", "edited_message", "channel_post", "edited_channel_post", "business_connection", "business_message", "edited_business_message", "deleted_business_messages", "guest_message", "message_reaction", "message_reaction_count", "inline_query", "chosen_inline_result", "callback_query", "shipping_query", "pre_checkout_query", "purchased_paid_media", "poll", "poll_answer", "my_chat_member", "chat_member", "chat_join_request", "chat_boost", "removed_chat_boost", "managed_bot", "subscription", "stopped_message_generation"];
nextPagesWebhook
Next.js Pages API uses the same (req, res) handler.
const nextPagesWebhook: (bot: [Bot](#bot), options?: [WebhookOptions](#webhookoptions)) => (req: [NodeLikeRequest](#nodelikerequest), res: [NodeLikeResponse](#nodelikeresponse)) => Promise<void>;