# telegramsjs

> A powerful library for interacting with the Telegram Bot API

Latest version **4.14.1** (published 2026-05-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install telegramsjs
pnpm add telegramsjs
yarn add telegramsjs
bun add telegramsjs
```

## Health

**Score 60/100 (C)** — status: active.

Positive: has types; esm support; no vulnerabilities; high maintenance score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 4.14.1 |
| Published | 2026-05-07 |
| First published | 2023-03-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=14 |
| Dependencies | 6 |
| Unpacked size | 1.1 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 52 |
| Author | Sempai |
| Maintainers | crazy-sempai07 |
| Keywords | javascript, typescript, telegram, library, sempai-07, telegramapi, api, bot |

## Links

- npm: https://www.npmjs.com/package/telegramsjs
- Repository: https://github.com/Telegramsjs/telegramsjs
- Homepage: https://docs-telegramsjs.vercel.app/
- Issues: https://github.com/Telegramsjs/telegramsjs/issues
- npm.io page: https://npm.io/package/telegramsjs

## Dependencies (6)

- [tslib](https://npm.io/package/tslib.md) ^2.8.0
- [node-fetch](https://npm.io/package/node-fetch.md) ^2.7.0
- [safe-compare](https://npm.io/package/safe-compare.md) ^1.1.4
- [sandwich-stream](https://npm.io/package/sandwich-stream.md) ^2.0.2
- [@telegram.ts/collection](https://npm.io/package/@telegram.ts/collection.md) ^2.0.1
- [@telegram.ts/formatters](https://npm.io/package/@telegram.ts/formatters.md) ^2.0.1

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 4.14.1 (latest) — 2026-05-07
- 4.15.0-beta.4 (beta) — 2026-08-22
- 4.15.0-beta.3 — 2026-08-22
- 4.15.0-beta.2 — 2026-08-22
- 4.15.0-beta.1 — 2026-08-22
- 4.14.0 — 2026-05-07
- 4.14.0-beta.1 — 2026-05-02
- 4.13.1 — 2026-01-14
- 4.13.0 — 2026-01-02
- 4.12.0 — 2025-12-29
- 4.11.0 — 2025-12-15
- 4.10.1 — 2025-08-24
- 4.10.0 — 2025-08-24
- 4.10.0-beta.1 — 2025-08-24
- 4.9.0 — 2025-05-10
- … 112 more at https://npm.io/package/telegramsjs/versions

## README

<div align="center">
  <h1>Telegramsjs</h1><br>
  <img src="https://raw.githubusercontent.com/Sempai-07/Telegramsjs/main/docs/avatar.png"><br>

[![Bot API](https://img.shields.io/badge/Bot%20API-v.9.6-00aced.svg?style=flat-square&logo=telegram)](https://core.telegram.org/bots/api)
[![NPM Version](https://img.shields.io/npm/v/telegramsjs.svg?maxAge=3600)](https://www.npmjs.com/package/telegramsjs)
[![NPM Downloads](https://img.shields.io/npm/dt/telegramsjs.svg?maxAge=3600)](https://www.npmjs.com/package/telegramsjs)

</div>

## About

`telegramsjs` is a powerful [Node.js](https://nodejs.org) module that allows you to easily interact with the
[Telegram API](https://core.telegram.org/bots).

- Object-oriented
- Predictable abstractions
- Performant
- 100% coverage of the Telegram API

## Installation

```sh
npm install telegramsjs
yarn add telegramsjs
```

## Support the Project 💖

> Support the developer with a cup of tea—after all, solo covers the package.  
> [☕ Buy me a coffee](https://send.monobank.ua/jar/AXsVZde3Lc)

### Optional packages

- **[@telegram.ts/collection](https://github.com/telegramsjs/collection)**: Collection utilities for `TelegramsJS`.
- **[@telegram.ts/types](https://github.com/telegramsjs/types)**: `TypeScript` types for Telegram API objects.
- **[@telegram.ts/emoji](https://github.com/telegramsjs/emoji)**: Emoji utilities for `TelegramsJS`.
- **[@telegram.ts/formatters](https://github.com/telegramsjs/formatters)**: Formatters for text and messages in `TelegramsJS`.

## Example usage

Install telegramsjs:

```sh
npm install telegramsjs
yarn add telegramsjs
```

Afterwards we can create a quite simple example bot:

```js
// ECMAscript/TypeScript
import {
  TelegramClient,
  InlineKeyboardBuilder,
  MarkupStyles,
} from "telegramsjs";
// CommonJS
const {
  TelegramClient,
  InlineKeyboardBuilder,
  MarkupStyles,
} = require("telegramsjs");

const client = new TelegramClient("TELEGRAM_BOT_TOKEN");

client.on("ready", async ({ user }) => {
  await user.setCommands([
    {
      command: "/start",
      description: "Starting command",
    },
  ]);

  if (user.capabilities.allow("joinGroups")) {
    console.log("The bot has permission to be added to other groups. 🔓");
  }
  
  console.log(`Bot @${user.username} is the ready status!`);

});

client.on("message", async (msg) => {
  if (!msg.content) return;

  if (msg.content === "/menu" || msg.content === "/start") {
    const menu = new InlineKeyboardBuilder()
      .text("Pay", "menu_pay", {
        style: MarkupStyles.Green,
        icon: "5463122435425448565",
      })
      .text("Rules", "menu_rules", {
        style: MarkupStyles.Danger,
        icon: "5465154440287757794",
      })
      .row()
      .text("Home", "menu_home", {
        style: MarkupStyles.Primary,
        icon: "5253997076169115797",
      });

    await msg.chat.send("Panel for payment", {
      replyMarkup: menu,
    });
  }

  if (msg.content.startsWith("/tag")) {
    if (!msg.chat.isSupergroup()) {
      return msg.reply(`Changing your nickname is only available in groups.`);
    }

    const [, newTag] = msg.content.split(" ");

    try {
      await msg.member.setTag(newTag);
      return msg.chat.send(
        `${msg.author.firstName} Your custom tag has been changed to: ${newTag}`,
      );
    } catch (err) {
      console.log(err);

      return msg.chat.send("Error when changing custom tag.");
    }
  }
});

client.login();
```

## Documentation

For more information and detailed documentation, please visit the [documentation](https://telegramsjs.vercel.app/).

## Contributions

We welcome contributions to the development of `Telegramsjs`! If you have any ideas or suggestions, please visit the [Official Support Server](https://discord.gg/j8G7jhHMbs) or the [Official Telegram Group](https://t.me/sempaika_telegramsjs).

## Example

For a comprehensive example of using the library, please refer to the GitHub page.

## License

`Telegramsjs` is available under the MIT license. For more information, please refer to the [LICENSE](https://github.com/Sempai-07/Telegramsjs/blob/main/LICENSE) file.

---
_Source: https://npm.io/package/telegramsjs · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
