Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Enumerations

Type aliases

Type aliases

AddStickerToSetOption

AddStickerToSetOption: { maskPosition?: MaskPosition }

Type declaration

  • Optional maskPosition?: MaskPosition

    A JSON-serialized object for position where the mask should be placed on faces

Animation

Animation: { duration: number; fileId: string; fileName?: string; fileSize?: number; height: number; mimeType?: string; thumb?: PhotoSize; width: number }

Type declaration

  • duration: number
  • fileId: string
  • Optional fileName?: string
  • Optional fileSize?: number
  • height: number
  • Optional mimeType?: string
  • Optional thumb?: PhotoSize
  • width: number

AnswerCallbackQueryOption

AnswerCallbackQueryOption: { cacheTime?: number; showAlert?: boolean; text?: string; url?: string }

Type declaration

  • Optional cacheTime?: number

    The maximum amount of time in seconds that the result of the callback query may be cached client-side. Telegram apps will support caching starting in version 3.14. Defaults to 0.

  • Optional showAlert?: boolean

    If true, an alert will be shown by the client instead of a notification at the top of the chat screen. Defaults to false.

  • Optional text?: string

    Text of the notification. If not specified, nothing will be shown to the user, 0-200 characters

  • Optional url?: string

    URL that will be opened by the user's client. If you have created a Game and accepted the conditions via @Botfather, specify the URL that opens your game – note that this will only work if the query comes from a callback_game button.

    Otherwise, you may use links like t.me/your_bot?start=XXXX that open your bot with a parameter.

AnswerInlineQueryOption

AnswerInlineQueryOption: { cacheTime?: number; isPersonal?: boolean; nextOffset?: string; switchPmParameter?: string; switchPmText?: string }

Type declaration

  • Optional cacheTime?: number

    The maximum amount of time in seconds that the result of the inline query may be cached on the server. Defaults to 300.

  • Optional isPersonal?: boolean

    Pass True, if results may be cached on the server side only for the user that sent the query. By default, results may be returned to any user who sends the same query

  • Optional nextOffset?: string

    Pass the offset that a client should send in the next query with the same text to receive more results. Pass an empty string if there are no more results or if you don‘t support pagination. Offset length can’t exceed 64 bytes.

  • Optional switchPmParameter?: string

    Deep-linking parameter for the /start message sent to the bot when user presses the switch button. 1-64 characters, only A-Z, a-z, 0-9, _ and - are allowed.

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

  • Optional switchPmText?: string

    If passed, clients will display a button with specified text that switches the user to a private chat with the bot and sends the bot a start message with the parameter switchPmParameter

AnswerPreCheckoutQueryOption

AnswerPreCheckoutQueryOption: { errorMessage?: string }

Type declaration

  • Optional errorMessage?: string

    Required if ok is False. Error message in human readable form that explains the reason for failure to proceed with the checkout (e.g. "Sorry, somebody just bought the last of our amazing black T-shirts while you were busy filling out your payment details. Please choose a different color or garment!"). Telegram will display this message to the user.

AnswerShippingQueryOption

AnswerShippingQueryOption: { shippingOptions?: ShippingOption[] } | { errorMessage?: string }

Audio

Audio: { duration: number; fileId: string; fileSize?: number; mimeType?: string; performer?: string; thumb?: PhotoSize; title?: string }

Type declaration

  • duration: number
  • fileId: string
  • Optional fileSize?: number
  • Optional mimeType?: string
  • Optional performer?: string
  • Optional thumb?: PhotoSize
  • Optional title?: string

CallbackGame

CallbackGame: any

A placeholder, currently holds no information. Use BotFather to set up your game.

CallbackQuery

CallbackQuery: { chatInstance: string; data?: string; from: User; gameShortName?: string; id: string; inlineMessageId?: string; message?: Message }

Type declaration

  • chatInstance: string
  • Optional data?: string
  • from: User
  • Optional gameShortName?: string
  • id: string
  • Optional inlineMessageId?: string
  • Optional message?: Message

Chat

Chat: { canSetStickerSet?: boolean; description?: string; firstName?: string; id: number; inviteLink?: string; lastName?: string; permissions?: ChatPermissions; photo?: ChatPhoto; pinnedMessage?: Message; stickerSetName?: string; title?: string; type: "private" | "group" | "supergroup" | "channel"; username?: string }

Type declaration

  • Optional canSetStickerSet?: boolean
  • Optional description?: string
  • Optional firstName?: string
  • id: number
  • Optional inviteLink?: string
  • Optional lastName?: string
  • Optional permissions?: ChatPermissions
  • Optional photo?: ChatPhoto
  • Optional pinnedMessage?: Message
  • Optional stickerSetName?: string
  • Optional title?: string
  • type: "private" | "group" | "supergroup" | "channel"
  • Optional username?: string

ChatMember

ChatMember: any

ChatPermissions

ChatPermissions: { canAddWebPagePreviews?: boolean; canChangeInfo?: boolean; canInviteUsers?: boolean; canPinMessages?: boolean; canSendMediaMessages?: boolean; canSendMessages?: boolean; canSendOtherMessages?: boolean; canSendPolls?: boolean }

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

Type declaration

  • Optional canAddWebPagePreviews?: boolean

    Optional. True, if the user is allowed to add web page previews to their messages, implies can_send_media_messages

  • Optional canChangeInfo?: boolean

    Optional. True, if the user is allowed to change the chat title, photo and other settings. Ignored in public supergroups

  • Optional canInviteUsers?: boolean

    Optional. True, if the user is allowed to invite new users to the chat

  • Optional canPinMessages?: boolean

    Optional. True, if the user is allowed to pin messages. Ignored in public supergroups

  • Optional canSendMediaMessages?: boolean

    Optional. True, if the user is allowed to send audios, documents, photos, videos, video notes and voice notes, implies can_send_messages

  • Optional canSendMessages?: boolean

    Optional. True, if the user is allowed to send text messages, contacts, locations and venues

  • Optional canSendOtherMessages?: boolean

    Optional. True, if the user is allowed to send animations, games, stickers and use inline bots, implies can_send_media_messages

  • Optional canSendPolls?: boolean

    Optional. True, if the user is allowed to send polls, implies can_send_messages

ChatPhoto

ChatPhoto: { bigFileId: string; smallFileId: string }

Type declaration

  • bigFileId: string
  • smallFileId: string

ChosenInlineResult

ChosenInlineResult: { from: User; inlineMessageId?: string; location?: Location; query: string; resultId: string }

Type declaration

  • from: User
  • Optional inlineMessageId?: string
  • Optional location?: Location
  • query: string
  • resultId: string

ClientConfig

ClientConfig: { accessToken: string; onRequest?: OnRequestFunction; origin?: string }

Type declaration

  • accessToken: string
  • Optional onRequest?: OnRequestFunction
  • Optional origin?: string

Contact

Contact: { firstName: string; lastName?: string; phoneNumber: string; userId?: number; vcard?: string }

Type declaration

  • firstName: string
  • Optional lastName?: string
  • phoneNumber: string
  • Optional userId?: number
  • Optional vcard?: string

CreateNewStickerSetOption

CreateNewStickerSetOption: { containsMasks?: boolean; maskPosition?: MaskPosition }

Type declaration

  • Optional containsMasks?: boolean

    Pass True, if a set of mask stickers should be created

  • Optional maskPosition?: MaskPosition

    A JSON-serialized object for position where the mask should be placed on faces

Document

Document: { fileId: string; fileName?: string; fileSize?: number; mimeType?: string; thumb?: PhotoSize }

Type declaration

  • fileId: string
  • Optional fileName?: string
  • Optional fileSize?: number
  • Optional mimeType?: string
  • Optional thumb?: PhotoSize

EditMessageCaptionOption

EditMessageCaptionOption: EditOption & { parseMode?: ParseMode; replyMarkup?: InlineKeyboardMarkup }

EditMessageLiveLocationOption

EditMessageLiveLocationOption: EditOption & { replyMarkup?: InlineKeyboardMarkup }

EditMessageMediaOption

EditMessageMediaOption: EditOption & { replyMarkup?: InlineKeyboardMarkup }

EditMessageReplyMarkupOption

EditMessageReplyMarkupOption: EditOption

EditMessageTextOption

EditMessageTextOption: EditOption & { disableWebPagePreview?: boolean; parseMode?: ParseMode; replyMarkup?: InlineKeyboardMarkup }

EditOption

EditOption: { chatId: number | string; messageId: number } | { inlineMessageId: string }

EncryptedCredentials

EncryptedCredentials: { data: string; hash: string; secret: string }

Type declaration

  • data: string
  • hash: string
  • secret: string

EncryptedPassportElement

EncryptedPassportElement: { data?: string; email?: string; files?: PassportFile[]; frontSide?: PassportFile; hash: string; phoneNumber?: string; reverseSide?: PassportFile; selfie?: PassportFile; translation?: PassportFile[]; type: "personal_details" | "passport" | "driver_license" | "identity_card" | "internal_passport" | "address" | "utility_bill" | "bank_statement" | "rental_agreement" | "passport_registration" | "temporary_registration" | "phone_number" | "email" }

Type declaration

  • Optional data?: string
  • Optional email?: string
  • Optional files?: PassportFile[]
  • Optional frontSide?: PassportFile
  • hash: string
  • Optional phoneNumber?: string
  • Optional reverseSide?: PassportFile
  • Optional selfie?: PassportFile
  • Optional translation?: PassportFile[]
  • type: "personal_details" | "passport" | "driver_license" | "identity_card" | "internal_passport" | "address" | "utility_bill" | "bank_statement" | "rental_agreement" | "passport_registration" | "temporary_registration" | "phone_number" | "email"

File

File: { fileId: string; filePath: string; fileSize?: number }

Type declaration

  • fileId: string
  • filePath: string
  • Optional fileSize?: number

ForceReply

ForceReply: { forceReply: boolean; selective?: boolean }

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

Type declaration

  • forceReply: boolean

    Shows reply interface to the user, as if they manually selected the bot‘s message and tapped ’Reply'

  • Optional selective?: boolean

    Optional. Use this parameter if you want to force reply from specific users only. Targets:

    1. users that are @mentioned in the text of the Message object;
    2. if the bot's message is a reply (has replyToMessageId), sender of the original message.

ForwardMessageOption

ForwardMessageOption: { disableNotification?: boolean }

Type declaration

  • Optional disableNotification?: boolean

    Sends the message silently. Users will receive a notification with no sound.

Game

Game: { animation?: Animation; description: string; photo: PhotoSize[]; text?: string; textEntities?: MessageEntity[]; title: string }

Type declaration

GameHighScore

GameHighScore: { position: number; score: number; user: User }

Type declaration

  • position: number
  • score: number
  • user: User

GetGameHighScoresOption

GetGameHighScoresOption: EditOption

GetUpdatesOption

GetUpdatesOption: { allowedUpdates?: string[]; limit?: number; offset?: number; timeout?: number }

Type declaration

  • Optional allowedUpdates?: string[]

    List the types of updates you want your bot to receive. For example, specify [“message”, “edited_channel_post”, “callback_query”] to only receive updates of these types. See Update for a complete list of available update types. Specify an empty list to receive all updates regardless of type (default). If not specified, the previous setting will be used.

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

  • Optional limit?: number

    Limits the number of updates to be retrieved. Values between 1—100 are accepted. Defaults to 100.

  • Optional offset?: number

    Identifier of the first update to be returned. Must be greater by one than the highest among the identifiers of previously received updates. By default, updates starting with the earliest unconfirmed update are returned. An update is considered confirmed as soon as getUpdates is called with an offset higher than its updateId. The negative offset can be specified to retrieve updates starting from -offset update from the end of the updates queue. All previous updates will forgotten.

  • Optional timeout?: number

    Timeout in seconds for long polling. Defaults to 0, i.e. usual short polling. Should be positive, short polling should be used for testing purposes only.

GetUserProfilePhotosOption

GetUserProfilePhotosOption: { limit?: number; offset?: number }

Type declaration

  • Optional limit?: number

    Limits the number of photos to be retrieved. Values between 1—100 are accepted. Defaults to 100.

  • Optional offset?: number

    Sequential number of the first photo to be returned. By default, all photos are returned.

InlineKeyboardButton

InlineKeyboardButton: { callbackData?: string; callbackGame?: CallbackGame; loginUrl?: LoginUrl; pay?: boolean; switchInlineQuery?: string; switchInlineQueryCurrentChat?: string; text: string; url?: string }

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

Type declaration

  • Optional callbackData?: string

    Optional. Data to be sent in a callback query to the bot when button is pressed, 1-64 bytes

  • Optional callbackGame?: CallbackGame

    Optional. Description of the game that will be launched when the user presses the button.

    NOTE: This type of button must always be the first button in the first row.

  • Optional loginUrl?: LoginUrl

    Optional. An HTTP URL used to automatically authorize the user. Can be used as a replacement for the Telegram Login Widget.

  • Optional pay?: boolean

    Optional. Specify True, to send a Pay button.

    NOTE: This type of button must always be the first button in the first row.

  • Optional switchInlineQuery?: string

    Optional. If set, pressing the button will prompt the user to select one of their chats, open that chat and insert the bot‘s username and the specified inline query in the input field. Can be empty, in which case just the bot’s username will be inserted.

    Note: This offers an easy way for users to start using your bot in inline mode when they are currently in a private chat with it. Especially useful when combined with switchPm… actions – in this case the user will be automatically returned to the chat they switched from, skipping the chat selection screen.

  • Optional switchInlineQueryCurrentChat?: string

    Optional. If set, pressing the button will insert the bot‘s username and the specified inline query in the current chat's input field. Can be empty, in which case only the bot’s username will be inserted.

    This offers a quick way for the user to open your bot in inline mode in the same chat – good for selecting something from multiple options.

  • text: string

    Label text on the button

  • Optional url?: string

    Optional. HTTP or tg:// url to be opened when button is pressed

InlineKeyboardMarkup

InlineKeyboardMarkup: { inlineKeyboard: InlineKeyboardButton[][] }

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

Type declaration

InlineQuery

InlineQuery: { from: User; id: string; location?: Location; offset: string; query: string }

Type declaration

  • from: User
  • id: string
  • Optional location?: Location
  • offset: string
  • query: string

InlineQueryResult

InlineQueryResultArticle

InlineQueryResultArticle: { description?: string; hideUrl?: boolean; id: string; inputMessageContent: InputMessageContent; replyMarkup?: InlineKeyboardMarkup; thumbHeight?: number; thumbUrl?: string; thumbWidth?: number; title: string; type: "article"; url?: string }

Type declaration

  • Optional description?: string
  • Optional hideUrl?: boolean
  • id: string
  • inputMessageContent: InputMessageContent
  • Optional replyMarkup?: InlineKeyboardMarkup
  • Optional thumbHeight?: number
  • Optional thumbUrl?: string
  • Optional thumbWidth?: number
  • title: string
  • type: "article"
  • Optional url?: string

InlineQueryResultAudio

InlineQueryResultAudio: { audioDuration?: number; audioUrl: string; caption?: string; id: string; inputMessageContent?: InputMessageContent; parseMode?: string; performer?: string; replyMarkup?: InlineKeyboardMarkup; title: string; type: "audio" }

Type declaration

  • Optional audioDuration?: number
  • audioUrl: string
  • Optional caption?: string
  • id: string
  • Optional inputMessageContent?: InputMessageContent
  • Optional parseMode?: string
  • Optional performer?: string
  • Optional replyMarkup?: InlineKeyboardMarkup
  • title: string
  • type: "audio"

InlineQueryResultCachedAudio

InlineQueryResultCachedAudio: { audioFileId: string; caption?: string; id: string; inputMessageContent?: InputMessageContent; parseMode?: string; replyMarkup?: InlineKeyboardMarkup; type: "audio" }

Type declaration

InlineQueryResultCachedDocument

InlineQueryResultCachedDocument: { caption?: string; description?: string; documentFileId: string; id: string; inputMessageContent?: InputMessageContent; parseMode?: string; replyMarkup?: InlineKeyboardMarkup; title: string; type: "document" }

Type declaration

  • Optional caption?: string
  • Optional description?: string
  • documentFileId: string
  • id: string
  • Optional inputMessageContent?: InputMessageContent
  • Optional parseMode?: string
  • Optional replyMarkup?: InlineKeyboardMarkup
  • title: string
  • type: "document"

InlineQueryResultCachedGif

InlineQueryResultCachedGif: { caption?: string; gifFileId: string; id: string; inputMessageContent?: InputMessageContent; parseMode?: string; replyMarkup?: InlineKeyboardMarkup; title?: string; type: "gif" }

Type declaration

  • Optional caption?: string
  • gifFileId: string
  • id: string
  • Optional inputMessageContent?: InputMessageContent
  • Optional parseMode?: string
  • Optional replyMarkup?: InlineKeyboardMarkup
  • Optional title?: string
  • type: "gif"

InlineQueryResultCachedMpeg4Gif

InlineQueryResultCachedMpeg4Gif: { caption?: string; id: string; inputMessageContent?: InputMessageContent; mpeg4FileId: string; parseMode?: string; replyMarkup?: InlineKeyboardMarkup; title?: string; type: "mpeg4_gif" }

Type declaration

  • Optional caption?: string
  • id: string
  • Optional inputMessageContent?: InputMessageContent
  • mpeg4FileId: string
  • Optional parseMode?: string
  • Optional replyMarkup?: InlineKeyboardMarkup
  • Optional title?: string
  • type: "mpeg4_gif"

InlineQueryResultCachedPhoto

InlineQueryResultCachedPhoto: { caption?: string; description?: string; id: string; inputMessageContent?: InputMessageContent; parseMode?: string; photoFileId: string; replyMarkup?: InlineKeyboardMarkup; title?: string; type: "photo" }

Type declaration

  • Optional caption?: string
  • Optional description?: string
  • id: string
  • Optional inputMessageContent?: InputMessageContent
  • Optional parseMode?: string
  • photoFileId: string
  • Optional replyMarkup?: InlineKeyboardMarkup
  • Optional title?: string
  • type: "photo"

InlineQueryResultCachedSticker

InlineQueryResultCachedSticker: { id: string; inputMessageContent?: InputMessageContent; replyMarkup?: InlineKeyboardMarkup; stickerFileId: string; type: "sticker" }

Type declaration

InlineQueryResultCachedVideo

InlineQueryResultCachedVideo: { caption?: string; description?: string; id: string; inputMessageContent?: InputMessageContent; parseMode?: string; replyMarkup?: InlineKeyboardMarkup; title: string; type: "video"; videoFileId: string }

Type declaration

  • Optional caption?: string
  • Optional description?: string
  • id: string
  • Optional inputMessageContent?: InputMessageContent
  • Optional parseMode?: string
  • Optional replyMarkup?: InlineKeyboardMarkup
  • title: string
  • type: "video"
  • videoFileId: string

InlineQueryResultCachedVoice

InlineQueryResultCachedVoice: { caption?: string; id: string; inputMessageContent?: InputMessageContent; parseMode?: string; replyMarkup?: InlineKeyboardMarkup; title: string; type: "voice"; voiceFileId: string }

Type declaration

  • Optional caption?: string
  • id: string
  • Optional inputMessageContent?: InputMessageContent
  • Optional parseMode?: string
  • Optional replyMarkup?: InlineKeyboardMarkup
  • title: string
  • type: "voice"
  • voiceFileId: string

InlineQueryResultContact

InlineQueryResultContact: { firstName: string; id: string; inputMessageContent?: InputMessageContent; lastName?: string; phoneNumber: string; replyMarkup?: InlineKeyboardMarkup; thumbHeight?: number; thumbUrl?: string; thumbWidth?: number; type: "contact"; vcard?: string }

Type declaration

  • firstName: string
  • id: string
  • Optional inputMessageContent?: InputMessageContent
  • Optional lastName?: string
  • phoneNumber: string
  • Optional replyMarkup?: InlineKeyboardMarkup
  • Optional thumbHeight?: number
  • Optional thumbUrl?: string
  • Optional thumbWidth?: number
  • type: "contact"
  • Optional vcard?: string

InlineQueryResultDocument

InlineQueryResultDocument: { caption?: string; description?: string; documentUrl: string; id: string; inputMessageContent?: InputMessageContent; mimeType: string; parseMode?: string; replyMarkup?: InlineKeyboardMarkup; thumbHeight?: number; thumbUrl?: string; thumbWidth?: number; title: string; type: "document" }

Type declaration

  • Optional caption?: string
  • Optional description?: string
  • documentUrl: string
  • id: string
  • Optional inputMessageContent?: InputMessageContent
  • mimeType: string
  • Optional parseMode?: string
  • Optional replyMarkup?: InlineKeyboardMarkup
  • Optional thumbHeight?: number
  • Optional thumbUrl?: string
  • Optional thumbWidth?: number
  • title: string
  • type: "document"

InlineQueryResultGame

InlineQueryResultGame: { gameShortName: string; id: string; replyMarkup?: InlineKeyboardMarkup; type: "game" }

Type declaration

InlineQueryResultGif

InlineQueryResultGif: { caption?: string; gifDuration?: number; gifHeight?: number; gifUrl: string; gifWidth?: number; id: string; inputMessageContent?: InputMessageContent; parseMode?: string; replyMarkup?: InlineKeyboardMarkup; thumbUrl: string; title?: string; type: "gif" }

