Full Code of yagop/node-telegram-bot-api for AI

master 24fb242bcfe4 cached
43 files
512.2 KB
135.0k tokens
252 symbols
1 requests
Download .txt
Showing preview only (531K chars total). Download the full file or copy to clipboard to get everything.
Repository: yagop/node-telegram-bot-api
Branch: master
Commit: 24fb242bcfe4
Files: 43
Total size: 512.2 KB

Directory structure:
gitextract_kd505wwd/

├── .babelrc
├── .editorconfig
├── .eslintignore
├── .eslintrc
├── .github/
│   ├── ISSUE_TEMPLATE.md
│   └── PULL_REQUEST_TEMPLATE.md
├── .gitignore
├── .npmignore
├── .travis.yml
├── CHANGELOG.md
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── LICENSE.md
├── README.md
├── doc/
│   ├── api.hbs
│   ├── api.md
│   ├── experimental.md
│   ├── help.md
│   ├── tutorials.md
│   └── usage.md
├── examples/
│   ├── game/
│   │   ├── game.html
│   │   └── game.js
│   ├── polling.js
│   ├── ssl/
│   │   ├── crt.pem
│   │   └── key.pem
│   └── webhook/
│       ├── express.js
│       ├── heroku.js
│       ├── https.js
│       ├── now.js
│       └── openshift2.js
├── index.js
├── package.json
├── src/
│   ├── errors.js
│   ├── telegram.js
│   ├── telegramPolling.js
│   ├── telegramWebHook.js
│   └── utils.js
└── test/
    ├── README.md
    ├── data/
    │   └── voice.ogg
    ├── mocha.opts
    ├── telegram.js
    ├── test.format-send-data.js
    └── utils.js

================================================
FILE CONTENTS
================================================

================================================
FILE: .babelrc
================================================
{
  "plugins": [
    "transform-strict-mode",
    "transform-object-rest-spread",
    "transform-class-properties"
  ],
  "presets": [
    "babel-preset-es2015"
  ]
}


================================================
FILE: .editorconfig
================================================
# http://editorconfig.org
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false


================================================
FILE: .eslintignore
================================================
bin
*.md


================================================
FILE: .eslintrc
================================================
{
  "extends": "airbnb/base",
  "parser": "babel-eslint",
  "rules": {
    "new-cap": 0,
    "prefer-arrow-callback": 0,
    "no-param-reassign": [2,{"props":false}],
    "max-len": [2, 200],
    "arrow-body-style": 0,
    "comma-dangle": 0,
    "indent": ["error", 2]
  },
  "plugins": [
    "mocha"
  ],
  "env": {
    "mocha": true
  }
}

================================================
FILE: .github/ISSUE_TEMPLATE.md
================================================
<!--
This template includes three sections:
1. Bug reporting
2. Feature request
3. Question

Please remove sections that do not apply to your issue
-->



<!--********************************************************************
Reporting a Bug.
*********************************************************************-->

> Bug Report

I have read:

