# telegram-api

> Control Telegram bots easily using the new Telegram API

Latest version **4.2.0** (published 2018-12-24) · MIT license · 0 weekly downloads

## Install

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

## 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 | 4.2.0 |
| Published | 2018-12-24 |
| First published | 2015-06-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.12.0 |
| Dependencies | 4 |
| Unpacked size | 102 KB |
| Known vulnerabilities | 0 (+5 in 2 direct dependencies) |
| Install scripts | no |
| GitHub stars | 121 |
| Author | Mahdi Dibaiee |
| Maintainers | mdibaiee |
| Keywords | Telegram, bot, node, module |

## Links

- npm: https://www.npmjs.com/package/telegram-api
- Repository: https://github.com/mdibaiee/node-telegram-api
- Issues: https://github.com/mdibaiee/node-telegram-api/issues
- npm.io page: https://npm.io/package/telegram-api

## Dependencies (4)

- [qs](https://npm.io/package/qs.md) 4.0.0
- [mime](https://npm.io/package/mime.md) 1.3.4
- [unirest](https://npm.io/package/unirest.md) 0.4.2
- [babel-polyfill](https://npm.io/package/babel-polyfill.md) ^6.7.4

## Alternatives

- [@expo/fingerprint](https://npm.io/package/@expo/fingerprint.md) — 6.2M weekly downloads
- [@azure/monitor-opentelemetry-exporter](https://npm.io/package/@azure/monitor-opentelemetry-exporter.md) — 850.0K weekly downloads
- [@azure/monitor-opentelemetry](https://npm.io/package/@azure/monitor-opentelemetry.md) — 624.0K weekly downloads
- [@posthog/ai](https://npm.io/package/@posthog/ai.md) — 423.3K weekly downloads
- [fakefilter](https://npm.io/package/fakefilter.md) — 63.9K weekly downloads

## Recent versions

- 4.2.0 (latest) — 2018-12-24
- 4.1.0 — 2018-04-20
- 4.0.0 — 2018-03-21
- 3.1.1 — 2018-03-21
- 3.1.0 — 2018-03-21
- 3.0.0 — 2018-03-02
- 2.0.0 — 2018-02-18
- 1.0.1 — 2018-02-14
- 1.0.0 — 2018-02-05
- 0.9.1 — 2018-02-01
- 0.9.0 — 2017-09-12
- 0.8.0 — 2017-09-12
- 0.7.9 — 2016-12-17
- 0.7.8 — 2016-11-23
- 0.7.7 — 2016-11-22
- … 35 more at https://npm.io/package/telegram-api/versions

## README

Telegram Bots
=============
Create and control [Telegram bots](https://core.telegram.org/bots) easily
using the new [Telegram API](https://core.telegram.org/bots/api).

```
npm install telegram-api
```

telegram-api is in beta, your feedback is appreciated, please [fill an issue](https://github.com/mdibaiee/node-telegram-api/issues)
for any bugs you find or any suggestions you have.

If you are cloning this repository, remember to run `npm install` to install dependencies.

If you are looking for a real-life example of a bot written using this module, see [mdibaiee/webdevrobot](https://github.com/mdibaiee/webdevrobot).

[**Documentation**](https://github.com/mdibaiee/node-telegram-api/wiki)

Example
=======
```javascript
// ES6:
import Bot, { Message, File } from 'telegram-api';

// ES5:
var Bot = require('telegram-api').default;
var Message = require('telegram-api/types/Message');
var File = require('telegram-api/types/File');

var bot = new Bot({
  token: 'YOUR_TOKEN'
});

bot.start();

bot.get(/Hi|Hey|Hello|Yo/, function(message) {
  var answer = new Message().text('Hello, Sir').to(message.chat.id);

  bot.send(answer);
});

bot.command('start', function(message) {
  var welcome = new File().file('./some_photo.png').caption('Welcome').to(message.chat.id);

  bot.send(welcome);
});

// Arguments, see: https://github.com/mdibaiee/node-telegram-api/wiki/Commands
bot.command('weather <city> [date]', function(message) {
  console.log(message.args.city, message.args.date);
})
```

Todo
====
- [x] Webhook support (not tested, see [#4](https://github.com/mdibaiee/node-telegram-api/issues/4))
- [x] Forward Type
- [x] BulkMessage Type
- [x] File Type
- [ ] Sticker Type
- [ ] Location Type
- [ ] Contact Type
- [ ] Allow remote control of bots (TCP maybe)
- [ ] YOUR IDEAS! [Fill an issue](https://github.com/mdibaiee/node-telegram-api/issues)

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