Change Log
July 10, 2026 Β· View on GitHub
All notable changes to this project will be documented in this file. This project adheres to Semantic Versioning.
Unreleased
v2 is a from-scratch redesign with no backward compatibility with the v1
TelegramBot surface. There is no shim - the table below is the migration path.
The core is runtime-agnostic (Node 18+, Bun, Deno, Cloudflare Workers, Vercel/Deno
Edge); the client is a single generated Api class; dispatch is koa-style
middleware over a per-update Context.
Migrating from v1
| Before (v1) | After (v2) |
|---|---|
const TelegramBot = require('node-telegram-bot-api') | import { Bot } from 'node-telegram-bot-api' (or const { Bot } = require(...) - both work) |
new TelegramBot(token, { polling: true }) | const bot = new Bot(token); bot.startPolling() |
new TelegramBot(token) (for raw API calls) | const bot = new Bot(token); await bot.api.getMe() |
request.fetchOptions.dispatcher / proxy options | inject a custom Undici fetch: new Bot(token, { fetch: (url, init) => fetch(url, { ...init, dispatcher }) }) |
bot.on('message', msg => ...) | bot.on('message', ctx => ...) - a router over Context, not an EventEmitter |
bot.onText(/\/echo (.+)/, (msg, m) => ...) | bot.hears(/\/echo (.+)/, ctx => { ctx.match[1] }) |
bot.onReplyToMessage(chatId, msgId, ...) | middleware reading ctx.message.reply_to_message |
bot.sendMessage(chatId, text, opts) | bot.api.sendMessage({ chat_id, text, ...opts }) or, in a handler, ctx.reply(text, opts) |
bot.sendMessage(id, t, { reply_markup: { inline_keyboard: [...] } }) | ctx.reply(t, { reply_markup: new InlineKeyboardBuilder().text('A','a').build() }) |
{ reply_markup: JSON.stringify(markup) } (manual) | a plain object { inline_keyboard: [...] } or a builder .build() - the field is a plain typed object; the pipeline serializes it |
bot.sendPhoto(id, '/path/to/p.jpg') | bot.api.sendPhoto({ chat_id, photo: await fromPath('/path/to/p.jpg') }) (from 'node-telegram-bot-api/node') |
bot.sendPhoto(id, fs.createReadStream(...)) | bot.api.sendPhoto({ chat_id, photo: new InputFile(bytes) }) |
bare string = path or file_id (via options.filepath) | a bare string is always a file_id/URL; bytes go through new InputFile()/fromPath() |
bot.sendMediaGroup(id, [{ type:'photo', media: stream }]) | bot.api.sendMediaGroup({ chat_id, media: [{ type:'photo', media: new InputFile(bytes) }] }) (or the MediaGroupBuilder) |
webhook via new TelegramBot(token, { webHook: { port } }) | createWebhookServer(bot, { path }) (/node) or webhookCallback(bot) on any runtime |
bot.setWebHook(url) | bot.api.setWebhook({ url }) |
bot.startPolling() / bot.stopPolling() / bot.isPolling() | bot.startPolling() / bot.stop() / bot.isRunning(), or longPoll(bot.api, opts, signal) directly |
error.code === 'ETELEGRAM', message substring matching | catch (e) { if (e instanceof TelegramApiError && e.errorCode === 429) e.retryAfter } |
EFATAL | split into NetworkError (EFETCH) and TimeoutError (ETIMEOUT) |
update.message always Message | undefined | Update is a discriminated union - if ('message' in update) update.message narrows |
bot.getMe(...) etc. (positional + options) | every method takes a single params object: bot.api.getMe(), bot.api.getChat({ chat_id }) |
| CommonJS, Node-only | web-standard core (Node 18+, Bun, Deno, Workers, edge); published dual ESM+CJS, so import or require both work |
Longer examples
| Before (v1) | After (v2) |
|---|---|
|
Polling handlers const TelegramBot = require("node-telegram-bot-api");
const bot = new TelegramBot(process.env.BOT_TOKEN, { polling: true });
bot.onText(/\/start/, (msg) => {
bot.sendMessage(msg.chat.id, "Hi");
});
bot.onText(/\/echo (.+)/, (msg, match) => {
bot.sendMessage(msg.chat.id, match[1]);
});
bot.on("callback_query", (query) => {
bot.answerCallbackQuery(query.id, { text: "ok" });
});
|
Polling handlers import { Bot } from "node-telegram-bot-api";
import { run } from "node-telegram-bot-api/node";
const bot = new Bot(process.env.BOT_TOKEN!);
bot.command("start", (ctx) => {
return ctx.reply("Hi");
});
bot.hears(/\/echo (.+)/, (ctx) => {
return ctx.reply(ctx.match![1]!);
});
bot.on("callback_query", (ctx) => {
return ctx.answerCallbackQuery({ text: "ok" });
});
await run(bot);
|
|
Uploads const TelegramBot = require("node-telegram-bot-api");
const fs = require("node:fs");
const bot = new TelegramBot(token);
await bot.sendPhoto(chatId, "./cat.jpg");
await bot.sendDocument(chatId, fs.createReadStream("./report.pdf"));
await bot.sendMediaGroup(chatId, [
{ type: "photo", media: fs.createReadStream("./a.jpg") },
{ type: "photo", media: "https://example.com/b.jpg" },
]);
|
Uploads import { Bot, InputFile } from "node-telegram-bot-api";
import { fromPath } from "node-telegram-bot-api/node";
import { readFile } from "node:fs/promises";
const bot = new Bot(token);
await bot.api.sendPhoto({ chat_id: chatId, photo: await fromPath("./cat.jpg") });
const report = await readFile("./report.pdf");
await bot.api.sendDocument({
chat_id: chatId,
document: new InputFile(report, { filename: "report.pdf" }),
});
await bot.api.sendMediaGroup({
chat_id: chatId,
media: [
{ type: "photo", media: await fromPath("./a.jpg") },
{ type: "photo", media: "https://example.com/b.jpg" },
],
});
|
|
Proxy request options const TelegramBot = require("node-telegram-bot-api");
const { ProxyAgent } = require("undici");
const dispatcher = new ProxyAgent("http://127.0.0.1:8080");
const bot = new TelegramBot(token, {
request: {
fetchOptions: { dispatcher },
},
});
|
Proxy request options import { fetch as undiciFetch, ProxyAgent, type Dispatcher } from "undici";
import { Bot } from "node-telegram-bot-api";
const dispatcher = new ProxyAgent("http://127.0.0.1:8080");
const bot = new Bot(token, {
fetch: (url, init) =>
undiciFetch(url, {
...init,
dispatcher,
} as RequestInit & { dispatcher: Dispatcher }),
});
await bot.api.getMe();
|
Runtime & module format
v2's source and runtime-agnostic core are ESM / web-standard, but the published package is dual-module: zshy emits both an ESM build (*.js / *.d.ts) and a CommonJS build (*.cjs / *.d.cts), and the package.json exports map exposes both import and require conditions. So unlike v1, the module system is not a migration blocker - a CommonJS project can keep calling require():
// ESM
import { Bot, Api } from "node-telegram-bot-api";
// CommonJS
const { Bot, Api } = require("node-telegram-bot-api");
The real break from v1 is the API surface (no TelegramBot class, single-argument methods, middleware instead of events - see the table above), not the way you load the module. The runtime-agnostic core still imports only web-standard APIs, so it runs unchanged on Node 18+, Bun, Deno, and edge runtimes; the CommonJS build is purely a convenience for Node consumers and pulls no Node dependency into the core.
The package name is intentionally retained (node-telegram-bot-api) even though v2 shares no API surface with v1. This is a deliberate semver-major: the name carries the install base and the docs/SEO, and v2 owns the lineage. The cost is that npm install node-telegram-bot-api on an old tutorial now lands you on a completely different API - the version (^2) is the only signal, so pin it.
Mental-model shifts
- One client, single-argument methods.
Apimirrors the wire API: one method per Bot API method, each taking one params object. Positional ergonomics (ctx.reply(text)) live onContext. - Structured fields are plain typed objects.
reply_markup,entities,reply_parameters,media, ... take a plain object/array (or a fluent builder, which returns the same plain shape); the pipeline serializes them once. Nojson()wrapper, no branded strings. A nested file is just anInputFiledropped into the file field - the pipeline hoists it to anattach://part. - Composition over events.
bot.use(mw)and the filter helpers (on/command/hears) are koa-style middleware over a per-updateContext, so sessions/auth/rate-limiting/error-boundaries wrap one another viaawait next(). A handler error never stops the bot: it is routed to the error boundary (default: log viaconsole.errorand continue); install your own withbot.catch(), and rethrow from it to opt back into fail-loud. - Two entry points, one dispatch path.
bot.startPolling(source)pumps an async generator for long-running processes;bot.handleUpdate(update)handles a single update and is what the edge/webhook callback calls. - Node helpers are opt-in.
import ... from 'node-telegram-bot-api'is the runtime-agnostic core;import ... from 'node-telegram-bot-api/node'addsfromPath,createWebhookServer, andrun. - Uploads stream. Multipart bodies are hand-rolled as a web
ReadableStreamand handed straight tofetch(duplex: "half"), so file bytes flow from their source without ever being buffered - upload memory stays flat regardless of file size.fromPath()wraps the file as a stream factory that re-opens a disk read stream per attempt (fs.openAsBlobwas rejected: Deno's node-compat implementation buffers the whole file eagerly).Blob/Uint8Arrayuploads re-stream on retry; a one-shotReadableStreamInputFileis sent exactly once and a failure surfaces immediately instead of retrying; a stream factory (InputFileStreamFactory,() => ReadableStream) opens a fresh stream per attempt and stays retryable. A runtime whosefetchcannot stream a request body (Bun < 1.4.0 with an HTTP(S) proxy configured - oven-sh/bun#33918, fixed upstream by oven-sh/bun#32635) transparently sends the same bytes as one bufferedBlob.inputFileToBlobis gone - nothing converts toFormDataanymore. The default per-requesttimeoutMsis now 300000 (5 min, was 30s) so a large upload on a slow link is not cut off mid-stream.
1.1.2 - 2026-06-25
Added
-
CommonJS consumption restored. The package now ships a dual ESM + CJS build (produced by
zshy): thepackage.jsonexportsmap exposes both animportand arequirecondition (with their own.d.ts/.d.ctstypings), so the library can be loaded with either syntax β// CommonJS const { TelegramBot } = require("node-telegram-bot-api"); // ESM (unchanged) import TelegramBot from "node-telegram-bot-api";The v1.0.0 dynamic-import workaround (
const { default: TelegramBot } = await import("node-telegram-bot-api")) is no longer required. Source maps are emitted for both module formats, and each CJS artifact references its own map.
1.1.1 - 2026-06-22
Added
-
request.fetchandrequest.fetchOptionsoptions (on theTelegramBotconstructor /HttpClient), for per-instance transport customization. Pass a customfetchimplementation (e.g. undici'sfetchbound to aProxyAgent), or extra fetch init such as an undicidispatcher, scoped to a single bot instance - nosetGlobalDispatcher, so other clients in the process are unaffected. This restores the per-instance proxy capability that the legacyrequest.agentprovided before the move to the built-infetch. (#1319)import TelegramBot from "node-telegram-bot-api"; import { ProxyAgent } from "undici"; const bot = new TelegramBot(token, { polling: true, request: { fetchOptions: { dispatcher: new ProxyAgent("http://127.0.0.1:8080") } }, });
Fixed
-
editMessageMedianow accepts a Buffer / stream / local file path for the newmedia(and itsthumbnail/cover), uploading it via anattach://part - previously only a file_id / URL or the legacyattach://<local-path>form worked. Resolved through the same_buildMediaItemspipeline assendMediaGroup; string callers and the oldattach://<local-path>form are unaffected. (#1189) -
Breaking:
createNewStickerSetandaddStickerToSetwere still sending the long-removedpng_sticker/emojisfields, which Telegram rejects with400 Bad Request: invalid sticker emojis. They now use the current Bot API shape - a single options object carryingstickers: InputSticker[](or a singlesticker: InputSticker), where each sticker's file (Buffer / stream / local path) is uploaded via anattach://part, while a file_id / URL string passes through unchanged. (#1236)// Before (broken): bot.createNewStickerSet(userId, name, title, pngSticker, "π"); // After: bot.createNewStickerSet({ user_id: userId, name, title, stickers: [{ sticker: "./a.png", format: "static", emoji_list: ["π"] }], }); bot.addStickerToSet({ user_id: userId, name, sticker: { sticker: "./b.webp", format: "static", emoji_list: ["π"] }, });
1.1.0 - 2026-06-13
Bot API 10.1 (June 11, 2026)
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).
1.0.0 - 2026-06-12
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; useanswerCallbackQuery(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-basedHttpClient(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?)βpermissionsis 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 aformatoption).- 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'sOptionstype β the client isfetch-based and the dependency is dropped. PollingOptions.intervalisnumberonly (wasstring | number).- Array arguments (
answerInlineQueryresults,sendMediaGroupmedia,sendInvoiceprices,setMyCommandscommands) no longer acceptreadonlyarrays.
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
0.68.0 - 2026-04-05
Added:
-
Support Telegram Bot API v9.3 (by @danielperez9430)
#getUserGifts#getChatGifts#sendMessageDraft(by @xjx0106)#repostStory
-
Fixed method:
unpinAllGeneralForumTopicMessagesreplaceStickerInSet
-
Support Telegram Bot API v9.5 (by @danielperez9430)
setChatMemberTag
-
Support Telegram Bot API v9.6 (by @danielperez9430)
- setMyProfilePhoto
- removeMyProfilePhoto
-
Added missing methods (by @danielperez9430)
- getUserProfileAudios
- approveSuggestedPost
- declineSuggestedPost
-
Added more test
-
Support Telegram Bot API v9.6
- getManagedBotToken
- replaceManagedBotToken
- savePreparedKeyboardButton
0.67.0 - 2025-12-13
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)
0.66.0 - 2024-05-03
- Support Telegram Bot API 7.2 & 7.3 (@danielperez9430)
- getBusinessConnection
- replaceStickerInSet
- Support for updates: (@danielperez9430)
- business_connection
- business_message
- edited_business_message
- deleted_business_messages
- Minor fixes: (@danielperez9430)
- getUserChatBoosts
0.65.1 - 2024-03-09
- Support for updates (@danielperez9430)
- message_reaction
- message_reaction_count
- chat_boost
- removed_chat_boost
0.65.0 - 2024-02-20
- Support Telegram Bot API v7.1
- deleteMessages (@Sp3ricka)
- copyMessages (@xjx0106 & @Sp3ricka)
- setMessageReaction (@Sp3ricka)
- forwardMessages (@danielperez9430)
- getUserChatBoosts (@danielperez9430)
- Minor changes: (@danielperez9430)
- Refactor methods order
- Fix copyMessages & setMessageReaction methods
- Added missing tests
- Fix tests for methods copyMessages & getMyDefaulAdministratorRights
0.64.0 - 2023-10-25
- Replace
requestwith a maintained version (@danielperez9430)
- Change
requestto@cypress/request - Change
request-promiseto@cypress/request-promise
0.63.0 - 2023-08-23
- Support Telegram Bot API v6.8 (@danielperez9430)
- unpinAllGeneralForumTopicMessages
[0.62.0][0.62.0] - 2023-03-19
- Support Telegram Bot API v6.6 & v6.7 (@danielperez9430)
- setMyDescription
- getMyDescription
- setMyShortDescription
- getMyShortDescription
- setCustomEmojiStickerSetThumbnail
- setStickerSetTitle
- deleteStickerSet
- setStickerEmojiList
- setStickerKeywords
- setStickerMaskPosition
[0.61.0][0.61.0] - 2022-12-30
- Support Telegram Bot API v6.4 (@danielperez9430)
- editGeneralForumTopic
- closeGeneralForumTopic
- reopenGeneralForumTopic
- hideGeneralForumTopic
- unhideGeneralForumTopic
- Minor changes: (@danielperez9430)
- The parameters
nameandicon_custom_emoji_idof the methodeditForumTopicare now optional. - Fix add thumb in sendAudio, sendVideo and sendVideoNote
- Fix getMyCommands and setMyCommands
- Suggested tip amounts stringify in sendInvoice
[0.60.0][0.60.0] - 2022-10-06
- Support Telegram Bot API v6.3 (@danielperez9430)
- createForumTopic
- closeForumTopic
- reopenForumTopic
- deleteForumTopic
- unpinAllForumTopicMessages
- getForumTopicIconStickers
-
Fix test getMyDefaultAdministratorRights (@danielperez9430)
-
Fix parse entities - (@toniop99)
[0.59.0][0.59.0] - 2022-08-15
- Support Telegram Bot API v6.2 (@danielperez9430)
- getCustomEmojiStickers
-
Support test enviroment (@tinsaeDev & @kamikazechaser)
-
Remove dependencies: (@danielperez9430)
- Remove bluebird => Use NodeJS Native Promises
- Remove depd => Use node native deprecate util for warnings
- Remove contributor dev dependency and add list of contributors in the readme
-
Remove legacy methods: (@danielperez9430)
- getChatMembersCount
- kickChatMember
- Docs: (@danielperez9430)
- Update the docs of the methods
- Order methods follow the Telegram bot API docs in src/telegram.js
- Update README
- Fix: (@danielperez9430)
- addStickerToSet() -> Allow to send tgs_sticker + webm_sticker
- Remove mandatory param βstart_parameterβ from sendInvoice, because in the docs is a optional param
- getStickerSet test fix deprecated response value "contains_masks" change to "sticker_type"
- Fix some other tests
- New Test: (@danielperez9430)
- deleteStickerFromSet
- setStickerPositionInSet
- getCustomEmojiStickers
[0.58.0][0.58.0] - 2022-06-22
-
Support Bot API v6.1: (@danielperez9430)
- Add method createInvoiceLink()
-
Support for setStickerSetThumb (@elihaidv)
-
Add new test (@danielperez9430)
- createInvoiceLink
-
Test fixes (@danielperez9430)
- sendVideoNote
- createNewStickerSet
- setStickerSetThumb
- getChatMenuButton
- setWebHook
-
Bug fixes (@danielperez9430)
- answerWebAppQuery
- Support for send thumb in sendAudio
[0.57.0][0.57.0] - 2022-04-23
Added:
-
Support Bot API v6: (@danielperez9430)
- Add method setChatMenuButton()
- Add method getChatMenuButton()
- Add method setMyDefaultAdministratorRights()
- Add method getMyDefaultAdministratorRights()
- Add method answerWebAppQuery()
- Renamed the fields voice_chat_scheduled, voice_chat_started, voice_chat_ended, and voice_chat_participants_invited to video_chat_scheduled, video_chat_started, video_chat_ended, and video_chat_participants_invited
Tests:
- answerWebAppQuery
- setChatMenuButton
- getChatMenuButton
- setMyDefaultAdministratorRights
- getMyDefaultAdministratorRights
[0.56.0][0.56.0] - 2021-12-07
Added:
-
Support Bot API v5.5: (@danielperez9430)
- Add method banChatSenderChat()
- Add method unbanChatSenderChat()
Fixes:
- Tests for support with new invite link format
[0.55.0][0.55.0] - 2021-11-06
Added:
-
Support Bot API v5.4: (@danielperez9430)
- Add method approveChatJoinRequest()
- Add method declineChatJoinRequest()
- Add support for new updates:
- chat_join_request
Fixes:
- Method editMessageMedia: Now you can send a local file (
"attach://" + filePatch)
[0.54.0][0.54.0] - 2021-06-29
Added:
-
Support Bot API v5.3: (@danielperez9430)
- Add method deleteMyCommands()
- Add method banChatMember()
- Add method getChatMemberCount()
New Test:
- deleteMyCommands
- banChatMember
- getChatMemberCount
Deprecated:
- Method kickChatMember()
- Method getChatMembersCount()
[0.53.0][0.53.0] - 2021-04-26
Added:
-
Support Bot API v5.2:(@danielperez9430)
- Add support for new messageTypes:
- voice_chat_scheduled
- Add support for new messageTypes:
[0.52.0][0.52.0] - 2021-03-20
Added:
-
Support Bot API v5.1: (by @danielperez9430)
- Add method createChatInviteLink()
- Add method editChatInviteLink()
- Add method revokeChatInviteLink()
- Add support for new messageTypes:
- voice_chat_started
- voice_chat_ended
- voice_chat_participants_invited
- message_auto_delete_timer_changed
- chat_invite_link
- chat_member_updated
- Add support for new updates:
- my_chat_member
- chat_member
New Test: (by @danielperez9430)
- createChatInviteLink
- editChatInviteLink
- revokeChatInviteLink
[0.51.0][0.51.0] - 2020-11-04
Added:
-
Support Bot API v5.0: (by @danielperez9430)
- Add method copyMessage()
- Add method unpinAllChatMessages()
- Add method close()
- Add method logOut()
Changed: (by @danielperez9430)
- Remove trailing-spaces
- Fix Bugs in Test
New Test: (by @danielperez9430)
- copyMessage
- unpinAllChatMessages
[0.50.0][0.50.0] - 2020-05-2020
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
[0.40.0][0.40.0] - 2019-05-04
Added:
- Support Bot API v4.2: (by @kamikazechaser)
- Add methods: TelegramBot#sendPoll(), TelegramBot#stopPoll()
- Support events: poll
- Support Bot API v4.0: (by @kamikazechaser)
- Add methods: TelegramBot#editMessageMedia(), TelegramBot#sendAnimation()
- Support new message types: passport_data, animation
0.30.0 - 2017-12-21
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#editMessageLiveLocation, TelegramBot#stopMessageLiveLocation (#439)
- Add methods TelegramBot#setChatStickerSet, TelegramBot#deleteChatStickerSet (#440)
- 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) (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:
- Fix the offset infinite loop bug (#265, #36) (by @GochoMugo)
- Fix game example (#449, #418) (by @MCSH)
0.29.0 - 2017-10-22
Added:
- Add Bot API v3.2 methods:
- (#429) TelegramBot#getStickerSet (by @CapacitorSet, @LibertyLocked)
- (#430) TelegramBot#uploadStickerFile (by @CapacitorSet)
- TelegramBot#createNewStickerSet, TelegramBot#addStickerToSet, TelegramBot#setStickerPositionInSet, TelegramBot#deleteStickerFromSet (by @GochoMugo)
- Supports API v3.3
Deprecated:
- Auto-enabling Promise cancellation (#319) (by @GochoMugo)
0.28.0 - 2017-08-06
Added:
- (#361) Support Bot API v3.1 (by @Lord-Protector, @kamikazechaser)
- (#332) Support Bot API v3.0 (by @kamikazechaser, @GochoMugo)
- Add TelegramBot#removeTextListener() (by @GochoMugo)
- (#342) Add game example (by @MCSH)
- (#315) List 'bot-brother' project in community section in README (by @saeedhei)
Changed:
- (#367) Update TelegramBot#answerCallbackQuery() signature (by @mnb3000)
Fixed:
- (#325) Fix global regexp state reset (by @Sirius-A)
- (#363) Fix download file path on windows (by @kucherenkovova)
- (#346) Fix anchor webhook link in docs (by @Coac)
0.27.1 - 2017-04-07
Added:
- (#287) Add Express WebHook example (by @kamikazechaser)
Fixed:
- (#291) Improve docs (by @preco21)
- (#298) Fix running on Node v5 (by @jehy)
- (#307) Fix badge links in README (by @JaakkoLipsanen)
- Fix defaulting value of
options.polling.params.timeout(by @GochoMugo) - Fix typos in Github issue template (by @GochoMugo, requested-by @GingerPlusPlus)
0.27.0 - 2017-02-10
Added:
- Add constructor options:
- (#243)
options.polling.params(by @GochoMugo, requested-by @sidelux)
- (#243)
- Add methods:
- (#74) TelegramBot#removeReplyListener() (by @githugger)
- (#283) Add proper error handling (by @GochoMugo)
- (#272) Add health-check endpoint (by @mironov)
options.webHook.healthEndpoint
- (#152) Add test for TelegramBot#sendDocument() using 'fileOpts' param (by @evolun)
- Document
options.webHook.host(by @GochoMugo) - (#264) Add Bot API version to README (by @kamikazechaser)
- Add examples:
- (#271) WebHook on Heroku (by @TheBeastOfCaerbannog)
- (#274) WebHook on Zeit Now (by @Ferrari)
Changed:
- (#147) Use String#indexOf(), instead of RegExp#test(), to find token in webhook request (by @AVVS)
Fixed:
- Fix bug:
- (#275, #280) fix es6 syntax error on Node.js v4.x (by @crazyabdul)
- (#276) promise.warning from
request-promise(by @GochoMugo, reported-by @preco21) - (#281) fix handling error during polling (by @GochoMugo, reported-by @dimawebmaker)
- (#284) fix error during deletion of already-set webhook, during polling (by @GochoMugo, reported-by @dcparga)
- Fix links in documentation (by @Ni2c2k)
0.26.0 - 2017-01-20
Added:
- Add TelegramBot constructor options:
options.httpsoptions.baseApiUrloptions.filepath
- Add methods:
- TelegramBot#stopPolling()
- TelegramBot#isPolling()
- TelegramBot#openWebHook()
- TelegramBot#closeWebHook()
- TelegramBot#hasOpenWebHook()
- TelegramBot#deleteWebHook()
- TelegramBot#getWebHookInfo()
Changed:
- Use POST requests by default
- Ensure all relevant methods return Promises
- Document auto-deletion of webhook during polling
- Deprecate support for Node.js v0.12
- Fix consistency of methods signatures
- Rename TelegramBot#initPolling() to TelegramBot#startPolling()
- Deprecate TelegramBot#initPolling()
Fixed:
- Handle error during formatting
formData - Fix ES6 syntax
Credits/Blames: Unless explicitly stated otherwise, above work was done by @GochoMugo
0.25.0 - 2016-12-21
Added:
- Supports the API v2.3 updates (by @kamikazechaser)
- Add TelegramBot constructor option:
options.request: proxy extra request options (by @tarmolov)options.onlyFirstMatch(by @GingerPlusPlus)
- Add methods:
- TelegramBot#sendVenue() (by Tketa)
- TelegramBot#sendContact() (by @GochoMugo)
- TelegramBot#getGameHighScores() (by @jishnu7)
Fixed:
- Fix request performance issue (by @preco21)
- Fix typos (by oflisback)