* [Usage information](https://github.com/yagop/node-telegram-bot-api/tree/master/doc/usage.md)
* [Help information](https://github.com/yagop/node-telegram-bot-api/tree/master/doc/help.md)

I am using the latest version of the library.

### Expected Behavior

<!-- Explain what you are trying to achieve -->

### Actual Behavior

<!-- Explain what happens, contrary to what you expected -->

### Steps to reproduce the Behavior

<!-- Explain how we can reproduce the bug -->



<!--********************************************************************
Feature Request.
*********************************************************************-->

> Feature Request

I have:

* searched for such a feature request (https://github.com/yagop/node-telegram-bot-api/labels/enhancement) and found none

### Introduction

<!-- Describe what value this feature would add, and in which use case,
or scenario -->

### Example

<!-- A code snippet of how this feature would work, were it already
implemented -->



<!--********************************************************************
Question.
*********************************************************************-->

> Question

<!-- Ask your question here. Please be precise, adding as much detail
as necessary. Also, add a code snippet(s) if possible. -->


================================================
FILE: .github/PULL_REQUEST_TEMPLATE.md
================================================
<!--
Mark whichever option below applies to this PR.
For example, if your PR passes all tests, you would mark the option as so:
- [x] All tests pass
Note the 'x' in between the square brackets '[]'
-->
- [ ] All tests pass
- [ ] I have run `npm run doc`

### Description

<!-- Explain what you are trying to achieve with this PR -->

### References

<!--
Add references to other documents/pages that are relevant to this
PR, such as related issues, documentation, etc.

For example,
* Issue #1: https://github.com/yagop/node-telegram-bot-api/issues/1
* Telegram Bot API - Getting updates: https://core.telegram.org/bots/api#getting-updates
-->


================================================
FILE: .gitignore
================================================
node_modules
coverage/
npm-debug.log
.package.json
package-lock.json
output.md
output/
lib/
lib-doc/
.DS_Store

================================================
FILE: .npmignore
================================================
# lcov
coverage/
*.log
.package.json

# artifacts & source
README.hbs
output.md
output/
test/
examples/
lib-doc/

# dotfiles
.travis.yml
.eslintrc
.eslintignore
.editorconfig
.babelrc
.gitignore
.git


================================================
FILE: .travis.yml
================================================
language: node_js
node_js:
  - "12"
  - "10"
  - "8"
  - "6"
#
# create required bash scripts to run builds on pull requests in the future
#
#script:
#   - 'if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then bash ./travis/run_on_pull_requests; fi'
#   - 'if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then bash ./travis/run_on_non_pull_requests; fi'
after_success:
  - bash <(curl -s https://codecov.io/bash)
cache:
  directories:
    - node_modules


================================================
FILE: CHANGELOG.md
================================================
# Change Log

All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased][Unreleased]

## [0.68.0][0.68.0] - 2026-03-15

Added:

1. Support Telegram Bot API v9.3 (by @danielperez9430)
   * `#getUserGifts`
   * `#getChatGifts`
   * `#sendMessageDraft` (by @xjx0106)
   * `#repostStory`

2. Fixed method:
   * `unpinAllGeneralForumTopicMessages`
   * `replaceStickerInSet`

3. Support Telegram Bot API v9.5 (by @danielperez9430)
   * `setChatMemberTag`

4. Support Telegram Bot API v9.6 (by @danielperez9430)
   * setMyProfilePhoto
   * removeMyProfilePhoto

5. Added missing methods (by @danielperez9430)
   * getUserProfileAudios
   * approveSuggestedPost
   * declineSuggestedPost

6. Added more test

## [0.67.0][0.67.0] - 2025-12-13

Added:

1. Support Telegram Bot API v7.4 (by @danielperez9430)
   * `#refundStarPayment`
6. Support Telegram Bot API 7.6 (@danielperez9430)
   * `#sendPaidMedia`
1. Support Telegram Bot API v7.9 (by @danielperez9430)
1. Support Telegram Bot API v7.10 (by @danielperez9430)
   * Update: `purchased_paid_media`
1. Support Telegram Bot API v8.0 and v8.1
   * `#savePreparedInlineMessage` (@IsmailBinMujeeb)
   * `#setUserEmojiStatus` (@danielperez9430)
   * `#editUserStarSubscription` (@danielperez9430)
   * `#getAvailableGifts` (@danielperez9430)
   * `#sendGift` (@danielperez9430)
1. Support Telegram Bot API v8.2, v8.3 (@danielperez9430)
   * `#verifyUser`
   * `#verifyChat`
   * `#removeUserVerification`
   * `#removeChatVerification`
1. Support Telegram Bot API v8.3 (by @danielperez9430)
1. Support Telegram Bot API v9.0 (by @danielperez9430)
   * `#readBusinessMessage`
   * `#deleteBusinessMessages`
   * `#setBusinessAccountName`
   * `#setBusinessAccountUsername`
   * `#setBusinessAccountBio`
   * `#setBusinessAccountProfilePhoto`
   * `#removeBusinessAccountProfilePhoto`
   * `#setBusinessAccountGiftSettings`
   * `#getBusinessAccountStarBalance`
   * `#transferBusinessAccountStars`
   * `#getBusinessAccountGifts`
   * `#convertGiftToStars`
   * `#upgradeGift`
   * `#transferGift`
   * `#postStory`
   * `#editStory`
   * `#deleteStory`
   * `#giftPremiumSubscription`
1. Support Telegram Bot API v9.1 (by @danielperez9430)
   * `#sendChecklist`
   * `#editMessageChecklist`
   * `#getMyStarBalance`

Fixed:

1. Reference causing error in `FatalError` (by @ivanjh)
1. Stringify `scope` field in `#deleteMyCommands` (by @XC-Zhang)
1. Stringify `allowed_updates` field in `#getUpdates` (by @alfanzain)
1. Stringify `message_ids` in `#forwardMessages` (by @qiaoshouzi)
1. Rename parameter `thumb` to `thumbnail` (by @0x114514BB)
1. Remove travis badge (by @melroy89)
1. Improve documentation on events (by @programminghoch10)
1. Fix Telegram invite group link (by @melroy89)

  
## [0.66.0][0.66.0] - 2024-05-03

1. Support Telegram Bot API 7.2 & 7.3 (@danielperez9430)
  * getBusinessConnection
  * replaceStickerInSet

2. Support for updates: (@danielperez9430)
  * business_connection
  * business_message
  * edited_business_message
  * deleted_business_messages

3. Minor fixes: (@danielperez9430)
  * getUserChatBoosts

## [0.65.1][0.65.1] - 2024-03-09

1. Support for updates (@danielperez9430)
  * message_reaction
  * message_reaction_count
  * chat_boost
  * removed_chat_boost

## [0.65.0][0.65.0] - 2024-02-20

1. Support Telegram Bot API v7.1
  * deleteMessages (@Sp3ricka)
  * copyMessages (@xjx0106 & @Sp3ricka)
  * setMessageReaction (@Sp3ricka)
  * forwardMessages (@danielperez9430)
  * getUserChatBoosts (@danielperez9430)

2. Minor changes: (@danielperez9430)
  * Refactor methods order
  * Fix copyMessages & setMessageReaction methods
  * Added missing tests 
  * Fix tests for methods copyMessages & getMyDefaulAdministratorRights

## [0.64.0][0.64.0] - 2023-10-25

1. Replace `request` with a maintained version (@danielperez9430)
 * Change `request` to `@cypress/request`
 * Change `request-promise` to `@cypress/request-promise`

## [0.63.0][0.63.0] - 2023-08-23

1. Support Telegram Bot API v6.8 (@danielperez9430)
 * unpinAllGeneralForumTopicMessages

## [0.62.0][0.62.0] - 2023-03-19

1. Support Telegram Bot API v6.6 & v6.7 (@danielperez9430)
 * setMyDescription
 * getMyDescription
 * setMyShortDescription
 * getMyShortDescription
 * setCustomEmojiStickerSetThumbnail
 * setStickerSetTitle
 * deleteStickerSet 
 * setStickerEmojiList 
 * setStickerKeywords 
 * setStickerMaskPosition 

## [0.61.0][0.61.0] - 2022-12-30

1. Support Telegram Bot API v6.4 (@danielperez9430)
 * editGeneralForumTopic
 * closeGeneralForumTopic
 * reopenGeneralForumTopic
 * hideGeneralForumTopic
 * unhideGeneralForumTopic

2. Minor changes: (@danielperez9430)
 * The parameters `name` and `icon_custom_emoji_id` of the method `editForumTopic` are now optional.
 * Fix add thumb in sendAudio, sendVideo and sendVideoNote
 * Fix getMyCommands and setMyCommands
 * Suggested tip amounts stringify in sendInvoice

## [0.60.0][0.60.0] - 2022-10-06

1. Support Telegram Bot API v6.3 (@danielperez9430)
 * createForumTopic
 * closeForumTopic
 * reopenForumTopic
 * deleteForumTopic
 * unpinAllForumTopicMessages
 * getForumTopicIconStickers

2. Fix test getMyDefaultAdministratorRights (@danielperez9430)

3. Fix parse entities - (@toniop99)

## [0.59.0][0.59.0] - 2022-08-15

1. Support Telegram Bot API v6.2 (@danielperez9430)
 * getCustomEmojiStickers

2. Support test enviroment (@tinsaeDev & @kamikazechaser)

3. Remove dependencies: (@danielperez9430)
   * Remove *bluebird* => Use NodeJS Native Promises
   * Remove *depd* => Use node native deprecate util for warnings
   * Remove contributor dev dependency and add list of contributors in the readme

4. Remove legacy methods: (@danielperez9430)
  * getChatMembersCount
  * kickChatMember

5. Docs: (@danielperez9430)
 * Update the docs of the methods
 * Order methods follow the Telegram bot API docs in src/telegram.js
 * Update README

6. Fix: (@danielperez9430)
 * addStickerToSet() -> Allow to send tgs_sticker + webm_sticker
 * Remove mandatory param “start_parameter” from sendInvoice, because in the docs is a optional param
 * getStickerSet test fix deprecated response value "contains_masks" change to "sticker_type"
 * Fix some other tests

7. New Test: (@danielperez9430)
 * deleteStickerFromSet
 * setStickerPositionInSet
 * getCustomEmojiStickers

## [0.58.0][0.58.0] - 2022-06-22

1. Support Bot API v6.1: (@danielperez9430)
   * Add method *createInvoiceLink()*

2. Support for setStickerSetThumb (@elihaidv)

3. Add new test (@danielperez9430)
   * createInvoiceLink

4. Test fixes (@danielperez9430)
   * sendVideoNote
   * createNewStickerSet
   * setStickerSetThumb
   * getChatMenuButton
   * setWebHook

5. Bug fixes (@danielperez9430)
   * answerWebAppQuery
   * Support for send thumb in sendAudio 

## [0.57.0][0.57.0] - 2022-04-23

Added:

1. Support Bot API v6: (@danielperez9430)

   * Add method *setChatMenuButton()*
   * Add method *getChatMenuButton()*
   * Add method *setMyDefaultAdministratorRights()*
   * Add method *getMyDefaultAdministratorRights()*
   * Add method *answerWebAppQuery()*
   * Renamed the fields voice_chat_scheduled, voice_chat_started, voice_chat_ended, and voice_chat_participants_invited to video_chat_scheduled, video_chat_started, video_chat_ended, and video_chat_participants_invited 


   Tests:

   * answerWebAppQuery
   * setChatMenuButton
   * getChatMenuButton
   * setMyDefaultAdministratorRights
   * getMyDefaultAdministratorRights

## [0.56.0][0.56.0] - 2021-12-07

Added:

1. Support Bot API v5.5: (@danielperez9430)

   * Add method *banChatSenderChat()*
   * Add method *unbanChatSenderChat()*

   Fixes:

   * Tests for support with new invite link format

## [0.55.0][0.55.0] - 2021-11-06

Added:

1. Support Bot API v5.4: (@danielperez9430)

   * Add method *approveChatJoinRequest()*
   * Add method *declineChatJoinRequest()*
   * Add support for new updates:
     * *chat_join_request*
   
   Fixes:

   * Method *editMessageMedia*: Now you can send a local file (`"attach://" + filePatch`)

## [0.54.0][0.54.0] - 2021-06-29

Added:

1. Support Bot API v5.3: (@danielperez9430)

   * Add method *deleteMyCommands()*
   * Add method *banChatMember()*
   * Add method *getChatMemberCount()*

   New Test:
   
   * deleteMyCommands
   * banChatMember
   * getChatMemberCount

   Deprecated:
   * Method *kickChatMember()*
   * Method *getChatMembersCount()*

## [0.53.0][0.53.0] - 2021-04-26

Added:

1. Support Bot API v5.2:(@danielperez9430)

   * Add support for new messageTypes:
     * *voice_chat_scheduled*

## [0.52.0][0.52.0] - 2021-03-20

Added:

1. Support Bot API v5.1: (by @danielperez9430)
   
   * Add method *createChatInviteLink()*
   * Add method *editChatInviteLink()*
   * Add method *revokeChatInviteLink()*
   * Add support for new messageTypes:
     * *voice_chat_started*
     * *voice_chat_ended*
     * *voice_chat_participants_invited*
     * *message_auto_delete_timer_changed*
     * *chat_invite_link*
     * *chat_member_updated*
   * Add support for new updates:
     * *my_chat_member*
     * *chat_member*
   
   New Test: (by @danielperez9430)
   
   * createChatInviteLink
   * editChatInviteLink
   * revokeChatInviteLink

## [0.51.0][0.51.0] - 2020-11-04

Added:

1. Support Bot API v5.0: (by @danielperez9430)
   
   * Add method *copyMessage()*
   * Add method *unpinAllChatMessages()*
   * Add method *close()*
   * Add method *logOut()*
   
   Changed: (by @danielperez9430)
   
   * Remove trailing-spaces
   * Fix Bugs in Test
   
   New Test: (by @danielperez9430)
   
   * copyMessage
   * unpinAllChatMessages

## [0.50.0][0.50.0] - 2020-05-2020

Added:

1. Support Bot API v4.8: (by @danielperez9430)
   * Add methods: *sendDice()*
2. Support Bot API v4.7: (by @danielperez9430)
   * Add methods: *getMyCommands()*,*setMyCommands()*
3. Support Bot API v4.5: (by @danielperez9430)
   * Add methods: *setChatAdministratorCustomTitle()*
4. Support Bot API v4.4: (by @danielperez9430)
   * Add methods: *setChatPermissions()*
5. Support for poll_answer (by @JieJiSS)
6. Add request options in file stream (by @zhangpanyi )

Changed: (by @danielperez9430)

* New message type: *dice*
* Fix Bugs in tests
* Fix regex compare (by @ledamint)
* Fix listening for error events when downloading files (by @Kraigo)

New Test: (by @danielperez9430)

* sendDice
* getMyCommands
* setMyCommands
* setChatAdministratorCustomTitle
* setChatPermissions

## [0.40.0][0.40.0] - 2019-05-04

Added:

1. Support Bot API v4.2: (by @kamikazechaser)
   * Add methods: *TelegramBot#sendPoll()*, *TelegramBot#stopPoll()*
   * Support events: *poll*
2. Support Bot API v4.0: (by @kamikazechaser)
   * Add methods: *TelegramBot#editMessageMedia()*, *TelegramBot#sendAnimation()*
   * Support new message types: *passport_data*, *animation*

* * *

## [0.30.0][0.30.0] - 2017-12-21

Added:

1. Support Bot API v3.5: (by @GochoMugo)
   * Allow `provider_data` parameter in *TelegramBot#sendInvoice*
   * Add method *TelegramBot#sendMediaGroup()*
2. Support Bot API v3.4: (by @kamikazechaser)
   * Add methods *TelegramBot#editMessageLiveLocation*, *TelegramBot#stopMessageLiveLocation* (#439)
   * Add methods *TelegramBot#setChatStickerSet*, *TelegramBot#deleteChatStickerSet* (#440)
3. Add methods:
   * *TelegramBot#getFileStream* (#442) (by @GochoMugo, requested-by @Xaqron)
4. Add options to *TelegramBot#stopPolling()* (by @GochoMugo)
5. Add `metadata` argument in `message` event (and friends e.g. `text`, `audio`, etc.) (#409) (by @jlsjonas, @GochoMugo)
6. Add forward-compatibility i.e. support future additional Telegram options (by @GochoMugo)
7. Add support for Node.js v9 (by @GochoMugo)
8. Document *TelegramBot.errors*, *TelegramBot.messageTypes* (by @GochoMugo)

Changed:

1. Update *TelegramBot#answerCallbackQuery()* signature (by @GochoMugo)
2. Improve default error logging of `polling_error` and `webhook_error` (#377)
3. Update dependencies

Deprecated:

1. Sending files: *(See [usage guide][usage-sending-files])* (by @hufan-akari, @GochoMugo)
   * Error will **not** be thrown if `Buffer` is used and file-type could **not** be detected.
   * Filename will **not** be set to `data.${ext}` if `Buffer` is used
   * Content type will **not** default to `null` or `undefined`

Fixed:

1. Fix the offset infinite loop bug (#265, #36) (by @GochoMugo)
2. Fix game example (#449, #418) (by @MCSH)

* * *

## [0.29.0][0.29.0] - 2017-10-22

Added:

1. Add Bot API v3.2 methods:
   * (#429) *TelegramBot#getStickerSet* (by @CapacitorSet, @LibertyLocked)
   * (#430) *TelegramBot#uploadStickerFile* (by @CapacitorSet)
   * *TelegramBot#createNewStickerSet*, *TelegramBot#addStickerToSet*, *TelegramBot#setStickerPositionInSet*, *TelegramBot#deleteStickerFromSet* (by @GochoMugo)
2. Supports API v3.3

Deprecated:

1. Auto-enabling Promise cancellation (#319) (by @GochoMugo)

* * *

## [0.28.0][0.28.0] - 2017-08-06

Added:

1. (#361) Support Bot API v3.1 (by @Lord-Protector, @kamikazechaser)
2. (#332) Support Bot API v3.0 (by @kamikazechaser, @GochoMugo)
3. Add *TelegramBot#removeTextListener()* (by @GochoMugo)
4. (#342) Add game example (by @MCSH)
5. (#315) List 'bot-brother' project in community section in README (by @saeedhei)

Changed:

1. (#367) Update *TelegramBot#answerCallbackQuery()* signature (by @mnb3000)

Fixed:

1. (#325) Fix global regexp state reset (by @Sirius-A)
2. (#363) Fix download file path on windows (by @kucherenkovova)
3. (#346) Fix anchor webhook link in docs (by @Coac)

* * *

## [0.27.1][0.27.1] - 2017-04-07

Added:

1. (#287) Add Express WebHook example (by @kamikazechaser)

Fixed:

1. (#291) Improve docs (by @preco21)
2. (#298) Fix running on Node v5 (by @jehy)
3. (#307) Fix badge links in README (by @JaakkoLipsanen)
4. Fix defaulting value of `options.polling.params.timeout` (by @GochoMugo)
5. Fix typos in Github issue template (by @GochoMugo, requested-by @GingerPlusPlus)

* * *

## [0.27.0][0.27.0] - 2017-02-10

Added:

1. Add constructor options:
   * (#243) `options.polling.params` (by @GochoMugo, requested-by @sidelux)
2. Add methods:
   * (#74) *TelegramBot#removeReplyListener()* (by @githugger)
3. (#283) Add proper error handling (by @GochoMugo)
4. (#272) Add health-check endpoint (by @mironov)
   * `options.webHook.healthEndpoint`
5. (#152) Add test for TelegramBot#sendDocument() using 'fileOpts'
   param (by @evolun)
6. Document `options.webHook.host` (by @GochoMugo)
7. (#264) Add Bot API version to README (by @kamikazechaser)
8. Add examples:
   - (#271) WebHook on Heroku (by @TheBeastOfCaerbannog)
   - (#274) WebHook on Zeit Now (by @Ferrari)

Changed:

1. (#147) Use *String#indexOf()*, instead of *RegExp#test()*, to
   find token in webhook request (by @AVVS)

Fixed:

* Fix bug:
  - (#275, #280) fix es6 syntax error on Node.js v4.x (by @crazyabdul)
  - (#276) promise.warning from `request-promise` (by @GochoMugo,
    reported-by @preco21)
  - (#281) fix handling error during polling (by @GochoMugo,
    reported-by @dimawebmaker)
  - (#284) fix error during deletion of already-set webhook, during
    polling (by @GochoMugo, reported-by @dcparga)
1. Fix links in documentation (by @Ni2c2k)

* * *

## [0.26.0][0.26.0] - 2017-01-20

Added:

1. Add *TelegramBot* constructor options:
   * `options.https`
   * `options.baseApiUrl`
   * `options.filepath`
2. Add methods:
   * *TelegramBot#stopPolling()*
   * *TelegramBot#isPolling()*
   * *TelegramBot#openWebHook()*
   * *TelegramBot#closeWebHook()*
   * *TelegramBot#hasOpenWebHook()*
   * *TelegramBot#deleteWebHook()*
   * *TelegramBot#getWebHookInfo()*

Changed:

1. Use POST requests by default
2. Ensure all relevant methods return Promises
3. Document auto-deletion of webhook during polling
4. Deprecate support for Node.js v0.12
5. Fix consistency of methods signatures
6. Rename *TelegramBot#initPolling()* to *TelegramBot#startPolling()*
   * Deprecate *TelegramBot#initPolling()*

Fixed:

1. Handle error during formatting `formData`
2. Fix ES6 syntax

*Credits/Blames: Unless explicitly stated otherwise, above work was
done by @GochoMugo*

* * *

## [0.25.0][0.25.0] - 2016-12-21

Added:

1. Supports the API v2.3 updates (by @kamikazechaser)
2. Add *TelegramBot* constructor option:
   * `options.request`: proxy extra request options (by @tarmolov)
   * `options.onlyFirstMatch` (by @GingerPlusPlus)
3. Add methods:
   * *TelegramBot#sendVenue()* (by Tketa)
   * *TelegramBot#sendContact()* (by @GochoMugo)
   * *TelegramBot#getGameHighScores()* (by @jishnu7)

Fixed:

1. Fix request performance issue (by @preco21)
2. Fix typos (by oflisback)

[usage-sending-files]:https://github.com/yagop/node-telegram-bot-api/blob/master/doc/usage.md#sending-files-options

[0.25.0]:https://github.com/yagop/node-telegram-bot-api/releases/tag/v0.25.0
[0.26.0]:https://github.com/yagop/node-telegram-bot-api/releases/tag/v0.26.0
[0.27.0]:https://github.com/yagop/node-telegram-bot-api/releases/tag/v0.27.0
[0.27.1]:https://github.com/yagop/node-telegram-bot-api/releases/tag/v0.27.1
[0.28.0]:https://github.com/yagop/node-telegram-bot-api/releases/tag/v0.28.0
[0.29.0]:https://github.com/yagop/node-telegram-bot-api/releases/tag/v0.29.0
[0.30.0]:https://github.com/yagop/node-telegram-bot-api/releases/tag/v0.30.0
[0.63.0]:https://github.com/yagop/node-telegram-bot-api/releases/tag/v0.63.0
[0.64.0]:https://github.com/yagop/node-telegram-bot-api/releases/tag/v0.64.0
[0.65.0]:https://github.com/yagop/node-telegram-bot-api/releases/tag/v0.65.0
[0.65.1]:https://github.com/yagop/node-telegram-bot-api/releases/tag/v0.65.1
[0.66.0]:https://github.com/yagop/node-telegram-bot-api/releases/tag/v0.66.0
[0.67.0]:https://github.com/yagop/node-telegram-bot-api/releases/tag/v0.67.0
[0.68.0]:https://github.com/yagop/node-telegram-bot-api/releases/tag/v0.68.0
[Unreleased]:https://github.com/yagop/node-telegram-bot-api/compare/v0.68.0...master


================================================
FILE: CODE_OF_CONDUCT.md
================================================
# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, gender identity and expression, level of experience,
nationality, personal appearance, race, religion, or sexual identity and
orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment
include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
  address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
  professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at mugo@forfuture.co.ke. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at [http://contributor-covenant.org/version/1/4][version]

[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/


================================================
FILE: CONTRIBUTING.md
================================================
# Contributing

> If you are willing to contribute, first you should know that
> I will love you and so will the Telegram Bot community.

Before proceeding any further, read the following documents:

1. [Code of Conduct][coc]
1. [License][license]

## General Information

### Creating a Github issue:

1. Ensure that your issue does **not** already exist. [Do a search](https://github.com/yagop/node-telegram-bot-api/issues).
2. Browse through [StackOverflow](https://stackoverflow.com/search?q=telegram+nodejs) and other similar platforms.
3. Should you open your issue, ensure you use the English language for
   the wider target audience.
4. Be patient please.


### Updating API Reference i.e. generating `doc/api.md`

Run:

```bash
$ npm run doc
```


### Running tests

Please read `test/README.md` for more information.


### Transpiling ES2015 for older Node.js versions

We use babel to transpile the code:

```bash
$ npm run build
```

[coc]:https://github.com/yagop/node-telegram-bot-api/blob/master/CODE_OF_CONDUCT.md
[license]:https://github.com/yagop/node-telegram-bot-api/blob/master/LICENSE.md


================================================
FILE: LICENSE.md
================================================
The MIT License (MIT)

Copyright (c) 2019 Yago

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.


================================================
FILE: README.md
================================================
<h1 align="center">Node.js Telegram Bot API</h1>

<div align="center">

Node.js module to interact with the official [Telegram Bot API](https://core.telegram.org/bots/api).


[![Bot API](https://img.shields.io/badge/Bot%20API-v.9.6-00aced.svg?style=flat-square&logo=telegram)](https://core.telegram.org/bots/api)
[![npm package](https://img.shields.io/npm/v/node-telegram-bot-api?logo=npm&style=flat-square)](https://www.npmjs.org/package/node-telegram-bot-api)
[![Coverage Status](https://img.shields.io/codecov/c/github/yagop/node-telegram-bot-api?style=flat-square&logo=codecov)](https://codecov.io/gh/yagop/node-telegram-bot-api)

[![https://telegram.me/node_telegram_bot_api](https://img.shields.io/badge/💬%20Telegram-Channel-blue.svg?style=flat-square)](https://telegram.me/node_telegram_bot_api)
[![https://t.me/+_IC8j_b1wSFlZTVk](https://img.shields.io/badge/💬%20Telegram-Group-blue.svg?style=flat-square)](https://t.me/+_IC8j_b1wSFlZTVk)
[![https://telegram.me/Yago_Perez](https://img.shields.io/badge/💬%20Telegram-Yago_Perez-blue.svg?style=flat-square)](https://telegram.me/Yago_Perez)

</div>

## 📦 Install

```sh
npm i node-telegram-bot-api
```

<br/>

> ✍️ **Note:** If you use Typescript you can install this package that contains type definitions for this library
>```sh
>npm install --save-dev @types/node-telegram-bot-api
>```

## 🚀 Usage

```js
const TelegramBot = require('node-telegram-bot-api');

// replace the value below with the Telegram token you receive from @BotFather
const token = 'YOUR_TELEGRAM_BOT_TOKEN';

// Create a bot that uses 'polling' to fetch new updates
const bot = new TelegramBot(token, {polling: true});

// Matches "/echo [whatever]"
bot.onText(/\/echo (.+)/, (msg, match) => {
  // 'msg' is the received Message from Telegram
  // 'match' is the result of executing the regexp above on the text content
  // of the message

  const chatId = msg.chat.id;
  const resp = match[1]; // the captured "whatever"

  // send back the matched "whatever" to the chat
  bot.sendMessage(chatId, resp);
});

// Listen for any kind of message. There are different kinds of
// messages.
bot.on('message', (msg) => {
  const chatId = msg.chat.id;

  // send a message to the chat acknowledging receipt of their message
  bot.sendMessage(chatId, 'Received your message');
});
```

## 📚 Documentation

* [Usage][usage]
* [Examples][examples]
* [Tutorials][tutorials]
* [Help Information][help]
* API Reference: ([api-release](../master/doc/api.md) / [development][api-dev] / [experimental][api-experimental])
* [Contributing to the Project][contributing]
* [Experimental Features][experimental]

_**Note**: Development is done against the **development** branch.
Code for the latest release resides on the **master** branch.
Experimental features reside on the **experimental** branch._


## 💭 Community

We thank all the developers in the Open-Source community who continuously
take their time and effort in advancing this project.
See our [list of contributors][contributors].

We have a [Telegram channel][tg-channel] where we post updates on
the Project. Head over and subscribe!

We also have a [Telegram  group][tg-group] to discuss issues related to this library.

Some things built using this library that might interest you:

* [tgfancy](https://github.com/GochoMugo/tgfancy): A fancy, higher-level wrapper for Telegram Bot API
* [node-telegram-bot-api-middleware](https://github.com/idchlife/node-telegram-bot-api-middleware): Middleware for node-telegram-bot-api
* [teleirc](https://github.com/FruitieX/teleirc): A simple Telegram ↔ IRC gateway
* [bot-brother](https://github.com/SerjoPepper/bot-brother): Node.js library to help you easily create telegram bots
* [redbot](https://github.com/guidone/node-red-contrib-chatbot): A Node-RED plugin to create telegram bots visually
* [node-telegram-keyboard-wrapper](https://github.com/alexandercerutti/node-telegram-keyboard-wrapper): A wrapper to improve keyboards structures creation through a more easy-to-see way (supports Inline Keyboards, Reply Keyboard, Remove Keyboard and Force Reply)
* [beetube-bot](https://github.com/kodjunkie/beetube-bot): A telegram bot for music, videos, movies, EDM tracks, torrent downloads, files and more.
* [telegram-inline-calendar](https://github.com/VDS13/telegram-inline-calendar): Date and time picker and inline calendar for Node.js telegram bots.
* [telegram-captcha](https://github.com/VDS13/telegram-captcha): Telegram bot to protect Telegram groups from automatic bots.


## 👥 Contributors

<p align="center">
  <a href="https://github.com/yagop/node-telegram-bot-api/graphs/contributors">
    <img src="https://contrib.rocks/image?repo=yagop/node-telegram-bot-api" />
  </a>
</p>

## License

**The MIT License (MIT)**

Copyright © 2019 Yago

[usage]:https://github.com/yagop/node-telegram-bot-api/tree/master/doc/usage.md
[examples]:https://github.com/yagop/node-telegram-bot-api/tree/master/examples
[help]:https://github.com/yagop/node-telegram-bot-api/tree/master/doc/help.md
[tutorials]:https://github.com/yagop/node-telegram-bot-api/tree/master/doc/tutorials.md
[api-dev]:https://github.com/yagop/node-telegram-bot-api/tree/master/doc/api.md
[api-release]:https://github.com/yagop/node-telegram-bot-api/tree/release/doc/api.md
[api-experimental]:https://github.com/yagop/node-telegram-bot-api/tree/experimental/doc/api.md
[contributing]:https://github.com/yagop/node-telegram-bot-api/tree/master/CONTRIBUTING.md
[contributors]:https://github.com/yagop/node-telegram-bot-api/graphs/contributors
[experimental]:https://github.com/yagop/node-telegram-bot-api/tree/master/doc/experimental.md
[tg-channel]:https://telegram.me/node_telegram_bot_api
[tg-group]:https://t.me/+UTbprHdcw0JdZdbL


================================================
FILE: doc/api.hbs
================================================
# API Reference

**Note:** If you are looking for available [events](usage.md#events) or usage of api, please refer [`usage.md`](usage.md).

{{#class name="TelegramBot"~}}
{{>header~}}
{{>body~}}
{{>member-index~}}
{{>members~}}
{{/class}}
* * *


[usage-sending-files-performance]:https://github.com/yagop/node-telegram-bot-api/tree/master/doc/usage.md#sending-files-performance
[setWebHook-v0.25.0]:https://github.com/yagop/node-telegram-bot-api/tree/4e5a493cadfaad5589a8d79e55d9e0d103000ce4#telegrambotsetwebhookurl-cert
[getUpdates-v0.25.0]:https://github.com/yagop/node-telegram-bot-api/tree/4e5a493cadfaad5589a8d79e55d9e0d103000ce4#TelegramBot+getUpdates
[getUserProfilePhotos-v0.25.0]:https://github.com/yagop/node-telegram-bot-api/tree/4e5a493cadfaad5589a8d79e55d9e0d103000ce4#TelegramBot+getUserProfilePhotos
[answerCallbackQuery-v0.27.1]:https://github.com/yagop/node-telegram-bot-api/blob/v0.27.1/doc/api.md#TelegramBot+answerCallbackQuery
[answerCallbackQuery-v0.29.0]:https://github.com/yagop/node-telegram-bot-api/blob/v0.29.0/doc/api.md#TelegramBot+answerCallbackQuery


================================================
FILE: doc/api.md
================================================
# API Reference

**Note:** If you are looking for available [events](usage.md#events) or usage of api, please refer [`usage.md`](usage.md).

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

## TelegramBot
TelegramBot

**Kind**: global class  
**See**: https://core.telegram.org/bots/api  

* [TelegramBot](#TelegramBot)
    * [new TelegramBot(token, [options])](#new_TelegramBot_new)
    * _instance_
        * [.on(event, listener)](#TelegramBot+on)
        * [.startPolling([options])](#TelegramBot+startPolling) ⇒ <code>Promise</code>
        * ~~[.initPolling([options])](#TelegramBot+initPolling) ⇒ <code>Promise</code>~~
        * [.stopPolling([options])](#TelegramBot+stopPolling) ⇒ <code>Promise</code>
        * [.getFileLink(fileId, [options])](#TelegramBot+getFileLink) ⇒ <code>Promise</code>
        * [.getFileStream(fileId, [options])](#TelegramBot+getFileStream) ⇒ <code>stream.Readable</code>
        * [.downloadFile(fileId, downloadDir, [options])](#TelegramBot+downloadFile) ⇒ <code>Promise</code>
        * [.onText(regexpRexecuted, callback)](#TelegramBot+onText)
        * [.removeTextListener(regexp)](#TelegramBot+removeTextListener) ⇒ <code>Object</code>
        * [.clearTextListeners()](#TelegramBot+clearTextListeners)
        * [.onReplyToMessage(chatId, messageId, callback)](#TelegramBot+onReplyToMessage) ⇒ <code>Number</code>
        * [.removeReplyListener(replyListenerId)](#TelegramBot+removeReplyListener) ⇒ <code>Object</code>
        * [.clearReplyListeners()](#TelegramBot+clearReplyListeners) ⇒ <code>Array</code>
        * [.isPolling()](#TelegramBot+isPolling) ⇒ <code>Boolean</code>
        * [.openWebHook()](#TelegramBot+openWebHook) ⇒ <code>Promise</code>
        * [.closeWebHook()](#TelegramBot+closeWebHook) ⇒ <code>Promise</code>
        * [.hasOpenWebHook()](#TelegramBot+hasOpenWebHook) ⇒ <code>Boolean</code>
        * [.processUpdate(update)](#TelegramBot+processUpdate)
        * [.getUpdates([options])](#TelegramBot+getUpdates) ⇒ <code>Promise</code>
        * [.setWebHook(url, [options], [fileOptions])](#TelegramBot+setWebHook) ⇒ <code>Promise</code>
        * [.deleteWebHook([options])](#TelegramBot+deleteWebHook) ⇒ <code>Promise</code>
        * [.getWebHookInfo([options])](#TelegramBot+getWebHookInfo) ⇒ <code>Promise</code>
        * [.getMe([options])](#TelegramBot+getMe) ⇒ <code>Promise</code>
        * [.logOut([options])](#TelegramBot+logOut) ⇒ <code>Promise</code>
        * [.close([options])](#TelegramBot+close) ⇒ <code>Promise</code>
        * [.sendMessage(chatId, text, [options])](#TelegramBot+sendMessage) ⇒ <code>Promise</code>
        * [.forwardMessage(chatId, fromChatId, messageId, [options])](#TelegramBot+forwardMessage) ⇒ <code>Promise</code>
        * [.forwardMessages(chatId, fromChatId, messageIds, [options])](#TelegramBot+forwardMessages) ⇒ <code>Promise</code>
        * [.copyMessage(chatId, fromChatId, messageId, [options])](#TelegramBot+copyMessage) ⇒ <code>Promise</code>
        * [.copyMessages(chatId, fromChatId, messageIds, [options])](#TelegramBot+copyMessages) ⇒ <code>Promise</code>
        * [.sendPhoto(chatId, photo, [options], [fileOptions])](#TelegramBot+sendPhoto) ⇒ <code>Promise</code>
        * [.sendAudio(chatId, audio, [options], [fileOptions])](#TelegramBot+sendAudio) ⇒ <code>Promise</code>
        * [.sendDocument(chatId, doc, [options], [fileOptions])](#TelegramBot+sendDocument) ⇒ <code>Promise</code>
        * [.sendVideo(chatId, video, [options], [fileOptions])](#TelegramBot+sendVideo) ⇒ <code>Promise</code>
        * [.sendAnimation(chatId, animation, [options], [fileOptions])](#TelegramBot+sendAnimation) ⇒ <code>Promise</code>
        * [.sendVoice(chatId, voice, [options], [fileOptions])](#TelegramBot+sendVoice) ⇒ <code>Promise</code>
        * [.sendVideoNote(chatId, videoNote, [options], [fileOptions])](#TelegramBot+sendVideoNote) ⇒ <code>Promise</code>
        * [.sendPaidMedia(chatId, starCount, media, [options])](#TelegramBot+sendPaidMedia) ⇒ <code>Promise</code>
        * [.sendMediaGroup(chatId, media, [options])](#TelegramBot+sendMediaGroup) ⇒ <code>Promise</code>
        * [.sendLocation(chatId, latitude, longitude, [options])](#TelegramBot+sendLocation) ⇒ <code>Promise</code>
        * [.editMessageLiveLocation(latitude, longitude, [options])](#TelegramBot+editMessageLiveLocation) ⇒ <code>Promise</code>
        * [.stopMessageLiveLocation([options])](#TelegramBot+stopMessageLiveLocation) ⇒ <code>Promise</code>
        * [.sendVenue(chatId, latitude, longitude, title, address, [options])](#TelegramBot+sendVenue) ⇒ <code>Promise</code>
        * [.sendContact(chatId, phoneNumber, firstName, [options])](#TelegramBot+sendContact) ⇒ <code>Promise</code>
        * [.sendPoll(chatId, question, pollOptions, [options])](#TelegramBot+sendPoll) ⇒ <code>Promise</code>
        * [.sendChecklist(businessConnectionId, chatId, checklist, [options])](#TelegramBot+sendChecklist) ⇒ <code>Promise</code>
        * [.sendDice(chatId, [options])](#TelegramBot+sendDice) ⇒ <code>Promise</code>
        * [.sendMessageDraft(chatId, draftId, text, [options])](#TelegramBot+sendMessageDraft) ⇒ <code>Promise</code>
        * [.sendChatAction(chatId, action, [options])](#TelegramBot+sendChatAction) ⇒ <code>Promise</code>
        * [.setMessageReaction(chatId, messageId, [options])](#TelegramBot+setMessageReaction) ⇒ <code>Promise.&lt;Boolean&gt;</code>
        * [.getUserProfilePhotos(userId, [options])](#TelegramBot+getUserProfilePhotos) ⇒ <code>Promise</code>
        * [.getUserProfileAudios(userId, [options])](#TelegramBot+getUserProfileAudios) ⇒ <code>Promise</code>
        * [.setUserEmojiStatus(userId, [options])](#TelegramBot+setUserEmojiStatus) ⇒ <code>Promise</code>
        * [.getFile(fileId, [options])](#TelegramBot+getFile) ⇒ <code>Promise</code>
        * [.banChatMember(chatId, userId, [options])](#TelegramBot+banChatMember) ⇒ <code>Promise</code>
        * [.unbanChatMember(chatId, userId, [options])](#TelegramBot+unbanChatMember) ⇒ <code>Promise</code>
        * [.restrictChatMember(chatId, userId, [options])](#TelegramBot+restrictChatMember) ⇒ <code>Promise</code>
        * [.promoteChatMember(chatId, userId, [options])](#TelegramBot+promoteChatMember) ⇒ <code>Promise</code>
        * [.setChatAdministratorCustomTitle(chatId, userId, customTitle, [options])](#TelegramBot+setChatAdministratorCustomTitle) ⇒ <code>Promise</code>
        * [.setChatMemberTag(chatId, userId, [options])](#TelegramBot+setChatMemberTag) ⇒ <code>Promise</code>
        * [.banChatSenderChat(chatId, senderChatId, [options])](#TelegramBot+banChatSenderChat) ⇒ <code>Promise</code>
        * [.unbanChatSenderChat(chatId, senderChatId, [options])](#TelegramBot+unbanChatSenderChat) ⇒ <code>Promise</code>
        * [.setChatPermissions(chatId, chatPermissions, [options])](#TelegramBot+setChatPermissions) ⇒ <code>Promise</code>
        * [.exportChatInviteLink(chatId, [options])](#TelegramBot+exportChatInviteLink) ⇒ <code>Promise</code>
        * [.createChatInviteLink(chatId, [options])](#TelegramBot+createChatInviteLink) ⇒ <code>Object</code>
        * [.editChatInviteLink(chatId, inviteLink, [options])](#TelegramBot+editChatInviteLink) ⇒ <code>Promise</code>
        * [.createChatSubscriptionInviteLink(chatId, subscriptionPeriod, subscriptionPrice, [options])](#TelegramBot+createChatSubscriptionInviteLink) ⇒ <code>Promise</code>
        * [.editChatSubscriptionInviteLink(chatId, inviteLink, [options])](#TelegramBot+editChatSubscriptionInviteLink) ⇒ <code>Promise</code>
        * [.revokeChatInviteLink(chatId, inviteLink, [options])](#TelegramBot+revokeChatInviteLink) ⇒ <code>Promise</code>
        * [.approveChatJoinRequest(chatId, userId, [options])](#TelegramBot+approveChatJoinRequest) ⇒ <code>Promise</code>
        * [.declineChatJoinRequest(chatId, userId, [options])](#TelegramBot+declineChatJoinRequest) ⇒ <code>Promise</code>
        * [.setChatPhoto(chatId, photo, [options], [fileOptions])](#TelegramBot+setChatPhoto) ⇒ <code>Promise</code>
        * [.deleteChatPhoto(chatId, [options])](#TelegramBot+deleteChatPhoto) ⇒ <code>Promise</code>
        * [.setChatTitle(chatId, title, [options])](#TelegramBot+setChatTitle) ⇒ <code>Promise</code>
        * [.setChatDescription(chatId, description, [options])](#TelegramBot+setChatDescription) ⇒ <code>Promise</code>
        * [.pinChatMessage(chatId, messageId, [options])](#TelegramBot+pinChatMessage) ⇒ <code>Promise</code>
        * [.unpinChatMessage(chatId, [options])](#TelegramBot+unpinChatMessage) ⇒ <code>Promise</code>
        * [.unpinAllChatMessages(chatId, [options])](#TelegramBot+unpinAllChatMessages) ⇒ <code>Promise</code>
        * [.leaveChat(chatId, [options])](#TelegramBot+leaveChat) ⇒ <code>Promise</code>
        * [.getChat(chatId, [options])](#TelegramBot+getChat) ⇒ <code>Promise</code>
        * [.getChatAdministrators(chatId, [options])](#TelegramBot+getChatAdministrators) ⇒ <code>Promise</code>
        * [.getChatMemberCount(chatId, [options])](#TelegramBot+getChatMemberCount) ⇒ <code>Promise</code>
        * [.getChatMember(chatId, userId, [options])](#TelegramBot+getChatMember) ⇒ <code>Promise</code>
        * [.setChatStickerSet(chatId, stickerSetName, [options])](#TelegramBot+setChatStickerSet) ⇒ <code>Promise</code>
        * [.deleteChatStickerSet(chatId, [options])](#TelegramBot+deleteChatStickerSet) ⇒ <code>Promise</code>
        * [.getForumTopicIconStickers(chatId, [options])](#TelegramBot+getForumTopicIconStickers) ⇒ <code>Promise</code>
        * [.createForumTopic(chatId, name, [options])](#TelegramBot+createForumTopic)
        * [.editForumTopic(chatId, messageThreadId, [options])](#TelegramBot+editForumTopic) ⇒ <code>Promise</code>
        * [.closeForumTopic(chatId, messageThreadId, [options])](#TelegramBot+closeForumTopic) ⇒ <code>Promise</code>
        * [.reopenForumTopic(chatId, messageThreadId, [options])](#TelegramBot+reopenForumTopic) ⇒ <code>Promise</code>
        * [.deleteForumTopic(chatId, messageThreadId, [options])](#TelegramBot+deleteForumTopic) ⇒ <code>Promise</code>
        * [.unpinAllForumTopicMessages(chatId, messageThreadId, [options])](#TelegramBot+unpinAllForumTopicMessages) ⇒ <code>Promise</code>
        * [.editGeneralForumTopic(chatId, name, [options])](#TelegramBot+editGeneralForumTopic) ⇒ <code>Promise</code>
        * [.closeGeneralForumTopic(chatId, [options])](#TelegramBot+closeGeneralForumTopic) ⇒ <code>Promise</code>
        * [.reopenGeneralForumTopic(chatId, [options])](#TelegramBot+reopenGeneralForumTopic) ⇒ <code>Promise</code>
        * [.hideGeneralForumTopic(chatId, [options])](#TelegramBot+hideGeneralForumTopic) ⇒ <code>Promise</code>
        * [.unhideGeneralForumTopic(chatId, [options])](#TelegramBot+unhideGeneralForumTopic) ⇒ <code>Promise</code>
        * [.unpinAllGeneralForumTopicMessages(chatId, [options])](#TelegramBot+unpinAllGeneralForumTopicMessages) ⇒ <code>Promise</code>
        * [.answerCallbackQuery(callbackQueryId, [options])](#TelegramBot+answerCallbackQuery) ⇒ <code>Promise</code>
        * [.savePreparedInlineMessage(userId, result, [options])](#TelegramBot+savePreparedInlineMessage) ⇒ <code>Promise</code>
        * [.getUserChatBoosts(chatId, userId, [options])](#TelegramBot+getUserChatBoosts) ⇒ <code>Promise</code>
        * [.getBusinessConnection(businessConnectionId, [options])](#TelegramBot+getBusinessConnection) ⇒ <code>Promise</code>
        * [.setMyCommands(commands, [options])](#TelegramBot+setMyCommands) ⇒ <code>Promise</code>
        * [.deleteMyCommands([options])](#TelegramBot+deleteMyCommands) ⇒ <code>Promise</code>
        * [.getMyCommands([options])](#TelegramBot+getMyCommands) ⇒ <code>Promise</code>
        * [.setMyName([options])](#TelegramBot+setMyName) ⇒ <code>Promise</code>
        * [.getMyName([options])](#TelegramBot+getMyName) ⇒ <code>Promise</code>
        * [.setMyDescription([options])](#TelegramBot+setMyDescription) ⇒ <code>Promise</code>
        * [.getMyDescription([options])](#TelegramBot+getMyDescription) ⇒ <code>Promise</code>
        * [.setMyShortDescription([options])](#TelegramBot+setMyShortDescription) ⇒ <code>Promise</code>
        * [.getMyShortDescription([options])](#TelegramBot+getMyShortDescription) ⇒ <code>Promise</code>
        * [.setMyProfilePhoto(photo, [options])](#TelegramBot+setMyProfilePhoto) ⇒ <code>Promise</code>
        * [.removeMyProfilePhoto([options])](#TelegramBot+removeMyProfilePhoto) ⇒ <code>Promise</code>
        * [.setChatMenuButton([options])](#TelegramBot+setChatMenuButton) ⇒ <code>Promise</code>
        * [.getChatMenuButton([options])](#TelegramBot+getChatMenuButton) ⇒ <code>Promise</code>
        * [.setMyDefaultAdministratorRights([options])](#TelegramBot+setMyDefaultAdministratorRights) ⇒ <code>Promise</code>
        * [.getMyDefaultAdministratorRights([options])](#TelegramBot+getMyDefaultAdministratorRights) ⇒ <code>Promise</code>
        * [.editMessageText(text, [options])](#TelegramBot+editMessageText) ⇒ <code>Promise</code>
        * [.editMessageCaption(caption, [options])](#TelegramBot+editMessageCaption) ⇒ <code>Promise</code>
        * [.editMessageMedia(media, [options])](#TelegramBot+editMessageMedia) ⇒ <code>Promise</code>
        * [.editMessageChecklist(businessConnectionId, chatId, messageId, checklist, [options])](#TelegramBot+editMessageChecklist) ⇒ <code>Promise</code>
        * [.editMessageReplyMarkup(replyMarkup, [options])](#TelegramBot+editMessageReplyMarkup) ⇒ <code>Promise</code>
        * [.stopPoll(chatId, pollId, [options])](#TelegramBot+stopPoll) ⇒ <code>Promise</code>
        * [.approveSuggestedPost(chatId, messageId, [options])](#TelegramBot+approveSuggestedPost) ⇒ <code>Promise</code>
        * [.declineSuggestedPost(chatId, messageId, [options])](#TelegramBot+declineSuggestedPost) ⇒ <code>Promise</code>
        * [.sendSticker(chatId, sticker, [options], [fileOptions])](#TelegramBot+sendSticker) ⇒ <code>Promise</code>
        * [.getStickerSet(name, [options])](#TelegramBot+getStickerSet) ⇒ <code>Promise</code>
        * [.getCustomEmojiStickers(custom_emoji_ids, [options])](#TelegramBot+getCustomEmojiStickers) ⇒ <code>Promise</code>
        * [.uploadStickerFile(userId, sticker, stickerFormat, [options], [fileOptions])](#TelegramBot+uploadStickerFile) ⇒ <code>Promise</code>
        * [.createNewStickerSet(userId, name, title, pngSticker, emojis, [options], [fileOptions])](#TelegramBot+createNewStickerSet) ⇒ <code>Promise</code>
        * [.addStickerToSet(userId, name, sticker, emojis, stickerType, [options], [fileOptions])](#TelegramBot+addStickerToSet) ⇒ <code>Promise</code>
        * [.setStickerPositionInSet(sticker, position, [options])](#TelegramBot+setStickerPositionInSet) ⇒ <code>Promise</code>
        * [.deleteStickerFromSet(sticker, [options])](#TelegramBot+deleteStickerFromSet) ⇒ <code>Promise</code>
        * [.replaceStickerInSet(userId, name, sticker, [options])](#TelegramBot+replaceStickerInSet) ⇒ <code>Promise</code>
        * [.setStickerEmojiList(sticker, emojiList, [options])](#TelegramBot+setStickerEmojiList) ⇒ <code>Promise</code>
        * [.setStickerKeywords(sticker, [options])](#TelegramBot+setStickerKeywords) ⇒ <code>Promise</code>
        * [.setStickerMaskPosition(sticker, [options])](#TelegramBot+setStickerMaskPosition) ⇒ <code>Promise</code>
        * [.setStickerSetTitle(name, title, [options])](#TelegramBot+setStickerSetTitle) ⇒ <code>Promise</code>
        * [.setStickerSetThumbnail(userId, name, thumbnail, [options], [fileOptions])](#TelegramBot+setStickerSetThumbnail) ⇒ <code>Promise</code>
        * [.setCustomEmojiStickerSetThumbnail(name, [options])](#TelegramBot+setCustomEmojiStickerSetThumbnail) ⇒ <code>Promise</code>
        * [.deleteStickerSet(name, [options])](#TelegramBot+deleteStickerSet) ⇒ <code>Promise</code>
        * [.answerInlineQuery(inlineQueryId, results, [options])](#TelegramBot+answerInlineQuery) ⇒ <code>Promise</code>
        * [.answerWebAppQuery(webAppQueryId, result, [options])](#TelegramBot+answerWebAppQuery) ⇒ <code>Promise</code>
        * [.sendInvoice(chatId, title, description, payload, providerToken, currency, prices, [options])](#TelegramBot+sendInvoice) ⇒ <code>Promise</code>
        * [.createInvoiceLink(title, description, payload, providerToken, currency, prices, [options])](#TelegramBot+createInvoiceLink) ⇒ <code>Promise</code>
        * [.answerShippingQuery(shippingQueryId, ok, [options])](#TelegramBot+answerShippingQuery) ⇒ <code>Promise</code>
        * [.answerPreCheckoutQuery(preCheckoutQueryId, ok, [options])](#TelegramBot+answerPreCheckoutQuery) ⇒ <code>Promise</code>
        * [.getMyStarBalance([options])](#TelegramBot+getMyStarBalance) ⇒ <code>Promise</code>
        * [.getStarTransactions([options])](#TelegramBot+getStarTransactions) ⇒ <code>Promise</code>
        * [.refundStarPayment(userId, telegramPaymentChargeId, [options])](#TelegramBot+refundStarPayment) ⇒ <code>Promise</code>
        * [.editUserStarSubscription(userId, telegramPaymentChargeId, isCanceled, [options])](#TelegramBot+editUserStarSubscription) ⇒ <code>Promise</code>
        * [.sendGame(chatId, gameShortName, [options])](#TelegramBot+sendGame) ⇒ <code>Promise</code>
        * [.setGameScore(userId, score, [options])](#TelegramBot+setGameScore) ⇒ <code>Promise</code>
        * [.getGameHighScores(userId, [options])](#TelegramBot+getGameHighScores) ⇒ <code>Promise</code>
        * [.deleteMessage(chatId, messageId, [options])](#TelegramBot+deleteMessage) ⇒ <code>Promise</code>
        * [.deleteMessages(chatId, messageIds, [options])](#TelegramBot+deleteMessages) ⇒ <code>Promise.&lt;Boolean&gt;</code>
        * [.getAvailableGifts([options])](#TelegramBot+getAvailableGifts) ⇒ <code>Promise</code>
        * [.sendGift(giftId, [options])](#TelegramBot+sendGift) ⇒ <code>Promise</code>
        * [.giftPremiumSubscription(userId, monthCount, starCount, [options])](#TelegramBot+giftPremiumSubscription) ⇒ <code>Promise</code>
        * [.verifyUser(userId, [options])](#TelegramBot+verifyUser) ⇒ <code>Promise</code>
        * [.verifyChat(chatId, [options])](#TelegramBot+verifyChat) ⇒ <code>Promise</code>
        * [.removeUserVerification(userId, [options])](#TelegramBot+removeUserVerification) ⇒ <code>Promise</code>
        * [.removeChatVerification(chatId, [options])](#TelegramBot+removeChatVerification) ⇒ <code>Promise</code>
        * [.readBusinessMessage(businessConnectionId, chatId, messageId, [options])](#TelegramBot+readBusinessMessage) ⇒ <code>Promise</code>
        * [.deleteBusinessMessages(businessConnectionId, messageIds, [options])](#TelegramBot+deleteBusinessMessages) ⇒ <code>Promise</code>
        * [.setBusinessAccountName(businessConnectionId, firstName, [options])](#TelegramBot+setBusinessAccountName) ⇒ <code>Promise</code>
        * [.setBusinessAccountUsername(businessConnectionId, [options])](#TelegramBot+setBusinessAccountUsername) ⇒ <code>Promise</code>
        * [.setBusinessAccountBio(businessConnectionId, [options])](#TelegramBot+setBusinessAccountBio) ⇒ <code>Promise</code>
        * [.setBusinessAccountProfilePhoto(businessConnectionId, photo, [options])](#TelegramBot+setBusinessAccountProfilePhoto) ⇒ <code>Promise</code>
        * [.removeBusinessAccountProfilePhoto(businessConnectionId, [options])](#TelegramBot+removeBusinessAccountProfilePhoto) ⇒ <code>Promise</code>
        * [.setBusinessAccountGiftSettings(businessConnectionId, showGiftButton, acceptedGiftTypes, [options])](#TelegramBot+setBusinessAccountGiftSettings) ⇒ <code>Promise</code>
        * [.getBusinessAccountStarBalance(businessConnectionId, [options])](#TelegramBot+getBusinessAccountStarBalance) ⇒ <code>Promise</code>
        * [.transferBusinessAccountStars(businessConnectionId, starCount, [options])](#TelegramBot+transferBusinessAccountStars) ⇒ <code>Promise</code>
        * [.getBusinessAccountGifts(businessConnectionId, [options])](#TelegramBot+getBusinessAccountGifts) ⇒ <code>Promise</code>
        * [.getUserGifts(userId, [options])](#TelegramBot+getUserGifts) ⇒ <code>Promise</code>
        * [.getChatGifts(chatId, [options])](#TelegramBot+getChatGifts) ⇒ <code>Promise</code>
        * [.convertGiftToStars(businessConnectionId, ownedGiftId, [options])](#TelegramBot+convertGiftToStars) ⇒ <code>Promise</code>
        * [.upgradeGift(businessConnectionId, ownedGiftId, [options])](#TelegramBot+upgradeGift) ⇒ <code>Promise</code>
        * [.transferGift(businessConnectionId, ownedGiftId, newOwnerChatId, [options])](#TelegramBot+transferGift) ⇒ <code>Promise</code>
        * [.postStory(businessConnectionId, content, activePeriod, [options])](#TelegramBot+postStory) ⇒ <code>Promise</code>
        * [.repostStory(businessConnectionId, fromChatId, fromStoryId, activePeriod, [options])](#TelegramBot+repostStory) ⇒ <code>Promise</code>
        * [.editStory(businessConnectionId, storyId, content, [options])](#TelegramBot+editStory) ⇒ <code>Promise</code>
        * [.deleteStory(businessConnectionId, storyId, [options])](#TelegramBot+deleteStory) ⇒ <code>Promise</code>
    * _static_
        * [.errors](#TelegramBot.errors) : <code>Object</code>
        * [.messageTypes](#TelegramBot.messageTypes) : <code>Array.&lt;String&gt;</code>

<a name="new_TelegramBot_new"></a>

### new TelegramBot(token, [options])
Both request method to obtain messages are implemented. To use standard polling, set `polling: true`
on `options`. Notice that [webHook](https://core.telegram.org/bots/api#setwebhook) will need a SSL certificate.
Emits `message` when a message arrives.


| Param | Type | Default | Description |
| --- | --- | --- | --- |
| token | <code>String</code> |  | Bot Token |
| [options] | <code>Object</code> |  |  |
| [options.polling] | <code>Boolean</code> \| <code>Object</code> | <code>false</code> | Set true to enable polling or set options.  If a WebHook has been set, it will be deleted automatically. |
| [options.polling.timeout] | <code>String</code> \| <code>Number</code> | <code>10</code> | *Deprecated. Use `options.polling.params` instead*.  Timeout in seconds for long polling. |
| [options.testEnvironment] | <code>Boolean</code> | <code>false</code> | Set true to  work with test enviroment. When working with the test environment, you may use HTTP links without TLS to test your Web App. |
| [options.polling.interval] | <code>String</code> \| <code>Number</code> | <code>300</code> | Interval between requests in miliseconds |
| [options.polling.autoStart] | <code>Boolean</code> | <code>true</code> | Start polling immediately |
| [options.polling.params] | <code>Object</code> |  | Parameters to be used in polling API requests.  See https://core.telegram.org/bots/api#getupdates for more information. |
| [options.polling.params.timeout] | <code>Number</code> | <code>10</code> | Timeout in seconds for long polling. |
| [options.polling.params.allowed_updates] | <code>Array.&lt;String&gt;</code> \| <code>String</code> |  | A JSON-serialized list of the update types you want your bot to receive.  For example, specify ["message", "edited_channel_post", "callback_query"] to only receive updates of these types. |
| [options.webHook] | <code>Boolean</code> \| <code>Object</code> | <code>false</code> | Set true to enable WebHook or set options |
| [options.webHook.host] | <code>String</code> | <code>&quot;0.0.0.0&quot;</code> | Host to bind to |
| [options.webHook.port] | <code>Number</code> | <code>8443</code> | Port to bind to |
| [options.webHook.key] | <code>String</code> |  | Path to file with PEM private key for webHook server.  The file is read **synchronously**! |
| [options.webHook.cert] | <code>String</code> |  | Path to file with PEM certificate (public) for webHook server.  The file is read **synchronously**! |
| [options.webHook.pfx] | <code>String</code> |  | Path to file with PFX private key and certificate chain for webHook server.  The file is read **synchronously**! |
| [options.webHook.autoOpen] | <code>Boolean</code> | <code>true</code> | Open webHook immediately |
| [options.webHook.https] | <code>Object</code> |  | Options to be passed to `https.createServer()`.  Note that `options.webHook.key`, `options.webHook.cert` and `options.webHook.pfx`, if provided, will be  used to override `key`, `cert` and `pfx` in this object, respectively.  See https://nodejs.org/api/https.html#https_https_createserver_options_requestlistener for more information. |
| [options.webHook.healthEndpoint] | <code>String</code> | <code>&quot;/healthz&quot;</code> | An endpoint for health checks that always responds with 200 OK |
| [options.onlyFirstMatch] | <code>Boolean</code> | <code>false</code> | Set to true to stop after first match. Otherwise, all regexps are executed |
| [options.request] | <code>Object</code> |  | Options which will be added for all requests to telegram api.  See https://github.com/request/request#requestoptions-callback for more information. |
| [options.baseApiUrl] | <code>String</code> | <code>&quot;https://api.telegram.org&quot;</code> | API Base URl; useful for proxying and testing |
| [options.filepath] | <code>Boolean</code> | <code>true</code> | Allow passing file-paths as arguments when sending files,  such as photos using `TelegramBot#sendPhoto()`. See [usage information][usage-sending-files-performance]  for more information on this option and its consequences. |
| [options.badRejection] | <code>Boolean</code> | <code>false</code> | Set to `true`  **if and only if** the Node.js version you're using terminates the  process on unhandled rejections. This option is only for  *forward-compatibility purposes*. |

<a name="TelegramBot+on"></a>

### telegramBot.on(event, listener)
Add listener for the specified [event](https://github.com/yagop/node-telegram-bot-api/blob/master/doc/usage.md#events).
This is the usual `emitter.on()` method.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**See**

- [Available events](https://github.com/yagop/node-telegram-bot-api/blob/master/doc/usage.md#events)
- https://nodejs.org/api/events.html#events_emitter_on_eventname_listener


| Param | Type |
| --- | --- |
| event | <code>String</code> | 
| listener | <code>function</code> | 

<a name="TelegramBot+startPolling"></a>

### telegramBot.startPolling([options]) ⇒ <code>Promise</code>
Start polling.
Rejects returned promise if a WebHook is being used by this instance.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  

| Param | Type | Default | Description |
| --- | --- | --- | --- |
| [options] | <code>Object</code> |  |  |
| [options.restart] | <code>Boolean</code> | <code>true</code> | Consecutive calls to this method causes polling to be restarted |

<a name="TelegramBot+initPolling"></a>

### ~~telegramBot.initPolling([options]) ⇒ <code>Promise</code>~~
***Deprecated***

Alias of `TelegramBot#startPolling()`. This is **deprecated**.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  

| Param | Type |
| --- | --- |
| [options] | <code>Object</code> | 

<a name="TelegramBot+stopPolling"></a>

### telegramBot.stopPolling([options]) ⇒ <code>Promise</code>
Stops polling after the last polling request resolves.
Multiple invocations do nothing if polling is already stopped.
Returning the promise of the last polling request is **deprecated**.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  

| Param | Type | Description |
| --- | --- | --- |
| [options] | <code>Object</code> | Options |
| [options.cancel] | <code>Boolean</code> | Cancel current request |
| [options.reason] | <code>String</code> | Reason for stopping polling |

<a name="TelegramBot+getFileLink"></a>

### telegramBot.getFileLink(fileId, [options]) ⇒ <code>Promise</code>
Get link for file.
Use this method to get link for file for subsequent use.
Attention: link will be valid for 1 hour.

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).

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - Promise which will have  *fileURI* in resolve callback  
**See**: https://core.telegram.org/bots/api#getfile  

| Param | Type | Description |
| --- | --- | --- |
| fileId | <code>String</code> | File identifier to get info about |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+getFileStream"></a>

### telegramBot.getFileStream(fileId, [options]) ⇒ <code>stream.Readable</code>
Return a readable stream for file.

`fileStream.path` is the specified file ID i.e. `fileId`.
`fileStream` emits event `info` passing a single argument i.e.
`info` with the interface `{ uri }` where `uri` is the URI of the
file on Telegram servers.

This method is a sugar extension of the [getFileLink](#TelegramBot+getFileLink) method,
which returns the full URI to the file on remote server.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>stream.Readable</code> - fileStream  

| Param | Type | Description |
| --- | --- | --- |
| fileId | <code>String</code> | File identifier to get info about |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+downloadFile"></a>

### telegramBot.downloadFile(fileId, downloadDir, [options]) ⇒ <code>Promise</code>
Downloads file in the specified folder.

This method is a sugar extension of the [getFileStream](#TelegramBot+getFileStream) method,
which returns a readable file stream.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - Promise, which will have *filePath* of downloaded file in resolve callback  

| Param | Type | Description |
| --- | --- | --- |
| fileId | <code>String</code> | File identifier to get info about |
| downloadDir | <code>String</code> | Absolute path to the folder in which file will be saved |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+onText"></a>

### telegramBot.onText(regexpRexecuted, callback)
Register a RegExp to test against an incomming text message.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  

| Param | Type | Description |
| --- | --- | --- |
| regexpRexecuted | <code>RegExp</code> | with `exec`. |
| callback | <code>function</code> | Callback will be called with 2 parameters, the `msg` and the result of executing `regexp.exec` on message text. |

<a name="TelegramBot+removeTextListener"></a>

### telegramBot.removeTextListener(regexp) ⇒ <code>Object</code>
Remove a listener registered with `onText()`.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Object</code> - deletedListener The removed reply listener if
  found. This object has `regexp` and `callback`
  properties. If not found, returns `null`.  

| Param | Type | Description |
| --- | --- | --- |
| regexp | <code>RegExp</code> | RegExp used previously in `onText()` |

<a name="TelegramBot+clearTextListeners"></a>

### telegramBot.clearTextListeners()
Remove all listeners registered with `onText()`.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
<a name="TelegramBot+onReplyToMessage"></a>

### telegramBot.onReplyToMessage(chatId, messageId, callback) ⇒ <code>Number</code>
Register a reply to wait for a message response.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Number</code> - id The ID of the inserted reply listener.  

| Param | Type | Description |
| --- | --- | --- |
| chatId | <code>Number</code> \| <code>String</code> | The chat id where the message cames from. |
| messageId | <code>Number</code> \| <code>String</code> | The message id to be replied. |
| callback | <code>function</code> | Callback will be called with the reply  message. |

<a name="TelegramBot+removeReplyListener"></a>

### telegramBot.removeReplyListener(replyListenerId) ⇒ <code>Object</code>
Removes a reply that has been prev. registered for a message response.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Object</code> - deletedListener The removed reply listener if
  found. This object has `id`, `chatId`, `messageId` and `callback`
  properties. If not found, returns `null`.  

| Param | Type | Description |
| --- | --- | --- |
| replyListenerId | <code>Number</code> | The ID of the reply listener. |

<a name="TelegramBot+clearReplyListeners"></a>

### telegramBot.clearReplyListeners() ⇒ <code>Array</code>
Removes all replies that have been prev. registered for a message response.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Array</code> - deletedListeners An array of removed listeners.  
<a name="TelegramBot+isPolling"></a>

### telegramBot.isPolling() ⇒ <code>Boolean</code>
Return true if polling. Otherwise, false.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
<a name="TelegramBot+openWebHook"></a>

### telegramBot.openWebHook() ⇒ <code>Promise</code>
Open webhook.
Multiple invocations do nothing if webhook is already open.
Rejects returned promise if Polling is being used by this instance.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
<a name="TelegramBot+closeWebHook"></a>

### telegramBot.closeWebHook() ⇒ <code>Promise</code>
Close webhook after closing all current connections.
Multiple invocations do nothing if webhook is already closed.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - Promise  
<a name="TelegramBot+hasOpenWebHook"></a>

### telegramBot.hasOpenWebHook() ⇒ <code>Boolean</code>
Return true if using webhook and it is open i.e. accepts connections.
Otherwise, false.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
<a name="TelegramBot+processUpdate"></a>

### telegramBot.processUpdate(update)
Process an update; emitting the proper events and executing regexp
callbacks. This method is useful should you be using a different
way to fetch updates, other than those provided by TelegramBot.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**See**: https://core.telegram.org/bots/api#update  

| Param | Type |
| --- | --- |
| update | <code>Object</code> | 

<a name="TelegramBot+getUpdates"></a>

### telegramBot.getUpdates([options]) ⇒ <code>Promise</code>
Use this method to receive incoming updates using long polling.
This method has an [older, compatible signature][getUpdates-v0.25.0]
that is being deprecated.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**See**: https://core.telegram.org/bots/api#getupdates  

| Param | Type | Description |
| --- | --- | --- |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+setWebHook"></a>

### telegramBot.setWebHook(url, [options], [fileOptions]) ⇒ <code>Promise</code>
Specify an url to receive incoming updates via an outgoing webHook.
This method has an [older, compatible signature][setWebHook-v0.25.0]
that is being deprecated.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**See**

- https://core.telegram.org/bots/api#setwebhook
- https://github.com/yagop/node-telegram-bot-api/blob/master/doc/usage.md#sending-files


| Param | Type | Description |
| --- | --- | --- |
| url | <code>String</code> | URL where Telegram will make HTTP Post. Leave empty to delete webHook. |
| [options] | <code>Object</code> | Additional Telegram query options |
| [options.certificate] | <code>String</code> \| <code>stream.Stream</code> | PEM certificate key (public). |
| [options.secret_token] | <code>String</code> | Optional secret token to be sent in a header `X-Telegram-Bot-Api-Secret-Token` in every webhook request. |
| [fileOptions] | <code>Object</code> | Optional file related meta-data |

<a name="TelegramBot+deleteWebHook"></a>

### telegramBot.deleteWebHook([options]) ⇒ <code>Promise</code>
Use this method to remove webhook integration if you decide to
switch back to getUpdates. Returns True on success.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**See**: https://core.telegram.org/bots/api#deletewebhook  

| Param | Type | Description |
| --- | --- | --- |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+getWebHookInfo"></a>

### telegramBot.getWebHookInfo([options]) ⇒ <code>Promise</code>
Use this method to get current webhook status.
On success, returns a [WebhookInfo](https://core.telegram.org/bots/api#webhookinfo) object.
If the bot is using getUpdates, will return an object with the
url field empty.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**See**: https://core.telegram.org/bots/api#getwebhookinfo  

| Param | Type | Description |
| --- | --- | --- |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+getMe"></a>

### telegramBot.getMe([options]) ⇒ <code>Promise</code>
A simple method for testing your bot's authentication token. Requires no parameters.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - basic information about the bot in form of a [User](https://core.telegram.org/bots/api#user) object.  
**See**: https://core.telegram.org/bots/api#getme  

| Param | Type | Description |
| --- | --- | --- |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+logOut"></a>

### telegramBot.logOut([options]) ⇒ <code>Promise</code>
This method log out your bot from the cloud Bot API server before launching the bot locally.
You must log out the bot before running it locally, otherwise there is no guarantee that the bot will receive updates.
After a successful call, you will not be able to log in again using the same token for 10 minutes.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - True on success  
**See**: https://core.telegram.org/bots/api#logout  

| Param | Type | Description |
| --- | --- | --- |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+close"></a>

### telegramBot.close([options]) ⇒ <code>Promise</code>
This method close the bot instance before moving it from one local server to another.
This method will return error 429 in the first 10 minutes after the bot is launched.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - True on success  
**See**: https://core.telegram.org/bots/api#close  

| Param | Type | Description |
| --- | --- | --- |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+sendMessage"></a>

### telegramBot.sendMessage(chatId, text, [options]) ⇒ <code>Promise</code>
Send text message.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - On success, the sent [Message](https://core.telegram.org/bots/api#message) object is returned  
**See**: https://core.telegram.org/bots/api#sendmessage  

| Param | Type | Description |
| --- | --- | --- |
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
| text | <code>String</code> | Text of the message to be sent |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+forwardMessage"></a>

### telegramBot.forwardMessage(chatId, fromChatId, messageId, [options]) ⇒ <code>Promise</code>
Forward messages of any kind.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**See**: https://core.telegram.org/bots/api#forwardmessage  

| Param | Type | Description |
| --- | --- | --- |
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) or username of the target channel (in the format `@channelusername`) |
| fromChatId | <code>Number</code> \| <code>String</code> | Unique identifier for the chat where the original message was sent (or channel username in the format `@channelusername`) |
| messageId | <code>Number</code> \| <code>String</code> | Unique message identifier in the chat specified in fromChatId |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+forwardMessages"></a>

### telegramBot.forwardMessages(chatId, fromChatId, messageIds, [options]) ⇒ <code>Promise</code>
Use this method to forward multiple messages of any kind.
If some of the specified messages can't be found or forwarded, they are skipped.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - An array of MessageId of the sent messages on success  
**See**: https://core.telegram.org/bots/api#forwardmessages  

| Param | Type | Description |
| --- | --- | --- |
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) or username of the target channel (in the format `@channelusername`) |
| fromChatId | <code>Number</code> \| <code>String</code> | Unique identifier for the chat where the original message was sent (or channel username in the format `@channelusername`) |
| messageIds | <code>Array.&lt;(Number\|String)&gt;</code> | Identifiers of 1-100 messages in the chat from_chat_id to forward. The identifiers must be specified in a strictly increasing order. |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+copyMessage"></a>

### telegramBot.copyMessage(chatId, fromChatId, messageId, [options]) ⇒ <code>Promise</code>
Copy messages of any kind. **Service messages and invoice messages can't be copied.**
The method is analogous to the method forwardMessages, but the copied message doesn't
have a link to the original message.
Returns the MessageId of the sent message on success.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - The [MessageId](https://core.telegram.org/bots/api#messageid) of the sent message on success  
**See**: https://core.telegram.org/bots/api#copymessage  

| Param | Type | Description |
| --- | --- | --- |
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
| fromChatId | <code>Number</code> \| <code>String</code> | Unique identifier for the chat where the original message was sent |
| messageId | <code>Number</code> \| <code>String</code> | Unique message identifier |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+copyMessages"></a>

### telegramBot.copyMessages(chatId, fromChatId, messageIds, [options]) ⇒ <code>Promise</code>
Use this method to copy messages of any kind. If some of the specified messages can't be found or copied, they are skipped.
Service messages, giveaway messages, giveaway winners messages, and invoice messages can't be copied.
Returns the MessageId of the sent message on success.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - An array of MessageId of the sent messages  
**See**: https://core.telegram.org/bots/api#copymessages  

| Param | Type | Description |
| --- | --- | --- |
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat |
| fromChatId | <code>Number</code> \| <code>String</code> | Unique identifier for the chat where the original message was sent |
| messageIds | <code>Array</code> | Identifiers of 1-100 messages in the chat from_chat_id to copy. The identifiers must be specified in a strictly increasing order. |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+sendPhoto"></a>

### telegramBot.sendPhoto(chatId, photo, [options], [fileOptions]) ⇒ <code>Promise</code>
Send photo

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - On success, the sent [Message](https://core.telegram.org/bots/api#message) object is returned  
**See**

- https://core.telegram.org/bots/api#sendphoto
- https://github.com/yagop/node-telegram-bot-api/blob/master/doc/usage.md#sending-files


| Param | Type | Description |
| --- | --- | --- |
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
| photo | <code>String</code> \| <code>stream.Stream</code> \| <code>Buffer</code> | A file path or a Stream. Can also be a `file_id` previously uploaded |
| [options] | <code>Object</code> | Additional Telegram query options |
| [fileOptions] | <code>Object</code> | Optional file related meta-data |

<a name="TelegramBot+sendAudio"></a>

### telegramBot.sendAudio(chatId, audio, [options], [fileOptions]) ⇒ <code>Promise</code>
Send audio

**Your audio must be in the .MP3 or .M4A format.**

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - On success, the sent [Message](https://core.telegram.org/bots/api#message) object is returned  
**See**

- https://core.telegram.org/bots/api#sendaudio
- https://github.com/yagop/node-telegram-bot-api/blob/master/doc/usage.md#sending-files


| Param | Type | Description |
| --- | --- | --- |
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
| audio | <code>String</code> \| <code>stream.Stream</code> \| <code>Buffer</code> | A file path, Stream or Buffer. Can also be a `file_id` previously uploaded. |
| [options] | <code>Object</code> | Additional Telegram query options |
| [fileOptions] | <code>Object</code> | Optional file related meta-data |

<a name="TelegramBot+sendDocument"></a>

### telegramBot.sendDocument(chatId, doc, [options], [fileOptions]) ⇒ <code>Promise</code>
Send Document

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - On success, the sent [Message](https://core.telegram.org/bots/api#message) object is returned  
**See**

- https://core.telegram.org/bots/api#sendDocument
- https://github.com/yagop/node-telegram-bot-api/blob/master/doc/usage.md#sending-files


| Param | Type | Description |
| --- | --- | --- |
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
| doc | <code>String</code> \| <code>stream.Stream</code> \| <code>Buffer</code> | A file path, Stream or Buffer. Can also be a `file_id` previously uploaded. |
| [options] | <code>Object</code> | Additional Telegram query options |
| [fileOptions] | <code>Object</code> | Optional file related meta-data |

<a name="TelegramBot+sendVideo"></a>

### telegramBot.sendVideo(chatId, video, [options], [fileOptions]) ⇒ <code>Promise</code>
Use this method to send video files, **Telegram clients support mp4 videos** (other formats may be sent as Document).

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - On success, the sent [Message](https://core.telegram.org/bots/api#message) object is returned  
**See**

- https://core.telegram.org/bots/api#sendvideo
- https://github.com/yagop/node-telegram-bot-api/blob/master/doc/usage.md#sending-files


| Param | Type | Description |
| --- | --- | --- |
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
| video | <code>String</code> \| <code>stream.Stream</code> \| <code>Buffer</code> | A file path or Stream. Can also be a `file_id` previously uploaded. |
| [options] | <code>Object</code> | Additional Telegram query options |
| [fileOptions] | <code>Object</code> | Optional file related meta-data |

<a name="TelegramBot+sendAnimation"></a>

### telegramBot.sendAnimation(chatId, animation, [options], [fileOptions]) ⇒ <code>Promise</code>
Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without sound).

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - On success, the sent [Message](https://core.telegram.org/bots/api#message) object is returned  
**See**

- https://core.telegram.org/bots/api#sendanimation
- https://github.com/yagop/node-telegram-bot-api/blob/master/doc/usage.md#sending-files


| Param | Type | Description |
| --- | --- | --- |
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
| animation | <code>String</code> \| <code>stream.Stream</code> \| <code>Buffer</code> | A file path, Stream or Buffer. Can also be a `file_id` previously uploaded. |
| [options] | <code>Object</code> | Additional Telegram query options |
| [fileOptions] | <code>Object</code> | Optional file related meta-data |

<a name="TelegramBot+sendVoice"></a>

### telegramBot.sendVoice(chatId, voice, [options], [fileOptions]) ⇒ <code>Promise</code>
Send voice

**Your audio must be in an .OGG file encoded with OPUS**, or in .MP3 format, or in .M4A format (other formats may be sent as Audio or Document)

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - On success, the sent [Message](https://core.telegram.org/bots/api#message) object is returned  
**See**

- https://core.telegram.org/bots/api#sendvoice
- https://github.com/yagop/node-telegram-bot-api/blob/master/doc/usage.md#sending-files


| Param | Type | Description |
| --- | --- | --- |
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
| voice | <code>String</code> \| <code>stream.Stream</code> \| <code>Buffer</code> | A file path, Stream or Buffer. Can also be a `file_id` previously uploaded. |
| [options] | <code>Object</code> | Additional Telegram query options |
| [fileOptions] | <code>Object</code> | Optional file related meta-data |

<a name="TelegramBot+sendVideoNote"></a>

### telegramBot.sendVideoNote(chatId, videoNote, [options], [fileOptions]) ⇒ <code>Promise</code>
Use this method to send video messages
Telegram clients support **rounded square MPEG4 videos** of up to 1 minute long.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - On success, the sent [Message](https://core.telegram.org/bots/api#message) object is returned  
**Info**: The length parameter is actually optional. However, the API (at time of writing) requires you to always provide it until it is fixed.  
**See**

- https://core.telegram.org/bots/api#sendvideonote
- https://github.com/yagop/node-telegram-bot-api/blob/master/doc/usage.md#sending-files


| Param | Type | Description |
| --- | --- | --- |
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
| videoNote | <code>String</code> \| <code>stream.Stream</code> \| <code>Buffer</code> | A file path or Stream. Can also be a `file_id` previously uploaded. |
| [options] | <code>Object</code> | Additional Telegram query options |
| [fileOptions] | <code>Object</code> | Optional file related meta-data |

<a name="TelegramBot+sendPaidMedia"></a>

### telegramBot.sendPaidMedia(chatId, starCount, media, [options]) ⇒ <code>Promise</code>
Use this method to send paid media.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - On success, the sent [Message](https://core.telegram.org/bots/api#message) object is returned  
**See**: https://core.telegram.org/bots/api#sendpaidmedia  

| Param | Type | Description |
| --- | --- | --- |
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
| starCount | <code>Number</code> | The number of Telegram Stars that must be paid to buy access to the media; 1-10000 |
| media | <code>Array</code> | Array of [InputPaidMedia](https://core.telegram.org/bots/api#inputpaidmedia). The media property can bea String, Stream or Buffer. |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+sendMediaGroup"></a>

### telegramBot.sendMediaGroup(chatId, media, [options]) ⇒ <code>Promise</code>
Use this method to send a group of photos or videos as an album.

**Documents and audio files can be only grouped in an album with messages of the same type**

If you wish to [specify file options](https://github.com/yagop/node-telegram-bot-api/blob/master/doc/usage.md#sending-files),
add a `fileOptions` property to the target input in `media`.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - On success, an array of the sent [Messages](https://core.telegram.org/bots/api#message)
is returned.  
**See**

- https://core.telegram.org/bots/api#sendmediagroup
- https://github.com/yagop/node-telegram-bot-api/blob/master/doc/usage.md#sending-files


| Param | Type | Description |
| --- | --- | --- |
| chatId | <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
| media | <code>Array</code> | A JSON-serialized array describing photos and videos to be sent, must include 2–10 items |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+sendLocation"></a>

### telegramBot.sendLocation(chatId, latitude, longitude, [options]) ⇒ <code>Promise</code>
Send location.
Use this method to send point on the map.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - On success, the sent [Message](https://core.telegram.org/bots/api#message) object is returned  
**See**: https://core.telegram.org/bots/api#sendlocation  

| Param | Type | Description |
| --- | --- | --- |
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
| latitude | <code>Float</code> | Latitude of location |
| longitude | <code>Float</code> | Longitude of location |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+editMessageLiveLocation"></a>

### telegramBot.editMessageLiveLocation(latitude, longitude, [options]) ⇒ <code>Promise</code>
Use this method to edit live location messages sent by
the bot or via the bot (for inline bots).

 A location **can be edited until its live_period expires or editing is explicitly disabled by a call to [stopMessageLiveLocation](https://core.telegram.org/bots/api#stopmessagelivelocation)**

Note that you must provide one of chat_id, message_id, or
inline_message_id in your request.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - On success, if the edited message is not an inline message, the edited [Message](https://core.telegram.org/bots/api#message) is returned, otherwise True is returned.  
**See**: https://core.telegram.org/bots/api#editmessagelivelocation  

| Param | Type | Description |
| --- | --- | --- |
| latitude | <code>Float</code> | Latitude of location |
| longitude | <code>Float</code> | Longitude of location |
| [options] | <code>Object</code> | Additional Telegram query options (provide either one of chat_id, message_id, or inline_message_id here) |

<a name="TelegramBot+stopMessageLiveLocation"></a>

### telegramBot.stopMessageLiveLocation([options]) ⇒ <code>Promise</code>
Use this method to stop updating a live location message sent by
the bot or via the bot (for inline bots) before live_period expires.

Note that you must provide one of chat_id, message_id, or
inline_message_id in your request.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - On success, if the edited message is not an inline message, the edited [Message](https://core.telegram.org/bots/api#message) is returned, otherwise True is returned.  
**See**: https://core.telegram.org/bots/api#stopmessagelivelocation  

| Param | Type | Description |
| --- | --- | --- |
| [options] | <code>Object</code> | Additional Telegram query options (provide either one of chat_id, message_id, or inline_message_id here) |

<a name="TelegramBot+sendVenue"></a>

### telegramBot.sendVenue(chatId, latitude, longitude, title, address, [options]) ⇒ <code>Promise</code>
Send venue.
Use this method to send information about a venue.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - On success, the sent [Message](https://core.telegram.org/bots/api#message) object is returned.  
**See**: https://core.telegram.org/bots/api#sendvenue  

| Param | Type | Description |
| --- | --- | --- |
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
| latitude | <code>Float</code> | Latitude of location |
| longitude | <code>Float</code> | Longitude of location |
| title | <code>String</code> | Name of the venue |
| address | <code>String</code> | Address of the venue |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+sendContact"></a>

### telegramBot.sendContact(chatId, phoneNumber, firstName, [options]) ⇒ <code>Promise</code>
Send contact.
Use this method to send phone contacts.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - On success, the sent [Message](https://core.telegram.org/bots/api#message) object is returned  
**See**: https://core.telegram.org/bots/api#sendcontact  

| Param | Type | Description |
| --- | --- | --- |
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
| phoneNumber | <code>String</code> | Contact's phone number |
| firstName | <code>String</code> | Contact's first name |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+sendPoll"></a>

### telegramBot.sendPoll(chatId, question, pollOptions, [options]) ⇒ <code>Promise</code>
Send poll.
Use this method to send a native poll.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - On success, the sent [Message](https://core.telegram.org/bots/api#message) object is returned  
**See**: https://core.telegram.org/bots/api#sendpoll  

| Param | Type | Description |
| --- | --- | --- |
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the group/channel |
| question | <code>String</code> | Poll question, 1-300 characters |
| pollOptions | <code>Array</code> | Poll options, between 2-10 options (only 1-100 characters each) |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+sendChecklist"></a>

### telegramBot.sendChecklist(businessConnectionId, chatId, checklist, [options]) ⇒ <code>Promise</code>
Send sendChecklist.
Use this method to send a checklist on behalf of a connected business account.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - On success, the sent [Message](https://core.telegram.org/bots/api#message) object is returned  
**See**: https://core.telegram.org/bots/api#sendchecklist  

| Param | Type | Description |
| --- | --- | --- |
| businessConnectionId | <code>Number</code> \| <code>String</code> | Unique identifier for the business connection |
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the group/channel |
| checklist | <code>Object</code> | A JSON-serialized object for the checklist to send |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+sendDice"></a>

### telegramBot.sendDice(chatId, [options]) ⇒ <code>Promise</code>
Send Dice
Use this method to send an animated emoji that will display a random value.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - On success, the sent [Message](https://core.telegram.org/bots/api#message) object is returned  
**See**: https://core.telegram.org/bots/api#senddice  

| Param | Type | Description |
| --- | --- | --- |
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+sendMessageDraft"></a>

### telegramBot.sendMessageDraft(chatId, draftId, text, [options]) ⇒ <code>Promise</code>
Send Message Draft
Use this method to stream a partial message to a user while the message is being generated; supported only for bots with forum topic mode enabled. Returns True on success.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - On success, return true  
**See**: https://core.telegram.org/bots/api#sendmessagedraft  

| Param | Type | Description |
| --- | --- | --- |
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target private chat |
| draftId | <code>Number</code> | Unique identifier of the message draft; must be non-zero. Changes of drafts with the same identifier are animated |
| text | <code>String</code> | Text of the message to be sent, 1-4096 characters after entities parsing |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+sendChatAction"></a>

### telegramBot.sendChatAction(chatId, action, [options]) ⇒ <code>Promise</code>
Send chat action.

Use this method when you need to tell the user that something is happening on the bot's side.
**The status is set for 5 seconds or less** (when a message arrives from your bot, Telegram clients clear its typing status).

 Action `typing` for [text messages](https://core.telegram.org/bots/api#sendmessage),
`upload_photo` for [photos](https://core.telegram.org/bots/api#sendphoto), `record_video` or `upload_video` for [videos](https://core.telegram.org/bots/api#sendvideo),
`record_voice` or `upload_voice` for [voice notes](https://core.telegram.org/bots/api#sendvoice), `upload_document` for [general files](https://core.telegram.org/bots/api#senddocument),
`choose_sticker` for [stickers](https://core.telegram.org/bots/api#sendsticker), `find_location` for [location data](https://core.telegram.org/bots/api#sendlocation),
`record_video_note` or `upload_video_note` for [video notes](https://core.telegram.org/bots/api#sendvideonote).

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - True on success  
**See**: https://core.telegram.org/bots/api#sendchataction  

| Param | Type | Description |
| --- | --- | --- |
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
| action | <code>String</code> | Type of action to broadcast. |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+setMessageReaction"></a>

### telegramBot.setMessageReaction(chatId, messageId, [options]) ⇒ <code>Promise.&lt;Boolean&gt;</code>
Use this method to change the chosen reactions on a message.
- Service messages can't be reacted to.
- Automatically forwarded messages from a channel to its discussion group have the same available reactions as messages in the channel.
- In albums, bots must react to the first message.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise.&lt;Boolean&gt;</code> - True on success  
**See**: https://core.telegram.org/bots/api#setmessagereaction  

| Param | Type | Description |
| --- | --- | --- |
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format @channelusername) |
| messageId | <code>Number</code> | Unique identifier of the target message |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+getUserProfilePhotos"></a>

### telegramBot.getUserProfilePhotos(userId, [options]) ⇒ <code>Promise</code>
Use this method to get a list of profile pictures for a user.
Returns a [UserProfilePhotos](https://core.telegram.org/bots/api#userprofilephotos) object.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - Returns a [UserProfilePhotos](https://core.telegram.org/bots/api#userprofilephotos) object  
**See**: https://core.telegram.org/bots/api#getuserprofilephotos  

| Param | Type | Description |
| --- | --- | --- |
| userId | <code>Number</code> | Unique identifier of the target user |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+getUserProfileAudios"></a>

### telegramBot.getUserProfileAudios(userId, [options]) ⇒ <code>Promise</code>
Use this method to get a list of profile audios for a user.
Returns a [UserProfileAudios](https://core.telegram.org/bots/api#userprofileaudios) object.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - Returns a [UserProfileAudios](https://core.telegram.org/bots/api#userprofileaudios) object  
**See**: https://core.telegram.org/bots/api#getuserprofileaudios  

| Param | Type | Description |
| --- | --- | --- |
| userId | <code>Number</code> | Unique identifier of the target user |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+setUserEmojiStatus"></a>

### telegramBot.setUserEmojiStatus(userId, [options]) ⇒ <code>Promise</code>
Changes the emoji status for a given user that previously allowed the bot to manage their emoji status
via the Mini App method [requestEmojiStatusAccess](https://core.telegram.org/bots/webapps#initializing-mini-apps).

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - True on success  
**See**: https://core.telegram.org/bots/api#setuseremojistatus  

| Param | Type | Description |
| --- | --- | --- |
| userId | <code>Number</code> | Unique identifier of the target user |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+getFile"></a>

### telegramBot.getFile(fileId, [options]) ⇒ <code>Promise</code>
Get file.
Use this method to get basic info about a file and prepare it for downloading.

Attention: **link will be valid for 1 hour.**

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - On success, a [File](https://core.telegram.org/bots/api#file) object is returned  
**See**: https://core.telegram.org/bots/api#getfile  

| Param | Type | Description |
| --- | --- | --- |
| fileId | <code>String</code> | File identifier to get info about |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+banChatMember"></a>

### telegramBot.banChatMember(chatId, userId, [options]) ⇒ <code>Promise</code>
Use this method to ban a user in a group, a supergroup or a channel.
In the case of supergroups and channels, the user will not be able to
return to the chat on their own using invite links, etc., unless unbanned first..

The **bot must be an administrator in the group, supergroup or a channel** for this to work.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - True on success.  
**See**: https://core.telegram.org/bots/api#banchatmember  

| Param | Type | Description |
| --- | --- | --- |
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
| userId | <code>Number</code> | Unique identifier of the target user |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+unbanChatMember"></a>

### telegramBot.unbanChatMember(chatId, userId, [options]) ⇒ <code>Promise</code>
Use this method to unban a previously kicked user in a supergroup.
The user will not return to the group automatically, but will be
able to join via link, etc.

The **bot must be an administrator** in the supergroup or channel for this to work.

**By default**, this method guarantees that after the call the user is not a member of the chat, but will be able to join it.
So **if the user is a member of the chat they will also be removed from the chat**. If you don't want this, use the parameter *only_if_banned*

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - True on success  
**See**: https://core.telegram.org/bots/api#unbanchatmember  

| Param | Type | Description |
| --- | --- | --- |
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
| userId | <code>Number</code> | Unique identifier of the target user |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+restrictChatMember"></a>

### telegramBot.restrictChatMember(chatId, userId, [options]) ⇒ <code>Promise</code>
Use this method to restrict a user in a supergroup.
The bot **must be an administrator in the supergroup** for this to work
and must have the appropriate admin rights. Pass True for all boolean parameters
to lift restrictions from a user. Returns True on success.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - True on success  
**See**: https://core.telegram.org/bots/api#restrictchatmember  

| Param | Type | Description |
| --- | --- | --- |
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
| userId | <code>Number</code> | Unique identifier of the target user |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+promoteChatMember"></a>

### telegramBot.promoteChatMember(chatId, userId, [options]) ⇒ <code>Promise</code>
Use this method to promote or demote a user in a supergroup or a channel.
The bot **must be an administrator** in the chat for this to work
and must have the appropriate admin rights. Pass False for all boolean parameters to demote a user.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - True on success.  
**See**: https://core.telegram.org/bots/api#promotechatmember  

| Param | Type | Description |
| --- | --- | --- |
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
| userId | <code>Number</code> |  |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+setChatAdministratorCustomTitle"></a>

### telegramBot.setChatAdministratorCustomTitle(chatId, userId, customTitle, [options]) ⇒ <code>Promise</code>
Use this method to set a custom title for an administrator in a supergroup promoted by the bot.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - True on success  
**See**: https://core.telegram.org/bots/api#setchatadministratorcustomtitle  

| Param | Type | Description |
| --- | --- | --- |
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
| userId | <code>Number</code> | Unique identifier of the target user |
| customTitle | <code>String</code> | New custom title for the administrator; 0-16 characters, emoji are not allowed |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+setChatMemberTag"></a>

### telegramBot.setChatMemberTag(chatId, userId, [options]) ⇒ <code>Promise</code>
Use this method to set a tag for a regular member in a group or a supergroup.

The bot must be an administrator in the chat for this to work and must have the can_manage_tags administrator right.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - True on success  
**See**: https://core.telegram.org/bots/api#setchatmembertag  

| Param | Type | Description |
| --- | --- | --- |
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
| userId | <code>Number</code> | Unique identifier of the target user |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+banChatSenderChat"></a>

### telegramBot.banChatSenderChat(chatId, senderChatId, [options]) ⇒ <code>Promise</code>
Use this method to ban a channel chat in a supergroup or a channel.

Until the chat is [unbanned](https://core.telegram.org/bots/api#unbanchatsenderchat), the owner of the banned chat won't be able to send messages on behalf of any of their channels.
The bot **must be an administrator in the supergroup or channel** for this to work and must have the appropriate administrator rights

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - True on success.  
**See**: https://core.telegram.org/bots/api#banchatsenderchat  

| Param | Type | Description |
| --- | --- | --- |
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
| senderChatId | <code>Number</code> | Unique identifier of the target user |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+unbanChatSenderChat"></a>

### telegramBot.unbanChatSenderChat(chatId, senderChatId, [options]) ⇒ <code>Promise</code>
Use this method to unban a previously banned channel chat in a supergroup or channel.

The bot **must be an administrator** for this to work and must have the appropriate administrator rights.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - True on success  
**See**: https://core.telegram.org/bots/api#unbanchatsenderchat  

| Param | Type | Description |
| --- | --- | --- |
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
| senderChatId | <code>Number</code> | Unique identifier of the target user |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+setChatPermissions"></a>

### telegramBot.setChatPermissions(chatId, chatPermissions, [options]) ⇒ <code>Promise</code>
Use this method to set default chat permissions for all members.

The bot **must be an administrator in the group or a supergroup** for this to
work and **must have the `can_restrict_members` admin rights.**

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - True on success  
**See**: https://core.telegram.org/bots/api#setchatpermissions  

| Param | Type | Description |
| --- | --- | --- |
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
| chatPermissions | <code>Array</code> | New default chat permissions |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+exportChatInviteLink"></a>

### telegramBot.exportChatInviteLink(chatId, [options]) ⇒ <code>Promise</code>
Use this method to generate a new primary invite link for a chat. **Any previously generated primary link is revoked**.

The bot **must be an administrator in the chat** for this to work and must have the appropriate administrator rights.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - Exported invite link as String on success.  
**See**: https://core.telegram.org/bots/api#exportchatinvitelink  

| Param | Type | Description |
| --- | --- | --- |
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+createChatInviteLink"></a>

### telegramBot.createChatInviteLink(chatId, [options]) ⇒ <code>Object</code>
Use this method to create an additional invite link for a chat.

The bot **must be an administrator in the chat** for this to work and must have the appropriate admin rights.

The link generated with this method can be revoked using the method [revokeChatInviteLink](https://core.telegram.org/bots/api#revokechatinvitelink)

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Object</code> - The new invite link as [ChatInviteLink](https://core.telegram.org/bots/api#chatinvitelink) object  
**See**: https://core.telegram.org/bots/api#createchatinvitelink  

| Param | Type | Description |
| --- | --- | --- |
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+editChatInviteLink"></a>

### telegramBot.editChatInviteLink(chatId, inviteLink, [options]) ⇒ <code>Promise</code>
Use this method to edit a non-primary invite link created by the bot.

The bot **must be an administrator in the chat** for this to work and must have the appropriate admin rights.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - The edited invite link as a [ChatInviteLink](https://core.telegram.org/bots/api#chatinvitelink) object  
**See**: https://core.telegram.org/bots/api#editchatinvitelink  

| Param | Type | Description |
| --- | --- | --- |
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
| inviteLink | <code>String</code> | Text with the invite link to edit |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+createChatSubscriptionInviteLink"></a>

### telegramBot.createChatSubscriptionInviteLink(chatId, subscriptionPeriod, subscriptionPrice, [options]) ⇒ <code>Promise</code>
Use this method to create a subscription invite link for a channel chat.

The bot must have the can_invite_users administrator rights

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - The new invite link as a [ChatInviteLink](https://core.telegram.org/bots/api#chatinvitelink) object  
**See**: https://core.telegram.org/bots/api#createchatsubscriptioninvitelink  

| Param | Type | Description |
| --- | --- | --- |
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
| subscriptionPeriod | <code>Number</code> | The number of seconds the subscription will be active for before the next payment. Currently, it must always be 2592000 (30 days) |
| subscriptionPrice | <code>Number</code> | The amount of Telegram Stars a user must pay initially and after each subsequent subscription period to be a member of the chat (1-2500) |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+editChatSubscriptionInviteLink"></a>

### telegramBot.editChatSubscriptionInviteLink(chatId, inviteLink, [options]) ⇒ <code>Promise</code>
Use this method to edit a subscription invite link created by the bot.

The bot must have the can_invite_users administrator rights

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - The new invite link as a [ChatInviteLink](https://core.telegram.org/bots/api#chatinvitelink) object  
**See**: https://core.telegram.org/bots/api#editchatsubscriptioninvitelink  

| Param | Type | Description |
| --- | --- | --- |
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
| inviteLink | <code>String</code> | The invite link to edit |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+revokeChatInviteLink"></a>

### telegramBot.revokeChatInviteLink(chatId, inviteLink, [options]) ⇒ <code>Promise</code>
Use this method to revoke an invite link created by the bot.
Note: If the primary link is revoked, a new link is automatically generated

The bot **must be an administrator in the chat** for this to work and must have the appropriate admin rights.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - The revoked invite link as [ChatInviteLink](https://core.telegram.org/bots/api#chatinvitelink) object  
**See**: https://core.telegram.org/bots/api#revokechatinvitelink  

| Param | Type | Description |
| --- | --- | --- |
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
| inviteLink | <code>String</code> | The invite link to revoke |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+approveChatJoinRequest"></a>

### telegramBot.approveChatJoinRequest(chatId, userId, [options]) ⇒ <code>Promise</code>
Use this method to approve a chat join request.

The bot **must be an administrator in the chat** for this to work and **must have the `can_invite_users` administrator right.**

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - True on success  
**See**: https://core.telegram.org/bots/api#approvechatjoinrequest  

| Param | Type | Description |
| --- | --- | --- |
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
| userId | <code>Number</code> | Unique identifier of the target user |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+declineChatJoinRequest"></a>

### telegramBot.declineChatJoinRequest(chatId, userId, [options]) ⇒ <code>Promise</code>
Use this method to decline a chat join request.

The bot **must be an administrator in the chat** for this to work and **must have the `can_invite_users` administrator right**.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - True on success  
**See**: https://core.telegram.org/bots/api#declinechatjoinrequest  

| Param | Type | Description |
| --- | --- | --- |
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
| userId | <code>Number</code> | Unique identifier of the target user |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+setChatPhoto"></a>

### telegramBot.setChatPhoto(chatId, photo, [options], [fileOptions]) ⇒ <code>Promise</code>
Use this method to set a new profile photo for the chat. **Photos can't be changed for private chats**.

The bot **must be an administrator in the chat** for this to work and must have the appropriate admin rights.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - True on success  
**See**: https://core.telegram.org/bots/api#setchatphoto  

| Param | Type | Description |
| --- | --- | --- |
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
| photo | <code>stream.Stream</code> \| <code>Buffer</code> | A file path or a Stream. |
| [options] | <code>Object</code> | Additional Telegram query options |
| [fileOptions] | <code>Object</code> | Optional file related meta-data |

<a name="TelegramBot+deleteChatPhoto"></a>

### telegramBot.deleteChatPhoto(chatId, [options]) ⇒ <code>Promise</code>
Use this method to delete a chat photo. **Photos can't be changed for private chats**.

The bot **must be an administrator in the chat** for this to work and must have the appropriate admin rights.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - True on success  
**See**: https://core.telegram.org/bots/api#deletechatphoto  

| Param | Type | Description |
| --- | --- | --- |
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+setChatTitle"></a>

### telegramBot.setChatTitle(chatId, title, [options]) ⇒ <code>Promise</code>
Use this method to change the title of a chat. **Titles can't be changed for private chats**.

The bot **must be an administrator in the chat** for this to work and must have the appropriate admin rights.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - True on success  
**See**: https://core.telegram.org/bots/api#setchattitle  

| Param | Type | Description |
| --- | --- | --- |
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
| title | <code>String</code> | New chat title, 1-255 characters |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+setChatDescription"></a>

### telegramBot.setChatDescription(chatId, description, [options]) ⇒ <code>Promise</code>
Use this method to change the description of a group, a supergroup or a channel.

The bot **must be an administrator in the chat** for this to work and must have the appropriate admin rights.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - True on success  
**See**: https://core.telegram.org/bots/api#setchatdescription  

| Param | Type | Description |
| --- | --- | --- |
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
| description | <code>String</code> | New chat title, 0-255 characters |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+pinChatMessage"></a>

### telegramBot.pinChatMessage(chatId, messageId, [options]) ⇒ <code>Promise</code>
Use this method to pin a message in a supergroup.

If the chat is not a private chat, the **bot must be an administrator in the chat** for this to work and must have the `can_pin_messages` administrator
right in a supergroup or `can_edit_messages` administrator right in a channel.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - True on success  
**See**: https://core.telegram.org/bots/api#pinchatmessage  

| Param | Type | Description |
| --- | --- | --- |
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
| messageId | <code>Number</code> | Identifier of a message to pin |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+unpinChatMessage"></a>

### telegramBot.unpinChatMessage(chatId, [options]) ⇒ <code>Promise</code>
Use this method to remove a message from the list of pinned messages in a chat

If the chat is not a private chat, the **bot must be an administrator in the chat** for this to work and must have the `can_pin_messages` administrator
right in a supergroup or `can_edit_messages` administrator right in a channel.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - True on success  
**See**: https://core.telegram.org/bots/api#unpinchatmessage  

| Param | Type | Description |
| --- | --- | --- |
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+unpinAllChatMessages"></a>

### telegramBot.unpinAllChatMessages(chatId, [options]) ⇒ <code>Promise</code>
Use this method to clear the list of pinned messages in a chat.

If the chat is not a private chat, the **bot must be an administrator in the chat** for this to work and must have the `can_pin_messages` administrator
right in a supergroup or `can_edit_messages` administrator right in a channel.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - True on success  
**See**: https://core.telegram.org/bots/api#unpinallchatmessages  

| Param | Type | Description |
| --- | --- | --- |
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+leaveChat"></a>

### telegramBot.leaveChat(chatId, [options]) ⇒ <code>Promise</code>
Use this method for your bot to leave a group, supergroup or channel

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - True on success  
**See**: https://core.telegram.org/bots/api#leavechat  

| Param | Type | Description |
| --- | --- | --- |
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+getChat"></a>

### telegramBot.getChat(chatId, [options]) ⇒ <code>Promise</code>
Use this method to get up to date information about the chat
(current name of the user for one-on-one conversations, current
username of a user, group or channel, etc.).

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - [ChatFullInfo](https://core.telegram.org/bots/api#chatfullinfo) object on success  
**See**: https://core.telegram.org/bots/api#getchat  

| Param | Type | Description |
| --- | --- | --- |
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) or channel |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+getChatAdministrators"></a>

### telegramBot.getChatAdministrators(chatId, [options]) ⇒ <code>Promise</code>
Use this method to get a list of administrators in a chat

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - On success, returns an Array of [ChatMember](https://core.telegram.org/bots/api#chatmember) objects that contains information about all chat administrators except other bots.
If the chat is a group or a supergroup and no administrators were appointed, only the creator will be returned  
**See**: https://core.telegram.org/bots/api#getchatadministrators  

| Param | Type | Description |
| --- | --- | --- |
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target group or username of the target supergroup |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+getChatMemberCount"></a>

### telegramBot.getChatMemberCount(chatId, [options]) ⇒ <code>Promise</code>
Use this method to get the number of members in a chat.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - Int on success  
**See**: https://core.telegram.org/bots/api#getchatmembercount  

| Param | Type | Description |
| --- | --- | --- |
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target group or username of the target supergroup |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+getChatMember"></a>

### telegramBot.getChatMember(chatId, userId, [options]) ⇒ <code>Promise</code>
Use this method to get information about a member of a chat.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - [ChatMember](https://core.telegram.org/bots/api#chatmember) object on success  
**See**: https://core.telegram.org/bots/api#getchatmember  

| Param | Type | Description |
| --- | --- | --- |
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target group or username of the target supergroup |
| userId | <code>Number</code> | Unique identifier of the target user |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+setChatStickerSet"></a>

### telegramBot.setChatStickerSet(chatId, stickerSetName, [options]) ⇒ <code>Promise</code>
Use this method to set a new group sticker set for a supergroup.

The bot **must be an administrator in the chat** for this to work and must have the appropriate administrator rights.

**Note:** Use the field `can_set_sticker_set` optionally returned in [getChat](https://core.telegram.org/bots/api#getchat) requests to check if the bot can use this method.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - True on success  
**See**: https://core.telegram.org/bots/api#setchatstickerset  

| Param | Type | Description |
| --- | --- | --- |
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target group or username of the target supergroup (in the format @supergroupusername) |
| stickerSetName | <code>String</code> | Name of the sticker set to be set as the group sticker set |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+deleteChatStickerSet"></a>

### telegramBot.deleteChatStickerSet(chatId, [options]) ⇒ <code>Promise</code>
Use this method to delete a group sticker set from a supergroup.

Use the field `can_set_sticker_set` optionally returned in [getChat](https://core.telegram.org/bots/api#getchat) requests to check if the bot can use this method.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - True on success  
**See**: https://core.telegram.org/bots/api#deletechatstickerset  

| Param | Type | Description |
| --- | --- | --- |
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target group or username of the target supergroup (in the format @supergroupusername) |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+getForumTopicIconStickers"></a>

### telegramBot.getForumTopicIconStickers(chatId, [options]) ⇒ <code>Promise</code>
Use this method to get custom emoji stickers, which can be used as a forum topic icon by any user.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - Array of [Sticker](https://core.telegram.org/bots/api#sticker) objects  
**See**: https://core.telegram.org/bots/api#getforumtopiciconstickers  

| Param | Type | Description |
| --- | --- | --- |
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target group or username of the target supergroup (in the format @supergroupusername) |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+createForumTopic"></a>

### telegramBot.createForumTopic(chatId, name, [options])
Use this method to create a topic in a forum supergroup chat.
The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights.

Returns information about the created topic as a [ForumTopic](https://core.telegram.org/bots/api#forumtopic) object.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**See**: https://core.telegram.org/bots/api#createforumtopic  

| Param | Type | Description |
| --- | --- | --- |
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target group or username of the target supergroup (in the format @supergroupusername) |
| name | <code>String</code> | Topic name, 1-128 characters |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+editForumTopic"></a>

### telegramBot.editForumTopic(chatId, messageThreadId, [options]) ⇒ <code>Promise</code>
Use this method to edit name and icon of a topic in a forum supergroup chat.
The bot must be an administrator in the chat for this to work and must have can_manage_topics administrator rights, unless it is the creator of the topic.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - True on success  
**See**: https://core.telegram.org/bots/api#editforumtopic  

| Param | Type | Description |
| --- | --- | --- |
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target group or username of the target supergroup (in the format @supergroupusername) |
| messageThreadId | <code>Number</code> | Unique identifier for the target message thread of the forum topic |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+closeForumTopic"></a>

### telegramBot.closeForumTopic(chatId, messageThreadId, [options]) ⇒ <code>Promise</code>
Use this method to close an open topic in a forum supergroup chat.
The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights, unless it is the creator of the topic.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - True on success  
**See**: https://core.telegram.org/bots/api#closeforumtopic  

| Param | Type | Description |
| --- | --- | --- |
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target group or username of the target supergroup (in the format @supergroupusername) |
| messageThreadId | <code>Number</code> | Unique identifier for the target message thread of the forum topic |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+reopenForumTopic"></a>

### telegramBot.reopenForumTopic(chatId, messageThreadId, [options]) ⇒ <code>Promise</code>
Use this method to reopen a closed topic in a forum supergroup chat.
The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights, unless it is the creator of the topic.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - True on success  
**See**: https://core.telegram.org/bots/api#reopenforumtopic  

| Param | Type | Description |
| --- | --- | --- |
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target group or username of the target supergroup (in the format @supergroupusername) |
| messageThreadId | <code>Number</code> | Unique identifier for the target message thread of the forum topic |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+deleteForumTopic"></a>

### telegramBot.deleteForumTopic(chatId, messageThreadId, [options]) ⇒ <code>Promise</code>
Use this method to delete a forum topic along with all its messages in a forum supergroup chat.
The bot must be an administrator in the chat for this to work and must have the can_delete_messages administrator rights.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - True on success  
**See**: https://core.telegram.org/bots/api#deleteforumtopic  

| Param | Type | Description |
| --- | --- | --- |
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target group or username of the target supergroup (in the format @supergroupusername) |
| messageThreadId | <code>Number</code> | Unique identifier for the target message thread of the forum topic |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+unpinAllForumTopicMessages"></a>

### telegramBot.unpinAllForumTopicMessages(chatId, messageThreadId, [options]) ⇒ <code>Promise</code>
Use this method to clear the list of pinned messages in a forum topic.
The bot must be an administrator in the chat for this to work and must have the can_pin_messages administrator right in the supergroup.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - True on success  
**See**: https://core.telegram.org/bots/api#unpinallforumtopicmessages  

| Param | Type | Description |
| --- | --- | --- |
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target group or username of the target supergroup (in the format @supergroupusername) |
| messageThreadId | <code>Number</code> | Unique identifier for the target message thread of the forum topic |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+editGeneralForumTopic"></a>

### telegramBot.editGeneralForumTopic(chatId, name, [options]) ⇒ <code>Promise</code>
Use this method to edit the name of the 'General' topic in a forum supergroup chat.
The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights.
The topic will be automatically unhidden if it was hidden.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - True on success  
**See**: https://core.telegram.org/bots/api#editgeneralforumtopic  

| Param | Type | Description |
| --- | --- | --- |
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target group or username of the target supergroup (in the format @supergroupusername) |
| name | <code>String</code> | New topic name, 1-128 characters |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+closeGeneralForumTopic"></a>

### telegramBot.closeGeneralForumTopic(chatId, [options]) ⇒ <code>Promise</code>
Use this method to close an open 'General' topic in a forum supergroup chat.
The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights.
The topic will be automatically unhidden if it was hidden.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - True on success  
**See**: https://core.telegram.org/bots/api#closegeneralforumtopic  

| Param | Type | Description |
| --- | --- | --- |
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target group or username of the target supergroup (in the format @supergroupusername) |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+reopenGeneralForumTopic"></a>

### telegramBot.reopenGeneralForumTopic(chatId, [options]) ⇒ <code>Promise</code>
Use this method to reopen a closed 'General' topic in a forum supergroup chat.
The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights.
The topic will be automatically unhidden if it was hidden.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - True on success  
**See**: https://core.telegram.org/bots/api#reopengeneralforumtopic  

| Param | Type | Description |
| --- | --- | --- |
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target group or username of the target supergroup (in the format @supergroupusername) |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+hideGeneralForumTopic"></a>

### telegramBot.hideGeneralForumTopic(chatId, [options]) ⇒ <code>Promise</code>
Use this method to hide the 'General' topic in a forum supergroup chat.
The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights.
The topic will be automatically closed if it was open.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - True on success  
**See**: https://core.telegram.org/bots/api#hidegeneralforumtopic  

| Param | Type | Description |
| --- | --- | --- |
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target group or username of the target supergroup (in the format @supergroupusername) |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+unhideGeneralForumTopic"></a>

### telegramBot.unhideGeneralForumTopic(chatId, [options]) ⇒ <code>Promise</code>
Use this method to unhide the 'General' topic in a forum supergroup chat.
The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - True on success  
**See**: https://core.telegram.org/bots/api#unhidegeneralforumtopic  

| Param | Type | Description |
| --- | --- | --- |
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target group or username of the target supergroup (in the format @supergroupusername) |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+unpinAllGeneralForumTopicMessages"></a>

### telegramBot.unpinAllGeneralForumTopicMessages(chatId, [options]) ⇒ <code>Promise</code>
Use this method to clear the list of pinned messages in a General forum topic.
The bot must be an administrator in the chat for this to work and must have the can_pin_messages administrator right in the supergroup.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - True on success  
**See**: https://core.telegram.org/bots/api#unpinallgeneralforumtopicmessages  

| Param | Type | Description |
| --- | --- | --- |
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target group or username of the target supergroup (in the format @supergroupusername) |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+answerCallbackQuery"></a>

### telegramBot.answerCallbackQuery(callbackQueryId, [options]) ⇒ <code>Promise</code>
Use this method to send answers to callback queries sent from
[inline keyboards](https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating).

The answer will be displayed to the user as a notification at the top of the chat screen or as an alert.

This method has **older, compatible signatures ([1][answerCallbackQuery-v0.27.1])([2][answerCallbackQuery-v0.29.0])**
that are being deprecated.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - True on success  
**See**: https://core.telegram.org/bots/api#answercallbackquery  

| Param | Type | Description |
| --- | --- | --- |
| callbackQueryId | <code>String</code> | Unique identifier for the query to be answered |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+savePreparedInlineMessage"></a>

### telegramBot.savePreparedInlineMessage(userId, result, [options]) ⇒ <code>Promise</code>
Use this method to stores a message that can be sent by a user of a Mini App.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - On success, returns a [PreparedInlineMessage](https://core.telegram.org/bots/api#preparedinlinemessage) object.  
**See**: https://core.telegram.org/bots/api#savepreparedinlinemessage  

| Param | Type | Description |
| --- | --- | --- |
| userId | <code>Number</code> | Unique identifier of the target user |
| result | <code>InlineQueryResult</code> | object that represents one result of an inline query |
| [options] | <code>Object</code> | Optional form data to include in the request |

<a name="TelegramBot+getUserChatBoosts"></a>

### telegramBot.getUserChatBoosts(chatId, userId, [options]) ⇒ <code>Promise</code>
Use this method to get the list of boosts added to a chat by a use.
Requires administrator rights in the chat

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - On success, returns a [UserChatBoosts](https://core.telegram.org/bots/api#userchatboosts) object  
**See**: https://core.telegram.org/bots/api#getuserchatboosts  

| Param | Type | Description |
| --- | --- | --- |
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the group/channel |
| userId | <code>Number</code> | Unique identifier of the target user |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+getBusinessConnection"></a>

### telegramBot.getBusinessConnection(businessConnectionId, [options]) ⇒ <code>Promise</code>
Use this method to get information about the connection of the bot with a business account

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - On success, returns [BusinessConnection](https://core.telegram.org/bots/api#businessconnection) object  
**See**: https://core.telegram.org/bots/api#getbusinessconnection  

| Param | Type | Description |
| --- | --- | --- |
| businessConnectionId | <code>Number</code> \| <code>String</code> | Unique identifier for the group/channel |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+setMyCommands"></a>

### telegramBot.setMyCommands(commands, [options]) ⇒ <code>Promise</code>
Use this method to change the list of the bot's commands.

See https://core.telegram.org/bots#commands for more details about bot commands

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - True on success  
**See**: https://core.telegram.org/bots/api#setmycommands  

| Param | Type | Description |
| --- | --- | --- |
| commands | <code>Array</code> | List of bot commands to be set as the list of the [bot's commands](https://core.telegram.org/bots/api#botcommand). At most 100 commands can be specified. |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+deleteMyCommands"></a>

### telegramBot.deleteMyCommands([options]) ⇒ <code>Promise</code>
Use this method to delete the list of the bot's commands for the given scope and user language.

 After deletion, [higher level commands](https://core.telegram.org/bots/api#determining-list-of-commands) will be shown to affected users.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - True on success  
**See**: https://core.telegram.org/bots/api#deletemycommands  

| Param | Type | Description |
| --- | --- | --- |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+getMyCommands"></a>

### telegramBot.getMyCommands([options]) ⇒ <code>Promise</code>
Use this method to get the current list of the bot's commands for the given scope and user language.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - Array of [BotCommand](https://core.telegram.org/bots/api#botcommand) on success. If commands aren't set, an empty list is returned.  
**See**: https://core.telegram.org/bots/api#getmycommands  

| Param | Type | Description |
| --- | --- | --- |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+setMyName"></a>

### telegramBot.setMyName([options]) ⇒ <code>Promise</code>
Use this method to change the bot's name.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - True on success  
**See**: https://core.telegram.org/bots/api#setmyname  

| Param | Type | Description |
| --- | --- | --- |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+getMyName"></a>

### telegramBot.getMyName([options]) ⇒ <code>Promise</code>
Use this method to get the current bot name for the given user language.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - [BotName](https://core.telegram.org/bots/api#botname) on success  
**See**: https://core.telegram.org/bots/api#getmyname  

| Param | Type | Description |
| --- | --- | --- |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+setMyDescription"></a>

### telegramBot.setMyDescription([options]) ⇒ <code>Promise</code>
Use this method to change the bot's description, which is shown in the chat with the bot if the chat is empty.

Returns True on success.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - True on success  
**See**: https://core.telegram.org/bots/api#setmydescription  

| Param | Type | Description |
| --- | --- | --- |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+getMyDescription"></a>

### telegramBot.getMyDescription([options]) ⇒ <code>Promise</code>
Use this method to get the current bot description for the given user language.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - Returns [BotDescription](https://core.telegram.org/bots/api#botdescription) on success.  
**See**: https://core.telegram.org/bots/api#getmydescription  

| Param | Type | Description |
| --- | --- | --- |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+setMyShortDescription"></a>

### telegramBot.setMyShortDescription([options]) ⇒ <code>Promise</code>
Use this method to change the bot's short description, which is shown on the bot's profile page
and is sent together with the link when users share the bot.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - Returns True on success.  
**See**: https://core.telegram.org/bots/api#setmyshortdescription  

| Param | Type | Description |
| --- | --- | --- |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+getMyShortDescription"></a>

### telegramBot.getMyShortDescription([options]) ⇒ <code>Promise</code>
Use this method to get the current bot short description for the given user language.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - Returns [BotShortDescription](https://core.telegram.org/bots/api#botshortdescription) on success.  
**See**: https://core.telegram.org/bots/api#getmyshortdescription  

| Param | Type | Description |
| --- | --- | --- |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+setMyProfilePhoto"></a>

### telegramBot.setMyProfilePhoto(photo, [options]) ⇒ <code>Promise</code>
Changes the profile photo of the bot.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - True on success  
**See**: https://core.telegram.org/bots/api#setmyprofilephoto  

| Param | Type | Description |
| --- | --- | --- |
| photo | <code>String</code> \| <code>stream.Stream</code> \| <code>Buffer</code> | New profile photo. |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+removeMyProfilePhoto"></a>

### telegramBot.removeMyProfilePhoto([options]) ⇒ <code>Promise</code>
Removes the profile photo of the bot.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - True on success  
**See**: https://core.telegram.org/bots/api#removemyprofilephoto  

| Param | Type | Description |
| --- | --- | --- |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+setChatMenuButton"></a>

### telegramBot.setChatMenuButton([options]) ⇒ <code>Promise</code>
Use this method to change the bot's menu button in a private chat, or the default menu button.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - True on success  
**See**: https://core.telegram.org/bots/api#setchatmenubutton  

| Param | Type | Description |
| --- | --- | --- |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+getChatMenuButton"></a>

### telegramBot.getChatMenuButton([options]) ⇒ <code>Promise</code>
Use this method to get the current value of the bot's menu button in a private chat, or the default menu button.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - [MenuButton](https://core.telegram.org/bots/api#menubutton) on success  
**See**: https://core.telegram.org/bots/api#getchatmenubutton  

| Param | Type | Description |
| --- | --- | --- |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+setMyDefaultAdministratorRights"></a>

### telegramBot.setMyDefaultAdministratorRights([options]) ⇒ <code>Promise</code>
Use this method to change the default administrator rights requested by the bot when it's added as an administrator to groups or channels.

These rights will be suggested to users, but they are are free to modify the list before adding the bot.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - True on success  
**See**: https://core.telegram.org/bots/api#getchatmenubutton  

| Param | Type | Description |
| --- | --- | --- |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+getMyDefaultAdministratorRights"></a>

### telegramBot.getMyDefaultAdministratorRights([options]) ⇒ <code>Promise</code>
Use this method to get the current default administrator rights of the bot.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - [ChatAdministratorRights](https://core.telegram.org/bots/api#chatadministratorrights) on success  
**See**: https://core.telegram.org/bots/api#getmydefaultadministratorrights  

| Param | Type | Description |
| --- | --- | --- |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+editMessageText"></a>

### telegramBot.editMessageText(text, [options]) ⇒ <code>Promise</code>
Use this method to edit text or [game](https://core.telegram.org/bots/api#games) messages sent by the bot or via the bot (for inline bots).

Note: that **you must provide one of chat_id, message_id, or inline_message_id** in your request.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - On success, if the edited message is not an inline message, the edited [Message](https://core.telegram.org/bots/api#message) is returned, otherwise True is returned  
**See**: https://core.telegram.org/bots/api#editmessagetext  

| Param | Type | Description |
| --- | --- | --- |
| text | <code>String</code> | New text of the message |
| [options] | <code>Object</code> | Additional Telegram query options (provide either one of chat_id, message_id, or inline_message_id here) |

<a name="TelegramBot+editMessageCaption"></a>

### telegramBot.editMessageCaption(caption, [options]) ⇒ <code>Promise</code>
Use this method to edit captions of messages sent by the bot or via the bot (for inline bots).

Note: You **must provide one of chat_id, message_id, or inline_message_id** in your request.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - On success, if the edited message is not an inline message, the edited [Message](https://core.telegram.org/bots/api#message) is returned, otherwise True is returned  
**See**: https://core.telegram.org/bots/api#editmessagecaption  

| Param | Type | Description |
| --- | --- | --- |
| caption | <code>String</code> | New caption of the message |
| [options] | <code>Object</code> | Additional Telegram query options (provide either one of chat_id, message_id, or inline_message_id here) |

<a name="TelegramBot+editMessageMedia"></a>

### telegramBot.editMessageMedia(media, [options]) ⇒ <code>Promise</code>
Use this method to edit animation, audio, document, photo, or video messages.

If a message is a part of a message album, then it can be edited only to a photo or a video.

Otherwise, message type can be changed arbitrarily. When inline message is edited, new file can't be uploaded.
Use previously uploaded file via its file_id or specify a URL.

Note: You **must provide one of chat_id, message_id, or inline_message_id** in your request.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - On success, if the edited message is not an inline message, the edited [Message](https://core.telegram.org/bots/api#message) is returned, otherwise True is returned  
**See**: https://core.telegram.org/bots/api#editmessagemedia  

| Param | Type | Description |
| --- | --- | --- |
| media | <code>Object</code> | A JSON-serialized object for a new media content of the message |
| [options] | <code>Object</code> | Additional Telegram query options (provide either one of chat_id, message_id, or inline_message_id here) |

<a name="TelegramBot+editMessageChecklist"></a>

### telegramBot.editMessageChecklist(businessConnectionId, chatId, messageId, checklist, [options]) ⇒ <code>Promise</code>
Use this method to edit a checklist on behalf of a business connection.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - On success, the sent [Message](https://core.telegram.org/bots/api#message) object is returned.  
**See**: https://core.telegram.org/bots/api#editmessagechecklist  

| Param | Type | Description |
| --- | --- | --- |
| businessConnectionId | <code>Number</code> \| <code>String</code> | Unique identifier for the target business connection |
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
| messageId | <code>Number</code> | Unique identifier for the target message |
| checklist | <code>Object</code> | A JSON-serialized object for the new checklist |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+editMessageReplyMarkup"></a>

### telegramBot.editMessageReplyMarkup(replyMarkup, [options]) ⇒ <code>Promise</code>
Use this method to edit only the reply markup of messages sent by the bot or via the bot (for inline bots).

Note: You **must provide one of chat_id, message_id, or inline_message_id** in your request.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - On success, if the edited message is not an inline message, the edited [Message](https://core.telegram.org/bots/api#message) is returned, otherwise True is returned  
**See**: https://core.telegram.org/bots/api#editmessagetext  

| Param | Type | Description |
| --- | --- | --- |
| replyMarkup | <code>Object</code> | A JSON-serialized object for an inline keyboard. |
| [options] | <code>Object</code> | Additional Telegram query options (provide either one of chat_id, message_id, or inline_message_id here) |

<a name="TelegramBot+stopPoll"></a>

### telegramBot.stopPoll(chatId, pollId, [options]) ⇒ <code>Promise</code>
Use this method to stop a poll which was sent by the bot.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - On success, the stopped [Poll](https://core.telegram.org/bots/api#poll) is returned  
**See**: https://core.telegram.org/bots/api#stoppoll  

| Param | Type | Description |
| --- | --- | --- |
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the group/channel |
| pollId | <code>Number</code> | Identifier of the original message with the poll |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+approveSuggestedPost"></a>

### telegramBot.approveSuggestedPost(chatId, messageId, [options]) ⇒ <code>Promise</code>
Use this method to approve a suggested post in a direct messages chat.

The bot must have the 'can_post_messages' administrator right in the corresponding channel chat.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - on success, returns True  
**See**: https://core.telegram.org/bots/api#approvesuggestedpost  

| Param | Type | Description |
| --- | --- | --- |
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the group/channel |
| messageId | <code>Number</code> | Identifier of the original message with the suggested post |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+declineSuggestedPost"></a>

### telegramBot.declineSuggestedPost(chatId, messageId, [options]) ⇒ <code>Promise</code>
Use this method to decline a suggested post in a direct messages chat.

The bot must have the 'can_manage_direct_messages' administrator right in the corresponding channel chat.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - on success, returns True  
**See**: https://core.telegram.org/bots/api#declinesuggestedpost  

| Param | Type | Description |
| --- | --- | --- |
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the group/channel |
| messageId | <code>Number</code> | Identifier of the original message with the suggested post |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+sendSticker"></a>

### telegramBot.sendSticker(chatId, sticker, [options], [fileOptions]) ⇒ <code>Promise</code>
Use this method to send static .WEBP, [animated](https://telegram.org/blog/animated-stickers) .TGS,
or [video](https://telegram.org/blog/video-stickers-better-reactions) .WEBM stickers.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - On success, the sent [Message](https://core.telegram.org/bots/api#message) is returned  
**See**: https://core.telegram.org/bots/api#sendsticker  

| Param | Type | Description |
| --- | --- | --- |
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
| sticker | <code>String</code> \| <code>stream.Stream</code> \| <code>Buffer</code> | A file path, Stream or Buffer. Can also be a `file_id` previously uploaded. Stickers are WebP format files. |
| [options] | <code>Object</code> | Additional Telegram query options |
| [fileOptions] | <code>Object</code> | Optional file related meta-data |

<a name="TelegramBot+getStickerSet"></a>

### telegramBot.getStickerSet(name, [options]) ⇒ <code>Promise</code>
Use this method to get a sticker set.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - On success, a [StickerSet](https://core.telegram.org/bots/api#stickerset) object is returned  
**See**: https://core.telegram.org/bots/api#getstickerset  

| Param | Type | Description |
| --- | --- | --- |
| name | <code>String</code> | Name of the sticker set |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+getCustomEmojiStickers"></a>

### telegramBot.getCustomEmojiStickers(custom_emoji_ids, [options]) ⇒ <code>Promise</code>
Use this method to get information about custom emoji stickers by their identifiers.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - Array of [Sticker](https://core.telegram.org/bots/api#sticker) objects.  
**See**: https://core.telegram.org/bots/api#getcustomemojistickers  

| Param | Type | Description |
| --- | --- | --- |
| custom_emoji_ids | <code>Array</code> | List of custom emoji identifiers. At most 200 custom emoji identifiers can be specified. |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+uploadStickerFile"></a>

### telegramBot.uploadStickerFile(userId, sticker, stickerFormat, [options], [fileOptions]) ⇒ <code>Promise</code>
Use this method to upload a file with a sticker for later use in *createNewStickerSet* and *addStickerToSet* methods (can be used multiple
times).

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - On success, a [File](https://core.telegram.org/bots/api#file) object is returned  
**See**: https://core.telegram.org/bots/api#uploadstickerfile  

| Param | Type | Default | Description |
| --- | --- | --- | --- |
| userId | <code>Number</code> |  | User identifier of sticker file owner |
| sticker | <code>String</code> \| <code>stream.Stream</code> \| <code>Buffer</code> |  | A file path or a Stream with the sticker in .WEBP, .PNG, .TGS, or .WEBM format. Can also be a `file_id` previously uploaded. |
| stickerFormat | <code>String</code> | <code>static</code> | Allow values:  `static`, `animated` or `video` |
| [options] | <code>Object</code> |  | Additional Telegram query options |
| [fileOptions] | <code>Object</code> |  | Optional file related meta-data |

<a name="TelegramBot+createNewStickerSet"></a>

### telegramBot.createNewStickerSet(userId, name, title, pngSticker, emojis, [options], [fileOptions]) ⇒ <code>Promise</code>
Use this method to create new sticker set owned by a user.

The bot will be able to edit the created sticker set.

You must use exactly one of the fields *png_sticker*, *tgs_sticker*, or *webm_sticker*

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - True on success  
**See**: https://core.telegram.org/bots/api#createnewstickerset  

| Param | Type | Description |
| --- | --- | --- |
| userId | <code>Number</code> | User identifier of created sticker set owner |
| name | <code>String</code> | Short name of sticker set, to be used in `t.me/addstickers/` URLs (e.g.,   *"animals"*). Can contain only english letters, digits and underscores.  Must begin with a letter, can't contain consecutive underscores and must end in `"_by_<bot_username>"`. `<bot_username>` is case insensitive. 1-64 characters. |
| title | <code>String</code> | Sticker set title, 1-64 characters |
| pngSticker | <code>String</code> \| <code>stream.Stream</code> \| <code>Buffer</code> | Png image with the sticker, must be up to 512 kilobytes in size,  dimensions must not exceed 512px, and either width or height must be exactly 512px. |
| emojis | <code>String</code> | One or more emoji corresponding to the sticker |
| [options] | <code>Object</code> | Additional Telegram query options |
| [fileOptions] | <code>Object</code> | Optional file related meta-data |

<a name="TelegramBot+addStickerToSet"></a>

### telegramBot.addStickerToSet(userId, name, sticker, emojis, stickerType, [options], [fileOptions]) ⇒ <code>Promise</code>
Use this method to add a new sticker to a set created by the bot.

You must use exactly one of the fields *png_sticker*, *tgs_sticker*, or *webm_sticker*

Animated stickers can be added to animated sticker sets and only to them

Note:
- Emoji sticker sets can have up to 200 sticker
- Static or Animated sticker sets can have up to 120 stickers

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - True on success  
**See**: https://core.telegram.org/bots/api#addstickertoset  

| Param | Type | Default | Description |
| --- | --- | --- | --- |
| userId | <code>Number</code> |  | User identifier of sticker set owner |
| name | <code>String</code> |  | Sticker set name |
| sticker | <code>String</code> \| <code>stream.Stream</code> \| <code>Buffer</code> |  | Png image with the sticker (must be up to 512 kilobytes in size, dimensions must not exceed 512px, and either width or height must be exactly 512px, [TGS animation](https://core.telegram.org/stickers#animated-sticker-requirements) with the sticker or [WEBM video](https://core.telegram.org/stickers#video-sticker-requirements) with the sticker. |
| emojis | <code>String</code> |  | One or more emoji corresponding to the sticker |
| stickerType | <code>String</code> | <code>png_sticker</code> | Allow values: `png_sticker`, `tgs_sticker`, or `webm_sticker`. |
| [options] | <code>Object</code> |  | Additional Telegram query options |
| [fileOptions] | <code>Object</code> |  | Optional file related meta-data |

<a name="TelegramBot+setStickerPositionInSet"></a>

### telegramBot.setStickerPositionInSet(sticker, position, [options]) ⇒ <code>Promise</code>
Use this method to move a sticker in a set created by the bot to a specific position.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - True on success  
**See**: https://core.telegram.org/bots/api#setstickerpositioninset  

| Param | Type | Description |
| --- | --- | --- |
| sticker | <code>String</code> | File identifier of the sticker |
| position | <code>Number</code> | New sticker position in the set, zero-based |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+deleteStickerFromSet"></a>

### telegramBot.deleteStickerFromSet(sticker, [options]) ⇒ <code>Promise</code>
Use this method to delete a sticker from a set created by the bot.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - True on success  
**See**: https://core.telegram.org/bots/api#deletestickerfromset  
**Todo**

- [ ] Add tests for this method!


| Param | Type | Description |
| --- | --- | --- |
| sticker | <code>String</code> | File identifier of the sticker |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+replaceStickerInSet"></a>

### telegramBot.replaceStickerInSet(userId, name, sticker, [options]) ⇒ <code>Promise</code>
Use this method to replace an existing sticker in a sticker set with a new one

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - True on success  
**See**: https://core.telegram.org/bots/api#replacestickerinset  
**Todo**

- [ ] Add tests for this method!


| Param | Type | Description |
| --- | --- | --- |
| userId | <code>Number</code> | User identifier of the sticker set owner |
| name | <code>String</code> | Sticker set name |
| sticker | <code>String</code> | File identifier of the sticker |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+setStickerEmojiList"></a>

### telegramBot.setStickerEmojiList(sticker, emojiList, [options]) ⇒ <code>Promise</code>
Use this method to change the list of emoji assigned to a regular or custom emoji sticker.

The sticker must belong to a sticker set created by the bot.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - True on success  
**See**: https://core.telegram.org/bots/api#setstickeremojilist  

| Param | Type | Description |
| --- | --- | --- |
| sticker | <code>String</code> | File identifier of the sticker |
| emojiList | <code>Array</code> | A JSON-serialized list of 1-20 emoji associated with the sticker |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+setStickerKeywords"></a>

### telegramBot.setStickerKeywords(sticker, [options]) ⇒ <code>Promise</code>
Use this method to change the list of emoji assigned to a `regular` or `custom emoji` sticker.

The sticker must belong to a sticker set created by the bot.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - True on success  
**See**: https://core.telegram.org/bots/api#setstickerkeywords  

| Param | Type | Description |
| --- | --- | --- |
| sticker | <code>String</code> | File identifier of the sticker |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+setStickerMaskPosition"></a>

### telegramBot.setStickerMaskPosition(sticker, [options]) ⇒ <code>Promise</code>
Use this method to change the [mask position](https://core.telegram.org/bots/api#maskposition) of a mask sticker.

The sticker must belong to a sticker set created by the bot.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - True on success  
**See**: https://core.telegram.org/bots/api#setstickermaskposition  

| Param | Type | Description |
| --- | --- | --- |
| sticker | <code>String</code> | File identifier of the sticker |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+setStickerSetTitle"></a>

### telegramBot.setStickerSetTitle(name, title, [options]) ⇒ <code>Promise</code>
Use this method to set the title of a created sticker set.

The sticker must belong to a sticker set created by the bot.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - True on success  
**See**: https://core.telegram.org/bots/api#setstickersettitle  

| Param | Type | Description |
| --- | --- | --- |
| name | <code>String</code> | Sticker set name |
| title | <code>String</code> | Sticker set title, 1-64 characters |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+setStickerSetThumbnail"></a>

### telegramBot.setStickerSetThumbnail(userId, name, thumbnail, [options], [fileOptions]) ⇒ <code>Promise</code>
Use this method to add a thumb to a set created by the bot.

Animated thumbnails can be set for animated sticker sets only. Video thumbnails can be set only for video sticker sets only

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - True on success  
**See**: https://core.telegram.org/bots/api#setstickersetthumbnail  

| Param | Type | Description |
| --- | --- | --- |
| userId | <code>Number</code> | User identifier of sticker set owner |
| name | <code>String</code> | Sticker set name |
| thumbnail | <code>String</code> \| <code>stream.Stream</code> \| <code>Buffer</code> | A .WEBP or .PNG image with the thumbnail, must be up to 128 kilobytes in size and have width and height exactly 100px, a TGS animation with the thumbnail up to 32 kilobytes in size or a WEBM video with the thumbnail up to 32 kilobytes in size. Pass a file_id as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one. Animated sticker set thumbnails can't be uploaded via HTTP URL. |
| [options] | <code>Object</code> | Additional Telegram query options |
| [fileOptions] | <code>Object</code> | Optional file related meta-data |

<a name="TelegramBot+setCustomEmojiStickerSetThumbnail"></a>

### telegramBot.setCustomEmojiStickerSetThumbnail(name, [options]) ⇒ <code>Promise</code>
Use this method to set the thumbnail of a custom emoji sticker set.

The sticker must belong to a sticker set created by the bot.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - True on success  
**See**: https://core.telegram.org/bots/api#setcustomemojistickersetthumbnail  

| Param | Type | Description |
| --- | --- | --- |
| name | <code>String</code> | Sticker set name |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+deleteStickerSet"></a>

### telegramBot.deleteStickerSet(name, [options]) ⇒ <code>Promise</code>
Use this method to delete a sticker set that was created by the bot.

The sticker must belong to a sticker set created by the bot.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - True on success  
**See**: https://core.telegram.org/bots/api#deletestickerset  

| Param | Type | Description |
| --- | --- | --- |
| name | <code>String</code> | Sticker set name |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+answerInlineQuery"></a>

### telegramBot.answerInlineQuery(inlineQueryId, results, [options]) ⇒ <code>Promise</code>
Send answers to an inline query.

Note: No more than 50 results per query are allowed.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - On success, True is returned  
**See**: https://core.telegram.org/bots/api#answerinlinequery  

| Param | Type | Description |
| --- | --- | --- |
| inlineQueryId | <code>String</code> | Unique identifier of the query |
| results | <code>Array.&lt;InlineQueryResult&gt;</code> | An array of results for the inline query |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+answerWebAppQuery"></a>

### telegramBot.answerWebAppQuery(webAppQueryId, result, [options]) ⇒ <code>Promise</code>
Use this method to set the result of an interaction with a [Web App](https://core.telegram.org/bots/webapps)
and send a corresponding message on behalf of the user to the chat from which the query originated.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - On success, a [SentWebAppMessage](https://core.telegram.org/bots/api#sentwebappmessage) object is returned  
**See**: https://core.telegram.org/bots/api#answerwebappquery  

| Param | Type | Description |
| --- | --- | --- |
| webAppQueryId | <code>String</code> | Unique identifier for the query to be answered |
| result | <code>InlineQueryResult</code> | object that represents one result of an inline query |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+sendInvoice"></a>

### telegramBot.sendInvoice(chatId, title, description, payload, providerToken, currency, prices, [options]) ⇒ <code>Promise</code>
Use this method to send an invoice.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - On success, the sent [Message](https://core.telegram.org/bots/api#message) is returned  
**See**: https://core.telegram.org/bots/api#sendinvoice  

| Param | Type | Description |
| --- | --- | --- |
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
| title | <code>String</code> | Product name, 1-32 characters |
| description | <code>String</code> | Product description, 1-255 characters |
| payload | <code>String</code> | Bot defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes. |
| providerToken | <code>String</code> | Payments provider token, obtained via `@BotFather` |
| currency | <code>String</code> | Three-letter ISO 4217 currency code |
| prices | <code>Array</code> | Breakdown of prices |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+createInvoiceLink"></a>

### telegramBot.createInvoiceLink(title, description, payload, providerToken, currency, prices, [options]) ⇒ <code>Promise</code>
Use this method to create a link for an invoice.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - The created invoice link as String on success.  
**See**: https://core.telegram.org/bots/api#createinvoicelink  

| Param | Type | Description |
| --- | --- | --- |
| title | <code>String</code> | Product name, 1-32 characters |
| description | <code>String</code> | Product description, 1-255 characters |
| payload | <code>String</code> | Bot defined invoice payload |
| providerToken | <code>String</code> | Payment provider token |
| currency | <code>String</code> | Three-letter ISO 4217 currency code |
| prices | <code>Array</code> | Breakdown of prices |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+answerShippingQuery"></a>

### telegramBot.answerShippingQuery(shippingQueryId, ok, [options]) ⇒ <code>Promise</code>
Use this method to reply to shipping queries.

If you sent an invoice requesting a shipping address and the parameter is_flexible was specified,
the Bot API will send an [Update](https://core.telegram.org/bots/api#update) with a shipping_query field to the bot

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - On success, True is returned  
**See**: https://core.telegram.org/bots/api#answershippingquery  

| Param | Type | Description |
| --- | --- | --- |
| shippingQueryId | <code>String</code> | Unique identifier for the query to be answered |
| ok | <code>Boolean</code> | Specify if delivery of the product is possible |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+answerPreCheckoutQuery"></a>

### telegramBot.answerPreCheckoutQuery(preCheckoutQueryId, ok, [options]) ⇒ <code>Promise</code>
Use this method to respond to such pre-checkout queries

Once the user has confirmed their payment and shipping details, the Bot API sends the final confirmation in the form of
an [Update](https://core.telegram.org/bots/api#update) with the field *pre_checkout_query*.

**Note:** The Bot API must receive an answer within 10 seconds after the pre-checkout query was sent.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - On success, True is returned  
**See**: https://core.telegram.org/bots/api#answerprecheckoutquery  

| Param | Type | Description |
| --- | --- | --- |
| preCheckoutQueryId | <code>String</code> | Unique identifier for the query to be answered |
| ok | <code>Boolean</code> | Specify if every order details are ok |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+getMyStarBalance"></a>

### telegramBot.getMyStarBalance([options]) ⇒ <code>Promise</code>
Use this method to get the current Telegram Stars balance of the bot.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - On success, returns a [StarAmount](https://core.telegram.org/bots/api#staramount) object  
**See**: https://core.telegram.org/bots/api#getmystarbalance  

| Param | Type | Description |
| --- | --- | --- |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+getStarTransactions"></a>

### telegramBot.getStarTransactions([options]) ⇒ <code>Promise</code>
Use this method for get the bot's Telegram Star transactions in chronological order

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - On success, returns a [StarTransactions](https://core.telegram.org/bots/api#startransactions) object  
**See**: https://core.telegram.org/bots/api#getstartransactions  

| Param | Type | Description |
| --- | --- | --- |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+refundStarPayment"></a>

### telegramBot.refundStarPayment(userId, telegramPaymentChargeId, [options]) ⇒ <code>Promise</code>
Use this method for refund a successful payment in [Telegram Stars](https://t.me/BotNews/90)

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - On success, True is returned  
**See**: https://core.telegram.org/bots/api#refundstarpayment  

| Param | Type | Description |
| --- | --- | --- |
| userId | <code>Number</code> | Unique identifier of the user whose payment will be refunded |
| telegramPaymentChargeId | <code>String</code> | Telegram payment identifier |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+editUserStarSubscription"></a>

### telegramBot.editUserStarSubscription(userId, telegramPaymentChargeId, isCanceled, [options]) ⇒ <code>Promise</code>
Allows the bot to cancel or re-enable extension of a subscription paid in Telegram Stars.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - On success, True is returned  
**See**: https://core.telegram.org/bots/api#cancelrenewsubscription  

| Param | Type | Description |
| --- | --- | --- |
| userId | <code>Number</code> | Unique identifier of the user whose subscription will be canceled or re-enabled |
| telegramPaymentChargeId | <code>String</code> | Telegram payment identifier for the subscription |
| isCanceled | <code>Boolean</code> | True, if the subscription should be canceled, False, if it should be re-enabled |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+sendGame"></a>

### telegramBot.sendGame(chatId, gameShortName, [options]) ⇒ <code>Promise</code>
Use this method to send a game.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - On success, the sent [Message](https://core.telegram.org/bots/api#message) is returned  
**See**: https://core.telegram.org/bots/api#sendgame  

| Param | Type | Description |
| --- | --- | --- |
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
| gameShortName | <code>String</code> | name of the game to be sent. Set up your games via `@BotFather`. |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+setGameScore"></a>

### telegramBot.setGameScore(userId, score, [options]) ⇒ <code>Promise</code>
Use this method to set the score of the specified user in a game message.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - On success, if the message is not an inline message, the [Message](https://core.telegram.org/bots/api#message) is returned, otherwise True is returned  
**See**: https://core.telegram.org/bots/api#setgamescore  

| Param | Type | Description |
| --- | --- | --- |
| userId | <code>Number</code> | Unique identifier of the target user |
| score | <code>Number</code> | New score value, must be non-negative |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+getGameHighScores"></a>

### telegramBot.getGameHighScores(userId, [options]) ⇒ <code>Promise</code>
Use this method to get data for high score tables.

Will return the score of the specified user and several of their neighbors in a game.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - On success, returns an Array of [GameHighScore](https://core.telegram.org/bots/api#gamehighscore) objects  
**See**: https://core.telegram.org/bots/api#getgamehighscores  

| Param | Type | Description |
| --- | --- | --- |
| userId | <code>Number</code> | Unique identifier of the target user |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+deleteMessage"></a>

### telegramBot.deleteMessage(chatId, messageId, [options]) ⇒ <code>Promise</code>
Use this method to delete a message, including service messages, with the following limitations:
- A message can only be deleted if it was sent less than 48 hours ago.
- A dice message can only be deleted if it was sent more than 24 hours ago.
- Bots can delete outgoing messages in groups and supergroups.
- Bots can delete incoming messages in groups, supergroups and channels.
- Bots granted `can_post_messages` permissions can delete outgoing messages in channels.
- If the bot is an administrator of a group, it can delete any message there.
- If the bot has `can_delete_messages` permission in a supergroup, it can delete any message there.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - True on success  
**See**: https://core.telegram.org/bots/api#deletemessage  

| Param | Type | Description |
| --- | --- | --- |
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format @channelusername) |
| messageId | <code>Number</code> | Unique identifier of the target message |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+deleteMessages"></a>

### telegramBot.deleteMessages(chatId, messageIds, [options]) ⇒ <code>Promise.&lt;Boolean&gt;</code>
Use this method to delete multiple messages simultaneously. If some of the specified messages can't be found, they are skipped.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise.&lt;Boolean&gt;</code> - True on success  
**See**: https://core.telegram.org/bots/api#deletemessages  

| Param | Type | Description |
| --- | --- | --- |
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format @channelusername) |
| messageIds | <code>Array.&lt;(Number\|String)&gt;</code> | Identifiers of 1-100 messages to delete. See deleteMessage for limitations on which messages can be deleted |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+getAvailableGifts"></a>

### telegramBot.getAvailableGifts([options]) ⇒ <code>Promise</code>
Use this method to returns the list of gifts that can be sent by the bot to users and channel chats.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - On success, returns a [Gifts](https://core.telegram.org/bots/api#gifts) objects.  
**See**: https://core.telegram.org/bots/api#getavailablegifts  

| Param | Type | Description |
| --- | --- | --- |
| [options] | <code>Object</code> | Additional Telegram query options. |

<a name="TelegramBot+sendGift"></a>

### telegramBot.sendGift(giftId, [options]) ⇒ <code>Promise</code>
Use this method to sends a gift to the given user or channel chat.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - On success, returns true.  
**See**: https://core.telegram.org/bots/api#getavailablegifts  

| Param | Type | Description |
| --- | --- | --- |
| giftId | <code>String</code> | Unique identifier of the gift |
| [options] | <code>Object</code> | Additional Telegram query options. |

<a name="TelegramBot+giftPremiumSubscription"></a>

### telegramBot.giftPremiumSubscription(userId, monthCount, starCount, [options]) ⇒ <code>Promise</code>
Use this method to sends a gift to the given user or channel chat.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - On success, returns true.  
**See**: https://core.telegram.org/bots/api#getavailablegifts  

| Param | Type | Description |
| --- | --- | --- |
| userId | <code>Number</code> | Unique identifier of the target user who will receive a Telegram Premium subscription. |
| monthCount | <code>Number</code> | Number of months the Telegram Premium subscription will be active for the user; must be one of 3, 6, or 12. |
| starCount | <code>String</code> | Number of Telegram Stars to pay for the Telegram Premium subscription; must be 1000 for 3 months, 1500 for 6 months, and 2500 for 12 months. |
| [options] | <code>Object</code> | Additional Telegram query options. |

<a name="TelegramBot+verifyUser"></a>

### telegramBot.verifyUser(userId, [options]) ⇒ <code>Promise</code>
This method verifies a user [on behalf of the organization](https://telegram.org/verify#third-party-verification) which is represented by the bot.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - On success, returns true.  
**See**: https://core.telegram.org/bots/api#verifyuser  

| Param | Type | Description |
| --- | --- | --- |
| userId | <code>Number</code> | Unique identifier of the target user. |
| [options] | <code>Object</code> | Additional Telegram query options. |

<a name="TelegramBot+verifyChat"></a>

### telegramBot.verifyChat(chatId, [options]) ⇒ <code>Promise</code>
This method verifies a chat [on behalf of the organization](https://telegram.org/verify#third-party-verification) which is represented by the bot.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - On success, returns true.  
**See**: https://core.telegram.org/bots/api#verifychat  

| Param | Type | Description |
| --- | --- | --- |
| chatId | <code>Number</code> | Unique identifier of the target chat. |
| [options] | <code>Object</code> | Additional Telegram query options. |

<a name="TelegramBot+removeUserVerification"></a>

### telegramBot.removeUserVerification(userId, [options]) ⇒ <code>Promise</code>
This method removes verification from a user who is currently verified [on behalf of the organization](https://telegram.org/verify#third-party-verification) which is represented by the bot.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - On success, returns true.  
**See**: https://core.telegram.org/bots/api#removeuserverification  

| Param | Type | Description |
| --- | --- | --- |
| userId | <code>Number</code> | Unique identifier of the target user |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+removeChatVerification"></a>

### telegramBot.removeChatVerification(chatId, [options]) ⇒ <code>Promise</code>
This method removes verification from a chat who is currently verified [on behalf of the organization](https://telegram.org/verify#third-party-verification) which is represented by the bot.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - On success, returns true.  
**See**: https://core.telegram.org/bots/api#removechatverification  

| Param | Type | Description |
| --- | --- | --- |
| chatId | <code>Number</code> | Unique identifier of the target chat. |
| [options] | <code>Object</code> | Additional Telegram query options. |

<a name="TelegramBot+readBusinessMessage"></a>

### telegramBot.readBusinessMessage(businessConnectionId, chatId, messageId, [options]) ⇒ <code>Promise</code>
This method marks incoming message as read on behalf of a business account.

Requires the **can_read_messages** business bot right

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - On success, returns true.  
**See**: https://core.telegram.org/bots/api#readbusinessmessage  

| Param | Type | Description |
| --- | --- | --- |
| businessConnectionId | <code>String</code> | Unique identifier of the business connection on behalf of which to read the message. |
| chatId | <code>Number</code> | Unique identifier of the chat in which the message was received. The chat must have been active in the last 24 hours. |
| messageId | <code>Number</code> | Unique identifier of the message to mark as read. |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+deleteBusinessMessages"></a>

### telegramBot.deleteBusinessMessages(businessConnectionId, messageIds, [options]) ⇒ <code>Promise</code>
This method delete messages on behalf of a business account.

Requires the **can_delete_outgoing_messages** business bot right to delete messages sent by the bot itself, or the **can_delete_all_messages business** bot right to delete any message.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - On success, returns true.  
**See**: https://core.telegram.org/bots/api#deletebusinessmessages  

| Param | Type | Description |
| --- | --- | --- |
| businessConnectionId | <code>String</code> | Unique identifier of the business connection on behalf of which to delete the message. |
| messageIds | <code>Array.&lt;Number&gt;</code> | List of 1-100 identifiers of messages to delete. All messages **must be from the same chat**. |
| [options] | <code>Object</code> | Additional Telegram query options. |

<a name="TelegramBot+setBusinessAccountName"></a>

### telegramBot.setBusinessAccountName(businessConnectionId, firstName, [options]) ⇒ <code>Promise</code>
This method changes the first and last name of a managed business account.

Requires the **can_change_name** business bot right.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - On success, returns true.  
**See**: https://core.telegram.org/bots/api#setbusinessaccountname  

| Param | Type | Description |
| --- | --- | --- |
| businessConnectionId | <code>String</code> | Unique identifier of the business connection. |
| firstName | <code>String</code> | The new value of the first name for the business account; 1-64 characters. |
| [options] | <code>Object</code> | Additional Telegram query options |

<a name="TelegramBot+setBusinessAccountUsername"></a>

### telegramBot.setBusinessAccountUsername(businessConnectionId, [options]) ⇒ <code>Promise</code>
This method changes the username of a managed business account.

Requires the **can_change_username** business bot right.

**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)  
**Returns**: <code>Promise</code> - On success, returns true.  
**See**: 
Download .txt
gitextract_kd505wwd/

├── .babelrc
├── .editorconfig
├── .eslintignore
├── .eslintrc
├── .github/
│   ├── ISSUE_TEMPLATE.md
│   └── PULL_REQUEST_TEMPLATE.md
├── .gitignore
├── .npmignore
├── .travis.yml
├── CHANGELOG.md
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── LICENSE.md
├── README.md
├── doc/
│   ├── api.hbs
│   ├── api.md
│   ├── experimental.md
│   ├── help.md
│   ├── tutorials.md
│   └── usage.md
├── examples/
│   ├── game/
│   │   ├── game.html
│   │   └── game.js
│   ├── polling.js
│   ├── ssl/
│   │   ├── crt.pem
│   │   └── key.pem
│   └── webhook/
│       ├── express.js
│       ├── heroku.js
│       ├── https.js
│       ├── now.js
│       └── openshift2.js
├── index.js
├── package.json
├── src/
│   ├── errors.js
│   ├── telegram.js
│   ├── telegramPolling.js
│   ├── telegramWebHook.js
│   └── utils.js
└── test/
    ├── README.md
    ├── data/
    │   └── voice.ogg
    ├── mocha.opts
    ├── telegram.js
    ├── test.format-send-data.js
    └── utils.js
Download .txt
SYMBOL INDEX (252 symbols across 13 files)

FILE: examples/game/game.js
  constant TOKEN (line 6) | const TOKEN = process.env.TELEGRAM_TOKEN || 'YOUR_TELEGRAM_BOT_TOKEN';

FILE: examples/polling.js
  constant TOKEN (line 7) | const TOKEN = process.env.TELEGRAM_TOKEN || 'YOUR_TELEGRAM_BOT_TOKEN';

FILE: examples/webhook/express.js
  constant TOKEN (line 7) | const TOKEN = process.env.TELEGRAM_TOKEN || 'YOUR_TELEGRAM_BOT_TOKEN';

FILE: examples/webhook/heroku.js
  constant TOKEN (line 7) | const TOKEN = process.env.TELEGRAM_TOKEN || 'YOUR_TELEGRAM_BOT_TOKEN';

FILE: examples/webhook/https.js
  constant TOKEN (line 7) | const TOKEN = process.env.TELEGRAM_TOKEN || 'YOUR_TELEGRAM_BOT_TOKEN';

FILE: examples/webhook/now.js
  constant TOKEN (line 8) | const TOKEN = process.env.TELEGRAM_TOKEN || 'YOUR_TELEGRAM_BOT_TOKEN';

FILE: examples/webhook/openshift2.js
  constant TOKEN (line 19) | const TOKEN = process.env.TELEGRAM_TOKEN || 'YOUR_TELEGRAM_BOT_TOKEN';

FILE: src/errors.js
  method constructor (line 9) | constructor(code, message) {
  method toJSON (line 13) | toJSON() {
  method constructor (line 29) | constructor(data) {
  method constructor (line 49) | constructor(message, response) {
  method constructor (line 64) | constructor(message, response) {

FILE: src/telegram.js
  constant URL (line 16) | const URL = require('url');
  function stringify (line 72) | function stringify(data) {
  class TelegramBot (line 80) | class TelegramBot extends EventEmitter {
    method errors (line 85) | static get errors() {
    method messageTypes (line 93) | static get messageTypes() {
    method on (line 105) | on(event, listener) {
    method constructor (line 163) | constructor(token, options = {}) {
    method _buildURL (line 200) | _buildURL(_path) {
    method _fixReplyMarkup (line 211) | _fixReplyMarkup(obj) {
    method _fixEntitiesField (line 227) | _fixEntitiesField(obj) {
    method _fixAddFileThumbnail (line 244) | _fixAddFileThumbnail(options, opts) {
    method _fixMessageIds (line 264) | _fixMessageIds(obj) {
    method _fixReplyParameters (line 278) | _fixReplyParameters(obj) {
    method _request (line 291) | _request(_path, options = {}) {
    method _formatSendData (line 352) | _formatSendData(type, data, fileOptions = {}) {
    method _formatSendMultipleData (line 437) | _formatSendMultipleData(type, files, fileOptions = {}) {
    method startPolling (line 502) | startPolling(options = {}) {
    method initPolling (line 519) | initPolling() {
    method stopPolling (line 533) | stopPolling(options) {
    method getFileLink (line 553) | getFileLink(fileId, form = {}) {
    method getFileStream (line 573) | getFileStream(fileId, form = {}) {
    method downloadFile (line 600) | downloadFile(fileId, downloadDir, form = {}) {
    method onText (line 629) | onText(regexp, callback) {
    method removeTextListener (line 640) | removeTextListener(regexp) {
    method clearTextListeners (line 653) | clearTextListeners() {
    method onReplyToMessage (line 666) | onReplyToMessage(chatId, messageId, callback) {
    method removeReplyListener (line 684) | removeReplyListener(replyListenerId) {
    method clearReplyListeners (line 699) | clearReplyListeners() {
    method isPolling (line 708) | isPolling() {
    method openWebHook (line 719) | openWebHook() {
    method closeWebHook (line 735) | closeWebHook() {
    method hasOpenWebHook (line 748) | hasOpenWebHook() {
    method processUpdate (line 761) | processUpdate(update) {
    method getUpdates (line 925) | getUpdates(form = {}) {
    method setWebHook (line 964) | setWebHook(url, options = {}, fileOptions = {}) {
    method deleteWebHook (line 1003) | deleteWebHook(form = {}) {
    method getWebHookInfo (line 1016) | getWebHookInfo(form = {}) {
    method getMe (line 1027) | getMe(form = {}) {
    method logOut (line 1040) | logOut(form = {}) {
    method close (line 1052) | close(form = {}) {
    method sendMessage (line 1064) | sendMessage(chatId, text, form = {}) {
    method forwardMessage (line 1081) | forwardMessage(chatId, fromChatId, messageId, form = {}) {
    method forwardMessages (line 1102) | forwardMessages(chatId, fromChatId, messageIds, form = {}) {
    method copyMessage (line 1122) | copyMessage(chatId, fromChatId, messageId, form = {}) {
    method copyMessages (line 1142) | copyMessages(chatId, fromChatId, messageIds, form = {}) {
    method sendPhoto (line 1160) | sendPhoto(chatId, photo, options = {}, fileOptions = {}) {
    method sendAudio (line 1189) | sendAudio(chatId, audio, options = {}, fileOptions = {}) {
    method sendDocument (line 1219) | sendDocument(chatId, doc, options = {}, fileOptions = {}) {
    method sendVideo (line 1248) | sendVideo(chatId, video, options = {}, fileOptions = {}) {
    method sendAnimation (line 1275) | sendAnimation(chatId, animation, options = {}, fileOptions = {}) {
    method sendVoice (line 1303) | sendVoice(chatId, voice, options = {}, fileOptions = {}) {
    method sendVideoNote (line 1331) | sendVideoNote(chatId, videoNote, options = {}, fileOptions = {}) {
    method sendPaidMedia (line 1356) | sendPaidMedia(chatId, starCount, media, options = {}) {
    method sendMediaGroup (line 1405) | sendMediaGroup(chatId, media, options = {}) {
    method sendLocation (line 1450) | sendLocation(chatId, latitude, longitude, form = {}) {
    method editMessageLiveLocation (line 1472) | editMessageLiveLocation(latitude, longitude, form = {}) {
    method stopMessageLiveLocation (line 1489) | stopMessageLiveLocation(form = {}) {
    method sendVenue (line 1506) | sendVenue(chatId, latitude, longitude, title, address, form = {}) {
    method sendContact (line 1526) | sendContact(chatId, phoneNumber, firstName, form = {}) {
    method sendPoll (line 1544) | sendPoll(chatId, question, pollOptions, form = {}) {
    method sendChecklist (line 1562) | sendChecklist(businessConnectionId, chatId, checklist, form = {}) {
    method sendDice (line 1577) | sendDice(chatId, options = {}) {
    method sendMessageDraft (line 1601) | sendMessageDraft(chatId, draftId, text, form = {}) {
    method sendChatAction (line 1627) | sendChatAction(chatId, action, form = {}) {
    method setMessageReaction (line 1645) | setMessageReaction(chatId, messageId, form = {}) {
    method getUserProfilePhotos (line 1663) | getUserProfilePhotos(userId, form = {}) {
    method getUserProfileAudios (line 1677) | getUserProfileAudios(userId, form = {}) {
    method setUserEmojiStatus (line 1692) | setUserEmojiStatus(userId, form = {}) {
    method getFile (line 1708) | getFile(fileId, form = {}) {
    method banChatMember (line 1727) | banChatMember(chatId, userId, form = {}) {
    method unbanChatMember (line 1749) | unbanChatMember(chatId, userId, form = {}) {
    method restrictChatMember (line 1767) | restrictChatMember(chatId, userId, form = {}) {
    method promoteChatMember (line 1784) | promoteChatMember(chatId, userId, form = {}) {
    method setChatAdministratorCustomTitle (line 1800) | setChatAdministratorCustomTitle(chatId, userId, customTitle, form = {}) {
    method setChatMemberTag (line 1818) | setChatMemberTag(chatId, userId, form = {}) {
    method banChatSenderChat (line 1836) | banChatSenderChat(chatId, senderChatId, form = {}) {
    method unbanChatSenderChat (line 1853) | unbanChatSenderChat(chatId, senderChatId, form = {}) {
    method setChatPermissions (line 1871) | setChatPermissions(chatId, chatPermissions, form = {}) {
    method exportChatInviteLink (line 1887) | exportChatInviteLink(chatId, form = {}) {
    method createChatInviteLink (line 1904) | createChatInviteLink(chatId, form = {}) {
    method editChatInviteLink (line 1920) | editChatInviteLink(chatId, inviteLink, form = {}) {
    method createChatSubscriptionInviteLink (line 1938) | createChatSubscriptionInviteLink(chatId, subscriptionPeriod, subscript...
    method editChatSubscriptionInviteLink (line 1956) | editChatSubscriptionInviteLink(chatId, inviteLink, form = {}) {
    method revokeChatInviteLink (line 1974) | revokeChatInviteLink(chatId, inviteLink, form = {}) {
    method approveChatJoinRequest (line 1991) | approveChatJoinRequest(chatId, userId, form = {}) {
    method declineChatJoinRequest (line 2008) | declineChatJoinRequest(chatId, userId, form = {}) {
    method setChatPhoto (line 2026) | setChatPhoto(chatId, photo, options = {}, fileOptions = {}) {
    method deleteChatPhoto (line 2051) | deleteChatPhoto(chatId, form = {}) {
    method setChatTitle (line 2067) | setChatTitle(chatId, title, form = {}) {
    method setChatDescription (line 2084) | setChatDescription(chatId, description, form = {}) {
    method pinChatMessage (line 2102) | pinChatMessage(chatId, messageId, form = {}) {
    method unpinChatMessage (line 2119) | unpinChatMessage(chatId, form = {}) {
    method unpinAllChatMessages (line 2135) | unpinAllChatMessages(chatId, form = {}) {
    method leaveChat (line 2148) | leaveChat(chatId, form = {}) {
    method getChat (line 2162) | getChat(chatId, form = {}) {
    method getChatAdministrators (line 2176) | getChatAdministrators(chatId, form = {}) {
    method getChatMemberCount (line 2189) | getChatMemberCount(chatId, form = {}) {
    method getChatMember (line 2203) | getChatMember(chatId, userId, form = {}) {
    method setChatStickerSet (line 2222) | setChatStickerSet(chatId, stickerSetName, form = {}) {
    method deleteChatStickerSet (line 2239) | deleteChatStickerSet(chatId, form = {}) {
    method getForumTopicIconStickers (line 2252) | getForumTopicIconStickers(chatId, form = {}) {
    method createForumTopic (line 2268) | createForumTopic(chatId, name, form = {}) {
    method editForumTopic (line 2284) | editForumTopic(chatId, messageThreadId, form = {}) {
    method closeForumTopic (line 2300) | closeForumTopic(chatId, messageThreadId, form = {}) {
    method reopenForumTopic (line 2316) | reopenForumTopic(chatId, messageThreadId, form = {}) {
    method deleteForumTopic (line 2332) | deleteForumTopic(chatId, messageThreadId, form = {}) {
    method unpinAllForumTopicMessages (line 2348) | unpinAllForumTopicMessages(chatId, messageThreadId, form = {}) {
    method editGeneralForumTopic (line 2365) | editGeneralForumTopic(chatId, name, form = {}) {
    method closeGeneralForumTopic (line 2381) | closeGeneralForumTopic(chatId, form = {}) {
    method reopenGeneralForumTopic (line 2396) | reopenGeneralForumTopic(chatId, form = {}) {
    method hideGeneralForumTopic (line 2411) | hideGeneralForumTopic(chatId, form = {}) {
    method unhideGeneralForumTopic (line 2425) | unhideGeneralForumTopic(chatId, form = {}) {
    method unpinAllGeneralForumTopicMessages (line 2439) | unpinAllGeneralForumTopicMessages(chatId, form = {}) {
    method answerCallbackQuery (line 2458) | answerCallbackQuery(callbackQueryId, form = {}) {
    method savePreparedInlineMessage (line 2495) | savePreparedInlineMessage(userId, result, form = {}) {
    method getUserChatBoosts (line 2511) | getUserChatBoosts(chatId, userId, form = {}) {
    method getBusinessConnection (line 2525) | getBusinessConnection(businessConnectionId, form = {}) {
    method setMyCommands (line 2540) | setMyCommands(commands, form = {}) {
    method deleteMyCommands (line 2559) | deleteMyCommands(form = {}) {
    method getMyCommands (line 2574) | getMyCommands(form = {}) {
    method setMyName (line 2588) | setMyName(form = {}) {
    method getMyName (line 2599) | getMyName(form = {}) {
    method setMyDescription (line 2612) | setMyDescription(form = {}) {
    method getMyDescription (line 2623) | getMyDescription(form = {}) {
    method setMyShortDescription (line 2635) | setMyShortDescription(form = {}) {
    method getMyShortDescription (line 2646) | getMyShortDescription(form = {}) {
    method setMyProfilePhoto (line 2658) | setMyProfilePhoto(photo, options = {}) {
    method removeMyProfilePhoto (line 2681) | removeMyProfilePhoto(form = {}) {
    method setChatMenuButton (line 2692) | setChatMenuButton(form = {}) {
    method getChatMenuButton (line 2703) | getChatMenuButton(form = {}) {
    method setMyDefaultAdministratorRights (line 2716) | setMyDefaultAdministratorRights(form = {}) {
    method getMyDefaultAdministratorRights (line 2727) | getMyDefaultAdministratorRights(form = {}) {
    method editMessageText (line 2741) | editMessageText(text, form = {}) {
    method editMessageCaption (line 2756) | editMessageCaption(caption, form = {}) {
    method editMessageMedia (line 2776) | editMessageMedia(media, form = {}) {
    method editMessageChecklist (line 2827) | editMessageChecklist(businessConnectionId, chatId, messageId, checklis...
    method editMessageReplyMarkup (line 2845) | editMessageReplyMarkup(replyMarkup, form = {}) {
    method stopPoll (line 2859) | stopPoll(chatId, pollId, form = {}) {
    method approveSuggestedPost (line 2876) | approveSuggestedPost(chatId, messageId, form = {}) {
    method declineSuggestedPost (line 2893) | declineSuggestedPost(chatId, messageId, form = {}) {
    method sendSticker (line 2910) | sendSticker(chatId, sticker, options = {}, fileOptions = {}) {
    method getStickerSet (line 2933) | getStickerSet(name, form = {}) {
    method getCustomEmojiStickers (line 2946) | getCustomEmojiStickers(customEmojiIds, form = {}) {
    method uploadStickerFile (line 2963) | uploadStickerFile(userId, sticker, stickerFormat = 'static', options =...
    method createNewStickerSet (line 2999) | createNewStickerSet(userId, name, title, pngSticker, emojis, options =...
    method addStickerToSet (line 3041) | addStickerToSet(userId, name, sticker, emojis, stickerType = 'png_stic...
    method setStickerPositionInSet (line 3073) | setStickerPositionInSet(sticker, position, form = {}) {
    method deleteStickerFromSet (line 3088) | deleteStickerFromSet(sticker, form = {}) {
    method replaceStickerInSet (line 3104) | replaceStickerInSet(userId, name, oldSticker, form = {}) {
    method setStickerEmojiList (line 3123) | setStickerEmojiList(sticker, emojiList, form = {}) {
    method setStickerKeywords (line 3139) | setStickerKeywords(sticker, form = {}) {
    method setStickerMaskPosition (line 3157) | setStickerMaskPosition(sticker, form = {}) {
    method setStickerSetTitle (line 3176) | setStickerSetTitle(name, title, form = {}) {
    method setStickerSetThumbnail (line 3200) | setStickerSetThumbnail(userId, name, thumbnail, options = {}, fileOpti...
    method setCustomEmojiStickerSetThumbnail (line 3228) | setCustomEmojiStickerSetThumbnail(name, form = {}) {
    method deleteStickerSet (line 3243) | deleteStickerSet(name, form = {}) {
    method answerInlineQuery (line 3259) | answerInlineQuery(inlineQueryId, results, form = {}) {
    method answerWebAppQuery (line 3275) | answerWebAppQuery(webAppQueryId, result, form = {}) {
    method sendInvoice (line 3295) | sendInvoice(chatId, title, description, payload, providerToken, curren...
    method createInvoiceLink (line 3323) | createInvoiceLink(title, description, payload, providerToken, currency...
    method answerShippingQuery (line 3345) | answerShippingQuery(shippingQueryId, ok, form = {}) {
    method answerPreCheckoutQuery (line 3366) | answerPreCheckoutQuery(preCheckoutQueryId, ok, form = {}) {
    method getMyStarBalance (line 3379) | getMyStarBalance(form = {}) {
    method getStarTransactions (line 3390) | getStarTransactions(form = {}) {
    method refundStarPayment (line 3403) | refundStarPayment(userId, telegramPaymentChargeId, form = {}) {
    method editUserStarSubscription (line 3419) | editUserStarSubscription(userId, telegramPaymentChargeId, isCanceled, ...
    method sendGame (line 3435) | sendGame(chatId, gameShortName, form = {}) {
    method setGameScore (line 3450) | setGameScore(userId, score, form = {}) {
    method getGameHighScores (line 3466) | getGameHighScores(userId, form = {}) {
    method deleteMessage (line 3488) | deleteMessage(chatId, messageId, form = {}) {
    method deleteMessages (line 3503) | deleteMessages(chatId, messageIds, form = {}) {
    method getAvailableGifts (line 3516) | getAvailableGifts(form = {}) {
    method sendGift (line 3528) | sendGift(giftId, form = {}) {
    method giftPremiumSubscription (line 3543) | giftPremiumSubscription(userId, monthCount, starCount, form = {}) {
    method verifyUser (line 3558) | verifyUser(userId, form = {}) {
    method verifyChat (line 3571) | verifyChat(chatId, form = {}) {
    method removeUserVerification (line 3584) | removeUserVerification(userId, form = {}) {
    method removeChatVerification (line 3597) | removeChatVerification(chatId, form = {}) {
    method readBusinessMessage (line 3614) | readBusinessMessage(businessConnectionId, chatId, messageId, form = {}) {
    method deleteBusinessMessages (line 3632) | deleteBusinessMessages(businessConnectionId, messageIds, form = {}) {
    method setBusinessAccountName (line 3649) | setBusinessAccountName(businessConnectionId, firstName, form = {}) {
    method setBusinessAccountUsername (line 3665) | setBusinessAccountUsername(businessConnectionId, form = {}) {
    method setBusinessAccountBio (line 3680) | setBusinessAccountBio(businessConnectionId, form = {}) {
    method setBusinessAccountProfilePhoto (line 3696) | setBusinessAccountProfilePhoto(businessConnectionId, photo, options = ...
    method removeBusinessAccountProfilePhoto (line 3724) | removeBusinessAccountProfilePhoto(businessConnectionId, form = {}) {
    method setBusinessAccountGiftSettings (line 3741) | setBusinessAccountGiftSettings(businessConnectionId, showGiftButton, a...
    method getBusinessAccountStarBalance (line 3758) | getBusinessAccountStarBalance(businessConnectionId, form = {}) {
    method transferBusinessAccountStars (line 3774) | transferBusinessAccountStars(businessConnectionId, startCount, form = ...
    method getBusinessAccountGifts (line 3790) | getBusinessAccountGifts(businessConnectionId, form = {}) {
    method getUserGifts (line 3803) | getUserGifts(userId, form = {}) {
    method getChatGifts (line 3818) | getChatGifts(chatId, form = {}) {
    method convertGiftToStars (line 3834) | convertGiftToStars(businessConnectionId, ownedGiftId, form = {}) {
    method upgradeGift (line 3852) | upgradeGift(businessConnectionId, ownedGiftId, form = {}) {
    method transferGift (line 3871) | transferGift(businessConnectionId, ownedGiftId, newOwnerChatId, form =...
    method postStory (line 3890) | postStory(businessConnectionId, content, activePeriod, options = {}) {
    method repostStory (line 3938) | repostStory(businessConnectionId, fromChatId, fromStoryId, activePerio...
    method editStory (line 3958) | editStory(businessConnectionId, storyId, content, options = {}) {
    method deleteStory (line 4004) | deleteStory(businessConnectionId, storyId, form = {}) {

FILE: src/telegramPolling.js
  constant ANOTHER_WEB_HOOK_USED (line 4) | const ANOTHER_WEB_HOOK_USED = 409;
  class TelegramBotPolling (line 7) | class TelegramBotPolling {
    method constructor (line 13) | constructor(bot) {
    method start (line 36) | start(options = {}) {
    method stop (line 58) | stop(options = {}) {
    method isPolling (line 79) | isPolling() {
    method _error (line 88) | _error(error) {
    method _polling (line 100) | _polling() {
    method _unsetWebHook (line 181) | _unsetWebHook() {
    method _getUpdates (line 189) | _getUpdates() {

FILE: src/telegramWebHook.js
  class TelegramBotWebHook (line 8) | class TelegramBotWebHook {
    method constructor (line 14) | constructor(bot) {
    method open (line 49) | open() {
    method close (line 70) | close() {
    method isOpen (line 86) | isOpen() {
    method _error (line 100) | _error(error) {
    method _parseBody (line 111) | _parseBody(error, body) {
    method _requestListener (line 132) | _requestListener(req, res) {

FILE: test/telegram.js
  constant TOKEN (line 16) | const TOKEN = process.env.TEST_TELEGRAM_TOKEN;
  constant PROVIDER_TOKEN (line 21) | const PROVIDER_TOKEN = process.env.TEST_PROVIDER_TOKEN;
  constant USERID (line 27) | const USERID = process.env.TEST_USER_ID || 777000;
  constant GROUPID (line 28) | const GROUPID = process.env.TEST_GROUP_ID || -1001075450562;
  constant GAME_SHORT_NAME (line 29) | const GAME_SHORT_NAME = process.env.TEST_GAME_SHORT_NAME || 'medusalab_t...
  constant STICKER_SET_NAME (line 30) | const STICKER_SET_NAME = process.env.TEST_STICKER_SET_NAME || 'pusheen';
  constant CURRENT_TIMESTAMP (line 31) | const CURRENT_TIMESTAMP = Date.now();
  constant FILE_PATH (line 46) | const FILE_PATH = `${__dirname}/data/photo.png`;
  constant FILE_ID (line 47) | let FILE_ID;
  constant GAME_CHAT_ID (line 48) | let GAME_CHAT_ID;
  constant GAME_MSG_ID (line 49) | let GAME_MSG_ID;
  constant BOT_USERNAME (line 50) | let BOT_USERNAME;
  constant CHAT_INFO (line 51) | let CHAT_INFO;
  constant STICKER_FILE_ID_FROM_SET (line 52) | let STICKER_FILE_ID_FROM_SET;
  constant STICKERS_FROM_BOT_SET (line 53) | let STICKERS_FROM_BOT_SET;

FILE: test/utils.js
  function startMockServer (line 90) | function startMockServer(port, options = {}) {
  function startStaticServer (line 112) | function startStaticServer(port) {
  function isPollingMockServer (line 122) | function isPollingMockServer(port, reverse) {
  function clearPollingCheck (line 137) | function clearPollingCheck(port) {
  function hasOpenWebHook (line 143) | function hasOpenWebHook(port, reverse) {
  function sendWebHookRequest (line 162) | function sendWebHookRequest(port, path, options = {}) {
  function sendWebHookMessage (line 179) | function sendWebHookMessage(port, token, options = {}) {
  function handleRatelimit (line 187) | function handleRatelimit(bot, methodName, suite) {
  function isTelegramFileURI (line 228) | function isTelegramFileURI(uri) {
Condensed preview — 43 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (540K chars).
[
  {
    "path": ".babelrc",
    "chars": 167,
    "preview": "{\n  \"plugins\": [\n    \"transform-strict-mode\",\n    \"transform-object-rest-spread\",\n    \"transform-class-properties\"\n  ],\n"
  },
  {
    "path": ".editorconfig",
    "chars": 214,
    "preview": "# http://editorconfig.org\nroot = true\n\n[*]\nindent_style = space\nindent_size = 2\nend_of_line = lf\ncharset = utf-8\ntrim_tr"
  },
  {
    "path": ".eslintignore",
    "chars": 9,
    "preview": "bin\n*.md\n"
  },
  {
    "path": ".eslintrc",
    "chars": 340,
    "preview": "{\n  \"extends\": \"airbnb/base\",\n  \"parser\": \"babel-eslint\",\n  \"rules\": {\n    \"new-cap\": 0,\n    \"prefer-arrow-callback\": 0,"
  },
  {
    "path": ".github/ISSUE_TEMPLATE.md",
    "chars": 1643,
    "preview": "<!--\nThis template includes three sections:\n1. Bug reporting\n2. Feature request\n3. Question\n\nPlease remove sections that"
  },
  {
    "path": ".github/PULL_REQUEST_TEMPLATE.md",
    "chars": 644,
    "preview": "<!--\nMark whichever option below applies to this PR.\nFor example, if your PR passes all tests, you would mark the option"
  },
  {
    "path": ".gitignore",
    "chars": 110,
    "preview": "node_modules\ncoverage/\nnpm-debug.log\n.package.json\npackage-lock.json\noutput.md\noutput/\nlib/\nlib-doc/\n.DS_Store"
  },
  {
    "path": ".npmignore",
    "chars": 200,
    "preview": "# lcov\ncoverage/\n*.log\n.package.json\n\n# artifacts & source\nREADME.hbs\noutput.md\noutput/\ntest/\nexamples/\nlib-doc/\n\n# dotf"
  },
  {
    "path": ".travis.yml",
    "chars": 441,
    "preview": "language: node_js\nnode_js:\n  - \"12\"\n  - \"10\"\n  - \"8\"\n  - \"6\"\n#\n# create required bash scripts to run builds on pull requ"
  },
  {
    "path": "CHANGELOG.md",
    "chars": 17893,
    "preview": "# Change Log\n\nAll notable changes to this project will be documented in this file.\nThis project adheres to [Semantic Ver"
  },
  {
    "path": "CODE_OF_CONDUCT.md",
    "chars": 3228,
    "preview": "# Contributor Covenant Code of Conduct\n\n## Our Pledge\n\nIn the interest of fostering an open and welcoming environment, w"
  },
  {
    "path": "CONTRIBUTING.md",
    "chars": 1111,
    "preview": "# Contributing\n\n> If you are willing to contribute, first you should know that\n> I will love you and so will the Telegra"
  },
  {
    "path": "LICENSE.md",
    "chars": 1071,
    "preview": "The MIT License (MIT)\n\nCopyright (c) 2019 Yago\n\nPermission is hereby granted, free of charge, to any person obtaining a "
  },
  {
    "path": "README.md",
    "chars": 5726,
    "preview": "<h1 align=\"center\">Node.js Telegram Bot API</h1>\n\n<div align=\"center\">\n\nNode.js module to interact with the official [Te"
  },
  {
    "path": "doc/api.hbs",
    "chars": 1084,
    "preview": "# API Reference\n\n**Note:** If you are looking for available [events](usage.md#events) or usage of api, please refer [`us"
  },
  {
    "path": "doc/api.md",
    "chars": 179778,
    "preview": "# API Reference\n\n**Note:** If you are looking for available [events](usage.md#events) or usage of api, please refer [`us"
  },
  {
    "path": "doc/experimental.md",
    "chars": 729,
    "preview": "# Experimental\n\nExperimental features are things we are trying out. We are **not** sure\nif they'll become stable and mov"
  },
  {
    "path": "doc/help.md",
    "chars": 4264,
    "preview": "# Help Information\n\n* [Common Pitfalls](#pitfalls)\n* [FAQs](#faqs)\n\n<a name=\"pitfalls\"></a>\n## Common Pitfalls\n\n<a name="
  },
  {
    "path": "doc/tutorials.md",
    "chars": 1116,
    "preview": "# Tutorials\n\n* [node-telegram-bot-api-tutorial by @hosein2398](https://github.com/hosein2398/node-telegram-bot-api-tutor"
  },
  {
    "path": "doc/usage.md",
    "chars": 9546,
    "preview": "# Usage\n\n- [Usage](#usage)\n  - [Events](#events)\n  - [WebHooks](#webhooks)\n  - [Sending files](#sending-files)\n    - [Fi"
  },
  {
    "path": "examples/game/game.html",
    "chars": 4248,
    "preview": "<!-- Game example taken from w3schools (https://www.w3schools.com/graphics/game_intro.asp) -->\n<!DOCTYPE html>\n<html>\n  "
  },
  {
    "path": "examples/game/game.js",
    "chars": 1510,
    "preview": "/**\n * This example demonstrates using HTML5 games with Telegram.\n */\n/* eslint-disable no-console */\n\nconst TOKEN = pro"
  },
  {
    "path": "examples/polling.js",
    "chars": 2109,
    "preview": "/**\n * This example demonstrates using polling.\n * It also demonstrates how you would process and send messages.\n */\n\n\nc"
  },
  {
    "path": "examples/ssl/crt.pem",
    "chars": 1310,
    "preview": "-----BEGIN CERTIFICATE-----\nMIIDmTCCAoGgAwIBAgIJAPz/mOxHHCRKMA0GCSqGSIb3DQEBCwUAMGMxCzAJBgNV\nBAYTAlVTMQ0wCwYDVQQIDARVdGF"
  },
  {
    "path": "examples/ssl/key.pem",
    "chars": 1679,
    "preview": "-----BEGIN RSA PRIVATE KEY-----\nMIIEpAIBAAKCAQEAw9YiYXN1s5KcoZy7UZyiXULpTrYPhlPhzlyJJdwge61C/swb\nqtnh/+fPZp8g8a15ond9ShU"
  },
  {
    "path": "examples/webhook/express.js",
    "chars": 993,
    "preview": "/**\n * This example demonstrates setting up a webook, and receiving\n * updates in your express app\n */\n/* eslint-disable"
  },
  {
    "path": "examples/webhook/heroku.js",
    "chars": 1221,
    "preview": "/**\n * This example demonstrates setting up webhook\n * on the Heroku platform.\n */\n\n\nconst TOKEN = process.env.TELEGRAM_"
  },
  {
    "path": "examples/webhook/https.js",
    "chars": 802,
    "preview": "/**\n * This example demonstrates setting up a webook, using a\n * self-signed certificate.\n */\n\n\nconst TOKEN = process.en"
  },
  {
    "path": "examples/webhook/now.js",
    "chars": 928,
    "preview": "/**\n * This example demonstrates setting up webhook on Zeit Now platform.\n * Attention: You have to use webhook with Zei"
  },
  {
    "path": "examples/webhook/openshift2.js",
    "chars": 1427,
    "preview": "/**\n * This example demonstrates setting up webhook\n * on the OpenShift platform.\n *\n * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
  },
  {
    "path": "index.js",
    "chars": 504,
    "preview": "/**\n * If running on Nodejs 5.x and below, we load the transpiled code.\n * Otherwise, we use the ES6 code.\n * We are dep"
  },
  {
    "path": "package.json",
    "chars": 2328,
    "preview": "{\n  \"name\": \"node-telegram-bot-api\",\n  \"version\": \"0.68.0\",\n  \"description\": \"Telegram Bot API\",\n  \"main\": \"./index.js\","
  },
  {
    "path": "src/errors.js",
    "chars": 1640,
    "preview": "exports.BaseError = class BaseError extends Error {\n  /**\n   * @class BaseError\n   * @constructor\n   * @private\n   * @pa"
  },
  {
    "path": "src/telegram.js",
    "chars": 171137,
    "preview": "// shims\nrequire('array.prototype.findindex').shim(); // for Node.js v0.x\n\nconst errors = require('./errors');\nconst Tel"
  },
  {
    "path": "src/telegramPolling.js",
    "chars": 6699,
    "preview": "const errors = require('./errors');\nconst debug = require('debug')('node-telegram-bot-api');\nconst deprecate = require('"
  },
  {
    "path": "src/telegramWebHook.js",
    "chars": 4862,
    "preview": "const errors = require('./errors');\nconst debug = require('debug')('node-telegram-bot-api');\nconst https = require('http"
  },
  {
    "path": "src/utils.js",
    "chars": 148,
    "preview": "const util = require('util');\n// Native deprecation warning\nexports.deprecate = (msg) => util.deprecate(() => { }, msg, "
  },
  {
    "path": "test/README.md",
    "chars": 917,
    "preview": "Running the tests:\n\n```bash\n# Token to be used\nexport TEST_TELEGRAM_TOKEN=<YOUR_BOT_TOKEN>\n\n# User Id which you want to "
  },
  {
    "path": "test/mocha.opts",
    "chars": 59,
    "preview": "--reporter spec\n--require  babel-register\n--timeout  30000\n"
  },
  {
    "path": "test/telegram.js",
    "chars": 79164,
    "preview": "const TelegramBot = require('..');\nconst request = require('@cypress/request-promise');\nconst assert = require('assert')"
  },
  {
    "path": "test/test.format-send-data.js",
    "chars": 4854,
    "preview": "const assert = require('assert');\nconst fs = require('fs');\nconst path = require('path');\nconst TelegramBot = require('."
  },
  {
    "path": "test/utils.js",
    "chars": 6603,
    "preview": "/* eslint-disable no-use-before-define */\nexports = module.exports = {\n  /**\n   * Clear polling check, so that 'isPollin"
  }
]

// ... and 1 more files (download for full content)

About this extraction

This page contains the full source code of the yagop/node-telegram-bot-api GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 43 files (512.2 KB), approximately 135.0k tokens, and a symbol index with 252 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!