Releases: yagop/node-telegram-bot-api
v1.1.0 - Telegram Bot API 10.1
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_messagetoeditMessageText, 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(withhtml/markdown/is_rtl/skip_entity_detectionfields), which is JSON-serialized automatically. - Regenerated
src/types/schemas.tswith 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_queriestoUser,guard_bottoChatFullInfo, andquery_idtoChatJoinRequest(in the generated types).
Polls
- Added the types
LinkandInputMediaLink(generated).
Also in this release
- Live integration tests covering the Bot API 10.1 methods (#1308, #1309).
- Regenerated
api.mddocumentation for Bot API v10.1. releaseandupdate-bot-apiClaude Code skills added (#1310).- Anchored
onTextcommand regexes to the start of the message in the examples (#1311). - Restored the polling/webhook mutual-exclusion unit test.
- Bumped dev dependency
esbuild0.28.0 → 0.28.1 (#1306).
Full Changelog: v1.0.0...v1.1.0
v1.0.0
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 —
useimport 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 legacyanswerCallbackQuery(id, text, showAlert)
andanswerCallbackQuery([options])forms are removed; use
answerCallbackQuery(id, { text, show_alert }).thumb→thumbnailonsendAudio/sendDocument/sendVideo/
sendAnimation/sendVoiceand the sticker methods.reply_to_message_id→reply_parameters:
{ reply_parameters: { message_id } }.- Reply-keyboard string shorthand removed.
KeyboardButtonis an object only;
usekeyboard: [[{ text: "Yes" }]]instead ofkeyboard: [["Yes"]].
(reply_markupis still serialized for you, or you may pass a pre-stringified value.) - Error
responseshape. Errors still exposecode
(EFATAL/EPARSE/ETELEGRAM) andresponse, butresponseis now a plain
object, not the rawhttp.IncomingMessage: readerror.response.status
(wasresponse.statusCode);error.response.bodyis unchanged. NTBA_FIX_350removed.filename/contentTypeare always auto-resolved
(including magic-byte sniffing ofBuffers); override per call via the
file-options argument.requestconstructor option still exists but feeds the internalfetch-based
HttpClient(timeouts, default headers) rather than the oldrequestlibrary —
review any proxy/agent configuration.- Build output moved from
lib/todist/.
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 — replaceTelegramBot.Messagewith a named
import:import TelegramBot, { type Message } from "node-telegram-bot-api".
The default import of the class is unchanged. *Optionsinterfaces are now*Paramstypes. Per-method option interfaces
(SendMessageOptions,SendPhotoOptions, …) are replaced by docs-faithful
<Method>Paramstypes that include the positional arguments; each method types
its trailing argument asOmit<<Method>Params, …>. There are no aliases under
the old names.- Renamed types:
ConstructorOptions→TelegramBotOptions,
StartPollingOptions→PollingStartOptions,
StopPollingOptions→PollingStopOptions,FileOptions→FileMeta,
Metadata→EventMetadata,TelegramEvents→TelegramBotEvents.
TextListener/ReplyListenerare no longer exported. restrictChatMember(chatId, userId, permissions, options?)—permissions
is now a required positional argument, not an option field.sendPoll—pollOptionschanged fromstring[]toInputPollOption[]
({ text, … }objects), matching the current Bot API.setStickerSetThumb→setStickerSetThumbnail(method renamed; adds a
formatoption).- Removed legacy option fields (the generated params are docs-faithful):
disable_web_page_preview(uselink_preview_options),
top-levelallow_sending_without_reply(usereply_parameters),
andanswerInlineQuery'sswitch_pm_text/switch_pm_parameter(usebutton). - Constructor
requestoption is no longer therequestlibrary'sOptions
type — the client isfetch-based and the dependency is dropped. PollingOptions.intervalisnumberonly (wasstring | number).- Array arguments (
answerInlineQueryresults,sendMediaGroupmedia,
sendInvoiceprices,setMyCommandscommands) no longer acceptreadonly
arrays.
Added
- TypeScript — full type coverage for all API methods, options, and responses, bundled with the package (no separate
@types/...install) - Generated types —
src/types/schemas.tsis generated from the live Bot API docs (npm run generate:types) as plaintypealiases; the types are docs-faithful and carry no runtime validation - ESM — the package is now ESM-only (
"type": "module");require()is no longer supported TelegramBotOptionstype 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
sendLivePhotomethod
Changed
src/telegram.js→src/telegram.ts(full rewrite)src/telegramPolling.js→src/polling.tssrc/telegramWebHook.js→src/webhook.tssrc/errors.js→src/errors.tssrc/utils.js→src/utils.tstest/rewritten in TypeScript withnode:testassertions- Build output:
lib/→dist/
Removed
- CJS support —
require('node-telegram-bot-api')no longer works; useimport - Mocha test infrastructure (
test/mocha.opts, legacytest/telegram.js) - Legacy
lib/output directory - Legacy file-option param
thumb— replaced bythumbnail - Deprecated request option
reply_to_message_id— usereply_parameters - Legacy
answerCallbackQuery(id, text, showAlert)/answerCallbackQuery([options])signatures — useanswerCallbackQuery(id, options) NTBA_FIX_350environment flag —filename/contentTypeare now always auto-resolved
Fixed
- String errors now include timestamps in console output
Full Changelog: v0.67.0...v1.0.0
v0.67.0
Added:
- Support Telegram Bot API v7.4 (by @danielperez9430)
#refundStarPayment
- Support Telegram Bot API 7.6 (@danielperez9430)
#sendPaidMedia
- Support Telegram Bot API v7.9 (by @danielperez9430)
- Support Telegram Bot API v7.10 (by @danielperez9430)
- Update:
purchased_paid_media
- Update:
- Support Telegram Bot API v8.0 and v8.1
#savePreparedInlineMessage(@IsmailBinMujeeb)#setUserEmojiStatus(@danielperez9430)#editUserStarSubscription(@danielperez9430)#getAvailableGifts(@danielperez9430)#sendGift(@danielperez9430)
- Support Telegram Bot API v8.2, v8.3 (@danielperez9430)
#verifyUser#verifyChat#removeUserVerification#removeChatVerification
- Support Telegram Bot API v8.3 (by @danielperez9430)
- 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
- Support Telegram Bot API v9.1 (by @danielperez9430)
#sendChecklist#editMessageChecklist#getMyStarBalance
Fixed:
- Reference causing error in
FatalError(by @ivanjh) - Stringify
scopefield in#deleteMyCommands(by @XC-Zhang) - Stringify
allowed_updatesfield in#getUpdates(by @alfanzain) - Stringify
message_idsin#forwardMessages(by @qiaoshouzi) - Rename parameter
thumbtothumbnail(by @0x114514BB) - Remove travis badge (by @melroy89)
- Improve documentation on events (by @programminghoch10)
- Fix Telegram invite group link (by @melroy89)
v0.50.0
Added:
- Support Bot API v4.8: (by @danielperez9430)
- Add methods: sendDice()
- Support Bot API v4.7: (by @danielperez9430)
- Add methods: getMyCommands(),setMyCommands()
- Support Bot API v4.5: (by @danielperez9430)
- Add methods: setChatAdministratorCustomTitle()
- Support Bot API v4.4: (by @danielperez9430)
- Add methods: setChatPermissions()
- Support for poll_answer (by @jiejiss)
- 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
Added:
- Support Bot API v3.5: (by @GochoMugo)
- Allow
provider_dataparameter in TelegramBot#sendInvoice - Add method TelegramBot#sendMediaGroup()
- Allow
- Support Bot API v3.4: (by @kamikazechaser)
- Add methods:
- TelegramBot#getFileStream (#442) (by @GochoMugo, requested-by @Xaqron)
- Add options to TelegramBot#stopPolling() (by @GochoMugo)
- Add
metadataargument inmessageevent (and friends e.g.text,audio, etc.) (#409) (by @jlsjonas, @GochoMugo) - Add forward-compatibility i.e. support future additional Telegram options (by @GochoMugo)
- Add support for Node.js v9 (by @GochoMugo)
- Document TelegramBot.errors, TelegramBot.messageTypes (by @GochoMugo)
Changed:
- Update TelegramBot#answerCallbackQuery() signature (by @GochoMugo)
- Improve default error logging of
polling_errorandwebhook_error(#377) - Update dependencies
Deprecated:
- Sending files: (See [usage guide][usage-sending-files]) (by @hufan-akari, @GochoMugo)
- Error will not be thrown if
Bufferis used and file-type could not be detected. - Filename will not be set to
data.${ext}ifBufferis used - Content type will not default to
nullorundefined
- Error will not be thrown if
Fixed: