Constructs a new Bot client instance.
Secret token provided by BotFather.
Custom HTTP, retry, and endpoint options.
Protected Readonly_Internal fetch adapter instance used for HTTP dispatch.
Optionalinit: RequestInitOptionalinit: RequestInitReadonlyapiBase endpoint URL of the Telegram Bot API server.
Protected Optional ReadonlybaseOptional base delay in milliseconds used for retry calculations.
ReadonlyoptionsClient configuration options.
Protected ReadonlyrequestDefault per-request abort timeout in milliseconds.
ReadonlytokenSecret Telegram Bot API token received from BotFather.
Adds a new sticker to a set created by the bot.
Options including user_id, name, and sticker descriptor.
true on success.
TelegramApiError When adding sticker fails.
Sends answers to callback queries sent from inline keyboards.
Options including callback_query_id, text, show_alert, url, and cache_time.
true on success.
TelegramApiError When answering callback query fails.
Answers a chat join request query from a user (Bot API 10.1+).
Query response options.
true on success.
Answers a guest query in a mini app.
Unique identifier of the query.
Result payload to return.
Object with optional inline_message_id.
Sends answers to an inline query from users.
Options including inline_query_id, results array, cache_time, is_personal, next_offset, button.
true on success.
TelegramApiError When answering inline query fails.
Replies to an incoming pre-checkout query to confirm or cancel the order.
Options including pre_checkout_query_id, ok, and optional error_message.
true on success.
TelegramApiError When confirming/canceling fails.
Replies to an incoming shipping query.
Options including shipping_query_id, ok, and optional shipping_options or error_message.
true on success.
TelegramApiError When replying fails.
Sets the result of an interaction with a Web App and sends a corresponding message on behalf of the user to the chat.
Unique identifier for the query.
An object describing the message to be sent.
Object with optional inline_message_id.
TelegramApiError When answering web app query fails.
Approves a chat join request from a user.
Unique identifier for the target chat.
Unique identifier of the target user.
true on success.
TelegramApiError When approval fails.
Approves a suggested post in a channel.
Channel chat identifier.
Identifier of the suggested post message.
OptionalsendDate: number
Point in time (Unix timestamp) when the post will be published; defaults to the current date and time when omitted.
true on success.
TelegramApiError When the request fails.
Bans a user in a group, a supergroup or a channel.
Unique identifier for the target group or channel.
Unique identifier of the target user.
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.
OptionalrevokeMessages: boolean
Pass true to delete all messages from the chat for the user that is being banned.
true on success.
TelegramApiError When banning fails.
Bans a channel in a chat, preventing it from sending messages.
Unique identifier for the target chat.
Unique identifier of the target sender channel.
true on success.
TelegramApiError When banning sender chat fails.
Closes the bot instance before moving it from one local server to another.
true on success.
TelegramApiError When close fails.
Closes an open topic in a forum supergroup chat.
Unique identifier for the target chat.
Unique identifier for the target message thread of the forum topic.
true on success.
TelegramApiError When closing topic fails.
Closes an open 'General' topic in a forum supergroup chat.
Unique identifier for the target chat.
true on success.
TelegramApiError When closing General topic fails.
Dynamically configures or updates the auto-retry and flood control settings.
Partial retry options to update.
This client instance for chaining.
Converts a regular gift owned by a managed business account to Telegram Stars.
Unique identifier of the business connection.
Unique identifier of the regular gift to convert.
true on success.
TelegramApiError When the request fails.
Copies a message of any kind, sending a new message with the same content without header links.
Copy options including optional custom caption, parse_mode, and reply_markup.
Object containing the message_id of the copied message.
TelegramApiError When copying fails.
Copies multiple messages of any kind in batch.
Batch copy options including chat_id, from_chat_id, and message_ids.
Array of MessageId objects containing the identifiers of copied messages.
TelegramApiError When batch copying fails.
Creates an additional invite link for a chat with optional expiration and usage limits.
Unique identifier for the target chat.
Options including name, expire_date, member_limit, and creates_join_request.
The created ChatInviteLink.
TelegramApiError When creating link fails.
Creates a subscription invite link for a channel or group.
Target chat identifier.
Subscription parameters.
Created link object.
Creates a topic in a forum supergroup chat.
Options including target chat_id, name, and optional icon_color or icon_custom_emoji_id.
The created ForumTopic object on success.
TelegramApiError When creating topic fails.
Creates an HTTP link for an invoice that can be shared in messages or buttons.
Invoice link parameters matching the documented createInvoiceLink set (no chat_id).
The created invoice link as a string.
TelegramApiError When link creation fails.
Creates a new sticker set owned by a user.
Options including user_id, name, title, stickers array, and sticker_format.
true on success.
TelegramApiError When creation fails.
Declines a chat join request from a user.
Unique identifier for the target chat.
Unique identifier of the target user.
true on success.
TelegramApiError When declining fails.
Declines a suggested post in a channel.
Channel chat identifier.
Identifier of the suggested post message.
Optionalcomment: string
Comment for the post author; pass an empty string for no comment.
true on success.
TelegramApiError When the request fails.
Removes all reactions on a message (this endpoint takes no message_id).
Unique identifier for the target chat or username of the target channel.
OptionaluserId: number
Identifier of the target user, for business connections only.
OptionalactorChatId: number
Unique identifier of the business chat on behalf of which to act.
true on success.
TelegramApiError When clearing reactions fails.
Deletes messages on behalf of a connected business account.
Unique identifier of the business connection.
List of message identifiers to delete.
true on success.
TelegramApiError When deleting messages fails.
Deletes a chat photo.
Unique identifier for the target chat.
true on success.
TelegramApiError When deleting chat photo fails.
Deletes a group sticker set from a supergroup.
Unique identifier for the target chat.
true on success.
TelegramApiError When deleting sticker set fails.
Deletes an ephemeral message (Bot API 10.2+).
Options object or chat identifier.
OptionalreceiverUserId: number
Receiver user identifier when passing positional arguments.
OptionalephemeralMessageId: number
Ephemeral message identifier when passing positional arguments.
true on success.
Deletes a forum topic along with all its messages in a forum supergroup chat.
Unique identifier for the target chat.
Unique identifier for the target message thread of the forum topic.
true on success.
TelegramApiError When deleting topic fails.
Deletes a message in a chat.
Unique identifier for the target chat or username of the target channel.
Identifier of the message to delete.
true on success.
TelegramApiError When message cannot be deleted.
Removes the calling user's or a managed business account's reaction from a message.
Unique identifier for the target chat or username of the target channel.
Identifier of the target message.
OptionaluserId: number
Identifier of the target user, for business connections only.
OptionalactorChatId: number
Unique identifier of the business chat on behalf of which to act.
true on success.
TelegramApiError When clearing reaction fails.
Deletes multiple messages simultaneously in a chat.
Unique identifier for the target chat or username of the target channel.
Array of 1-100 identifiers of messages to delete.
true on success.
TelegramApiError When messages cannot be deleted.
Deletes the list of the bot's commands for the given scope and user language.
Optional scope and language_code.
true on success.
TelegramApiError When deleting commands fails.
Deletes a sticker from a set created by the bot.
File identifier of the sticker.
true on success.
TelegramApiError When deleting sticker fails.
Deletes a sticker set that was created by the bot.
Sticker set name.
true on success.
TelegramApiError When deleting set fails.
Deletes a story previously posted on behalf of a connected business account.
Unique identifier of the business connection.
Identifier of the story to delete.
true on success.
TelegramApiError When deleting story fails.
Removes webhook integration, reverting to getUpdates polling.
OptionaldropPendingUpdates: boolean
Pass true to discard all queued undelivered updates.
true on success.
TelegramApiError When removing webhook fails.
General-purpose raw API method executor.
Expected result payload type.
API method name.
Request parameters.
Unwrapped API result.
Edits a non-primary invite link created by the bot.
Unique identifier for the target chat.
The invite link to edit.
Updated invite link parameters.
The edited ChatInviteLink.
TelegramApiError When editing link fails.
Edits a chat subscription invite link.
Target chat identifier.
Invite link to edit.
Updated link parameters.
Edited link object.
Edits an ephemeral message caption (Bot API 10.3+).
Ephemeral message caption edit options.
true on success.
Edits an ephemeral message media (Bot API 10.3+).
Ephemeral message media edit options.
true on success.
Edits an ephemeral message reply markup (Bot API 10.3+).
Ephemeral message reply markup edit options.
true on success.
Edits an ephemeral message text (Bot API 10.2+).
Ephemeral message edit options.
true on success.
Edits the name and icon of a topic in a forum supergroup chat.
Options including chat_id, message_thread_id, and updated name or icon_custom_emoji_id.
true on success.
TelegramApiError When editing topic fails.
Edits the name of the 'General' topic in a forum supergroup chat.
Unique identifier for the target chat.
New name of the topic (1-128 characters).
true on success.
TelegramApiError When editing General topic fails.
Edits the caption of a media message previously sent by the bot.
Options including optional caption, parse_mode, and reply_markup.
The edited Message or true if inline message.
TelegramApiError When editing caption fails.
Edits an interactive checklist message.
Checklist modification options.
Edited Message or boolean.
TelegramApiError When editing the checklist fails.
Edits a live location message previously sent by the bot.
Options including latitude, longitude, and either chat_id+message_id or inline_message_id.
The edited Message or true if inline message.
TelegramApiError When editing live location fails.
Edits the animation, audio, document, photo, or video content of a message.
Options including new media descriptor and target message ID.
The edited Message or true if inline message.
TelegramApiError When editing media fails.
Edits only the inline keyboard reply markup of a message.
Target message options with optional new reply_markup.
The edited Message or true if inline message.
TelegramApiError When editing reply markup fails.
Edits the text of a message previously sent by the bot or via inline queries.
Options including text, chat_id+message_id or inline_message_id, reply_markup, and the optional business_connection_id.
The edited Message or true if inline message.
TelegramApiError When editing text fails.
Edits a story previously posted by the bot on behalf of a business account.
Unique identifier of the business connection.
Unique identifier of the story to edit.
New content for the story.
Additional edit parameters.
The edited Story object.
TelegramApiError When editing story fails.
Allows the bot to cancel or re-enable a subscription paid with Telegram Stars for a user.
Identifier of the user whose subscription will be edited.
Telegram payment identifier for the subscription charge.
Pass true to cancel the subscription, or false to re-enable.
true on success.
TelegramApiError When updating subscription status fails.
Generates a new primary invite link for a chat; any previously generated primary link is revoked.
Unique identifier for the target chat.
The new invite link as a string.
TelegramApiError When exporting link fails.
Forwards a message of any kind.
Forward options including chat_id, from_chat_id, and message_id.
The forwarded Message.
TelegramApiError When forwarding fails.
Forwards multiple messages of any kind in batch.
Forward batch options including chat_id, from_chat_id, and message_ids.
Array of MessageId objects containing the identifiers of forwarded messages.
TelegramApiError When batch forwarding fails.
Returns the list of gifts that can be sent by the bot to users and channel chats.
A Gifts object containing the available gifts.
TelegramApiError When retrieving gifts fails.
Retrieves the gifts received and owned by a connected business account.
Unique identifier of the business connection.
Optional exclusion, sorting and pagination filters.
Owned gifts of the business account.
TelegramApiError When the request fails.
Retrieves the Telegram Star balance of a connected business account.
Unique identifier of the business connection.
Object containing the star amount.
Retrieves information about the connection of the bot with a business account.
Unique identifier of the business connection.
A BusinessConnection object.
TelegramApiError When connection is not found.
Retrieves 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.).
Unique identifier for the target chat or username of the target channel.
A ChatFullInfo object.
TelegramApiError When chat is not found or bot lacks access.
The docs declare the return type as ChatFullInfo, not Chat. Because
ChatFullInfo extends Chat, callers that annotated the result as a Chat
keep compiling and additionally gain access to the documented full-info
fields (max_reaction_count, parent_chat, accepted_gift_types,
rating, community, guard_bot, …).
Retrieves a list of administrators in a chat, which includes the chat creator and all promoted admins.
Unique identifier for the target chat.
Array of ChatMember objects.
TelegramApiError When retrieving administrators fails.
Retrieves the gifts owned by a chat.
Target chat identifier or channel @username.
Optional exclusion (including saved/unsaved), sorting and pagination filters.
List of chat gifts.
TelegramApiError When the request fails.
Retrieves information about a specific member of a chat.
Unique identifier for the target chat.
Unique identifier of the target user.
A ChatMember object.
TelegramApiError When user is not found.
Retrieves the number of members in a chat.
Unique identifier for the target chat.
Total member count as a number.
TelegramApiError When retrieving count fails.
Retrieves the current value of the bot's menu button in a private chat, or the default menu button.
OptionalchatId: string | number
Unique identifier for the target private chat. If not specified, default menu button is returned.
A MenuButton object.
TelegramApiError When retrieving menu button fails.
Retrieves information about custom emoji stickers by their identifiers.
List of custom emoji identifiers (up to 200).
Array of Sticker objects.
TelegramApiError When retrieval fails.
Retrieves basic info about a file and prepares it for downloading.
File identifier to get info about.
A File object with file_path.
TelegramApiError When file is not found or exceeds 20MB bot limit.
Retrieves custom emoji stickers that can be used as forum topic icons.
Array of sticker objects.
TelegramApiError When retrieval fails.
Retrieves high score tables for a game.
Target user identifier.
Target message coordinates.
Array of GameHighScore objects.
TelegramApiError When retrieving scores fails.
Retrieves access settings for a managed bot.
Unique identifier of the target user that owns the managed bot.
Access settings.
Retrieves the token of a managed bot.
Unique identifier of the target user that owns the managed bot.
Object containing the bot token.
Basic information about the bot in form of a User object.
The User object representing the bot.
TelegramApiError When token is invalid or request fails.
Retrieves the current list of the bot's commands for the given scope and user language.
Optional scope and language_code.
Array of BotCommand objects.
TelegramApiError When retrieving commands fails.
Retrieves the current default administrator rights of the bot.
OptionalforChannels: boolean
Pass true to get default rights for channels, or false for groups/supergroups.
A ChatAdministratorRights object.
TelegramApiError When retrieving administrator rights fails.
Retrieves the current bot description for the given user language.
OptionallanguageCode: string
Two-letter ISO 639-1 language code.
A BotDescription object.
TelegramApiError When retrieving description fails.
Retrieves the current bot name for the given user language.
OptionallanguageCode: string
Two-letter ISO 639-1 language code.
A BotName object.
TelegramApiError When retrieving bot name fails.
Retrieves the current bot short description for the given user language.
OptionallanguageCode: string
Two-letter ISO 639-1 language code.
A BotShortDescription object.
TelegramApiError When retrieving short description fails.
Retrieves the bot's current balance in Telegram Stars.
A StarAmount object containing amount and optional nanostar_amount.
TelegramApiError When retrieving balance fails.
Retrieves the bot's Telegram Star transactions in chronological order.
Optionaloffset: number
Number of transactions to skip in the response.
Optionallimit: number
The maximum number of transactions to retrieve (1-100).
A StarTransactions object.
TelegramApiError When retrieving transactions fails.
Retrieves a sticker set by its short name.
Short name of the sticker set.
A StickerSet object.
TelegramApiError When sticker set is not found.
Retrieves incoming updates using long polling.
Polling options such as offset, limit, timeout, and allowed_updates.
Array of RawUpdate objects.
TelegramApiError When retrieving updates fails.
Retrieves the list of boosts added to a chat by a user.
Unique identifier for the target chat or username of the target channel.
Unique identifier of the target user.
A UserChatBoosts object containing the list of boosts.
TelegramApiError When retrieving boosts fails.
Retrieves the gifts owned and hosted by a user.
Target user identifier.
Optional exclusion, sorting and pagination filters.
List of user gifts.
TelegramApiError When the request fails.
Retrieves messages from a user's personal chat with the bot.
Unique identifier of the target user.
Maximum number of messages to be returned; 1-100.
Array of Message objects.
TelegramApiError When retrieving messages fails.
Retrieves profile audio files for a user.
Target user identifier.
Optionaloffset: number
Query offset.
Optionallimit: number
Maximum items to retrieve.
Profile audio objects.
Retrieves a list of profile pictures for a user.
Unique identifier of the target user.
Optionaloffset: number
Sequential number of first photo to return (default 0).
Optionallimit: number
Limits the number of photos to be retrieved (1-100, default 100).
A UserProfilePhotos object.
TelegramApiError When retrieving photos fails.
Retrieves current webhook status information.
A WebhookInfo object.
TelegramApiError When retrieving webhook info fails.
Gifts a Telegram Premium subscription to a user.
Premium gift parameters.
true on success.
Hides the 'General' topic in a forum supergroup chat.
Unique identifier for the target chat.
true on success.
TelegramApiError When hiding General topic fails.
Initializes client state and verifies credentials via getMe.
Leaves a group, supergroup or channel.
Unique identifier for the target chat.
true on success.
TelegramApiError When leaving chat fails.
Logs out from the cloud Bot API server before launching a local Bot API server.
true on success.
TelegramApiError When logout fails.
Registers an observer invoked whenever a Bot API request finally fails.
Hooks run in registration order right before the TelegramApiError is thrown, after retries are exhausted. Observers cannot alter the error; exceptions inside a hook are swallowed and logged. Useful for alerting and metrics plugins.
Callback receiving the method name and the final error.
Optionaltag: string
Optional owner tag for grouped removal via BaseBotClient.removeHooksByTag.
This client instance for chaining.
Pins a message in a group, a supergroup, or a channel.
Unique identifier for the target chat.
Identifier of a message to pin.
OptionaldisableNotification: boolean
Pass true if it is not necessary to send a notification to all chat members.
OptionalbusinessConnectionId: string
Unique identifier of the business connection on behalf of which the message will be pinned.
true on success.
TelegramApiError When pinning message fails.
Posts a story on behalf of a connected business account.
Unique identifier of the business connection.
Content of the story.
Additional story options.
The posted Story object.
TelegramApiError When posting story fails.
Promotes or demotes a user in a supergroup or a channel.
Unique identifier for the target chat.
Unique identifier of the target user.
Admin rights flags (e.g. can_manage_chat, can_delete_messages, can_invite_users).
true on success.
TelegramApiError When promotion fails.
Marks incoming messages in a business account as read.
Unique identifier of the business connection.
Unique identifier of the chat in which the message was received.
Identifier of the message to mark as read.
true on success.
TelegramApiError When marking message fails.
Refunds a successful payment in Telegram Stars.
Identifier of the user who made the payment.
Telegram payment identifier.
true on success.
TelegramApiError When refund fails.
Removes the profile photo of a connected business account.
Unique identifier of the business connection.
Optional is_public flag; pass True to remove the public photo.
true on success.
TelegramApiError When the request fails.
Removes verification from a chat that was previously verified by the bot.
Unique identifier for the target chat or username of the target channel.
true on success.
TelegramApiError When removing verification fails.
Removes the profile photo of the bot.
true on success.
Removes verification from a user that was previously verified by the bot.
Unique identifier of the target user.
true on success.
TelegramApiError When removing verification fails.
Reopens a closed topic in a forum supergroup chat.
Unique identifier for the target chat.
Unique identifier for the target message thread of the forum topic.
true on success.
TelegramApiError When reopening topic fails.
Reopens a closed 'General' topic in a forum supergroup chat.
Unique identifier for the target chat.
true on success.
TelegramApiError When reopening General topic fails.
Generates a replacement token for a managed bot.
Unique identifier of the target user that owns the managed bot.
Object containing the new bot token.
Replaces an existing sticker in a sticker set with a new one.
Options including user_id, name, old_sticker, and sticker descriptor.
true on success.
TelegramApiError When replacing sticker fails.
Reposts a story to a channel or story feed.
Repost parameters.
Repost result.
Core request dispatcher to execute any raw Telegram Bot API endpoint.
Automatically serializes JSON objects or multipart FormData when file buffers / InputFile are present.
Handles HTTP 429 rate-limiting (honoring retry_after) and HTTP 5xx retries with exponential
backoff, sharing a single retry budget across both so that repeated 429s cannot retry forever
or starve genuine 5xx retries.
The expected return payload type from Telegram.
The Bot API method name (e.g. "sendMessage", "getMe", "setWebhook").
Key-value parameters corresponding to the API method fields.
Resolves with the unwrapped result field returned by Telegram.
TelegramApiError When Telegram returns ok: false, HTTP 4xx, or after retry exhaustion on 429/5xx/network errors.
Restricts a user in a supergroup.
Unique identifier for the target chat.
Unique identifier of the target user.
Object for new user permissions (e.g. can_send_messages).
OptionaluseIndependentChatPermissions: boolean
Pass true if chat permissions are set independently.
OptionaluntilDate: number
Date when restrictions will be lifted; Unix time.
true on success.
TelegramApiError When restriction fails.
Revokes an invite link created by the bot.
Unique identifier for the target chat.
The invite link to revoke.
The revoked ChatInviteLink.
TelegramApiError When revoking fails.
Stores a message that can be sent by a user of a Mini App.
Prepared inline message options including user_id and result.
A PreparedInlineMessage object containing the id and expiration_date.
TelegramApiError When saving the prepared message fails.
const prepared = await bot.savePreparedInlineMessage({
user_id: 123456,
result: {
type: "article",
id: "art_1",
title: "Shareable Result",
input_message_content: { message_text: "Shared via Mini App!" },
},
allow_user_chats: true,
allow_group_chats: true,
});
console.log(`Prepared message ID: ${prepared.id}`);
Saves a prepared keyboard button for a Mini App.
Button options.
Prepared button result.
Sends an animation (GIF or H.264/MPEG-4 AVC video without sound).
Options including chat_id, animation, and optional caption.
The sent Message.
TelegramApiError When sending fails.
Sends an audio file (.MP3 or .M4A format).
Options including chat_id, audio, performer, title, and optional duration.
The sent Message.
TelegramApiError When sending fails.
Broadcasts a chat status action (e.g. typing, uploading photo) to chat members.
Options including chat_id and action (from ChatAction).
true on success.
TelegramApiError When sending action fails.
Sends a Web App for a chat join request (Bot API 10.1+).
Join request Web App options.
true on success.
Sends an interactive checklist message.
Checklist configuration options.
Sent Message.
TelegramApiError When sending the checklist fails.
Sends a phone contact card to a chat.
Options including chat_id, phone_number, first_name, and optional last_name.
The sent Message.
TelegramApiError When sending fails.
Sends an animated dice, dart, basketball, football, slot machine, or bowling pin.
Options including chat_id and optional emoji (default 🎲).
The sent Message with dice result value.
TelegramApiError When sending dice fails.
Sends a general file/document of any type.
Options including chat_id, document, and optional caption.
The sent Message.
TelegramApiError When sending fails.
Sends a game to a chat.
Unique identifier for the target chat.
Short name of the game, serves as the unique identifier for the game. Set up via BotFather.
Additional parameters for sending game.
The sent Message.
TelegramApiError When sending game fails.
Sends a gift to the given user or channel chat.
Options including gift_id and either user_id or chat_id, plus optional message text, text_parse_mode, text_entities and pay_for_upgrade.
true on success.
Exactly one of user_id and chat_id must be provided. The gift can't be converted to Telegram Stars by the receiver.
TelegramApiError When sending gift fails.
await bot.sendGift({
user_id: 123456,
gift_id: "gift_abc123",
text: "Enjoy your gift!",
pay_for_upgrade: true,
});
Sends an invoice to a user or channel.
Options including chat_id, title, description, payload, currency, and prices.
The sent Message containing the invoice.
TelegramApiError When sending invoice fails.
Sends an animated Live Photo message.
Live photo options.
Sent Message.
Sends a geographic location point on a map.
Options including chat_id, latitude, longitude, and optional live_period.
The sent Message.
TelegramApiError When sending fails.
Sends a group of 2-10 photos, videos, documents, or audios as an album.
Options including chat_id and media array of InputMedia.
Array of sent Message objects.
TelegramApiError When sending media group fails.
Sends a text message to a specific chat or user.
Message options including chat_id, text, parse_mode, reply_markup, and reply_parameters.
The sent Message.
TelegramApiError When sending fails.
Sets a message draft in a personal chat.
Options including chat_id and draft content.
true on success.
Sends paid media (photos/videos purchased with Telegram Stars).
Paid media parameters including chat_id, star_count, and media array.
The sent Message.
Sends a photo to a chat.
Options including chat_id, photo (file_id, URL, or InputFile), and optional caption.
The sent Message.
TelegramApiError When sending fails.
Sends a native Telegram poll or quiz.
Options including chat_id, question, options array, type, and is_anonymous.
The sent Message.
TelegramApiError When sending poll fails.
Sends a structured rich formatted message (Bot API 10.1+).
Rich message options including chat_id and rich_message.
The sent Message.
Streams a draft of a rich formatted message (Bot API 10.1+).
Rich message draft options.
true on success.
Sends a static, animated (.TGS), or video (.WEBM) sticker.
Options including chat_id and sticker (file ID, URL, or InputFile).
The sent Message.
TelegramApiError When sending sticker fails.
Sends information about a venue / location with title and address.
Options including chat_id, latitude, longitude, title, and address.
The sent Message.
TelegramApiError When sending fails.
Sends a video file.
Options including chat_id, video, duration, width, height, and optional caption.
The sent Message.
TelegramApiError When sending fails.
Sends a round video note (up to 1 minute, square 1:1 aspect ratio).
Options including chat_id, video_note, and optional length and duration.
The sent Message.
TelegramApiError When sending fails.
Sends an audio voice note (.OGG format encoded with OPUS).
Options including chat_id, voice, and optional duration and caption.
The sent Message.
TelegramApiError When sending fails.
Changes the bio description of a connected business account.
Unique identifier of the business connection.
Optionalbio: string
New bio text.
true on success.
Configures gift settings for a connected business account.
Unique identifier of the business connection.
Gift settings parameters: the required show_gift_button flag and an
AcceptedGiftTypes object in accepted_gift_types.
true on success.
TelegramApiError When the request fails.
Changes the first and last name of a managed business account.
Unique identifier of the business connection.
New first name of the business account; 1-64 characters.
OptionallastName: string
New last name of the business account; 0-64 characters.
true on success.
TelegramApiError When the request fails.
Sets the profile photo for a connected business account.
Unique identifier of the business connection.
The new profile photo to set.
Optional is_public flag.
true on success.
TelegramApiError When the request fails.
Changes the username of a connected business account.
Unique identifier of the business connection.
Optionalusername: string
New username.
true on success.
Sets a custom title for an administrator in a supergroup promoted by the bot.
Unique identifier for the target chat.
Unique identifier of the target user.
New custom title for the administrator; 0-16 characters.
true on success.
TelegramApiError When setting title fails.
Changes the description of a group, a supergroup or a channel.
Unique identifier for the target chat.
Optionaldescription: string
New chat description, 0-255 characters.
true on success.
TelegramApiError When setting description fails.
Sets a custom tag for a chat member.
Target chat identifier.
Target user identifier.
Optionaltag: string
Tag name to set.
true on success.
Changes the bot's menu button in a private chat, or the default menu button.
OptionalchatId: string | number
Unique identifier for the target private chat. If not specified, default menu button is changed.
OptionalmenuButton: MenuButton
An object for the new bot menu button.
true on success.
TelegramApiError When changing menu button fails.
Sets default chat permissions for all members.
Unique identifier for the target chat.
Object for new default chat permissions.
OptionaluseIndependentChatPermissions: boolean
Pass true if chat permissions are set independently.
true on success.
TelegramApiError When setting permissions fails.
Sets a new profile photo for the chat.
true on success.
TelegramApiError When setting chat photo fails.
Sets a new group sticker set for a supergroup.
Unique identifier for the target chat.
Name of the sticker set to be set as the group sticker set.
true on success.
TelegramApiError When setting sticker set fails.
Changes the title of a chat.
Unique identifier for the target chat.
New chat title, 1-128 characters.
true on success.
TelegramApiError When setting title fails.
Sets the thumbnail of a custom emoji sticker set.
Sticker set name.
OptionalcustomEmojiId: string
Custom emoji identifier of a sticker from the set.
true on success.
TelegramApiError When setting thumbnail fails.
Sets the score of the specified user in a game.
User identifier.
New score, must be non-negative.
Additional parameters including target message coordinates.
The edited Message or true.
TelegramApiError When setting score fails.
Updates access settings for a managed bot.
Unique identifier of the target user that owns the managed bot.
Updated access options including the required is_access_restricted flag.
true on success.
Sets emoji or custom emoji reactions on a message.
Reaction options including chat_id, message_id, and reaction array/string.
true on success.
TelegramApiError When setting reaction fails.
Changes the list of the bot's commands for the given scope and user language.
Options including commands array, and optional scope and language_code.
true on success.
TelegramApiError When setting commands fails.
Changes the default administrator rights requested by the bot when added as administrator.
Optionalrights: ChatAdministratorRights
An object describing new default administrator rights.
OptionalforChannels: boolean
Pass true to change default rights for channels, or false for groups/supergroups.
true on success.
TelegramApiError When changing administrator rights fails.
Changes the bot's description, which is shown on the chat with the bot when empty.
Optionaldescription: string
New bot description (0-512 characters). Pass undefined to remove description.
OptionallanguageCode: string
Two-letter ISO 639-1 language code.
true on success.
TelegramApiError When changing description fails.
Changes the bot's name.
Optionalname: string
New bot name (0-64 characters). Pass empty or undefined to remove the name.
OptionallanguageCode: string
Two-letter ISO 639-1 language code.
true on success.
TelegramApiError When changing bot name fails.
Sets the profile photo for the bot.
Photo file to set.
true on success.
Changes the bot's short description, which is shown on the bot's profile page and sent with links.
OptionalshortDescription: string
New short description (0-120 characters). Pass undefined to remove.
OptionallanguageCode: string
Two-letter ISO 639-1 language code.
true on success.
TelegramApiError When changing short description fails.
Informs a user that some of the Telegram Passport elements they provided contains errors.
User identifier.
Array describing the errors in the elements.
true on success.
TelegramApiError When reporting errors fails.
Changes the list of emoji assigned to a regular or custom emoji sticker.
File identifier of the sticker.
List of 1-20 emoji associated with the sticker.
true on success.
TelegramApiError When setting emoji list fails.
Changes search keywords for a sticker.
File identifier of the sticker.
Optionalkeywords: string[]
List of 0-20 search keywords for the sticker.
true on success.
TelegramApiError When setting keywords fails.
Changes the mask position of a mask sticker.
File identifier of the sticker.
OptionalmaskPosition: MaskPosition
Object with the position where the mask should be placed.
true on success.
TelegramApiError When setting mask position fails.
Moves a sticker in a set created by the bot to a specific position.
File identifier of the sticker.
New 0-based position of the sticker in the set.
true on success.
TelegramApiError When moving position fails.
Sets the thumbnail of a regular or custom emoji sticker set.
true on success.
TelegramApiError When setting thumbnail fails.
Sets the title of a created sticker set.
Sticker set name.
Sticker set title, 1-64 characters.
true on success.
TelegramApiError When setting title fails.
Changes the emoji status for a given user that granted permission to the bot.
Unique identifier of the target user.
OptionalemojiStatusCustomEmojiId: string
Custom emoji identifier of the emoji status to set; pass an empty string to remove the status.
Optional emoji_status_expiration_date.
true on success.
Serialized as the documented emoji_status_custom_emoji_id and emoji_status_expiration_date fields.
TelegramApiError When setting emoji status fails.
Configures a webhook URL to receive incoming updates via HTTPS POST requests.
Webhook settings including url, optional secret_token, allowed_updates, and certificate.
true on success.
TelegramApiError When setting webhook fails.
Gracefully shuts down active client sessions and connections.
Helper utility to pause asynchronous execution for a given number of seconds.
Used internally during retry delays and rate-limit backoff.
Duration in seconds to pause execution.
Promise that resolves once the specified duration elapses.
Stops updating a live location message before live_period expires.
Target message identifier options.
The stopped Message or true if inline message.
TelegramApiError When stopping fails.
Stops a poll which was sent by the bot.
Unique identifier for the target chat or channel.
Identifier of the original message with the poll.
Additional stop options.
The final stopped Poll state.
TelegramApiError When stopping poll fails.
Transfers Telegram Stars from a business account.
Unique identifier of the business connection.
Number of stars to transfer.
true on success.
Transfers an owned unique gift to another user or chat.
Unique identifier of the business connection.
Unique identifier of the gift to transfer.
Unique identifier of the chat which will own the gift.
Optional star_count paid for the transfer from the business account balance.
true on success.
TelegramApiError When the request fails.
Registers a hook invoked before every outgoing Bot API request.
Hooks run in registration order and may mutate the payload. Intended for plugins that need to observe or decorate all API traffic (logging, metrics, throttling signals, test mocks).
Callback receiving the method name and the mutable payload.
Optionaltag: string
Optional owner tag; all hooks sharing a tag can be removed together via BaseBotClient.removeHooksByTag.
This client instance for chaining.
Registers a hook invoked with every successful Bot API response.
Hooks run in registration order. Returning a value replaces the result for subsequent hooks
and the caller; returning undefined keeps it unchanged. Useful for response logging,
caching, or normalization plugins.
Callback receiving the method name and the unwrapped result.
Optionaltag: string
Optional owner tag for grouped removal via BaseBotClient.removeHooksByTag.
This client instance for chaining.
Unbans a previously banned user in a supergroup or channel.
Unique identifier for the target group or channel.
Unique identifier of the target user.
OptionalonlyIfBanned: boolean
Do nothing if the user is not banned.
true on success.
TelegramApiError When unbanning fails.
Unbans a previously banned channel in a chat.
Unique identifier for the target chat.
Unique identifier of the target sender channel.
true on success.
TelegramApiError When unbanning sender chat fails.
Unhides the 'General' topic in a forum supergroup chat.
Unique identifier for the target chat.
true on success.
TelegramApiError When unhiding General topic fails.
Clears the list of pinned messages in a chat.
Unique identifier for the target chat.
true on success.
TelegramApiError When clearing pinned messages fails.
Clears the list of pinned messages in a forum topic.
Unique identifier for the target chat.
Unique identifier for the target message thread of the forum topic.
true on success.
TelegramApiError When unpinning messages fails.
Clears the list of pinned messages in the 'General' topic of a forum supergroup chat.
Unique identifier for the target chat.
true on success.
TelegramApiError When unpinning General topic messages fails.
Unpins a message in a group, a supergroup, or a channel.
Unique identifier for the target chat.
OptionalmessageId: number
Identifier of a message to unpin. If not specified, the most recent pinned message is unpinned.
OptionalbusinessConnectionId: string
Unique identifier of the business connection on behalf of which the message will be unpinned.
true on success.
TelegramApiError When unpinning fails.
Upgrades a regular gift owned by a managed business account to a unique gift.
Unique identifier of the business connection.
Unique identifier of the regular gift to upgrade.
Optional keep_original_details and star_count parameters.
true on success.
TelegramApiError When the request fails.
Uploads a file with a sticker for later use in createNewStickerSet and addStickerToSet methods.
User identifier of sticker file owner.
A file with the sticker (.PNG, .WEBP, .TGS, or .WEBM).
Format of the sticker: "static", "animated", or "video".
The uploaded File object.
TelegramApiError When upload fails.
Verifies a chat on behalf of the organization which owns the bot.
Unique identifier for the target chat or username of the target channel.
OptionalcustomDescription: string
Custom description for the verification status; 0-70 characters.
true on success.
TelegramApiError When verification fails.
Verifies a user on behalf of the organization which owns the bot.
Unique identifier of the target user.
OptionalcustomDescription: string
Custom description for the verification status; 0-70 characters.
true on success.
TelegramApiError When verification fails.
Primary HTTP Client for executing Telegram Bot API requests.
Inherits all domain method mixins with full autocomplete and type safety.
Example