Type declaration

  • Optional caption?: string
  • Optional gifDuration?: number
  • Optional gifHeight?: number
  • gifUrl: string
  • Optional gifWidth?: number
  • id: string
  • Optional inputMessageContent?: InputMessageContent
  • Optional parseMode?: string
  • Optional replyMarkup?: InlineKeyboardMarkup
  • thumbUrl: string
  • Optional title?: string
  • type: "gif"

InlineQueryResultLocation

InlineQueryResultLocation: { id: string; inputMessageContent?: InputMessageContent; latitude: number; livePeriod?: number; longitude: number; replyMarkup?: InlineKeyboardMarkup; thumbHeight?: number; thumbUrl?: string; thumbWidth?: number; title: string; type: "location" }

Type declaration

  • id: string
  • Optional inputMessageContent?: InputMessageContent
  • latitude: number
  • Optional livePeriod?: number
  • longitude: number
  • Optional replyMarkup?: InlineKeyboardMarkup
  • Optional thumbHeight?: number
  • Optional thumbUrl?: string
  • Optional thumbWidth?: number
  • title: string
  • type: "location"

InlineQueryResultMpeg4Gif

InlineQueryResultMpeg4Gif: { caption?: string; id: string; inputMessageContent?: InputMessageContent; mpeg4Duration?: number; mpeg4Height?: number; mpeg4Url: string; mpeg4Width?: number; parseMode?: string; replyMarkup?: InlineKeyboardMarkup; thumbUrl: string; title?: string; type: "mpeg4_gif" }

Type declaration

  • Optional caption?: string
  • id: string
  • Optional inputMessageContent?: InputMessageContent
  • Optional mpeg4Duration?: number
  • Optional mpeg4Height?: number
  • mpeg4Url: string
  • Optional mpeg4Width?: number
  • Optional parseMode?: string
  • Optional replyMarkup?: InlineKeyboardMarkup
  • thumbUrl: string
  • Optional title?: string
  • type: "mpeg4_gif"

InlineQueryResultPhoto

InlineQueryResultPhoto: { caption?: string; description?: string; id: string; inputMessageContent?: InputMessageContent; parseMode?: string; photoUrl: string; replyMarkup?: InlineKeyboardMarkup; thumbUrl: string; title?: string; type: "photo" }

Type declaration

  • Optional caption?: string
  • Optional description?: string
  • id: string
  • Optional inputMessageContent?: InputMessageContent
  • Optional parseMode?: string
  • photoUrl: string
  • Optional replyMarkup?: InlineKeyboardMarkup
  • thumbUrl: string
  • Optional title?: string
  • type: "photo"

InlineQueryResultVenue

InlineQueryResultVenue: { address: string; foursquareId?: string; foursquareType?: string; id: string; inputMessageContent?: InputMessageContent; latitude: number; longitude: number; replyMarkup?: InlineKeyboardMarkup; thumbHeight?: number; thumbUrl?: string; thumbWidth?: number; title: string; type: "venue" }

Type declaration

  • address: string
  • Optional foursquareId?: string
  • Optional foursquareType?: string
  • id: string
  • Optional inputMessageContent?: InputMessageContent
  • latitude: number
  • longitude: number
  • Optional replyMarkup?: InlineKeyboardMarkup
  • Optional thumbHeight?: number
  • Optional thumbUrl?: string
  • Optional thumbWidth?: number
  • title: string
  • type: "venue"

InlineQueryResultVideo

InlineQueryResultVideo: { caption?: string; description?: string; id: string; inputMessageContent?: InputMessageContent; mimeType: string; parseMode?: string; replyMarkup?: InlineKeyboardMarkup; thumbUrl: string; title: string; type: "video"; videoDuration?: number; videoHeight?: number; videoUrl: string; videoWidth?: number }

Type declaration

  • Optional caption?: string
  • Optional description?: string
  • id: string
  • Optional inputMessageContent?: InputMessageContent
  • mimeType: string
  • Optional parseMode?: string
  • Optional replyMarkup?: InlineKeyboardMarkup
  • thumbUrl: string
  • title: string
  • type: "video"
  • Optional videoDuration?: number
  • Optional videoHeight?: number
  • videoUrl: string
  • Optional videoWidth?: number

InlineQueryResultVoice

InlineQueryResultVoice: { caption?: string; id: string; inputMessageContent?: InputMessageContent; parseMode?: string; replyMarkup?: InlineKeyboardMarkup; title: string; type: "voice"; voiceDuration?: number; voiceUrl: string }

Type declaration

  • Optional caption?: string
  • id: string
  • Optional inputMessageContent?: InputMessageContent
  • Optional parseMode?: string
  • Optional replyMarkup?: InlineKeyboardMarkup
  • title: string
  • type: "voice"
  • Optional voiceDuration?: number
  • voiceUrl: string

InputContactMessageContent

InputContactMessageContent: { firstName: string; lastName?: string; phoneNumber: string; vcard?: string }

Type declaration

  • firstName: string
  • Optional lastName?: string
  • phoneNumber: string
  • Optional vcard?: string

InputLocationMessageContent

InputLocationMessageContent: { latitude: number; livePeriod?: number; longitude: number }

Type declaration

  • latitude: number
  • Optional livePeriod?: number
  • longitude: number

InputMedia

InputMediaAnimation

InputMediaAnimation: { caption?: string; duration?: number; height?: number; media: string; parseMode?: string; thumb?: string; type: Animation; width?: number }

Type declaration

  • Optional caption?: string
  • Optional duration?: number
  • Optional height?: number
  • media: string
  • Optional parseMode?: string
  • Optional thumb?: string
  • type: Animation
  • Optional width?: number

InputMediaAudio

InputMediaAudio: { caption?: string; duration?: number; media: string; parseMode?: string; performer?: string; thumb?: string; title?: string; type: Audio }

Type declaration

  • Optional caption?: string
  • Optional duration?: number
  • media: string
  • Optional parseMode?: string
  • Optional performer?: string
  • Optional thumb?: string
  • Optional title?: string
  • type: Audio

InputMediaDocument

InputMediaDocument: { caption?: string; media: string; parseMode?: string; thumb?: string; type: Document }

Type declaration

  • Optional caption?: string
  • media: string
  • Optional parseMode?: string
  • Optional thumb?: string
  • type: Document

InputMediaPhoto

InputMediaPhoto: { caption?: string; media: string; parseMode?: ParseMode; type: Photo }

Type declaration

  • Optional caption?: string

    Optional. Caption of the photo to be sent, 0-1024 characters

  • media: string

    File to send. Pass a fileId to send a file that exists on the Telegram servers (recommended) or pass an HTTP URL for Telegram to get a file from the Internet. Upload file is not supported yet.

  • Optional parseMode?: ParseMode

    Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.

  • type: Photo

    Type of the result, must be photo

InputMediaVideo

InputMediaVideo: { caption?: string; duration?: number; height?: number; media: string; parseMode?: string; supportsStreaming?: boolean; thumb?: string; type: Video; width?: number }

