# @crcr/tg-broadcast-limits

> Class that helps sending Telegram bulk messages without hitting limits and 429 errors.

Latest version **1.0.6** (published 2021-01-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install @crcr/tg-broadcast-limits
pnpm add @crcr/tg-broadcast-limits
yarn add @crcr/tg-broadcast-limits
bun add @crcr/tg-broadcast-limits
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.6 |
| Published | 2021-01-15 |
| First published | 2021-01-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 6.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | dvs |
| Maintainers | crcr |
| Keywords | telegram, telegram-bot-api, javascript, typescript |

## Links

- npm: https://www.npmjs.com/package/@crcr/tg-broadcast-limits
- Repository: https://github.com/dvs-crcr/tg-broadcast-limits
- Homepage: https://github.com/dvs-crcr/tg-broadcast-limits#readme
- Issues: https://github.com/dvs-crcr/tg-broadcast-limits/issues
- npm.io page: https://npm.io/package/@crcr/tg-broadcast-limits

## Dependencies (1)

- [@crcr/utils](https://npm.io/package/@crcr/utils.md) 1.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

- 1.0.6 (latest) — 2021-01-15
- 1.0.5 — 2021-01-15
- 1.0.4 — 2021-01-15
- 1.0.3 — 2021-01-14
- 1.0.2 — 2021-01-13
- 1.0.1 — 2021-01-13
- 1.0.0 — 2021-01-13

## README

# tg-broadcast-limits
[![NPM Version][npm-image]][npm-url]
>Node.js module that helps sending Telegram bulk messages without hitting limits and 429 errors.

## Install
```bash
$ npm i @crcr/tg-broadcast-limits
```

## Usage
>See the [examples/](https://github.com/dvs-crcr/tg-broadcast-limits/tree/main/examples) folder for detailed example.
```js
const TelegramApi = require('./TelegramApi'); // telegram api example
const TBL = require('@crcr/tg-broadcast-limits').default;
// OR USE: 
// import { default as TBL } from '@crcr/tg-broadcast-limits'

const chatIds = [1, 2, 3];  // Array of chat ids ;)
const token = '123:heLLoworldtGBRoadCaStLimiTS'; // Telegram bot api token

function broadcast(token, chatIds, text) {
  const tbl = new TBL()
  chatIds.forEach((chatId) => {
    tbl.push(chatId, TelegramApi.sendMessage.bind(this), token, chatId, text);
  })
}

broadcast(token, chatIds, 'Hello from dvs!');
```

## Telegram Broadcast limits
Used limit values:
* 20 msg per minute in same group;
* 1 msg per second in same chat;
* 30 msg per second in any chat.
>You can read about the limits on the official [Telegram website](https://core.telegram.org/bots/faq#broadcasting-to-users).

## License
[MIT](LICENSE)

[npm-image]: https://img.shields.io/npm/v/@crcr/tg-broadcast-limits?style=flat-square
[npm-url]: https://www.npmjs.com/package/@crcr/tg-broadcast-limits

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