telebot-ts API Documentation - v1.0.0
    Preparing search index...

    Class Update

    Wrapper for Telegram Update objects with convenience getters.

    Encapsulates the raw update delivered by Telegram and exposes lazy resolution getters for the active user, chat, message, and sender.

    const user = update.effective_user;
    const chat = update.effective_chat;

    Implements

    Index
    • Constructs an Update wrapper instance.

      Parameters

      • raw: RawUpdate

        The raw update payload received from the Telegram API.

      • Optionalbot: Bot

        Optional Bot instance associated with this update.

      Returns Update

    business_connection?: BusinessConnection

    The bot was connected to or disconnected from a business account, or a user edited an existing connection with the bot.

    business_message?: Message

    New message from a connected business account.

    callback_query?: CallbackQuery

    New incoming callback query.

    Optional Readonlychannel_post

    channel_post?: Message

    New incoming channel post of any kind - text, photo, sticker, etc.

    chat_boost?: ChatBoostUpdated

    A chat boost was added or changed.

    chat_join_request?: ChatJoinRequest

    A request to join the chat has been sent.

    chat_member?: ChatMemberUpdated

    A chat member's status was updated in a chat.

    chosen_inline_result?: ChosenInlineResult

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

    deleted_business_messages?: BusinessMessagesDeleted

    Messages were deleted from a connected business account.

    edited_business_message?: Message

    New version of a message from a connected business account.

    Optional Readonlyedited_channel_post

    edited_channel_post?: Message

    New version of a channel post that is known to the bot and was edited.

    edited_message?: Message

    New version of a message that is known to the bot and was edited.

    guest_message?: Message

    New guest message.

    inline_query?: InlineQuery

    New incoming inline query.

    managed_bot?: ManagedBotUpdated

    A new bot was created to be managed by the bot, or the token or owner of a managed bot was changed.

    message?: Message

    New incoming message of any kind - text, photo, sticker, etc.

    message_reaction?: MessageReactionUpdated

    A reaction to a message was changed by a user.

    message_reaction_count?: MessageReactionCountUpdated

    Reactions to a message with anonymous reactions were changed.

    my_chat_member?: ChatMemberUpdated

    The bot's chat member status was updated in a chat.

    poll?: Poll

    New poll state. Bots receive only updates about stopped polls and polls, which are sent by the bot.

    poll_answer?: PollAnswer

    A user changed their answer in a non-anonymous poll. Bots receive new votes only in polls that were sent by the bot itself.

    pre_checkout_query?: PreCheckoutQuery

    New incoming pre-checkout query. Contains full information about checkout.

    purchased_paid_media?: PaidMediaPurchased

    A user purchased paid media with Telegram Stars.

    removed_chat_boost?: ChatBoostRemoved

    A boost was removed from a chat.

    shipping_query?: ShippingQuery

    New incoming shipping query. Only for invoices with flexible prices.

    stopped_message_generation?: MessageGenerationStopped

    A user asked the bot to stop the generation of a message (Bot API 10.3+).

    subscription?: BotSubscriptionUpdated

    A user payment subscription toward the bot has changed.

    update_id: number

    The update's unique identifier. Update identifiers start from a certain positive number and increase sequentially.

    • get effectiveChat(): Chat | undefined

      The chat that this update belongs to.

      Returns Chat | undefined

    • get effectiveMessage(): Message | undefined

      The message contained in this update.

      Returns Message | undefined

    • get effectiveSender(): User | Chat | undefined

      The sender of the message (either a User or a Chat channel sender).

      Returns User | Chat | undefined

    • get effectiveUser(): User | undefined

      The user that sent the message or triggered the update, resolved across update types.

      Returns User | undefined