Type declaration

  • Optional caption?: string

    Optional. Caption of the video to be sent, 0-1024 characters

  • Optional duration?: number

    Optional. Video duration

  • Optional height?: number

    Optional. Video height

  • media: string

    File to send. Pass a fileId to send a file that exists on the Telegram servers (recommended) or pass an HTTP URL for Telegram to get a file from the Internet. Upload file is not supported yet.

  • Optional parseMode?: string

    Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.

  • Optional supportsStreaming?: boolean

    Optional. Pass True, if the uploaded video is suitable for streaming

  • Optional thumb?: string

    Thumb is not supported yet.

  • type: Video

    Type of the result, must be video

  • Optional width?: number

    Optional. Video width

InputMessageContent

InputTextMessageContent

InputTextMessageContent: { disableWebPagePreview?: boolean; messageText: string; parseMode?: string }

Type declaration

  • Optional disableWebPagePreview?: boolean
  • messageText: string
  • Optional parseMode?: string

InputVenueMessageContent

InputVenueMessageContent: { address: string; foursquareId?: string; foursquareType?: string; latitude: number; longitude: number; title: string }

Type declaration

  • address: string
  • Optional foursquareId?: string
  • Optional foursquareType?: string
  • latitude: number
  • longitude: number
  • title: string

Invoice

Invoice: { currency: string; description: string; startParameter: string; title: string; totalAmount: number }

Type declaration

  • currency: string
  • description: string
  • startParameter: string
  • title: string
  • totalAmount: number

KeyboardButton

KeyboardButton: { requestContact?: boolean; requestLocation?: boolean; text: string }

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

Type declaration

  • Optional requestContact?: boolean

    Optional. If True, the user's phone number will be sent as a contact when the button is pressed. Available in private chats only

  • Optional requestLocation?: boolean

    Optional. If True, the user's current location will be sent when the button is pressed. Available in private chats only

  • text: string

    Text of the button. If none of the optional fields are used, it will be sent as a message when the button is pressed

KickChatMemberOption

KickChatMemberOption: { untilDate?: number }

Type declaration

  • Optional untilDate?: number

    Date when the user will be unbanned, unix time. If user is banned for more than 366 days or less than 30 seconds from the current time they are considered to be banned forever

LabeledPrice

LabeledPrice: { amount: number; label: string }

Type declaration

  • amount: number
  • label: string

Location

Location: { latitude: number; longitude: number }

This object represents a point on the map.

Type declaration

  • latitude: number

    Latitude as defined by sender

  • longitude: number

    Longitude as defined by sender

LoginUrl

LoginUrl: { botUsername?: string; forwardText?: string; requestWriteAccess?: boolean; url: string }

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

Type declaration

MaskPosition

MaskPosition: { point: "forehead" | "eyes" | "mouth" | "chin"; scale: number; xShift: number; yShift: number }

Type declaration

  • point: "forehead" | "eyes" | "mouth" | "chin"
  • scale: number
  • xShift: number
  • yShift: number

Message

Message: { animation?: Animation; audio?: Audio; authorSignature?: string; caption?: string; captionEntities?: MessageEntity[]; channelChatCreated?: boolean; chat: Chat; connectedWebsite?: string; contact?: Contact; date: number; deleteChatPhoto?: boolean; document?: Document; editDate?: number; entities?: MessageEntity[]; forwardDate?: number; forwardFrom?: User; forwardFromChat?: Chat; forwardFromMessageId?: number; forwardSenderName?: string; forwardSignature?: string; from?: User; game?: Game; groupChatCreated?: boolean; invoice?: Invoice; leftChatMember?: User; location?: Location; mediaGroupId?: string; messageId: number; migrateFromChatId?: number; migrateToChatId?: number; newChatMembers?: User[]; newChatPhoto?: PhotoSize[]; newChatTitle?: string; passportData?: PassportData; photo?: PhotoSize[]; pinnedMessage?: Message; poll?: Poll; replyMarkup?: InlineKeyboardMarkup; replyToMessage?: Message; sticker?: Sticker; successfulPayment?: SuccessfulPayment; supergroupChatCreated?: boolean; text?: string; venue?: Venue; video?: Video; videoNote?: VideoNote; voice?: Voice }

Type declaration

  • Optional animation?: Animation
  • Optional audio?: Audio
  • Optional authorSignature?: string
  • Optional caption?: string
  • Optional captionEntities?: MessageEntity[]
  • Optional channelChatCreated?: boolean
  • chat: Chat
  • Optional connectedWebsite?: string
  • Optional contact?: Contact
  • date: number
  • Optional deleteChatPhoto?: boolean
  • Optional document?: Document
  • Optional editDate?: number
  • Optional entities?: MessageEntity[]
  • Optional forwardDate?: number
  • Optional forwardFrom?: User
  • Optional forwardFromChat?: Chat
  • Optional forwardFromMessageId?: number
  • Optional forwardSenderName?: string
  • Optional forwardSignature?: string
  • Optional from?: User
  • Optional game?: Game
  • Optional groupChatCreated?: boolean
  • Optional invoice?: Invoice
  • Optional leftChatMember?: User
  • Optional location?: Location
  • Optional mediaGroupId?: string
  • messageId: number
  • Optional migrateFromChatId?: number
  • Optional migrateToChatId?: number
  • Optional newChatMembers?: User[]
  • Optional newChatPhoto?: PhotoSize[]
  • Optional newChatTitle?: string
  • Optional passportData?: PassportData
  • Optional photo?: PhotoSize[]
  • Optional pinnedMessage?: Message
  • Optional poll?: Poll
  • Optional replyMarkup?: InlineKeyboardMarkup
  • Optional replyToMessage?: Message
  • Optional sticker?: Sticker
  • Optional successfulPayment?: SuccessfulPayment
  • Optional supergroupChatCreated?: boolean
  • Optional text?: string
  • Optional venue?: Venue
  • Optional video?: Video
  • Optional videoNote?: VideoNote
  • Optional voice?: Voice

MessageEntity

MessageEntity: { length: number; offset: number; type: "mention" | "hashtag" | "cashtag" | "bot_command" | "url" | "email" | "phone_number" | "bold" | "italic" | "code" | "pre" | "text_link" | "text_mention"; url?: string; user?: User }

Type declaration

  • length: number
  • offset: number
  • type: "mention" | "hashtag" | "cashtag" | "bot_command" | "url" | "email" | "phone_number" | "bold" | "italic" | "code" | "pre" | "text_link" | "text_mention"
  • Optional url?: string
  • Optional user?: User

OrderInfo

OrderInfo: { email?: string; name?: string; phoneNumber?: string; shippingAddress?: ShippingAddress }

Type declaration

  • Optional email?: string
  • Optional name?: string
  • Optional phoneNumber?: string
  • Optional shippingAddress?: ShippingAddress

PassportData

PassportData: { credentials: EncryptedCredentials; data: EncryptedPassportElement[] }

Type declaration

PassportElementError

PassportElementErrorDataField

PassportElementErrorDataField: { dataHash: string; fieldName: string; message: string; source: string; type: "personal_details" | "passport" | "driver_license" | "identity_card" | "internal_passport" | "address" }

Type declaration

  • dataHash: string
  • fieldName: string
  • message: string
  • source: string
  • type: "personal_details" | "passport" | "driver_license" | "identity_card" | "internal_passport" | "address"

