# telegram-push

> Async push text notifications to your telegram bot users.

Latest version **1.0.3** (published 2021-01-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install telegram-push
pnpm add telegram-push
yarn add telegram-push
bun add telegram-push
```

## 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.3 |
| Published | 2021-01-23 |
| First published | 2018-08-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 7.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Nemanja Petrovic |
| Maintainers | nempet |
| Keywords | async, telegram, bot, push, notification, message, text |

## Links

- npm: https://www.npmjs.com/package/telegram-push
- Repository: https://github.com/nemanjapetrovic/telegram-push
- Homepage: https://github.com/nemanjapetrovic/telegram-push#readme
- Issues: https://github.com/nemanjapetrovic/telegram-push/issues
- npm.io page: https://npm.io/package/telegram-push

## Alternatives

- [update-check](https://npm.io/package/update-check.md) — 4.0M weekly downloads
- [react-native-onesignal](https://npm.io/package/react-native-onesignal.md) — 134.5K weekly downloads
- [react-redux-toastr](https://npm.io/package/react-redux-toastr.md) — 33.7K weekly downloads
- [@nocobase/plugin-notification-manager](https://npm.io/package/@nocobase/plugin-notification-manager.md) — 2.0K weekly downloads
- [react-simple-toasts](https://npm.io/package/react-simple-toasts.md) — 1.9K weekly downloads

## Recent versions

- 1.0.3 (latest) — 2021-01-23
- 1.0.2 — 2020-04-28
- 1.0.1 — 2018-08-05
- 1.0.0 — 2018-08-05

## README

# telegram-push

Is npm package used to send text push notifications to your Telegram bot users.

# Install

To install this package just run:

```npm install telegram-push```

# Basic usage example

telegram-push requires for you to set up two environment variables:

- TELEGRAM_URL=https://api.telegram.org
- TELEGRAM_BOT_TOKEN=insert_your_bot_token

Here is an example of using telegram-push:

```
const telegramPush = require('telegram-push');

function foo () {
    //...
    //...
    telegramPush.sendAsync(chatId, 'some message foo');
}
```

How to use telegram-push with async/await:

```
const telegramPush = require('telegram-push');

async function foo1 () {
    //...
    //...

    // async sending of the messages
    telegramPush.sendAsync(chatId, 'some async send message foo 1');
    telegramPush.sendAsync(chatId, 'some async send message foo 2');
}

async function foo2 ()
{
    //...
    //...

    // sending one message after the other
    await telegramPush.sendAsync(chatId, 'some async send message foo 1');
    await telegramPush.sendAsync(chatId, 'some async send message foo 2');
}
```
# About telegram-push

Telegram-push is using chatId created automatically by Telegram when some of your users sends the first message to your Telegram bot.
This chatId represents created chat between some person and your Telegram bot. To find this chatId you can go to the next url:

https://api.telegram.org/bot{YOUR_BOT_TOKEN_HERE}/GetUpdates

Example fake url:
https://api.telegram.org/bot124124124:AFHFASajsa9dasjajksdaldasd/GetUpdates

or you can find more instructions on Telegram official [site](https://core.telegram.org/bots)

# [Contribution](https://github.com/nemanjapetrovic/telegram-push/blob/master/CONTRIBUTING.md)

Feel free to contribute by forking this repository, making changes, and submitting pull requests. For any questions or advice place an issue on this repository.

# License

  [MIT](LICENSE)

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