npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@injitools/bot-telegram

v0.4.0

Published

Telegram provider for @injitools/bot: a Bot API client (long polling, SOCKS proxy, MarkdownV2 auto-escaping) and the MultiBot social provider on top of it.

Readme

@injitools/bot-telegram

Telegram provider for @injitools/bot: a thin Bot API client (got, optional SOCKS5 proxy, errors with the API's error_code) and the MultiBot social provider on top of it — long polling with the offset persisted, message/callback_query → MultiBot messages, MarkdownV2 rendering with validate-then-auto-escape, inline and reply keyboards, block detection.

Part of the Inji monorepo.

Install

npm install @injitools/bot @injitools/bot-telegram

Usage

import {MultiBot} from "@injitools/bot";
import {MultiBotTelegramProvider, TelegramApi} from "@injitools/bot-telegram";

const api = new TelegramApi(process.env.TELEGRAM_BOT_TOKEN);           // {proxyUrl: 'socks5h://…'} or TELEGRAM_PROXY_URL
const provider = await MultiBotTelegramProvider.fromApi(api);           // name: telegram:bot:<id>
bot.addProvider(provider);

await provider.pullUpdates();            // one getUpdates round (25 s long poll), dispatched through bot.ingest
await provider.handleUpdate(update);     // …or feed a webhook body

handleUpdate trusts what it is given — authenticating the webhook is the caller's job. Register it with setWebhook({secret_token}) and reject any request whose X-Telegram-Bot-Api-Secret-Token header does not match before passing the body on; otherwise anyone who learns the URL can post updates as any user.

Failed requests never carry the token: the Bot API has it in every URL, so TelegramApi rebuilds got's errors with the token masked instead of letting them out with the request attached.

Outgoing text is rendered as MarkdownV2: valid markup passes as is, anything the API would reject (., !, an unbalanced *) is escaped by ensureMarkdownV2. Use escapeMarkdownV2 for text that must be shown literally.

A 403 from sendMessage is the only way to learn that the peer blocked the bot: the provider calls bot.onBlocked(chat, true) and re-throws — the caller sees the message did not go out. Every successful send and every incoming message report false.

TelegramApi also covers getChat, getFile/downloadFile, sendPhoto, editMessageText, deleteMessage, sendChatAction, answerCallbackQuery, sendInvoice/answerPreCheckoutQuery, and getCommand/postCommand for everything else.

License

MIT