PassportElementErrorFile

PassportElementErrorFile: { fileHash: string; message: string; source: "file"; type: "utility_bill" | "bank_statement" | "rental_agreement" | "passport_registration" | "temporary_registration" }

Type declaration

  • fileHash: string
  • message: string
  • source: "file"
  • type: "utility_bill" | "bank_statement" | "rental_agreement" | "passport_registration" | "temporary_registration"

PassportElementErrorFiles

PassportElementErrorFiles: { fileHashes: string[]; message: string; source: "files"; type: "utility_bill" | "bank_statement" | "rental_agreement" | "passport_registration" | "temporary_registration" }

Type declaration

  • fileHashes: string[]
  • message: string
  • source: "files"
  • type: "utility_bill" | "bank_statement" | "rental_agreement" | "passport_registration" | "temporary_registration"

PassportElementErrorFrontSide

PassportElementErrorFrontSide: { fileHash: string; message: string; source: "front_side"; type: "passport" | "driver_license" | "identity_card" | "internal_passport" }

Type declaration

  • fileHash: string
  • message: string
  • source: "front_side"
  • type: "passport" | "driver_license" | "identity_card" | "internal_passport"

PassportElementErrorReverseSide

PassportElementErrorReverseSide: { fileHash: string; message: string; source: "reverse_side"; type: "driver_license" | "identity_card" }

Type declaration

  • fileHash: string
  • message: string
  • source: "reverse_side"
  • type: "driver_license" | "identity_card"

PassportElementErrorSelfie

PassportElementErrorSelfie: { fileHash: string; message: string; source: "selfie"; type: "passport" | "driver_license" | "identity_card" | "internal_passport" }

Type declaration

  • fileHash: string
  • message: string
  • source: "selfie"
  • type: "passport" | "driver_license" | "identity_card" | "internal_passport"

PassportElementErrorTranslationFile

PassportElementErrorTranslationFile: { fileHash: string; message: string; source: "translation_file"; type: "passport" | "driver_license" | "identity_card" | "internal_passport" | "utility_bill" | "bank_statement" | "rental_agreement" | "passport_registration" | "temporary_registration" }

Type declaration

  • fileHash: string
  • message: string
  • source: "translation_file"
  • type: "passport" | "driver_license" | "identity_card" | "internal_passport" | "utility_bill" | "bank_statement" | "rental_agreement" | "passport_registration" | "temporary_registration"

PassportElementErrorTranslationFiles

PassportElementErrorTranslationFiles: { fileHashes: string[]; message: string; source: "translation_files"; type: "passport" | "driver_license" | "identity_card" | "internal_passport" | "utility_bill" | "bank_statement" | "rental_agreement" | "passport_registration" | "temporary_registration" }

Type declaration

  • fileHashes: string[]
  • message: string
  • source: "translation_files"
  • type: "passport" | "driver_license" | "identity_card" | "internal_passport" | "utility_bill" | "bank_statement" | "rental_agreement" | "passport_registration" | "temporary_registration"

PassportElementErrorUnspecified

PassportElementErrorUnspecified: { elementHash: string; message: string; source: "unspecified"; type: string }

Type declaration

  • elementHash: string
  • message: string
  • source: "unspecified"
  • type: string

PassportFile

PassportFile: { fileDate: number; fileId: string; fileSize: number }

Type declaration

  • fileDate: number
  • fileId: string
  • fileSize: number

PhotoSize

PhotoSize: { fileId: string; fileSize?: number; height: number; width: number }

Type declaration

  • fileId: string
  • Optional fileSize?: number
  • height: number
  • width: number

PinChatMessageOption

PinChatMessageOption: { disableNotification?: boolean }

Type declaration

  • Optional disableNotification?: boolean

    Pass True, if it is not necessary to send a notification to all chat members about the new pinned message. Notifications are always disabled in channels.

Poll

Poll: { allowsMultipleAnswers: boolean; closeDate?: number; correctOptionId?: number; explanation?: string; explanationEntities?: MessageEntity[]; id: string; isAnonymous: boolean; isClosed: boolean; openPeriod?: number; options: PollOption[]; question: string; totalVoterCount: number; type: string }

Type declaration

  • allowsMultipleAnswers: boolean

    True, if the poll allows multiple answers

  • Optional closeDate?: number

    Optional. Point in time (Unix timestamp) when the poll will be automatically closed

  • Optional correctOptionId?: number

    Optional. 0-based identifier of the correct answer option. Available only for polls in the quiz mode, which are closed, or was sent (not forwarded) by the bot or to the private chat with the bot.

  • Optional explanation?: string

    Optional. Text that is shown when a user chooses an incorrect answer or taps on the lamp icon in a quiz-style poll, 0-200 characters

  • Optional explanationEntities?: MessageEntity[]

    Optional. Special entities like usernames, URLs, bot commands, etc. that appear in the explanation

  • id: string

    Unique poll identifier

  • isAnonymous: boolean

    True, if the poll is anonymous

  • isClosed: boolean

    True, if the poll is closed

  • Optional openPeriod?: number

    Optional. Amount of time in seconds the poll will be active after creation

  • options: PollOption[]

    List of poll options

  • question: string

    Poll question, 1-255 characters

  • totalVoterCount: number

    Total number of users that voted in the poll

  • type: string

    Poll type, currently can be “regular” or “quiz”

PollAnswer

PollAnswer: { optionIds: number[]; pollId: string; user: User }

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

Type declaration

  • optionIds: number[]

    0-based identifiers of answer options, chosen by the user. May be empty if the user retracted their vote.

  • pollId: string

    Unique poll identifier

  • user: User

    The user, who changed the answer to the poll

PollOption

PollOption: { text: string; voterCount: number }

Type declaration

  • text: string
  • voterCount: number

PreCheckoutQuery

PreCheckoutQuery: { currency: string; from: User; id: string; invoicePayload: string; orderInfo?: OrderInfo; shippingOptionId?: string; totalAmount: number }

Type declaration

  • currency: string
  • from: User
  • id: string
  • invoicePayload: string
  • Optional orderInfo?: OrderInfo
  • Optional shippingOptionId?: string
  • totalAmount: number

Product

Product: { currency: string; description: string; payload: string; prices: LabeledPrice[]; providerToken: string; startParameter: string; title: string }

Type declaration

  • currency: string
  • description: string
  • payload: string
  • prices: LabeledPrice[]
  • providerToken: string
  • startParameter: string
  • title: string

PromoteChatMemberOption

PromoteChatMemberOption: { canChangeInfo?: boolean; canDeleteMessages?: boolean; canEditMessages?: boolean; canInviteUsers?: boolean; canPinMessages?: boolean; canPostMessages?: boolean; canPromoteMembers?: boolean; canRestrictMembers?: boolean }

Type declaration

  • Optional canChangeInfo?: boolean

    Pass True, if the administrator can change chat title, photo and other settings

  • Optional canDeleteMessages?: boolean

    Pass True, if the administrator can delete messages of other users

  • Optional canEditMessages?: boolean

    Pass True, if the administrator can edit messages of other users and can pin messages, channels only

  • Optional canInviteUsers?: boolean

    Pass True, if the administrator can invite new users to the chat

  • Optional canPinMessages?: boolean

    Pass True, if the administrator can pin messages, supergroups only

  • Optional canPostMessages?: boolean

    Pass True, if the administrator can create channel posts, channels only

  • Optional canPromoteMembers?: boolean

    Pass True, if the administrator can add new administrators with a subset of his own privileges or demote administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by him)

  • Optional canRestrictMembers?: boolean

    Pass True, if the administrator can restrict, ban or unban chat members

ReplyKeyboardMarkup

ReplyKeyboardMarkup: { keyboard: KeyboardButton[][]; oneTimeKeyboard?: boolean; resizeKeyboard?: boolean; selective?: boolean }

This object represents a custom keyboard with reply options.

Type declaration

  • keyboard: KeyboardButton[][]

    Array of button rows, each represented by an Array of KeyboardButton objects

  • Optional oneTimeKeyboard?: boolean

    Optional. Requests clients to hide the keyboard as soon as it's been used. The keyboard will still be available, but clients will automatically display the usual letter-keyboard in the chat – the user can press a special button in the input field to see the custom keyboard again. Defaults to false.

  • Optional resizeKeyboard?: boolean

    Optional. Requests clients to resize the keyboard vertically for optimal fit (e.g., make the keyboard smaller if there are just two rows of buttons). Defaults to false, in which case the custom keyboard is always of the same height as the app's standard keyboard.

  • Optional selective?: boolean

    Optional. Use this parameter if you want to show the keyboard to specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply (has replyToMessageId), sender of the original message.

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

ReplyKeyboardRemove

ReplyKeyboardRemove: { removeKeyboard: true; selective?: boolean }

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

Type declaration

  • removeKeyboard: true

    Requests clients to remove the custom keyboard (user will not be able to summon this keyboard; if you want to hide the keyboard from sight but keep it accessible, use oneTimeKeyboard in ReplyKeyboardMarkup)

  • Optional selective?: boolean

    Optional. Use this parameter if you want to remove the keyboard for specific users only. Targets:

    1. users that are @mentioned in the text of the Message object
    2. if the bot's message is a reply (has replyToMessageId), sender of the original message.

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

ResponseParameters

ResponseParameters: any

RestrictChatMemberOption

RestrictChatMemberOption: { untilDate?: number }

Type declaration

  • Optional untilDate?: number

    Date when restrictions will be lifted for the user, unix time. If user is restricted for more than 366 days or less than 30 seconds from the current time, they are considered to be restricted forever

SendAnimationOption

SendAnimationOption: { caption?: string; disableNotification?: boolean; duration?: number; height?: number; parseMode?: ParseMode; replyMarkup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply; replyToMessageId?: number; thumb?: string; width?: number }

Type declaration

SendAudioOption

SendAudioOption: { caption?: string; disableNotification?: boolean; duration?: number; parseMode?: ParseMode; performer?: string; replyMarkup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply; replyToMessageId?: number; thumb?: string; title?: string }

Type declaration

SendContactOption

SendContactOption: { disableNotification?: boolean; lastName?: string; replyMarkup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply; replyToMessageId?: number; vcard?: string }

Type declaration

SendContactRequiredOption

SendContactRequiredOption: { firstName: string; phoneNumber: string }

Type declaration

  • firstName: string

    Contact's first name

  • phoneNumber: string

    Contact's phone number

SendDocumentOption

SendDocumentOption: { caption?: string; disableNotification?: boolean; parseMode?: ParseMode; replyMarkup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply; replyToMessageId?: number; thumb?: string }

Type declaration

SendGameOption

SendGameOption: { disableNotification?: boolean; replyMarkup?: InlineKeyboardMarkup; replyToMessageId?: number }

Type declaration

SendInvoiceOption

SendInvoiceOption: { disableNotification?: boolean; isFlexible?: boolean; needEmail?: boolean; needName?: boolean; needPhoneNumber?: boolean; needShippingAddress?: boolean; photoHeight?: number; photoSize?: number; photoUrl?: string; photoWidth?: number; providerData?: string; replyMarkup?: InlineKeyboardMarkup; replyToMessageId?: number; sendEmailToProvider?: boolean; sendPhoneNumberToProvider?: boolean }

Type declaration

  • Optional disableNotification?: boolean

    Sends the message silently. Users will receive a notification with no sound.

  • Optional isFlexible?: boolean

    Pass True, if the final price depends on the shipping method

  • Optional needEmail?: boolean

    Pass True, if you require the user's email address to complete the order

  • Optional needName?: boolean

    Pass True, if you require the user's full name to complete the order

  • Optional needPhoneNumber?: boolean

    Pass True, if you require the user's phone number to complete the order

  • Optional needShippingAddress?: boolean

    Pass True, if you require the user's shipping address to complete the order

  • Optional photoHeight?: number

    Photo height

  • Optional photoSize?: number

    Photo size

  • Optional photoUrl?: string

    URL of the product photo for the invoice. Can be a photo of the goods or a marketing image for a service. People like it better when they see what they are paying for.

  • Optional photoWidth?: number

    Photo width

  • Optional providerData?: string

    JSON-encoded data about the invoice, which will be shared with the payment provider. A detailed description of required fields should be provided by the payment provider.

  • Optional replyMarkup?: InlineKeyboardMarkup

    A JSON-serialized object for an inline keyboard. If empty, one 'Pay total price' button will be shown. If not empty, the first button must be a Pay button.

  • Optional replyToMessageId?: number

    If the message is a reply, ID of the original message

  • Optional sendEmailToProvider?: boolean

    Pass True, if user's email address should be sent to provider

  • Optional sendPhoneNumberToProvider?: boolean

    Pass True, if user's phone number should be sent to provider

SendLocationOption

SendLocationOption: { disableNotification?: boolean; livePeriod?: number; replyMarkup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply; replyToMessageId?: number }

Type declaration

SendMediaGroupOption

SendMediaGroupOption: { disableNotification?: boolean; replyToMessageId?: number }

Type declaration

SendMessageOption

SendMessageOption: { disableNotification?: boolean; disableWebPagePreview?: boolean; parseMode?: ParseMode; replyMarkup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply; replyToMessageId?: number }

Type declaration

SendPhotoOption

SendPhotoOption: { caption?: string; disableNotification?: boolean; parseMode?: ParseMode; replyMarkup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply; replyToMessageId?: number }

Type declaration

SendPollOption

SendPollOption: { allowsMultipleAnswers?: boolean; closeDate?: number; correctOptionId?: number; disableNotification?: boolean; explanation?: string; explanationParseMode?: string; isAnonymous?: boolean; isClosed?: boolean; openPeriod?: number; replyMarkup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply; replyToMessageId?: number; type?: string }

Type declaration

SendStickerOption

SendStickerOption: { disableNotification?: boolean; replyMarkup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply; replyToMessageId?: number }

Type declaration

SendVenueOption

SendVenueOption: { disableNotification?: boolean; foursquareId?: string; foursquareType?: string; replyMarkup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply; replyToMessageId?: number }

Type declaration

SendVideoNoteOption

SendVideoNoteOption: { disableNotification?: boolean; duration?: number; length?: number; replyMarkup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply; replyToMessageId?: number; thumb?: string }

Type declaration

SendVideoOption

SendVideoOption: { caption?: string; disableNotification?: boolean; duration?: number; height?: number; parseMode?: ParseMode; replyMarkup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply; replyToMessageId?: number; supportsStreaming?: boolean; thumb?: string; width?: number }

Type declaration

SendVoiceOption

SendVoiceOption: { caption?: string; disableNotification?: boolean; duration?: number; parseMode?: ParseMode; replyMarkup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply; replyToMessageId?: number }

Type declaration

SetGameScoreOption

SetGameScoreOption: EditOption & { disableEditMessage?: boolean; force?: boolean }

SetWebhookOption

SetWebhookOption: { allowedUpdates?: string[]; certificate?: string; maxConnections?: number }

Type declaration

  • Optional allowedUpdates?: string[]

    List the types of updates you want your bot to receive. For example, specify [“message”, “edited_channel_post”, “callback_query”] to only receive updates of these types. See Update for a complete list of available update types. Specify an empty list to receive all updates regardless of type (default). If not specified, the previous setting will be used.

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

  • Optional certificate?: string

    not supported yet.

  • Optional maxConnections?: number

    Maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery, 1-100. Defaults to 40. Use lower values to limit the load on your bot‘s server, and higher values to increase your bot’s throughput.

ShippingAddress

ShippingAddress: { city: string; countryCode: string; postCode: string; state: string; streetLine1: string; streetLine2: string }

Type declaration

  • city: string
  • countryCode: string
  • postCode: string
  • state: string
  • streetLine1: string
  • streetLine2: string

ShippingOption

ShippingOption: { id: string; prices: LabeledPrice[]; title: string }

Type declaration

ShippingQuery

ShippingQuery: { from: User; id: string; invoicePayload: string; shippingAddress: ShippingAddress }

Type declaration

Sticker

Sticker: { emoji?: string; fileId: string; fileSize?: number; height: number; isAnimated: boolean; maskPosition?: MaskPosition; setName?: string; thumb?: PhotoSize; width: number }

Type declaration

  • Optional emoji?: string
  • fileId: string
  • Optional fileSize?: number
  • height: number
  • isAnimated: boolean
  • Optional maskPosition?: MaskPosition
  • Optional setName?: string
  • Optional thumb?: PhotoSize
  • width: number

StickerSet

StickerSet: { containsMasks: boolean; isAnimated: boolean; name: string; stickers: Sticker[]; title: string }

Type declaration

  • containsMasks: boolean
  • isAnimated: boolean
  • name: string
  • stickers: Sticker[]
  • title: string

StopMessageLiveLocationOption

StopMessageLiveLocationOption: EditOption & { replyMarkup?: InlineKeyboardMarkup }

StopPollOption

StopPollOption: { replyMarkup?: InlineKeyboardMarkup }

SuccessfulPayment

SuccessfulPayment: { currency: string; invoicePayload: string; orderInfo?: OrderInfo; providerPaymentChargeId: string; shippingOptionId?: string; telegramPaymentChargeId: string; totalAmount: number }

Type declaration

  • currency: string
  • invoicePayload: string
  • Optional orderInfo?: OrderInfo
  • providerPaymentChargeId: string
  • Optional shippingOptionId?: string
  • telegramPaymentChargeId: string
  • totalAmount: number

Update

Update: { callbackQuery?: CallbackQuery; channelPost?: Message; chosenInlineResult?: ChosenInlineResult; editedChannelPost?: Message; editedMessage?: Message; inlineQuery?: InlineQuery; message?: Message; poll?: Poll; pollAnswer?: PollAnswer; preCheckoutQuery?: PreCheckoutQuery; shippingQuery?: ShippingQuery; updateId: number }

Type declaration

User

User: { canJoinGroups?: boolean; canReadAllGroupMessages?: boolean; firstName: string; id: number; isBot: boolean; languageCode?: string; lastName?: string; supportsInlineQueries?: boolean; username?: string }

This object represents a Telegram user or bot.

Type declaration

  • Optional canJoinGroups?: boolean

    Optional. True, if the bot can be invited to groups. Returned only in getMe.

  • Optional canReadAllGroupMessages?: boolean

    Optional. True, if privacy mode is disabled for the bot. Returned only in getMe.

  • firstName: string

    User‘s or bot’s first name

  • id: number

    Unique identifier for this user or bot

  • isBot: boolean

    True, if this user is a bot

  • Optional languageCode?: string

    Optional. (IETF language tag)[https://en.wikipedia.org/wiki/IETF_language_tag] of the user's language

  • Optional lastName?: string

    Optional. User‘s or bot’s last name

  • Optional supportsInlineQueries?: boolean

    Optional. True, if the bot supports inline queries. Returned only in getMe.

  • Optional username?: string

    Optional. User‘s or bot’s username

UserProfilePhotos

UserProfilePhotos: { photos: PhotoSize[][]; totalCount: number }

Type declaration

Venue

Venue: { address: string; foursquareId?: string; foursquareType?: string; latitude: number; longitude: number; title: string }

This object represents a venue.

Type declaration

  • address: string

    Address of the venue

  • Optional foursquareId?: string

    Optional. Foursquare identifier of the venue

  • Optional foursquareType?: string

    Optional. Foursquare type of the venue. (For example, "arts_entertainment/default", "arts_entertainment/aquarium" or "food/icecream".)

  • latitude: number

    Latitude of the venue

  • longitude: number

    Longitude of the venue

  • title: string

    Name of the venue

Video

Video: { duration: number; fileId: string; fileSize?: number; height: number; mimeType?: string; thumb?: PhotoSize; width: number }

Type declaration

  • duration: number
  • fileId: string
  • Optional fileSize?: number
  • height: number
  • Optional mimeType?: string
  • Optional thumb?: PhotoSize
  • width: number

VideoNote

VideoNote: { duration: number; fileId: string; fileSize?: number; length: number; thumb?: PhotoSize }

Type declaration

  • duration: number
  • fileId: string
  • Optional fileSize?: number
  • length: number
  • Optional thumb?: PhotoSize

Voice

Voice: { duration: number; fileId: string; fileSize?: number; mimeType?: string }

Type declaration

  • duration: number
  • fileId: string
  • Optional fileSize?: number
  • Optional mimeType?: string

WebhookInfo

WebhookInfo: { allowedUpdates?: string[]; hasCustomCertificate: boolean; lastErrorDate?: number; lastErrorMessage?: string; maxConnections?: number; pendingUpdateCount: number; url: string }

Contains information about the current status of a webhook.

Type declaration

  • Optional allowedUpdates?: string[]

    Optional. A list of update types the bot is subscribed to. Defaults to all update types

  • hasCustomCertificate: boolean

    True, if a custom certificate was provided for webhook certificate checks

  • Optional lastErrorDate?: number

    Optional. Unix time for the most recent error that happened when trying to deliver an update via webhook

  • Optional lastErrorMessage?: string

    Optional. Error message in human-readable format for the most recent error that happened when trying to deliver an update via webhook

  • Optional maxConnections?: number

    Optional. Maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery

  • pendingUpdateCount: number

    Number of updates awaiting delivery

  • url: string

    Webhook URL, may be empty if webhook is not set up

Generated using TypeDoc