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

node-telegram-bot-api

Package Overview
Dependencies
Maintainers
1
Versions
64
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-telegram-bot-api - npm Package Compare versions

Comparing version 0.21.1 to 0.22.0

lib/telegram.js

144

package.json
{
"name": "node-telegram-bot-api",
"version": "0.21.1",
"version": "0.22.0",
"description": "Telegram Bot API",
"main": "index.js",
"main": "./lib/telegram.js",
"directories": {

@@ -17,6 +17,7 @@ "example": "examples",

"scripts": {
"test": "./node_modules/.bin/mocha test/index.js",
"prepublish": "./node_modules/.bin/babel -d ./lib src",
"test": "./node_modules/.bin/mocha test/index.js --timeout 10000",
"test-cov": "./node_modules/.bin/istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- -R spec && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage",
"gen-doc": "./node_modules/.bin/jsdoc2md --src src/telegram.js -t README.hbs > README.md",
"jshint": "./node_modules/.bin/jshint src test"
"gen-doc": "./node_modules/.bin/babel --no-babelrc --plugins transform-es2015-spread,transform-es2015-destructuring,transform-strict-mode,transform-es2015-parameters,transform-es2015-shorthand-properties,transform-object-rest-spread,transform-class-properties -d lib-doc src && ./node_modules/.bin/jsdoc2md --src lib-doc/telegram.js -t README.hbs > README.md",
"eslint": "./node_modules/.bin/eslint ./src"
},

@@ -26,17 +27,34 @@ "author": "Yago PΓ©rez <yagoperezs@gmail.com>",

"dependencies": {
"bluebird": "^2.10.2",
"bl": "^1.1.2",
"bluebird": "^3.3.4",
"debug": "^2.2.0",
"eventemitter3": "^1.2.0",
"file-type": "^3.8.0",
"mime": "^1.3.4",
"request": "^2.69.0"
"pump": "^1.0.1",
"request": "^2.69.0",
"request-promise": "^2.0.1"
},
"devDependencies": {
"babel-cli": "^6.6.5",
"babel-eslint": "^5.0.0",
"babel-plugin-transform-class-properties": "^6.6.0",
"babel-plugin-transform-es2015-destructuring": "^6.6.5",
"babel-plugin-transform-es2015-parameters": "^6.7.0",
"babel-plugin-transform-es2015-shorthand-properties": "^6.5.0",
"babel-plugin-transform-es2015-spread": "^6.6.5",
"babel-plugin-transform-object-rest-spread": "^6.6.5",
"babel-plugin-transform-strict-mode": "^6.6.5",
"babel-preset-es2015": "^6.6.0",
"babel-register": "^6.7.2",
"contributor": "^0.1.25",
"coveralls": "^2.11.8",
"eslint": "^2.4.0",
"eslint-config-airbnb": "^6.1.0",
"eslint-plugin-mocha": "^2.0.0",
"is": "^3.1.0",
"istanbul": "^0.4.2",
"jsdoc-to-markdown": "^1.3.3",
"jshint": "^2.9.1",
"mocha": "^2.4.5",
"mocha-lcov-reporter": "^1.2.0",
"should": "^8.2.2"
"mocha-lcov-reporter": "^1.2.0"
},

@@ -62,35 +80,8 @@ "repository": {

{
"name": "Ivan Skorokhodov",
"email": "iskorokhodov@gmail.com",
"url": "https://github.com/universome",
"contributions": 3,
"additions": 219,
"deletions": 5,
"hireable": null
},
{
"name": "Yago",
"email": "yago@yago.me",
"url": "https://github.com/yagop",
"contributions": 161,
"additions": 2543,
"deletions": 1004,
"hireable": true
},
{
"name": "Matthew Brandly",
"email": "matt@brandly.me",
"url": "https://github.com/brandly",
"contributions": 1,
"additions": 1,
"name": "Cristian Baldi",
"email": "bld.cris.96@gmail.com",
"url": "https://github.com/crisbal",
"contributions": 2,
"additions": 26,
"deletions": 1,
"hireable": null
},
{
"name": "Guido GarcΓ­a",
"email": "palmerabollo@gmail.com",
"url": "https://github.com/palmerabollo",
"contributions": 1,
"additions": 1,
"deletions": 1,
"hireable": true

@@ -117,7 +108,7 @@ },

{
"name": "Cristian Baldi",
"email": "bld.cris.96@gmail.com",
"url": "https://github.com/crisbal",
"contributions": 2,
"additions": 26,
"name": "Guido GarcΓ­a",
"email": "palmerabollo@gmail.com",
"url": "https://github.com/palmerabollo",
"contributions": 1,
"additions": 1,
"deletions": 1,

@@ -127,2 +118,11 @@ "hireable": true

{
"name": "Matthew Brandly",
"email": "matt@brandly.me",
"url": "https://github.com/brandly",
"contributions": 1,
"additions": 1,
"deletions": 1,
"hireable": null
},
{
"name": "VΓ­tor Augusto da Silva Vasconcellos",

@@ -137,2 +137,20 @@ "email": "vasvas10@gmail.com",

{
"name": "Rafael Kr",
"email": null,
"url": "https://github.com/RafaelKr",
"contributions": 3,
"additions": 3,
"deletions": 2,
"hireable": null
},
{
"name": "Vitaly Aminev",
"email": null,
"url": "https://github.com/AVVS",
"contributions": 2,
"additions": 1065,
"deletions": 1001,
"hireable": true
},
{
"name": "Rey",

@@ -147,2 +165,11 @@ "email": null,

{
"name": "Ivan Skorokhodov",
"email": "iskorokhodov@gmail.com",
"url": "https://github.com/universome",
"contributions": 3,
"additions": 219,
"deletions": 5,
"hireable": null
},
{
"name": "Ilias Ismanalijev",

@@ -157,9 +184,9 @@ "email": "hello@illyism.com",

{
"name": "Rafael Kr",
"email": null,
"url": "https://github.com/RafaelKr",
"contributions": 3,
"additions": 3,
"deletions": 2,
"hireable": null
"name": null,
"email": "exlmotodev@gmail.com",
"url": "https://github.com/EXL",
"contributions": 4,
"additions": 4,
"deletions": 4,
"hireable": true
},

@@ -174,4 +201,13 @@ {

"hireable": true
},
{
"name": "Yago",
"email": "yago@yago.me",
"url": "https://github.com/yagop",
"contributions": 169,
"additions": 2676,
"deletions": 1091,
"hireable": true
}
]
}

@@ -36,3 +36,3 @@ [![Build Status](https://travis-ci.org/yagop/node-telegram-bot-api.svg?branch=master)](https://travis-ci.org/yagop/node-telegram-bot-api) [![Build status](https://ci.appveyor.com/api/projects/status/ujko6bsum3g5msjh/branch/master?svg=true)](https://ci.appveyor.com/project/yagop/node-telegram-bot-api/branch/master) [![Coverage Status](https://coveralls.io/repos/yagop/node-telegram-bot-api/badge.svg?branch=master)](https://coveralls.io/r/yagop/node-telegram-bot-api?branch=master) [![bitHound Score](https://www.bithound.io/github/yagop/node-telegram-bot-api/badges/score.svg)](https://www.bithound.io/github/yagop/node-telegram-bot-api) [![https://telegram.me/node_telegram_bot_api](https://img.shields.io/badge/πŸ’¬ Telegram-node__telegram__bot__api-blue.svg)](https://telegram.me/node_telegram_bot_api) [![https://telegram.me/Yago_Perez](https://img.shields.io/badge/πŸ’¬ Telegram-Yago__Perez-blue.svg)](https://telegram.me/Yago_Perez)

Every time TelegramBot receives a message, it emits a `message`. Depending on which [message](https://core.telegram.org/bots/api#message) was received, emits an event from this ones: `text`, `audio`, `document`, `photo`, `sticker`, `video`, `voice`, `contact`, `location`, `new_chat_participant`, `left_chat_participant`, `new_chat_title`, `new_chat_photo`, `delete_chat_photo`, `group_chat_created`. Its much better to listen a specific event rather than a `message` in order to stay safe from the content.
TelegramBot emits `inline_query` when receives an [https://core.telegram.org/bots/api#inlinequery](Inline Query) and `chosen_inline_result` when receives a [ChosenInlineResult](https://core.telegram.org/bots/api#choseninlineresult). Bot must be enabled on [inline mode](https://core.telegram.org/bots/api#inline-mode)
TelegramBot emits `inline_query` when receives an [Inline Query](https://core.telegram.org/bots/api#inlinequery) and `chosen_inline_result` when receives a [ChosenInlineResult](https://core.telegram.org/bots/api#choseninlineresult). Bot must be enabled on [inline mode](https://core.telegram.org/bots/api#inline-mode)
* * *

@@ -53,2 +53,3 @@

<a name="TelegramBot"></a>
## TelegramBot

@@ -84,2 +85,3 @@ TelegramBot

<a name="new_TelegramBot_new"></a>
### new TelegramBot(token, [options])

@@ -103,2 +105,3 @@ Both request method to obtain messages are implemented. To use standard polling, set `polling: true`

<a name="TelegramBot+getMe"></a>
### telegramBot.getMe() β‡’ <code>Promise</code>

@@ -110,2 +113,3 @@ Returns basic information about the bot in form of a `User` object.

<a name="TelegramBot+setWebHook"></a>
### telegramBot.setWebHook(url, [cert])

@@ -123,2 +127,3 @@ Specify an url to receive incoming updates via an outgoing webHook.

<a name="TelegramBot+getUpdates"></a>
### telegramBot.getUpdates([timeout], [limit], [offset]) β‡’ <code>Promise</code>

@@ -138,2 +143,3 @@ Use this method to receive incoming updates using long polling

<a name="TelegramBot+sendMessage"></a>
### telegramBot.sendMessage(chatId, text, [options]) β‡’ <code>Promise</code>

@@ -152,2 +158,3 @@ Send text message.

<a name="TelegramBot+answerInlineQuery"></a>
### telegramBot.answerInlineQuery(inlineQueryId, results, [options]) β‡’ <code>Promise</code>

@@ -166,2 +173,3 @@ Send answers to an inline query.

<a name="TelegramBot+forwardMessage"></a>
### telegramBot.forwardMessage(chatId, fromChatId, messageId) β‡’ <code>Promise</code>

@@ -179,2 +187,3 @@ Forward messages of any kind.

<a name="TelegramBot+sendPhoto"></a>
### telegramBot.sendPhoto(chatId, photo, [options]) β‡’ <code>Promise</code>

@@ -193,2 +202,3 @@ Send photo

<a name="TelegramBot+sendAudio"></a>
### telegramBot.sendAudio(chatId, audio, [options]) β‡’ <code>Promise</code>

@@ -207,2 +217,3 @@ Send audio

<a name="TelegramBot+sendDocument"></a>
### telegramBot.sendDocument(chatId, doc, [options]) β‡’ <code>Promise</code>

@@ -221,2 +232,3 @@ Send Document

<a name="TelegramBot+sendSticker"></a>
### telegramBot.sendSticker(chatId, sticker, [options]) β‡’ <code>Promise</code>

@@ -235,2 +247,3 @@ Send .webp stickers.

<a name="TelegramBot+sendVideo"></a>
### telegramBot.sendVideo(chatId, video, [options]) β‡’ <code>Promise</code>

@@ -249,2 +262,3 @@ Use this method to send video files, Telegram clients support mp4 videos (other formats may be sent as Document).

<a name="TelegramBot+sendVoice"></a>
### telegramBot.sendVoice(chatId, voice, [options]) β‡’ <code>Promise</code>

@@ -263,2 +277,3 @@ Send voice

<a name="TelegramBot+sendChatAction"></a>
### telegramBot.sendChatAction(chatId, action) β‡’ <code>Promise</code>

@@ -280,2 +295,3 @@ Send chat action.

<a name="TelegramBot+getUserProfilePhotos"></a>
### telegramBot.getUserProfilePhotos(userId, [offset], [limit]) β‡’ <code>Promise</code>

@@ -295,2 +311,3 @@ Use this method to get a list of profile pictures for a user.

<a name="TelegramBot+sendLocation"></a>
### telegramBot.sendLocation(chatId, latitude, longitude, [options]) β‡’ <code>Promise</code>

@@ -311,2 +328,3 @@ Send location.

<a name="TelegramBot+getFile"></a>
### telegramBot.getFile(fileId) β‡’ <code>Promise</code>

@@ -325,2 +343,3 @@ Get file.

<a name="TelegramBot+getFileLink"></a>
### telegramBot.getFileLink(fileId) β‡’ <code>Promise</code>

@@ -331,3 +350,4 @@ Get link for file.

This method is a sugar extension of the (getFile)[#getfilefileid] method, which returns just path to file on remote server (you will have to manually build full uri after that).
This method is a sugar extension of the (getFile)[#getfilefileid] method,
which returns just path to file on remote server (you will have to manually build full uri after that).

@@ -343,2 +363,3 @@ **Kind**: instance method of <code>[TelegramBot](#TelegramBot)</code>

<a name="TelegramBot+downloadFile"></a>
### telegramBot.downloadFile(fileId, downloadDir) β‡’ <code>Promise</code>

@@ -357,2 +378,3 @@ Downloads file in the specified folder.

<a name="TelegramBot+onText"></a>
### telegramBot.onText(regexp, callback)

@@ -369,2 +391,3 @@ Register a RegExp to test against an incomming text message.

<a name="TelegramBot+onReplyToMessage"></a>
### telegramBot.onReplyToMessage(chatId, messageId, callback)

@@ -379,4 +402,4 @@ Register a reply to wait for a message response.

| messageId | <code>Number</code> &#124; <code>String</code> | The message id to be replied. |
| callback | <code>function</code> | Callback will be called with the reply message. |
| callback | <code>function</code> | Callback will be called with the reply message. |
* * *

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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