Skip to content

Releases: yagop/node-telegram-bot-api

v1.1.0 - Telegram Bot API 10.1

14 Jun 20:59
827d89d

Choose a tag to compare

Adds support for Telegram Bot API 10.1 (June 11, 2026) on top of the v1.0.0 TypeScript rewrite. No breaking changes — Node.js ≥ 18 and ESM-only are unchanged from v1.0.0.

Rich Messages

  • Added the method sendRichMessage(chatId, richMessage, form?)Message.
  • Added the method sendRichMessageDraft(chatId, draftId, richMessage, form?)boolean.
  • Added the parameter rich_message to editMessageText, alongside a new single-object overload:
    // New (preferred) — text or rich_message:
    editMessageText({ chat_id, message_id, text: "…" })
    editMessageText({ chat_id, message_id, rich_message: {} })
    
    // Old (deprecated, still works):
    editMessageText("text", { chat_id, message_id })
  • Added the type InputRichMessage (with html / markdown / is_rtl / skip_entity_detection fields), which is JSON-serialized automatically.
  • Regenerated src/types/schemas.ts with all new RichMessage, RichText, RichBlock, and related types.

Join Request Queries

  • Added the method answerChatJoinRequestQuery(queryId, result, form?)boolean.
  • Added the method sendChatJoinRequestWebApp(queryId, webAppUrl, form?)boolean.
  • Added the fields supports_join_request_queries to User, guard_bot to ChatFullInfo, and query_id to ChatJoinRequest (in the generated types).

Polls

  • Added the types Link and InputMediaLink (generated).

Also in this release

  • Live integration tests covering the Bot API 10.1 methods (#1308, #1309).
  • Regenerated api.md documentation for Bot API v10.1.
  • release and update-bot-api Claude Code skills added (#1310).
  • Anchored onText command regexes to the start of the message in the examples (#1311).
  • Restored the polling/webhook mutual-exclusion unit test.
  • Bumped dev dependency esbuild 0.28.0 → 0.28.1 (#1306).

Full Changelog: v1.0.0...v1.1.0

v1.0.0

12 Jun 23:36
0d469a8

Choose a tag to compare

Rewritten in TypeScript

The library has been rewritten from JavaScript to TypeScript and now requires
Node.js ≥ 18. The public surface — the TelegramBot class, its method
names, their positional arguments, and the emitted events — is otherwise
unchanged, so most bots keep working after the breaking changes below.

Migrating from v0.67.x

  • ESM-only. The package is "type": "module"; require() no longer works —
    use import TelegramBot from "node-telegram-bot-api". The class is both the
    default and a named export. If you are stuck on CommonJS, load it with a
    dynamic import: const { default: TelegramBot } = await import("node-telegram-bot-api").
  • answerCallbackQuery — the legacy answerCallbackQuery(id, text, showAlert)
    and answerCallbackQuery([options]) forms are removed; use
    answerCallbackQuery(id, { text, show_alert }).
  • thumbthumbnail on sendAudio / sendDocument / sendVideo /
    sendAnimation / sendVoice and the sticker methods.
  • reply_to_message_idreply_parameters:
    { reply_parameters: { message_id } }.
  • Reply-keyboard string shorthand removed. KeyboardButton is an object only;
    use keyboard: [[{ text: "Yes" }]] instead of keyboard: [["Yes"]].
    (reply_markup is still serialized for you, or you may pass a pre-stringified value.)
  • Error response shape. Errors still expose code
    (EFATAL / EPARSE / ETELEGRAM) and response, but response is now a plain
    object, not the raw http.IncomingMessage: read error.response.status
    (was response.statusCode); error.response.body is unchanged.
  • NTBA_FIX_350 removed. filename / contentType are always auto-resolved
    (including magic-byte sniffing of Buffers); override per call via the
    file-options argument.
  • request constructor option still exists but feeds the internal fetch-based
    HttpClient (timeouts, default headers) rather than the old request library —
    review any proxy/agent configuration.
  • Build output moved from lib/ to dist/.

Breaking changes for @types/node-telegram-bot-api users

The bundled types replace the community @types/node-telegram-bot-api
(DefinitelyTyped) package. Uninstall @types/node-telegram-bot-api; the
following differences affect existing typed code:

  • Types are no longer namespaced. The old package exposed everything under a
    TelegramBot.* namespace (TelegramBot.Message, TelegramBot.ChatId, …).
    Types are now flat named exports — replace TelegramBot.Message with a named
    import: import TelegramBot, { type Message } from "node-telegram-bot-api".
    The default import of the class is unchanged.
  • *Options interfaces are now *Params types. Per-method option interfaces
    (SendMessageOptions, SendPhotoOptions, …) are replaced by docs-faithful
    <Method>Params types that include the positional arguments; each method types
    its trailing argument as Omit<<Method>Params, …>. There are no aliases under
    the old names.
  • Renamed types: ConstructorOptionsTelegramBotOptions,
    StartPollingOptionsPollingStartOptions,
    StopPollingOptionsPollingStopOptions, FileOptionsFileMeta,
    MetadataEventMetadata, TelegramEventsTelegramBotEvents.
    TextListener / ReplyListener are no longer exported.
  • restrictChatMember(chatId, userId, permissions, options?)permissions
    is now a required positional argument, not an option field.
  • sendPollpollOptions changed from string[] to InputPollOption[]
    ({ text, … } objects), matching the current Bot API.
  • setStickerSetThumbsetStickerSetThumbnail (method renamed; adds a
    format option).
  • Removed legacy option fields (the generated params are docs-faithful):
    disable_web_page_preview (use link_preview_options),
    top-level allow_sending_without_reply (use reply_parameters),
    and answerInlineQuery's switch_pm_text / switch_pm_parameter (use button).
  • Constructor request option is no longer the request library's Options
    type — the client is fetch-based and the dependency is dropped.
  • PollingOptions.interval is number only (was string | number).
  • Array arguments (answerInlineQuery results, sendMediaGroup media,
    sendInvoice prices, setMyCommands commands) no longer accept readonly
    arrays.

Added

  • TypeScript — full type coverage for all API methods, options, and responses, bundled with the package (no separate @types/... install)
  • Generated typessrc/types/schemas.ts is generated from the live Bot API docs (npm run generate:types) as plain type aliases; the types are docs-faithful and carry no runtime validation
  • ESM — the package is now ESM-only ("type": "module"); require() is no longer supported
  • TelegramBotOptions type exported from the main entrypoint
  • Type exports: ChatId, ParseMode, MessageEntity, ReplyMarkup, ReplyParameters, LinkPreviewOptions, SuggestedPostPrice, SuggestedPostInfo, SuggestedPostParameters, and all generated API types
  • Node.js native test runner replaces Mocha
  • sendLivePhoto method

Changed

  • src/telegram.jssrc/telegram.ts (full rewrite)
  • src/telegramPolling.jssrc/polling.ts
  • src/telegramWebHook.jssrc/webhook.ts
  • src/errors.jssrc/errors.ts
  • src/utils.jssrc/utils.ts
  • test/ rewritten in TypeScript with node:test assertions
  • Build output: lib/dist/

Removed

  • CJS support — require('node-telegram-bot-api') no longer works; use import
  • Mocha test infrastructure (test/mocha.opts, legacy test/telegram.js)
  • Legacy lib/ output directory
  • Legacy file-option param thumb — replaced by thumbnail
  • Deprecated request option reply_to_message_id — use reply_parameters
  • Legacy answerCallbackQuery(id, text, showAlert) / answerCallbackQuery([options]) signatures — use answerCallbackQuery(id, options)
  • NTBA_FIX_350 environment flag — filename/contentType are now always auto-resolved

Fixed

  • String errors now include timestamps in console output

Full Changelog: v0.67.0...v1.0.0

v0.67.0

13 Dec 02:23
v0.67.0
5d95b43

Choose a tag to compare

Added:

  1. Support Telegram Bot API v7.4 (by @danielperez9430)
    • #refundStarPayment
  2. Support Telegram Bot API 7.6 (@danielperez9430)
    • #sendPaidMedia
  3. Support Telegram Bot API v7.9 (by @danielperez9430)
  4. Support Telegram Bot API v7.10 (by @danielperez9430)
    • Update: purchased_paid_media
  5. Support Telegram Bot API v8.0 and v8.1
  6. Support Telegram Bot API v8.2, v8.3 (@danielperez9430)
    • #verifyUser
    • #verifyChat
    • #removeUserVerification
    • #removeChatVerification
  7. Support Telegram Bot API v8.3 (by @danielperez9430)
  8. Support Telegram Bot API v9.0 (by @danielperez9430)
    • #readBusinessMessage
    • #deleteBusinessMessages
    • #setBusinessAccountName
    • #setBusinessAccountUsername
    • #setBusinessAccountBio
    • #setBusinessAccountProfilePhoto
    • #removeBusinessAccountProfilePhoto
    • #setBusinessAccountGiftSettings
    • #getBusinessAccountStarBalance
    • #transferBusinessAccountStars
    • #getBusinessAccountGifts
    • #convertGiftToStars
    • #upgradeGift
    • #transferGift
    • #postStory
    • #editStory
    • #deleteStory
    • #giftPremiumSubscription
  9. Support Telegram Bot API v9.1 (by @danielperez9430)
    • #sendChecklist
    • #editMessageChecklist
    • #getMyStarBalance

Fixed:

  1. Reference causing error in FatalError (by @ivanjh)
  2. Stringify scope field in #deleteMyCommands (by @XC-Zhang)
  3. Stringify allowed_updates field in #getUpdates (by @alfanzain)
  4. Stringify message_ids in #forwardMessages (by @qiaoshouzi)
  5. Rename parameter thumb to thumbnail (by @0x114514BB)
  6. Remove travis badge (by @melroy89)
  7. Improve documentation on events (by @programminghoch10)
  8. Fix Telegram invite group link (by @melroy89)

v0.50.0

12 May 06:30
917c20c

Choose a tag to compare

Added:

  1. Support Bot API v4.8: (by @danielperez9430)
    • Add methods: sendDice()
  2. Support Bot API v4.7: (by @danielperez9430)
    • Add methods: getMyCommands(),setMyCommands()
  3. Support Bot API v4.5: (by @danielperez9430)
    • Add methods: setChatAdministratorCustomTitle()
  4. Support Bot API v4.4: (by @danielperez9430)
    • Add methods: setChatPermissions()
  5. Support for poll_answer (by @jiejiss)
  6. Add request options in file stream (by @zhangpanyi )

Changed: (by @danielperez9430)

  • New message type: dice
  • Fix Bugs in tests
  • Fix regex compare (by @ledamint)
  • Fix listening for error events when downloading files (by @Kraigo)

New Test: (by @danielperez9430)

  • sendDice
  • getMyCommands
  • setMyCommands
  • setChatAdministratorCustomTitle
  • setChatPermissions

v0.30.0

21 Dec 11:35
119d892

Choose a tag to compare

Added:

  1. Support Bot API v3.5: (by @GochoMugo)
    • Allow provider_data parameter in TelegramBot#sendInvoice
    • Add method TelegramBot#sendMediaGroup()
  2. Support Bot API v3.4: (by @kamikazechaser)
    • Add methods TelegramBot#editMessageLiveLocation, TelegramBot#stopMessageLiveLocation (#439)
    • Add methods TelegramBot#setChatStickerSet, TelegramBot#deleteChatStickerSet (#440)
  3. Add methods:
  4. Add options to TelegramBot#stopPolling() (by @GochoMugo)
  5. Add metadata argument in message event (and friends e.g. text, audio, etc.) (#409) (by @jlsjonas, @GochoMugo)
  6. Add forward-compatibility i.e. support future additional Telegram options (by @GochoMugo)
  7. Add support for Node.js v9 (by @GochoMugo)
  8. Document TelegramBot.errors, TelegramBot.messageTypes (by @GochoMugo)

Changed:

  1. Update TelegramBot#answerCallbackQuery() signature (by @GochoMugo)
  2. Improve default error logging of polling_error and webhook_error (#377)
  3. Update dependencies

Deprecated:

  1. Sending files: (See [usage guide][usage-sending-files]) (by @hufan-akari, @GochoMugo)
    • Error will not be thrown if Buffer is used and file-type could not be detected.
    • Filename will not be set to data.${ext} if Buffer is used
    • Content type will not default to null or undefined

Fixed:

  1. Fix the offset infinite loop bug (#265, #36) (by @GochoMugo)
  2. Fix game example (#449, #418) (by @MCSH)

v0.29.0

22 Oct 16:37
7f41992

Choose a tag to compare

See CHANGELOG.md.

v0.28.0

15 Aug 06:27
580afc9

Choose a tag to compare

See CHANGELOG.md

v0.27.1

10 Apr 05:56
e250d65

Choose a tag to compare

See CHANGELOG.md

v0.27.0

10 Feb 14:56
7304265

Choose a tag to compare

See CHANGELOG.md

v0.26.0

20 Jan 07:14
54212da

Choose a tag to compare

See CHANGELOG.md