1.2.1 • Published 8 years ago

telegram-promise v1.2.1

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

telegram-promise Build Status

This is a simple implementation of Telegram Bot API.

Key features:

  • ES2015
  • Promise based
  • Easy customizable
  • Bot API 2.0

Supports Node.js versions greater than 4.

What isn't included:

  • Handling updates (webhook or long polling). It is business of your application.

Installation

$ npm install telegram-promise --save

Usage

const TelegramBotAPI = require('telegram-promise');

const api = new TelegramBotAPI(ACCESS_TOKEN);

api.getMe()
  .then(res => {
    console.log(res.result);
  })
  .catch(err => {
    console.error(err);
  });

api.sendPhoto({
  chat_id: CHAT_ID,
  photo: fs.createReadStream('cats.png'),
})
  .then(res => {
    console.log('Done!');
  })
  .catch(err => {
    console.log('Error:', err);
  });

API

Module API follows the official Telegram Bot API: https://core.telegram.org/bots/api

Implemented API verion: April 9, 2016 Bot API 2.0

All methods have the last parameter options. It can be used for request customization. See more: node-fetch.

More info

License

MIT

1.2.1

8 years ago

1.2.0

8 years ago

1.1.0

8 years ago

1.0.1

8 years ago

0.0.3

8 years ago

1.0.0

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago