Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

telegram-promise

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

telegram-promise

Simple Telegram Bot API

  • 1.2.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
8
Maintainers
1
Weekly downloads
 
Created
Source

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

Keywords

FAQs

Package last updated on 21 Jul 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc