Download Latest Version 1.2.0 source code.zip (1.3 MB)
Email in envelope

Get an email when there's a new version of Node.js Telegram Bot API

Home / v1.1.1
Name Modified Size InfoDownloads / Week
Parent folder
README.md 2026-06-22 2.3 kB
v1.1.1 source code.tar.gz 2026-06-22 1.3 MB
v1.1.1 source code.zip 2026-06-22 1.3 MB
Totals: 3 Items   2.6 MB 0

Added

  • request.fetch and request.fetchOptions options (on the TelegramBot constructor / HttpClient), for per-instance transport customization. Pass a custom fetch implementation (e.g. undici's fetch bound to a ProxyAgent), or extra fetch init such as an undici dispatcher, scoped to a single bot instance - no setGlobalDispatcher, so other clients in the process are unaffected. This restores the per-instance proxy capability that the legacy request.agent provided before the move to the built-in fetch. (#1319)

```ts 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

  • editMessageMedia now accepts a Buffer / stream / local file path for the new media (and its thumbnail / cover), uploading it via an attach:// part - previously only a file_id / URL or the legacy attach://<local-path> form worked. Resolved through the same _buildMediaItems pipeline as sendMediaGroup; string callers and the old attach://<local-path> form are unaffected. (#1189)

  • Breaking: createNewStickerSet and addStickerToSet were still sending the long-removed png_sticker / emojis fields, which Telegram rejects with 400 Bad Request: invalid sticker emojis. They now use the current Bot API shape - a single options object carrying stickers: InputSticker[] (or a single sticker: InputSticker), where each sticker's file (Buffer / stream / local path) is uploaded via an attach:// part, while a file_id / URL string passes through unchanged. (#1236)

```ts // 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: ["🎈"] }, }); ```

Source: README.md, updated 2026-06-22