tgify.js - v1.3.0
    Preparing search index...

    Class Telegram

    Hierarchy

    • ApiClient
      • Telegram
    Index

    Constructors

    Properties

    Accessors

    Methods

    addStickerToSet answerCbQuery answerGameQuery answerInlineQuery answerPreCheckoutQuery answerShippingQuery answerWebAppQuery approveChatJoinRequest approveSuggestedPost banChatMember banChatSenderChat callApi close closeForumTopic closeGeneralForumTopic convertGiftToStars copyMessage copyMessages createChatInviteLink createChatSubscriptionInviteLink createForumTopic createInvoiceLink createNewStickerSet declineChatJoinRequest declineSuggestedPost deleteBusinessMessages deleteChatPhoto deleteChatStickerSet deleteForumTopic deleteMessage deleteMessages deleteMyCommands deleteStickerFromSet deleteStickerSet deleteStory deleteWebhook editChatInviteLink editChatSubscriptionInviteLink editForumTopic editGeneralForumTopic editMessageCaption editMessageChecklist editMessageLiveLocation editMessageMedia editMessageReplyMarkup editMessageText editStory editUserStarSubscription exportChatInviteLink forwardMessage forwardMessages getAvailableGifts getBusinessAccountGifts getBusinessAccountStarBalance getChat getChatAdministrators getChatGifts getChatMember getChatMembersCount getChatMenuButton getCustomEmojiStickers getFile getFileLink getForumTopicIconStickers getGameHighScores getMe getMyCommands getMyDefaultAdministratorRights getMyDescription getMyName getMyShortDescription getMyStarBalance getStarTransactions getStickerSet getUpdates getUserChatBoosts getUserGifts getUserProfileAudios getUserProfilePhotos getWebhookInfo giftPremiumSubscription hideGeneralForumTopic leaveChat logOut pinChatMessage postStory promoteChatMember readBusinessMessage refundStarPayment removeBusinessAccountProfilePhoto removeChatVerification removeMyProfilePhoto removeUserVerification reopenForumTopic reopenGeneralForumTopic repostStory restrictChatMember revokeChatInviteLink savePreparedInlineMessage sendAnimation sendAudio sendChatAction sendChecklist sendContact sendCopy sendDice sendDocument sendGame sendGift sendInvoice sendLocation sendMediaGroup sendMessage sendMessageDraft sendPaidMedia sendPhoto sendPoll sendQuiz sendSticker sendVenue sendVideo sendVideoNote sendVoice setBusinessAccountBio setBusinessAccountGiftSettings setBusinessAccountName setBusinessAccountProfilePhoto setBusinessAccountUsername setChatAdministratorCustomTitle setChatDescription setChatMenuButton setChatPermissions setChatPhoto setChatStickerSet setChatTitle setCustomEmojiStickerSetThumbnail setGameScore setMessageReaction setMyCommands setMyDefaultAdministratorRights setMyDescription setMyName setMyProfilePhoto setMyShortDescription setPassportDataErrors setStickerEmojiList setStickerKeywords setStickerMaskPosition setStickerPositionInSet setStickerSetThumbnail setStickerSetTitle setUserEmojiStatus setWebhook stopMessageLiveLocation stopPoll transferBusinessAccountStars transferGift unbanChatMember unbanChatSenderChat unhideGeneralForumTopic unpinAllChatMessages unpinAllForumTopicMessages unpinAllGeneralForumTopicMessages unpinChatMessage upgradeGift uploadStickerFile verifyChat verifyUser

    Constructors

    • Parameters

      • token: string
      • Optionaloptions: Partial<Options>
      • Optionalresponse: Response

      Returns Telegram

    Properties

    options: Options
    token: string

    Accessors

    • get kickChatMember(): (
          chatId: string | number,
          userId: number,
          untilDate?: number,
          extra?: Omit<{}, "chat_id" | "user_id" | "until_date">,
      ) => Promise<true>

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

      Returns (
          chatId: string | number,
          userId: number,
          untilDate?: number,
          extra?: Omit<{}, "chat_id" | "user_id" | "until_date">,
      ) => Promise<true>

        • (
              chatId: string | number,
              userId: number,
              untilDate?: number,
              extra?: Omit<{}, "chat_id" | "user_id" | "until_date">,
          ): Promise<true>
        • Kick a user from a group, a supergroup or a channel. In the case of supergroups and channels, the user will not be able to return to the group on their own using invite links, etc., unless unbanned first. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights.

          Parameters

          • chatId: string | number

            Unique identifier for the target group or username of the target supergroup or channel (in the format @channelusername)

          • userId: number
          • OptionaluntilDate: 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

          • Optionalextra: Omit<{}, "chat_id" | "user_id" | "until_date">

          Returns Promise<true>

      since API 5.3. Use Telegram.banChatMember

    • get setStickerSetThumb(): (
          name: string,
          userId: number,
          thumbnail?: string | InputFile,
          format?: "video" | "static" | "animated",
      ) => Promise<true>

      Returns (
          name: string,
          userId: number,
          thumbnail?: string | InputFile,
          format?: "video" | "static" | "animated",
      ) => Promise<true>

        • (
              name: string,
              userId: number,
              thumbnail?: string | InputFile,
              format?: "video" | "static" | "animated",
          ): Promise<true>
        • Use this method to set the thumbnail of a regular or mask sticker set. The format of the thumbnail file must match the format of the stickers in the set.

          Parameters

          • name: string

            Sticker set name

          • userId: number

            User identifier of the sticker set owner

          • Optionalthumbnail: string | InputFile

            A .WEBP or .PNG image with the thumbnail, must be up to 128 kilobytes in size and have a width and height of exactly 100px, or a .TGS animation with a thumbnail up to 32 kilobytes in size (see animated sticker technical requirements), or a WEBM video with the thumbnail up to 32 kilobytes in size; see video sticker technical requirements. Pass a file_id as a String to send a file that already exists on the Telegram servers, pass a HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using Input helpers. Animated and video sticker set thumbnails can't be uploaded via HTTP URL. If omitted, then the thumbnail is dropped and the first sticker is used as the thumbnail.

          • format: "video" | "static" | "animated" = 'static'

            Format of the sticker set thumbnail; must be one of "static", "animated", or "video"

          Returns Promise<true>

      since API 6.8. Use Telegram.setStickerSetThumbnail

    Methods

    • Add a new sticker to a set created by the bot.

      Parameters

      • ownerId: number

        User identifier of sticker set owner

      • name: string

        Sticker set name

      • stickerData: ExtraAddStickerToSet

      Returns Promise<true>

    • Parameters

      • callbackQueryId: string
      • Optionaltext: string
      • Optionalextra: Omit<{}, "text" | "chat_id" | "callback_query_id">

      Returns Promise<true>

    • Parameters

      • callbackQueryId: string
      • url: string

      Returns Promise<true>

    • Send answers to an inline query. No more than 50 results per query are allowed.

      Parameters

      • inlineQueryId: string
      • results: readonly InlineQueryResult[]
      • Optionalextra: Omit<{}, "chat_id" | "inline_query_id" | "results">

      Returns Promise<true>

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

      Parameters

      • preCheckoutQueryId: string
      • ok: boolean

        Specify True if everything is alright (goods are available, etc.) and the bot is ready to proceed with the order. Use False if there are any problems.

      • OptionalerrorMessage: 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.

      Returns Promise<true>

    • If you sent an invoice requesting a shipping address and the parameter is_flexible was specified, the Bot API will send an Update with a shipping_query field to the bot. Reply to shipping queries.

      Parameters

      • shippingQueryId: string
      • ok: boolean

        Specify True if delivery to the specified address is possible and False if there are any problems (for example, if delivery to the specified address is not possible)

      • shippingOptions: readonly ShippingOption[] | undefined

        Required if ok is True. A JSON-serialized array of available shipping options.

      • errorMessage: string | undefined

        Required if ok is False. Error message in human readable form that explains why it is impossible to complete the order (e.g. "Sorry, delivery to your desired address is unavailable'). Telegram will display this message to the user.

      Returns Promise<true>

    • Use this method to set the result of an interaction with a Web App and send a corresponding message on behalf of the user to the chat from which the query originated. On success, a SentWebAppMessage object is returned.

      Parameters

      • webAppQueryId: string
      • result: InlineQueryResult

        A JSON-serialized object describing the message to be sent

      Returns Promise<SentWebAppMessage>

    • Approve a chat join request. The bot must be an administrator in the chat for this to work and must have the can_invite_users administrator right.

      Parameters

      • chatId: string | number

        Unique identifier for the target chat or username of the target channel (in the format @channelusername)

      • userId: number

        Unique identifier of the target user

      Returns Promise<true>

    • Use this method to approve a suggested post in a direct messages chat. The bot must have the 'can_post_messages' administrator right in the corresponding channel chat. Returns True on success.

      Parameters

      • chatId: number

        Unique identifier for the target direct messages chat

      • messageId: number

        Identifier of a suggested post message to approve

      • Optionalextra: Omit<{}, "chat_id">
        • sendDate

          Point in time (Unix timestamp) when the post is expected to be published; omit if the date has already been specified when the suggested post was created. If specified, then the date must be not more than 2678400 seconds (30 days) in the future

      Returns Promise<true>

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

      Parameters

      • chatId: string | number

        Unique identifier for the target group or username of the target supergroup or channel (in the format @channelusername)

      • userId: number
      • OptionaluntilDate: 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

      • Optionalextra: Omit<{}, "chat_id" | "user_id" | "until_date">

      Returns Promise<true>

    • Ban a channel chat in a supergroup or a channel. The owner of the chat will not be able to send messages and join live streams on behalf of the chat, unless it is unbanned first. The bot must be an administrator in the supergroup or channel for this to work and must have the appropriate administrator rights.

      Parameters

      • chatId: string | number

        Unique identifier for the target chat or username of the target channel (in the format @channelusername)

      • senderChatId: number

        Unique identifier of the target sender chat

      • Optionalextra: { caption?: string | FmtString<string> }

      Returns Promise<true>

    • Type Parameters

      • M extends keyof Telegram

      Parameters

      • method: M
      • payload: Opts<M>
      • __namedParameters: CallApiOptions = {}

      Returns Promise<ReturnType<Telegram[M]>>

    • Close the bot instance before moving it from one local server to another.

      Returns Promise<true>

    • Use this method to close an open topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights, unless it is the creator of the topic. Returns True on success.

      Parameters

      • chat_id: string | number
      • message_thread_id: number

        Unique identifier for the target message thread of the forum topic

      Returns Promise<true>

    • Use this method to close an open 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights. Returns True on success.

      Parameters

      • chat_id: string | number

        Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)

      Returns Promise<true>

    • Converts a given regular gift to Telegram Stars. Requires the can_convert_gifts_to_stars business bot right. Returns True on success.

      Parameters

      • businessConnectionId: string

        Unique identifier of the business connection

      • giftId: string

        Unique identifier of the regular gift that should be converted to Telegram Stars

      Returns Promise<true>

    • Send copy of existing message.

      Parameters

      • chatId: string | number

        Unique identifier for the target chat or username of the target channel (in the format @channelusername)

      • fromChatId: string | number

        Unique identifier for the chat where the original message was sent (or channel username in the format @channelusername)

      • messageId: number

        Message identifier in the chat specified in from_chat_id

      • Optionalextra: { caption?: string | FmtString<string> }

      Returns Promise<MessageId>

    • Use this method to copy messages of any kind. If some of the specified messages can't be found or copied, they are skipped. Service messages, giveaway messages, giveaway winners messages, and invoice messages can't be copied. A quiz poll can be copied only if the value of the field correct_option_id is known to the bot. The method is analogous to the method forwardMessages, but the copied messages don't have a link to the original message. Album grouping is kept for copied messages.

      Parameters

      • chatId: string | number

        Unique identifier for the target chat or username of the target channel (in the format @channelusername)

      • fromChatId: string | number

        Unique identifier for the chat where the original messages were sent (or channel username in the format @channelusername)

      • messageIds: number[]

        Identifiers of 1-100 messages in the chat from_chat_id to copy. The identifiers must be specified in a strictly increasing order.

      • Optionalextra: Omit<{}, "chat_id" | "from_chat_id" | "message_ids">

      Returns Promise<MessageId[]>

    • Parameters

      • chatId: string | number
      • Optionalextra: Omit<{}, "chat_id">

      Returns Promise<ChatInviteLink>

    • Use this method to create a subscription invite link for a channel chat. The bot must have the can_invite_users administrator rights. The link can be edited using the method editChatSubscriptionInviteLink or revoked using the method revokeChatInviteLink. Returns the new invite link as a ChatInviteLink object.

      Parameters

      • chatId: string | number

        Unique identifier for the target channel chat or username of the target channel (in the format @channelusername)

      • subscriptionPrice: number

        The amount of Telegram Stars a user must pay initially and after each subsequent subscription period to be a member of the chat; 1-10000

      • Optionalextra: Omit<{}, "chat_id" | "subscription_period" | "subscription_price">
        • name

          Invite link name; 0-32 characters

      Returns Promise<ChatInviteLink>

    • Use this method to create a topic in a forum supergroup chat or a private chat with a user. In the case of a supergroup chat the bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator right. Returns information about the created topic as a ForumTopic object.

      Parameters

      • chat_id: string | number
      • name: string

        Topic name, 1-128 characters

      • Optionalextra: Omit<{}, "chat_id" | "name">
        • icon_color

          Color of the topic icon in RGB format. Currently, must be one of 7322096 (0x6FB9F0), 16766590 (0xFFD67E), 13338331 (0xCB86DB), 9367192 (0x8EEE98), 16749490 (0xFF93B2), or 16478047 (0xFB6F5F)

        • icon_custom_emoji_id

          Unique identifier of the custom emoji shown as the topic icon. Use getForumTopicIconStickers to get all allowed custom emoji identifiers.

      Returns Promise<ForumTopic>

    • Create new sticker set owned by a user. The bot will be able to edit the created sticker set.

      Parameters

      • ownerId: number

        User identifier of created sticker set owner

      • name: string

        Short name of sticker set, to be used in t.me/addstickers/ URLs (e.g., animals). Can contain only english letters, digits and underscores. Must begin with a letter, can't contain consecutive underscores and must end in “by”. <bot_username> is case insensitive. 1-64 characters.

      • title: string

        Sticker set title, 1-64 characters

      • stickerData: ExtraCreateNewStickerSet

      Returns Promise<true>

    • Decline a chat join request. The bot must be an administrator in the chat for this to work and must have the can_invite_users administrator right.

      Parameters

      • chatId: string | number

        Unique identifier for the target chat or username of the target channel (in the format @channelusername)

      • userId: number

        Unique identifier of the target user

      Returns Promise<true>

    • Use this method to decline a suggested post in a direct messages chat. The bot must have the 'can_manage_direct_messages' administrator right in the corresponding channel chat. Returns True on success.

      Parameters

      • chatId: number

        Unique identifier for the target direct messages chat

      • messageId: number

        Identifier of a suggested post message to approve

      • Optionalextra: Omit<{}, "chat_id">
        • comment

          Comment for the creator of the suggested post; 0-128 characters

      Returns Promise<true>

    • Delete messages on behalf of a business account. Requires the can_delete_sent_messages business bot right to delete messages sent by the bot itself, or the can_delete_all_messages business bot right to delete any message. Returns True on success.

      Parameters

      • businessConnectionId: string

        Unique identifier of the business connection on behalf of which to read the message

      • messageIds: number[]

        A JSON-serialized list of 1-100 identifiers of messages to delete. All messages must be from the same chat. See deleteMessage for limitations on which messages can be deleted

      Returns Promise<true>

    • Parameters

      • chatId: string | number

      Returns Promise<true>

    • Parameters

      • chatId: string | number

      Returns Promise<true>

    • Use this method to delete a forum topic along with all its messages in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_delete_messages administrator rights. Returns True on success.

      Parameters

      • chat_id: string | number
      • message_thread_id: number

        Unique identifier for the target message thread of the forum topic

      Returns Promise<true>

    • Delete a message, including service messages, with the following limitations:

      • A message can only be deleted if it was sent less than 48 hours ago.
      • Bots can delete outgoing messages in groups and supergroups.
      • Bots granted can_post_messages permissions can delete outgoing messages in channels.
      • If the bot is an administrator of a group, it can delete any message there.
      • If the bot has can_delete_messages permission in a supergroup or a channel, it can delete any message there.

      Parameters

      • chatId: string | number

        Unique identifier for the target chat or username of the target channel (in the format @channelusername)

      • messageId: number

        Identifier of the message to delete

      Returns Promise<true>

    • Use this method to delete multiple messages simultaneously. If some of the specified messages can't be found, they are skipped.

      Parameters

      • chatId: string | number

        Unique identifier for the target chat or username of the target channel (in the format @channelusername)

      • messageIds: number[]

        Identifiers of 1-100 messages to delete. See deleteMessage for limitations on which messages can be deleted

      Returns Promise<true>

    • Parameters

      • extra: {} = {}

      Returns Promise<true>

    • Delete a sticker from a set created by the bot.

      Parameters

      • sticker: string

        File identifier of the sticker

      Returns Promise<true>

    • Parameters

      • name: string

      Returns Promise<true>

    • Deletes a story previously posted by the bot on behalf of a managed business account. Requires the can_manage_stories business bot right. Returns True on success.

      Parameters

      • businessConnectionId: string

        Unique identifier of the business connection

      • storyId: number

        Unique identifier of the story to delete

      Returns Promise<true>

    • Remove webhook integration.

      Parameters

      • Optionalextra: { drop_pending_updates?: boolean }

      Returns Promise<true>

    • Parameters

      • chatId: string | number
      • inviteLink: string
      • Optionalextra: Omit<{}, "chat_id" | "invite_link">

      Returns Promise<ChatInviteLink>

    • Use this method to edit a subscription invite link created by the bot. The bot must have the can_invite_users administrator rights. Returns the edited invite link as a ChatInviteLink object.

      Parameters

      • chatId: string | number

        Unique identifier for the target chat or username of the target channel (in the format @channelusername)

      • inviteLink: string

        The invite link to edit

      • Optionalextra: Omit<{}, "chat_id" | "invite_link">
        • name

          Invite link name; 0-32 characters

      Returns Promise<ChatInviteLink>

    • Use this method to edit name and icon of a topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have can_manage_topics administrator rights, unless it is the creator of the topic. Returns True on success.

      Parameters

      • chat_id: string | number
      • message_thread_id: number

        Unique identifier for the target message thread of the forum topic

      • extra: ExtraEditForumTopic

      Returns Promise<true>

    • Use this method to edit the name of the 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have can_manage_topics administrator rights. Returns True on success.

      Parameters

      • chat_id: string | number

        Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)

      • name: string

        New topic name, 1-128 characters

      Returns Promise<true>

    • Edit captions of messages sent by the bot or via the bot (for inline bots). On success, if edited message is sent by the bot, the edited Message is returned, otherwise True is returned.

      Parameters

      • chatId: string | number | undefined

        Required if inlineMessageId is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername)

      • messageId: number | undefined

        Required if inlineMessageId is not specified. Identifier of the sent message

      • inlineMessageId: string | undefined

        Required if chatId and messageId are not specified. Identifier of the inline message

      • caption: string | FmtString<string> | undefined

        New caption of the message

      • Optionalextra: Omit<{}, "caption" | "chat_id" | "message_id" | "inline_message_id">

      Returns Promise<true | Edited & CaptionableMessage & BusinessSentMessage>

    • Use this method to edit a checklist on behalf of a connected business account. On success, the edited Message is returned.

      Parameters

      • businessConnectionId: string

        Unique identifier of the business connection on behalf of which the message will be sent

      • chatId: number

        Unique identifier for the target chat

      • messageId: number

        Unique identifier for the target message

      • checklist: InputChecklist

        A JSON-serialized object for the checklist to send

      • Optionalextra: Omit<{}, "chat_id" | "business_connection_id" | "message_id" | "checklist">
        • reply_markup

          A JSON-serialized object for the new inline keyboard for the message

      Returns Promise<ChecklistMessage & BusinessSentMessage>

    • Parameters

      • chatId: string | number | undefined
      • messageId: number | undefined
      • inlineMessageId: string | undefined
      • latitude: number
      • longitude: number
      • Optionalextra: Omit<
            {},
            "chat_id"
            | "message_id"
            | "inline_message_id"
            | "latitude"
            | "longitude",
        >

      Returns Promise<true | Edited & LocationMessage & BusinessSentMessage>

    • Edit animation, audio, document, photo, or video messages. If a message is a part of a message album, then it can be edited only to a photo or a video. Otherwise, message type can be changed arbitrarily. When inline message is edited, new file can't be uploaded. Use previously uploaded file via its file_id or specify a URL.

      Parameters

      • chatId: string | number | undefined

        Required if inlineMessageId is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername)

      • messageId: number | undefined

        Required if inlineMessageId is not specified. Identifier of the sent message

      • inlineMessageId: string | undefined

        Required if chatId and messageId are not specified. Identifier of the inline message

      • media:
            | { caption?: string
            | FmtString<string> }
            | { caption?: string | FmtString<string> }
            | { caption?: string | FmtString<string> }
            | { caption?: string | FmtString<string> }
            | { caption?: string | FmtString<string> }

        New media of message

      • Optionalextra: Omit<{}, "chat_id" | "message_id" | "inline_message_id" | "media">

        Additional parameters, such as reply_markup

      Returns Promise<true | (Edited & (Message & BusinessSentMessage))>

    • Edit only the reply markup of messages sent by the bot or via the bot (for inline bots).

      Parameters

      • chatId: string | number | undefined

        Required if inlineMessageId is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername)

      • messageId: number | undefined

        Required if inlineMessageId is not specified. Identifier of the sent message

      • inlineMessageId: string | undefined

        Required if chatId and messageId are not specified. Identifier of the inline message

      • markup: InlineKeyboardMarkup | undefined

        A JSON-serialized object for an inline keyboard.

      Returns Promise<true | (Edited & (Message & BusinessSentMessage))>

      If edited message is sent by the bot, the edited Message is returned, otherwise True is returned.

    • Edit text and game messages sent by the bot or via the bot (for inline bots). On success, if edited message is sent by the bot, the edited Message is returned, otherwise True is returned.

      Parameters

      • chatId: string | number | undefined

        Required if inlineMessageId is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername)

      • messageId: number | undefined

        Required if inlineMessageId is not specified. Identifier of the sent message

      • inlineMessageId: string | undefined

        Required if chatId and messageId are not specified. Identifier of the inline message

      • text: string | FmtString<string>

        New text of the message

      • Optionalextra: Omit<{}, "text" | "chat_id" | "message_id" | "inline_message_id">

      Returns Promise<true | Edited & TextMessage & BusinessSentMessage>

    • Edits a story previously posted by the bot on behalf of a managed business account. Requires the can_manage_stories business bot right. Returns Story on success.

      Parameters

      • businessConnectionId: string

        Unique identifier of the business connection

      • storyId: number

        Unique identifier of the story to edit

      • content: InputStoryContent

        Content of the story

      • Optionalextra: { caption?: string | FmtString<string> }
        • Optionalcaption?: string | FmtString<string>

          Caption of the story, 0-2048 characters after entities parsing

      Returns Promise<Story>

    • Allows the bot to cancel or re-enable extension of a subscription paid in Telegram Stars. Returns True on success.

      Parameters

      • userId: number

        Identifier of the user whose subscription will be edited

      • paymentChargeId: string

        Telegram payment identifier for the subscription

      • isCanceled: boolean

        Pass True to cancel extension of the user subscription; the subscription must be active up to the end of the current subscription period. Pass False to allow the user to re-enable a subscription that was previously canceled by the bot.

      Returns Promise<true>

    • Export an invite link to a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights.

      Parameters

      • chatId: string | number

        Unique identifier for the target chat or username of the target channel (in the format @channelusername)

      Returns Promise<string>

    • Forward existing message.

      Parameters

      • chatId: string | number

        Unique identifier for the target chat or username of the target channel (in the format @channelusername)

      • fromChatId: string | number

        Unique identifier for the chat where the original message was sent (or channel username in the format @channelusername)

      • messageId: number

        Message identifier in the chat specified in from_chat_id

      • Optionalextra: Omit<{}, "chat_id" | "from_chat_id" | "message_id">

      Returns Promise<Message & BusinessSentMessage>

    • Use this method to forward multiple messages of any kind. If some of the specified messages can't be found or forwarded, they are skipped. Service messages and messages with protected content can't be forwarded. Album grouping is kept for forwarded messages.

      Parameters

      • chatId: string | number

        Unique identifier for the target chat or username of the target channel (in the format @channelusername)

      • fromChatId: string | number

        Unique identifier for the chat where the original messages were sent (or channel username in the format @channelusername)

      • messageIds: number[]

        Identifiers of 1-100 messages in the chat from_chat_id to forward. The identifiers must be specified in a strictly increasing order.

      • Optionalextra: Omit<{}, "chat_id" | "from_chat_id" | "message_ids">

      Returns Promise<MessageId[]>

    • Returns the list of gifts that can be sent by the bot to users and channel chats. Requires no parameters. Returns a Gifts object.

      Returns Promise<Gifts>

    • Returns the gifts received and owned by a managed business account. Requires the can_view_gifts_and_stars business bot right. Returns OwnedGifts on success.

      Parameters

      • businessConnectionId: string

        Unique identifier of the business connection

      • Optionalextra: Omit<{}, "chat_id" | "business_connection_id">
        • exclude_unsaved

          Pass True to exclude gifts that aren't saved to the account's profile page

        • exclude_saved

          Pass True to exclude gifts that are saved to the account's profile page

        • exclude_unlimited

          Pass True to exclude gifts that can be purchased an unlimited number of times

        • exclude_limited_upgradable

          Pass True to exclude gifts that can be purchased a limited number of times and can be upgraded to unique

        • exclude_limited_non_upgradable

          Pass True to exclude gifts that can be purchased a limited number of times and can't be upgraded to unique

        • exclude_unique

          Pass True to exclude unique gifts

        • exclude_from_blockchain

          Pass True to exclude gifts that were assigned from the TON blockchain and can't be resold or transferred in Telegram

        • sort_by_price

          Pass True to sort results by gift price instead of send date. Sorting is applied before pagination.

        • offset

          Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results

        • limit

          The maximum number of gifts to be returned; 1-100. Defaults to 100

      Returns Promise<OwnedGifts>

    • Returns the amount of Telegram Stars owned by a managed business account. Requires the can_view_gifts_and_stars business bot right. Returns StarAmount on success.

      Parameters

      • businessConnectionId: string

        Unique identifier of the business connection

      Returns Promise<StarAmount>

    • Get up to date information about the chat (current name of the user for one-on-one conversations, current username of a user, group or channel, etc.).

      Parameters

      • chatId: string | number

        Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername)

      Returns Promise<ChatFullInfo>

    • Parameters

      • chatId: string | number

        Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername)

      Returns Promise<(ChatMemberOwner | ChatMemberAdministrator)[]>

    • Returns the gifts owned by a chat. Returns OwnedGifts on success.

      Parameters

      • chatId: string | number

        Unique identifier for the target chat or username of the target channel (in the format @channelusername)

      • Optionalextra: Omit<{}, "chat_id">
        • exclude_unsaved

          Pass True to exclude gifts that aren't saved to the account's profile page

        • exclude_saved

          Pass True to exclude gifts that are saved to the account's profile page

        • exclude_unlimited

          Pass True to exclude gifts that can be purchased an unlimited number of times

        • exclude_limited_upgradable

          Pass True to exclude gifts that can be purchased a limited number of times and can be upgraded to unique

        • exclude_limited_non_upgradable

          Pass True to exclude gifts that can be purchased a limited number of times and can't be upgraded to unique

        • exclude_from_blockchain

          Pass True to exclude gifts that were assigned from the TON blockchain and can't be resold or transferred in Telegram

        • exclude_unique

          Pass True to exclude unique gifts

        • sort_by_price

          Pass True to sort results by gift price instead of send date. Sorting is applied before pagination.

        • offset

          Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results

        • limit

          The maximum number of gifts to be returned; 1-100. Defaults to 100

      Returns Promise<OwnedGifts>

    • Get information about a member of a chat.

      Parameters

      • chatId: string | number

        Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername)

      • userId: number

        Unique identifier of the target user

      Returns Promise<ChatMember>

    • Get the number of members in a chat.

      Parameters

      • chatId: string | number

        Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername)

      Returns Promise<number>

    • Use this method to get the current value of the bot's menu button in a private chat, or the default menu button. Returns MenuButton on success.

      Parameters

      • chatId: { chatId?: number } = {}

        Unique identifier for the target private chat. If not specified, default bot's menu button will be returned.

      Returns Promise<MenuButton>

    • Parameters

      • custom_emoji_ids: string[]

      Returns Promise<Sticker[]>

    • Get basic info about a file and prepare it for downloading.

      Parameters

      • fileId: string

        Id of file to get link to

      Returns Promise<File>

    • Get download link to a file.

      Parameters

      • fileId: string | File

      Returns Promise<URL>

    • Parameters

      • userId: number
      • inlineMessageId: string | undefined
      • chatId: number | undefined
      • messageId: number | undefined

      Returns Promise<GameHighScore[]>

    • Get basic information about the bot

      Returns Promise<UserFromGetMe>

    • Get the current list of the bot's commands.

      Parameters

      • extra: {} = {}

      Returns Promise<BotCommand[]>

    • Use this method to get the current default administrator rights of the bot. Returns ChatAdministratorRights on success.

      Parameters

      • forChannels: { forChannels?: boolean } = {}

        Pass true to get default administrator rights of the bot in channels. Otherwise, default administrator rights of the bot for groups and supergroups will be returned.

      Returns Promise<ChatAdministratorRights>

    • Use this method to get the current bot description for the given user language.

      Parameters

      • Optionallanguage_code: string

        A two-letter ISO 639-1 language code.

      Returns Promise<BotDescription>

    • Use this method to get the current bot name for the given user language.

      Parameters

      • Optionallanguage_code: string

        A two-letter ISO 639-1 language code or an empty string

      Returns Promise<BotName>

    • Use this method to get the current bot short description for the given user language.

      Parameters

      • Optionallanguage_code: string

        A two-letter ISO 639-1 language code or an empty string

      Returns Promise<BotShortDescription>

    • Returns the bot's Telegram Star transactions in chronological order. On success, returns a StarTransactions object.

      Parameters

      • Optionaloffset: number

        Number of transactions to skip in the response

      • Optionallimit: number

        The maximum number of transactions to be retrieved. Values between 1-100 are accepted. Defaults to 100

      Returns Promise<StarTransactions>

    • Parameters

      • name: string

      Returns Promise<StickerSet>

    • Directly request incoming updates. You should probably use Telegraf::launch instead.

      Parameters

      • timeout: number
      • limit: number
      • offset: number
      • allowedUpdates: readonly UpdateType[] | undefined

      Returns Promise<Update[]>

    • Use this method to get the list of boosts added to a chat by a user. Requires administrator rights in the chat. Returns a UserChatBoosts object.

      Parameters

      • chat_id: string | number

        Unique identifier for the chat or username of the channel (in the format @channelusername)

      • user_id: number

        Unique identifier of the target user

      Returns Promise<UserChatBoosts>

    • Returns the gifts owned and hosted by a user. Returns OwnedGifts on success.

      Parameters

      • userId: number

        Unique identifier of the user

      • Optionalextra: Omit<{}, "chat_id" | "user_id">
        • exclude_unlimited

          Pass True to exclude gifts that can be purchased an unlimited number of times

        • exclude_limited_upgradable

          Pass True to exclude gifts that can be purchased a limited number of times and can be upgraded to unique

        • exclude_limited_non_upgradable

          Pass True to exclude gifts that can be purchased a limited number of times and can't be upgraded to unique

        • exclude_from_blockchain

          Pass True to exclude gifts that were assigned from the TON blockchain and can't be resold or transferred in Telegram

        • exclude_unique

          Pass True to exclude unique gifts

        • sort_by_price

          Pass True to sort results by gift price instead of send date. Sorting is applied before pagination.

        • offset

          Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results

        • limit

          The maximum number of gifts to be returned; 1-100. Defaults to 100

      Returns Promise<OwnedGifts>

    • Use this method to get a list of profile audios for a user. Returns a UserProfileAudios object.

      Parameters

      • userId: number

        Unique identifier of the target user

      • Optionalextra: Omit<{}, "chat_id" | "user_id">
        • offset

          Sequential number of the first audio to be returned. By default, all audios are returned.

        • limit

          Limits the number of audios to be retrieved. Values between 1-100 are accepted. Defaults to 100.

      Returns Promise<UserProfileAudios>

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

      Parameters

      • userId: number

        Unique identifier of the target user

      • Optionaloffset: number

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

      • Optionallimit: number

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

      Returns Promise<UserProfilePhotos>

    • Returns Promise<WebhookInfo>

    • Gifts a Telegram Premium subscription to the given user. Returns True on success.

      Parameters

      • userId: number

        Unique identifier of the target user who will receive a Telegram Premium subscription

      • starCount: 1000 | 1500 | 2500

        Number of months the Telegram Premium subscription will be active for the user; must be one of 3, 6, or 12

      • monthCount: 3 | 6 | 12

        Number of Telegram Stars to pay for the Telegram Premium subscription; must be 1000 for 3 months, 1500 for 6 months, and 2500 for 12 months

      • Optionalextra: Omit<{}, "chat_id" | "user_id" | "star_count" | "month_count">
        • text

          Text that will be shown along with the service message about the subscription; 0-128 characters

        • text_parse_mode

          Mode for parsing entities in the text. See formatting options for more details. Entities other than “bold”, “italic”, “underline”, “strikethrough”, “spoiler”, and “custom_emoji” are ignored.

        • text_entities

          A JSON-serialized list of special entities that appear in the gift text. It can be specified instead of text_parse_mode. Entities other than “bold”, “italic”, “underline”, “strikethrough”, “spoiler”, and “custom_emoji” are ignored.

      Returns Promise<true>

    • Use this method to hide the 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights. The topic will be automatically closed if it was open. Returns True on success.

      Parameters

      • chat_id: string | number

        Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)

      Returns Promise<true>

    • Use this method for your bot to leave a group, supergroup or channel.

      Parameters

      • chatId: string | number

        Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername)

      Returns Promise<true>

    • Log out from the cloud Bot API server before launching the bot locally.

      Returns Promise<true>

    • Pin a message in a group, a supergroup, or a channel. The bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' admin right in the supergroup or 'can_edit_messages' admin right in the channel.

      Parameters

      • chatId: string | number

        Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)

      • messageId: number
      • Optionalextra: { disable_notification?: boolean }

      Returns Promise<true>

    • Posts a story on behalf of a managed business account. Requires the can_manage_stories business bot right. Returns Story on success.

      Parameters

      • businessConnectionId: string

        Unique identifier of the business connection

      • content: InputStoryContent

        Content of the story

      • activePeriod: 21600 | 43200 | 86400 | 172800

        Period after which the story is moved to the archive, in seconds; must be one of 6 * 3600, 12 * 3600, 86400, or 2 * 86400

      • Optionalextra: { caption?: string | FmtString<string> }
        • Optionalcaption?: string | FmtString<string>

          Caption of the story, 0-2048 characters after entities parsing

      Returns Promise<Story>

    • Promote or demote a user in a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Pass False for all boolean parameters to demote a user.

      Parameters

      • chatId: string | number

        Unique identifier for the target chat or username of the target channel (in the format @channelusername)

      • userId: number
      • extra: ExtraPromoteChatMember

      Returns Promise<true>

    • Marks incoming message as read on behalf of a business account. Requires the can_read_messages business bot right. Returns True on success.

      Parameters

      • businessConnectionId: string

        Unique identifier of the business connection on behalf of which to read the message

      • chatId: number

        Unique identifier of the chat in which the message was received. The chat must have been active in the last 24 hours.

      • messageId: number

        Unique identifier of the message to mark as read

      Returns Promise<true>

    • Refunds a successful payment in Telegram Stars. Returns True on success.

      Parameters

      • userId: number

        Identifier of the user whose payment will be refunded

      • paymentChargeId: string

        Telegram payment identifier

      Returns Promise<true>

    • Removes the current profile photo of a managed business account. Requires the can_edit_profile_photo business bot right. Returns True on success.

      Parameters

      • businessConnectionId: string

        Unique identifier of the business connection

      • OptionalisPublic: boolean

        Pass True to remove the public photo, which is visible even if the main photo is hidden by the business account's privacy settings. After the main photo is removed, the previous profile photo (if present) becomes the main photo.

      Returns Promise<true>

    • Removes verification from a chat that is currently verified on behalf of the organization represented by the bot. Returns True on success.

      Parameters

      • chatId: string | number

        Unique identifier for the target chat or username of the target channel (in the format @channelusername). Channel direct messages chats can't be verified.

      Returns Promise<true>

    • Removes verification from a user who is currently verified on behalf of the organization represented by the bot. Returns True on success.

      Parameters

      • userId: number

        Unique identifier of the target user

      Returns Promise<true>

    • Use this method to reopen a closed topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights, unless it is the creator of the topic. Returns True on success.

      Parameters

      • chat_id: string | number
      • message_thread_id: number

        Unique identifier for the target message thread of the forum topic

      Returns Promise<true>

    • Use this method to reopen a closed 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights. The topic will be automatically unhidden if it was hidden. Returns True on success.

      Parameters

      • chat_id: string | number

        Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)

      Returns Promise<true>

    • Reposts a story on behalf of a business account from another business account. Both business accounts must be managed by the same bot, and the story on the source account must have been posted (or reposted) by the bot. Requires the can_manage_stories business bot right for both business accounts. Returns Story on success.

      Parameters

      • businessConnectionId: string

        Unique identifier of the business connection

      • fromChatId: number

        Unique identifier of the chat which posted the story that should be reposted

      • fromStoryId: number

        Unique identifier of the story that should be reposted

      • activePeriod: 21600 | 43200 | 86400 | 172800

        Period after which the story is moved to the archive, in seconds; must be one of 6 * 3600, 12 * 3600, 86400, or 2 * 86400

      • Optionalextra: Omit<
            {},
            | "chat_id"
            | "business_connection_id"
            | "from_chat_id"
            | "active_period"
            | "from_story_id",
        >
        • post_to_chat_page

          Pass True to keep the story accessible after it expires

        • protect_content

          Pass True if the content of the story must be protected from forwarding and screenshotting

      Returns Promise<Story>

    • Restrict a user in a supergroup. The bot must be an administrator in the supergroup for this to work and must have the appropriate admin rights. Pass True for all boolean parameters to lift restrictions from a user.

      Parameters

      • chatId: string | number

        Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)

      • userId: number
      • extra: ExtraRestrictChatMember

      Returns Promise<true>

    • Parameters

      • chatId: string | number
      • inviteLink: string

      Returns Promise<ChatInviteLink>

    • Stores a message that can be sent by a user of a Mini App. Returns a PreparedInlineMessage object.

      Parameters

      • userId: number

        Unique identifier of the target user that can use the prepared message

      • result: InlineQueryResult

        A JSON-serialized object describing the message to be sent

      • Optionalextra: Omit<{}, "chat_id" | "user_id" | "result">
        • allow_user_chats

          Pass True if the message can be sent to private chats with users

        • allow_bot_chats

          Pass True if the message can be sent to private chats with bots

        • allow_group_chats

          Pass True if the message can be sent to group and supergroup chats

        • allow_channel_chats

          Pass True if the message can be sent to channel chats

      Returns Promise<PreparedInlineMessage>

    • Send .gif animations.

      Parameters

      • chatId: string | number

        Unique identifier for the target chat or username of the target channel (in the format @channelusername)

      • animation: string | InputFile
      • Optionalextra: { caption?: string | FmtString<string> }

      Returns Promise<AnimationMessage & BusinessSentMessage>

    • Send audio files, if you want Telegram clients to display them in the music player. Your audio must be in the .mp3 format. Bots can currently send audio files of up to 50 MB in size, this limit may be changed in the future.

      Parameters

      • chatId: string | number

        Unique identifier for the target chat or username of the target channel (in the format @channelusername)

      • audio: string | InputFile
      • Optionalextra: { caption?: string | FmtString<string> }

      Returns Promise<AudioMessage & BusinessSentMessage>

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

      Parameters

      • chat_id: string | number
      • action:
            | "typing"
            | "upload_photo"
            | "record_video"
            | "upload_video"
            | "record_voice"
            | "upload_voice"
            | "upload_document"
            | "choose_sticker"
            | "find_location"
            | "record_video_note"
            | "upload_video_note"
      • Optionalextra: Omit<{}, "action" | "chat_id">

      Returns Promise<true>

    • Use this method to send a checklist on behalf of a connected business account. On success, the sent Message is returned.

      Parameters

      • businessConnectionId: string

        Unique identifier of the business connection on behalf of which the message will be sent

      • chatId: number

        Unique identifier for the target chat

      • checklist: InputChecklist

        A JSON-serialized object for the checklist to send

      • Optionalextra: Omit<{}, "chat_id" | "checklist">
        • disable_notification

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

        • protect_content

          Protects the contents of the sent message from forwarding and saving

        • message_effect_id

          Unique identifier of the message effect to be added to the message

        • reply_parameters

          A JSON-serialized object for description of the message to reply to

        • reply_markup

          A JSON-serialized object for an inline keyboard

      Returns Promise<ChecklistMessage & BusinessSentMessage>

    • Parameters

      • chatId: string | number
      • phoneNumber: string
      • firstName: string
      • Optionalextra: Omit<{}, "phone_number" | "chat_id" | "first_name">

      Returns Promise<ContactMessage & BusinessSentMessage>

    • Send copy of existing message.

      Parameters

      • chatId: string | number

        Unique identifier for the target chat or username of the target channel (in the format @channelusername)

      • message: Message

        Received message object

      • Optionalextra: { caption?: string | FmtString<string> }

      Returns Promise<MessageId>

      use copyMessage instead

    • Send a dice, which will have a random value from 1 to 6.

      Parameters

      • chatId: string | number

        Unique identifier for the target chat or username of the target channel (in the format @channelusername)

      • Optionalextra: Omit<{}, "chat_id">

      Returns Promise<DiceMessage & BusinessSentMessage>

    • Send general files. Bots can currently send files of any type of up to 50 MB in size, this limit may be changed in the future.

      Parameters

      • chatId: string | number

        Unique identifier for the target chat or username of the target channel (in the format @channelusername)

      • document: string | InputFile
      • Optionalextra: { caption?: string | FmtString<string> }

      Returns Promise<DocumentMessage & BusinessSentMessage>

    • Parameters

      • chatId: number

        Unique identifier for the target chat

      • gameName: string
      • Optionalextra: Omit<{}, "chat_id" | "game_short_name">

      Returns Promise<GameMessage & BusinessSentMessage>

    • Sends a gift to the given user or channel chat. The gift can't be converted to Telegram Stars by the receiver. Returns True on success.

      Parameters

      • giftId: string

        Identifier of the gift; limited gifts can't be sent to channel chats

      • Optionalextra: Omit<{}, "chat_id" | "gift_id">
        • user_id

          Required if user_id is not specified. Unique identifier for the chat or username of the channel (in the format @channelusername) that will receive the gift.

        • chat_id

          Required if user_id is not specified. Unique identifier for the chat or username of the channel (in the format @channelusername) that will receive the gift.

        • pay_for_upgrade

          Pass True to pay for the gift upgrade from the bot's balance, thereby making the upgrade free for the receiver

        • text

          Text that will be shown along with the gift; 0-128 characters

        • text_parse_mode

          Mode for parsing entities in the text. See formatting options for more details. Entities other than “bold”, “italic”, “underline”, “strikethrough”, “spoiler”, and “custom_emoji” are ignored.

        • text_entities

          A JSON-serialized list of special entities that appear in the gift text. It can be specified instead of text_parse_mode. Entities other than “bold”, “italic”, “underline”, “strikethrough”, “spoiler”, and “custom_emoji” are ignored.

      Returns Promise<true>

    • Parameters

      • chatId: string | number

        Unique identifier for the target private chat

      • invoice: NewInvoiceParameters
      • Optionalextra: Omit<
            {},
            | "chat_id"
            | "direct_messages_topic_id"
            | "protect_content"
            | "allow_paid_broadcast"
            | "message_effect_id"
            | "suggested_post_parameters"
            | "title"
            | "description"
            | "payload"
            | "provider_token"
            | "currency"
            | "prices"
            | "max_tip_amount"
            | "suggested_tip_amounts"
            | "provider_data"
            | "photo_url"
            | "photo_size"
            | "photo_width"
            | "photo_height"
            | "need_name"
            | "need_phone_number"
            | "need_email"
            | "need_shipping_address"
            | "send_phone_number_to_provider"
            | "send_email_to_provider"
            | "is_flexible"
            | "start_parameter",
        >

      Returns Promise<InvoiceMessage & BusinessSentMessage>

    • Send point on the map.

      Parameters

      • chatId: string | number

        Unique identifier for the target chat or username of the target channel (in the format @channelusername)

      • latitude: number
      • longitude: number
      • Optionalextra: Omit<{}, "chat_id" | "latitude" | "longitude">

      Returns Promise<LocationMessage & BusinessSentMessage>

    • Send a group of photos or videos as an album.

      Parameters

      • chatId: string | number

        Unique identifier for the target chat or username of the target channel (in the format @channelusername)

      • media: MediaGroup

        A JSON-serialized array describing photos and videos to be sent, must include 2–10 items

      • Optionalextra: Omit<{}, "chat_id" | "media">

      Returns Promise<
          (
              (DocumentMessage | AudioMessage | PhotoMessage | VideoMessage) & BusinessSentMessage
          )[],
      >

    • Send a text message.

      Parameters

      • chatId: string | number

        Unique identifier for the target chat or username of the target channel (in the format @channelusername)

      • text: string | FmtString<string>

        Text of the message to be sent

      • Optionalextra: Omit<{}, "text" | "chat_id">

      Returns Promise<TextMessage & BusinessSentMessage>

    • Use this method to stream a partial message to a user while the message is being generated; supported only for bots with forum topic mode enabled. Returns True on success.

      Parameters

      • chatId: number

        Unique identifier for the target private chat

      • draftId: number

        Unique identifier of the message draft; must be non-zero. Changes of drafts with the same identifier are animated

      • text: string

        Text of the message to be sent, 1-4096 characters after entities parsing

      • Optionalextra: Omit<{}, "text" | "chat_id" | "draft_id">
        • message_thread_id

          Unique identifier for the target message thread

        • parse_mode

          Mode for parsing entities in the message text. See formatting options for more details.

        • entities

          A JSON-serialized list of special entities that appear in message text, which can be specified instead of parse_mode

      Returns Promise<true>

    • Use this method to send paid media. On success, the sent Message is returned.

      Parameters

      • chatId: string | number

        Unique identifier for the target chat or username of the target channel (in the format @channelusername)

      • starCount: number

        The number of Telegram Stars that must be paid to buy access to the media; 1-25000

      • media: PaidMediaGroup

        A JSON-serialized array describing the media to be sent; up to 10 items

      • Optionalextra: Omit<{}, "caption" | "chat_id" | "media" | "star_count">

      Returns Promise<PaidMediaMessage & BusinessSentMessage>

    • Parameters

      • chatId: string | number

        Unique identifier for the target chat or username of the target channel (in the format @channelusername)

      • photo: string | InputFile
      • Optionalextra: { caption?: string | FmtString<string> }

      Returns Promise<PhotoMessage & BusinessSentMessage>

    • Send a native poll.

      Parameters

      • chatId: string | number

        Unique identifier for the target chat or username of the target channel (in the format @channelusername)

      • question: string

        Poll question, 1-255 characters

      • options: readonly InputPollOption[]

        A JSON-serialized list of answer options, 2-10 strings 1-100 characters each

      • Optionalextra: Omit<{}, "type" | "chat_id" | "question" | "options">

      Returns Promise<PollMessage & BusinessSentMessage>

    • Send a native quiz.

      Parameters

      • chatId: string | number

        Unique identifier for the target chat or username of the target channel (in the format @channelusername)

      • question: string

        Poll question, 1-255 characters

      • options: readonly InputPollOption[]

        A JSON-serialized list of answer options, 2-10 strings 1-100 characters each

      • Optionalextra: Omit<{}, "type" | "chat_id" | "question" | "options">

      Returns Promise<PollMessage & BusinessSentMessage>

    • Send .webp, animated .tgs, or video .webm stickers

      Parameters

      • chatId: string | number

        Unique identifier for the target chat or username of the target channel (in the format @channelusername)

      • sticker: string | InputFile
      • Optionalextra: Omit<{}, "chat_id" | "sticker">

      Returns Promise<StickerMessage & BusinessSentMessage>

    • Parameters

      • chatId: string | number
      • latitude: number
      • longitude: number
      • title: string
      • address: string
      • Optionalextra: Omit<{}, "chat_id" | "title" | "latitude" | "longitude" | "address">

      Returns Promise<VenueMessage & BusinessSentMessage>

    • Send video files, Telegram clients support mp4 videos (other formats may be sent as Document). Bots can currently send video files of up to 50 MB in size, this limit may be changed in the future.

      Parameters

      • chatId: string | number

        Unique identifier for the target chat or username of the target channel (in the format @channelusername)

      • video: string | InputFile
      • Optionalextra: { caption?: string | FmtString<string> }

      Returns Promise<VideoMessage & BusinessSentMessage>

    • Send video messages.

      Parameters

      • chatId: string | number

        Unique identifier for the target chat or username of the target channel (in the format @channelusername)

      • videoNote: string | InputFileVideoNote
      • Optionalextra: Omit<{}, "chat_id" | "video_note">

      Returns Promise<VideoNoteMessage & BusinessSentMessage>

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

      Parameters

      • chatId: string | number

        Unique identifier for the target chat or username of the target channel (in the format @channelusername)

      • voice: string | InputFile
      • Optionalextra: { caption?: string | FmtString<string> }

      Returns Promise<VoiceMessage & BusinessSentMessage>

    • Changes the bio of a managed business account. Requires the can_change_bio business bot right. Returns True on success.

      Parameters

      • businessConnectionId: string

        Unique identifier of the business connection

      • Optionalbio: string

        The new value of the bio for the business account; 0-140 characters

      Returns Promise<true>

    • Changes the privacy settings pertaining to incoming gifts in a managed business account. Requires the can_change_gift_settings business bot right. Returns True on success.

      Parameters

      • businessConnectionId: string

        Unique identifier of the business connection

      • showGiftButton: boolean

        Pass True, if a button for sending a gift to the user or by the business account must always be shown in the input field

      • acceptedGiftTypes: AcceptedGiftTypes

        Types of gifts accepted by the business account

      Returns Promise<true>

    • Changes the first and last name of a managed business account. Requires the can_change_name business bot right. Returns True on success.

      Parameters

      • businessConnectionId: string

        Unique identifier of the business connection

      • firstName: string

        The new value of the first name for the business account; 1-64 characters

      • lastName: string

        The new value of the last name for the business account; 0-64 characters

      Returns Promise<true>

    • Changes the profile photo of a managed business account. Requires the can_edit_profile_photo business bot right. Returns True on success.

      Parameters

      • businessConnectionId: string

        Unique identifier of the business connection

      • photo: InputProfilePhoto

        The new profile photo to set

      • OptionalisPublic: boolean

        Pass True to set the public photo, which will be visible even if the main photo is hidden by the business account's privacy settings. An account can have only one public photo.

      Returns Promise<true>

    • Changes the username of a managed business account. Requires the can_change_username business bot right. Returns True on success.

      Parameters

      • businessConnectionId: string

        Unique identifier of the business connection

      • username: string

        The new value of the username for the business account; 0-32 characters

      Returns Promise<true>

    • Parameters

      • chatId: string | number
      • userId: number
      • title: string

      Returns Promise<true>

    • Parameters

      • chatId: string | number
      • Optionaldescription: string

      Returns Promise<true>

    • Use this method to change the bot's menu button in a private chat, or the default menu button. Returns true on success.

      Parameters

      • chatId: { chatId?: number; menuButton?: MenuButton } = {}

        Unique identifier for the target private chat. If not specified, default bot's menu button will be changed.

      Returns Promise<true>

    • Parameters

      • chatId: string | number
      • permissions: ChatPermissions
      • Optionalextra: Omit<{}, "chat_id" | "permissions">

      Returns Promise<true>

    • Parameters

      • chatId: string | number
      • photo: InputFile

      Returns Promise<true>

    • Parameters

      • chatId: string | number
      • setName: string

      Returns Promise<true>

    • Change the title of a chat. Titles can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights.

      Parameters

      • chatId: string | number

        Unique identifier for the target group or username of the target supergroup or channel (in the format @channelusername)

      • title: string

        New chat title, 1-255 characters

      Returns Promise<true>

    • Parameters

      • name: string
      • custom_emoji_id: string

      Returns Promise<true>

    • Parameters

      • userId: number
      • score: number
      • inlineMessageId: string | undefined
      • chatId: number | undefined
      • messageId: number | undefined
      • editMessage: boolean = true
      • force: boolean = false

      Returns Promise<true | Edited & GameMessage & BusinessSentMessage>

    • Use this method to change the chosen reactions on a message. Service messages can't be reacted to. Automatically forwarded messages from a channel to its discussion group have the same available reactions as messages in the channel. In albums, bots must react to the first message.

      Parameters

      • chat_id: string | number

        Unique identifier for the target chat or username of the target channel (in the format @channelusername)

      • message_id: number

        Identifier of the target message

      • Optionalreaction: ReactionType[]

        New list of reaction types to set on the message. Currently, as non-premium users, bots can set up to one reaction per message. A custom emoji reaction can be used if it is either already present on the message or explicitly allowed by chat administrators.

      • Optionalis_big: boolean

        Pass True to set the reaction with a big animation

      Returns Promise<true>

    • Change the list of the bot's commands.

      Parameters

      • commands: readonly BotCommand[]

        A list of bot commands to be set as the list of the bot's commands. At most 100 commands can be specified.

      • Optionalextra: Omit<{}, "chat_id" | "commands">

      Returns Promise<true>

    • Use this method to change the default administrator rights requested by the bot when it's added as an administrator to groups or channels. These rights will be suggested to users, but they are are free to modify the list before adding the bot.

      Parameters

      • __namedParameters: { forChannels?: boolean; rights?: ChatAdministratorRights } = {}

      Returns Promise<true>

    • Use this method to change the bot's description, which is shown in the chat with the bot if the chat is empty.

      Parameters

      • description: string

        New bot description; 0-512 characters. Pass an empty string to remove the dedicated description for the given language.

      • Optionallanguage_code: string

        A two-letter ISO 639-1 language code. If empty, the description will be applied to all users for whose language there is no dedicated description.

      Returns Promise<true>

    • Use this method to change the bot's name.

      Parameters

      • name: string

        New bot name; 0-64 characters. Pass an empty string to remove the dedicated name for the given language.

      • Optionallanguage_code: string

        A two-letter ISO 639-1 language code. If empty, the name will be shown to all users for whose language there is no dedicated name.

      Returns Promise<true>

    • Use this method to change the bot's short description, which is shown on the bot's profile page and is sent together with the link when users share the bot.

      Parameters

      • short_description: string
      • Optionallanguage_code: string

        A two-letter ISO 639-1 language code. If empty, the short description will be applied to all users for whose language there is no dedicated short description.

      Returns Promise<true>

    • Parameters

      • userId: number
      • errors: readonly PassportElementError[]

      Returns Promise<true>

    • Parameters

      • sticker: string
      • emoji_list: string[]

      Returns Promise<true>

    • Parameters

      • sticker: string
      • Optionalkeywords: string[]

      Returns Promise<true>

    • Parameters

      • sticker: string
      • Optionalmask_position: MaskPosition

      Returns Promise<true>

    • Move a sticker in a set created by the bot to a specific position.

      Parameters

      • sticker: string

        File identifier of the sticker

      • position: number

        New sticker position in the set, zero-based

      Returns Promise<true>

    • Use this method to set the thumbnail of a regular or mask sticker set. The format of the thumbnail file must match the format of the stickers in the set.

      Parameters

      • name: string

        Sticker set name

      • userId: number

        User identifier of the sticker set owner

      • Optionalthumbnail: string | InputFile

        A .WEBP or .PNG image with the thumbnail, must be up to 128 kilobytes in size and have a width and height of exactly 100px, or a .TGS animation with a thumbnail up to 32 kilobytes in size (see animated sticker technical requirements), or a WEBM video with the thumbnail up to 32 kilobytes in size; see video sticker technical requirements. Pass a file_id as a String to send a file that already exists on the Telegram servers, pass a HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using Input helpers. Animated and video sticker set thumbnails can't be uploaded via HTTP URL. If omitted, then the thumbnail is dropped and the first sticker is used as the thumbnail.

      • format: "video" | "static" | "animated" = 'static'

        Format of the sticker set thumbnail; must be one of "static", "animated", or "video"

      Returns Promise<true>

    • Parameters

      • name: string
      • title: string

      Returns Promise<true>

    • Changes the emoji status for a given user that previously allowed the bot to manage their emoji status via the Mini App method requestEmojiStatusAccess. Returns True on success.

      Parameters

      • userId: number

        Unique identifier of the target user

      • Optionalextra: Omit<{}, "chat_id" | "user_id">
        • statusCustomEmojiId

          Custom emoji identifier of the emoji status to set. Pass an empty string to remove the status.

        • statusExpirationDate

          Expiration date of the emoji status, if any

      Returns Promise<true>

    • Specify a url to receive incoming updates via an outgoing webhook.

      Parameters

      • url: string

        HTTPS url to send updates to. Use an empty string to remove webhook integration

      • Optionalextra: Omit<{}, "url" | "chat_id">

      Returns Promise<true>

    • Parameters

      • chatId: string | number | undefined
      • messageId: number | undefined
      • inlineMessageId: string | undefined
      • Optionalmarkup: InlineKeyboardMarkup

      Returns Promise<true | Edited & LocationMessage & BusinessSentMessage>

    • Parameters

      • chatId: string | number

        Unique identifier for the target chat or username of the target channel (in the format @channelusername)

      • messageId: number

        Identifier of the original message with the poll

      • Optionalextra: Omit<{}, "chat_id" | "message_id">

      Returns Promise<Poll>

    • Transfers Telegram Stars from the business account balance to the bot's balance. Requires the can_transfer_stars business bot right. Returns True on success.

      Parameters

      • businessConnectionId: string

        Unique identifier of the business connection

      • starCount: number

        Number of Telegram Stars to transfer; 1-10000

      Returns Promise<true>

    • Transfers an owned unique gift to another user. Requires the can_transfer_and_upgrade_gifts business bot right. Requires can_transfer_stars business bot right if the transfer is paid. Returns True on success.

      Parameters

      • businessConnectionId: string

        Unique identifier of the business connection

      • giftId: string

        Unique identifier of the regular gift that should be transferred

      • newOwnerChatid: number

        Unique identifier of the chat which will own the gift. The chat must be active in the last 24 hours.

      • Optionalextra: Omit<
            {},
            | "chat_id"
            | "business_connection_id"
            | "owned_gift_id"
            | "new_owner_chat_id",
        >
        • star_count

          The amount of Telegram Stars that will be paid for the transfer from the business account balance. If positive, then the can_transfer_stars business bot right is required.

      Returns Promise<true>

    • Unban a user from a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights.

      Parameters

      • chatId: string | number

        Unique identifier for the target group or username of the target supergroup or channel (in the format @username)

      • userId: number

        Unique identifier of the target user

      • Optionalextra: { only_if_banned?: boolean }

      Returns Promise<true>

    • Unban a previously banned channel chat in a supergroup or channel. The bot must be an administrator for this to work and must have the appropriate administrator rights.

      Parameters

      • chatId: string | number

        Unique identifier for the target chat or username of the target channel (in the format @channelusername)

      • senderChatId: number

        Unique identifier of the target sender chat

      Returns Promise<true>

    • Use this method to unhide the 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights. Returns True on success.

      Parameters

      • chat_id: string | number

        Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)

      Returns Promise<true>

    • Clear the list of pinned messages in a chat.

      Parameters

      • chatId: string | number

        Unique identifier for the target chat or username of the target channel (in the format @channelusername)

      Returns Promise<true>

    • Use this method to clear the list of pinned messages in a forum topic. The bot must be an administrator in the chat for this to work and must have the can_pin_messages administrator right in the supergroup. Returns True on success.

      Parameters

      • chat_id: string | number
      • message_thread_id: number

        Unique identifier for the target message thread of the forum topic

      Returns Promise<true>

    • Use this method to clear the list of pinned messages in a General forum topic. The bot must be an administrator in the chat for this to work and must have the can_pin_messages administrator right in the supergroup.

      Parameters

      • chat_id: string | number

        Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)

      Returns Promise<true>

    • Unpin a message in a group, a supergroup, or a channel. The bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' admin right in the supergroup or 'can_edit_messages' admin right in the channel.

      Parameters

      • chatId: string | number

        Unique identifier for the target chat or username of the target channel (in the format @channelusername)

      • OptionalmessageId: number

      Returns Promise<true>

    • Upgrades a given regular gift to a unique gift. Requires the can_transfer_and_upgrade_gifts business bot right. Additionally requires the can_transfer_stars business bot right if the upgrade is paid. Returns True on success.

      Parameters

      • businessConnectionId: string

        Unique identifier of the business connection

      • giftId: string

        Unique identifier of the regular gift that should be upgraded to a unique one

      • Optionalextra: Omit<{}, "chat_id" | "business_connection_id" | "owned_gift_id">
        • keep_original_details

          Pass True to keep the original gift text, sender and receiver in the upgraded gift

        • star_count

          amount of Telegram Stars that will be paid for the upgrade from the business account balance. If gift.prepaid_upgrade_star_count > 0, then pass 0, otherwise, the can_transfer_stars business bot right is required and gift.upgrade_star_count must be passed.

      Returns Promise<true>

    • Upload a .png file with a sticker for later use in createNewStickerSet and addStickerToSet methods (can be used multiple times). https://core.telegram.org/bots/api#sending-files

      Parameters

      • ownerId: number

        User identifier of sticker file owner

      • sticker: InputFile
      • sticker_format: "video" | "static" | "animated"

      Returns Promise<File>

    • Verifies a chat on behalf of the organization which is represented by the bot. Returns True on success.

      Parameters

      • chatId: string | number

        Unique identifier for the target chat or username of the target channel (in the format @channelusername). Channel direct messages chats can't be verified.

      • Optionalextra: Omit<{}, "chat_id">
        • custom_description

          Custom description for the verification; 0-70 characters. Must be empty if the organization isn't allowed to provide a custom verification description.

      Returns Promise<true>

    • Verifies a user on behalf of the organization which is represented by the bot. Returns True on success.

      Parameters

      • userId: number

        Unique identifier of the target user

      • Optionalextra: Omit<{}, "chat_id" | "user_id">
        • custom_description

          Custom description for the verification; 0-70 characters. Must be empty if the organization isn't allowed to provide a custom verification description.

      Returns Promise<true>