mirror of
https://github.com/yagop/node-telegram-bot-api
synced 2025-08-22 09:57:10 +00:00
Compare commits
136 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
59b43a5355 | ||
|
6d7adc3e12 | ||
|
8fe6f04df2 | ||
|
074912cdb3 | ||
|
cb21b01c3a | ||
|
0b2662fd24 | ||
|
b4effe6980 | ||
|
94e61c0a10 | ||
|
8cff652e05 | ||
|
01c3ea77c9 | ||
|
5fd83b3243 | ||
|
531a15e7b8 | ||
|
12d28f3958 | ||
|
766b4344a8 | ||
|
f40b421717 | ||
|
e7dd42c227 | ||
|
7e9ee42769 | ||
|
65ef0a2fcc | ||
|
fea59f455c | ||
|
556de8794d | ||
|
7fe501f19f | ||
|
d323a3bac5 | ||
|
515a1acdc7 | ||
|
8f741b2cb6 | ||
|
db976c4598 | ||
|
8df6e6583e | ||
|
be25ec69d2 | ||
|
00ffca5fdd | ||
|
cceea22a93 | ||
|
e81ec60377 | ||
|
4fa9a735bb | ||
|
5385d41f1f | ||
|
12d4d25af4 | ||
|
f17e801b8a | ||
|
595cdbd0c6 | ||
|
dfe24a4d38 | ||
|
542002ec0d | ||
|
2885db0e31 | ||
|
ad2b8c2ce1 | ||
|
4ec6a68840 | ||
|
ab0eb183ad | ||
|
c4164a21ce | ||
|
6077f9ba10 | ||
|
41f493ba82 | ||
|
53b5565e8a | ||
|
58261d1be3 | ||
|
4ef4fe9ba9 | ||
|
ab5928669b | ||
|
0eb8b8032f | ||
|
ccdd14670b | ||
|
d85370452a | ||
|
22d99fd91d | ||
|
fe4afd6533 | ||
|
c9b05e7996 | ||
|
f50cf982c7 | ||
|
449f03f786 | ||
|
d28875154c | ||
|
f97cad7588 | ||
|
6ad9115fb1 | ||
|
72feca3d02 | ||
|
280a58c0e2 | ||
|
0f33cb5ab7 | ||
|
e114682f2e | ||
|
1a7f41c930 | ||
|
c6cb87ec12 | ||
|
bbbc6cb8b8 | ||
|
5ff22148d8 | ||
|
19b5fc5bd3 | ||
|
68ac69cf99 | ||
|
e119612b5f | ||
|
b9e8675736 | ||
|
d87e8d258d | ||
|
a1e73481db | ||
|
6c0f2e73c0 | ||
|
15c878ea89 | ||
|
b60f065a83 | ||
|
921cb65fce | ||
|
5cc6629ca0 | ||
|
2416679cee | ||
|
5a4787884e | ||
|
2c06bc3b3d | ||
|
e6938f81eb | ||
|
de76dcd2cb | ||
|
7738677b45 | ||
|
28cd62e355 | ||
|
ec7e61e041 | ||
|
3829e727aa | ||
|
5d30b6a134 | ||
|
fc24d0dc4d | ||
|
167e52c04a | ||
|
93eaad082c | ||
|
917c20c2c7 | ||
|
7643551adc | ||
|
d853a18079 | ||
|
b4309cf45a | ||
|
1ca5e2b967 | ||
|
1bae9c2964 | ||
|
c6a0eedc9a | ||
|
8bf57c1275 | ||
|
5169d79bd9 | ||
|
667380f1de | ||
|
5553ceecbb | ||
|
e66243a776 | ||
|
1f1e46e01b | ||
|
690c26faa2 | ||
|
0613a1bb08 | ||
|
7feb88464d | ||
|
a0aa87329f | ||
|
0b8ca03b54 | ||
|
f1a044e88e | ||
|
0b476fe35d | ||
|
cf28a17654 | ||
|
8a51b70028 | ||
|
d6f5639768 | ||
|
47bea20539 | ||
|
29e0038bf3 | ||
|
d70442d746 | ||
|
6e46f48606 | ||
|
6a7c088a63 | ||
|
11a6b221e9 | ||
|
42b31fbc9e | ||
|
ca7eee8b0c | ||
|
e207ef665b | ||
|
cca75ec92a | ||
|
fadf738da4 | ||
|
8b99ccb75c | ||
|
2d3421905c | ||
|
67c738b0d3 | ||
|
8ef560160c | ||
|
b585957a0a | ||
|
8b7d10e01b | ||
|
1224613fec | ||
|
0461c0bfe3 | ||
|
71fbad31d9 | ||
|
091ef7a8a7 | ||
|
435f06319e |
@ -5,9 +5,10 @@
|
||||
"new-cap": 0,
|
||||
"prefer-arrow-callback": 0,
|
||||
"no-param-reassign": [2,{"props":false}],
|
||||
"max-len": [2, 150],
|
||||
"max-len": [2, 200],
|
||||
"arrow-body-style": 0,
|
||||
"comma-dangle": 0
|
||||
"comma-dangle": 0,
|
||||
"indent": ["error", 2]
|
||||
},
|
||||
"plugins": [
|
||||
"mocha"
|
||||
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -7,3 +7,4 @@ output.md
|
||||
output/
|
||||
lib/
|
||||
lib-doc/
|
||||
.DS_Store
|
13
.travis.yml
13
.travis.yml
@ -1,12 +1,15 @@
|
||||
language: node_js
|
||||
node_js:
|
||||
- "9"
|
||||
- "12"
|
||||
- "10"
|
||||
- "8"
|
||||
- "7"
|
||||
- "6"
|
||||
- "5"
|
||||
- "4"
|
||||
# - "0.12"
|
||||
#
|
||||
# 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:
|
||||
|
508
CHANGELOG.md
508
CHANGELOG.md
@ -3,9 +3,368 @@
|
||||
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] - UNRELEASE
|
||||
|
||||
1. Support Telegram Bot API 9.1 (@danielperez9430)
|
||||
* sendChecklist
|
||||
* editMessageChecklist
|
||||
* getMyStarBalance
|
||||
|
||||
2. Support Telegram Bot API 9.0 (@danielperez9430)
|
||||
* readBusinessMessage
|
||||
* deleteBusinessMessages
|
||||
* setBusinessAccountName
|
||||
* setBusinessAccountUsername
|
||||
* setBusinessAccountBio
|
||||
* setBusinessAccountProfilePhoto
|
||||
* removeBusinessAccountProfilePhoto
|
||||
* setBusinessAccountGiftSettings
|
||||
* getBusinessAccountStarBalance
|
||||
* transferBusinessAccountStars
|
||||
* getBusinessAccountGifts
|
||||
* convertGiftToStars
|
||||
* upgradeGift
|
||||
* transferGift
|
||||
* postStory
|
||||
* editStory
|
||||
* deleteStory
|
||||
* giftPremiumSubscription
|
||||
|
||||
3. Support Telegram Bot API 8.2 and 8.3 (@danielperez9430)
|
||||
* verifyUser
|
||||
* verifyChat
|
||||
* removeUserVerification
|
||||
* removeChatVerification
|
||||
|
||||
4. Support Telegram Bot API 8.0 and 8.1
|
||||
* savePreparedInlineMessage (@IsmailBinMujeeb & @danielperez9430)
|
||||
* setUserEmojiStatus (@danielperez9430)
|
||||
* editUserStarSubscription (@danielperez9430)
|
||||
* getAvailableGifts (@danielperez9430)
|
||||
* sendGift (@danielperez9430)
|
||||
|
||||
5. Support Telegram Bot API 7.10 (@danielperez9430)
|
||||
* Update: `purchased_paid_media`
|
||||
|
||||
6. Support Telegram Bot API 7.6 (@danielperez9430)
|
||||
* sendPaidMedia
|
||||
|
||||
## [0.67.0][0.67.0] - 2024-05-30
|
||||
|
||||
1. Support Telegram Bot API 7.4 (@danielperez9430)
|
||||
* refundStarPayment
|
||||
|
||||
## [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*
|
||||
|
||||
* * *
|
||||
|
||||
@ -14,37 +373,36 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
||||
Added:
|
||||
|
||||
1. Support Bot API v3.5: (by @GochoMugo)
|
||||
* Allow `provider_data` parameter in *TelegramBot#sendInvoice*
|
||||
* Add method *TelegramBot#sendMediaGroup()*
|
||||
1. Support Bot API v3.4: (by @kamikazechaser)
|
||||
* Add methods *TelegramBot#editMessageLiveLocation*, *TelegramBot#stopMessageLiveLocation* (#439)
|
||||
* Add methods *TelegramBot#setChatStickerSet*, *TelegramBot#deleteChatStickerSet* (#440)
|
||||
1. Add methods:
|
||||
* *TelegramBot#getFileStream* (#442) (by @GochoMugo, requested-by @Xaqron)
|
||||
1. Add options to *TelegramBot#stopPolling()* (by @GochoMugo)
|
||||
1. Add `metadata` argument in `message` event (and friends e.g. `text`, `audio`, etc.) (#409) (by @jlsjonas, @GochoMugo)
|
||||
1. Add forward-compatibility i.e. support future additional Telegram options (by @GochoMugo)
|
||||
1. Add support for Node.js v9 (by @GochoMugo)
|
||||
1. Document *TelegramBot.errors*, *TelegramBot.messageTypes* (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)
|
||||
1. Improve default error logging of `polling_error` and `webhook_error` (#377)
|
||||
1. Update dependencies
|
||||
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`
|
||||
* 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)
|
||||
1. Fix game example (#449, #418) (by @MCSH)
|
||||
|
||||
2. Fix game example (#449, #418) (by @MCSH)
|
||||
|
||||
* * *
|
||||
|
||||
@ -53,16 +411,15 @@ Fixed:
|
||||
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)
|
||||
1. Supports API v3.3
|
||||
* (#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
|
||||
@ -70,10 +427,10 @@ Deprecated:
|
||||
Added:
|
||||
|
||||
1. (#361) Support Bot API v3.1 (by @Lord-Protector, @kamikazechaser)
|
||||
1. (#332) Support Bot API v3.0 (by @kamikazechaser, @GochoMugo)
|
||||
1. Add *TelegramBot#removeTextListener()* (by @GochoMugo)
|
||||
1. (#342) Add game example (by @MCSH)
|
||||
1. (#315) List 'bot-brother' project in community section in README (by @saeedhei)
|
||||
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:
|
||||
|
||||
@ -82,9 +439,8 @@ Changed:
|
||||
Fixed:
|
||||
|
||||
1. (#325) Fix global regexp state reset (by @Sirius-A)
|
||||
1. (#363) Fix download file path on windows (by @kucherenkovova)
|
||||
1. (#346) Fix anchor webhook link in docs (by @Coac)
|
||||
|
||||
2. (#363) Fix download file path on windows (by @kucherenkovova)
|
||||
3. (#346) Fix anchor webhook link in docs (by @Coac)
|
||||
|
||||
* * *
|
||||
|
||||
@ -94,15 +450,13 @@ Added:
|
||||
|
||||
1. (#287) Add Express WebHook example (by @kamikazechaser)
|
||||
|
||||
|
||||
Fixed:
|
||||
|
||||
1. (#291) Improve docs (by @preco21)
|
||||
1. (#298) Fix running on Node v5 (by @jehy)
|
||||
1. (#307) Fix badge links in README (by @JaakkoLipsanen)
|
||||
1. Fix defaulting value of `options.polling.params.timeout` (by @GochoMugo)
|
||||
1. Fix typos in Github issue template (by @GochoMugo, requested-by @GingerPlusPlus)
|
||||
|
||||
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)
|
||||
|
||||
* * *
|
||||
|
||||
@ -111,19 +465,19 @@ Fixed:
|
||||
Added:
|
||||
|
||||
1. Add constructor options:
|
||||
* (#243) `options.polling.params` (by @GochoMugo, requested-by @sidelux)
|
||||
1. Add methods:
|
||||
* (#74) *TelegramBot#removeReplyListener()* (by @githugger)
|
||||
1. (#283) Add proper error handling (by @GochoMugo)
|
||||
1. (#272) Add health-check endpoint (by @mironov)
|
||||
* `options.webHook.healthEndpoint`
|
||||
1. (#152) Add test for TelegramBot#sendDocument() using 'fileOpts'
|
||||
* (#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)
|
||||
1. Document `options.webHook.host` (by @GochoMugo)
|
||||
1. (#264) Add Bot API version to README (by @kamikazechaser)
|
||||
1. Add examples:
|
||||
- (#271) WebHook on Heroku (by @TheBeastOfCaerbannog)
|
||||
- (#274) WebHook on Zeit Now (by @Ferrari)
|
||||
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:
|
||||
|
||||
@ -142,7 +496,6 @@ Fixed:
|
||||
polling (by @GochoMugo, reported-by @dcparga)
|
||||
1. Fix links in documentation (by @Ni2c2k)
|
||||
|
||||
|
||||
* * *
|
||||
|
||||
## [0.26.0][0.26.0] - 2017-01-20
|
||||
@ -150,32 +503,32 @@ Fixed:
|
||||
Added:
|
||||
|
||||
1. Add *TelegramBot* constructor options:
|
||||
* `options.https`
|
||||
* `options.baseApiUrl`
|
||||
* `options.filepath`
|
||||
1. Add methods:
|
||||
* *TelegramBot#stopPolling()*
|
||||
* *TelegramBot#isPolling()*
|
||||
* *TelegramBot#openWebHook()*
|
||||
* *TelegramBot#closeWebHook()*
|
||||
* *TelegramBot#hasOpenWebHook()*
|
||||
* *TelegramBot#deleteWebHook()*
|
||||
* *TelegramBot#getWebHookInfo()*
|
||||
* `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
|
||||
1. Ensure all relevant methods return Promises
|
||||
1. Document auto-deletion of webhook during polling
|
||||
1. Deprecate support for Node.js v0.12
|
||||
1. Fix consistency of methods signatures
|
||||
1. Rename *TelegramBot#initPolling()* to *TelegramBot#startPolling()*
|
||||
* Deprecate *TelegramBot#initPolling()*
|
||||
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`
|
||||
1. Fix ES6 syntax
|
||||
2. Fix ES6 syntax
|
||||
|
||||
*Credits/Blames: Unless explicitly stated otherwise, above work was
|
||||
done by @GochoMugo*
|
||||
@ -187,19 +540,18 @@ done by @GochoMugo*
|
||||
Added:
|
||||
|
||||
1. Supports the API v2.3 updates (by @kamikazechaser)
|
||||
1. Add *TelegramBot* constructor option:
|
||||
* `options.request`: proxy extra request options (by @tarmolov)
|
||||
* `options.onlyFirstMatch` (by @GingerPlusPlus)
|
||||
1. Add methods:
|
||||
* *TelegramBot#sendVenue()* (by Tketa)
|
||||
* *TelegramBot#sendContact()* (by @GochoMugo)
|
||||
* *TelegramBot#getGameHighScores()* (by @jishnu7)
|
||||
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)
|
||||
1. Fix typos (by oflisback)
|
||||
|
||||
2. Fix typos (by oflisback)
|
||||
|
||||
[usage-sending-files]:https://github.com/yagop/node-telegram-bot-api/blob/master/doc/usage.md#sending-files-options
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2017 Yago
|
||||
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
|
||||
|
66
README.md
66
README.md
@ -1,22 +1,34 @@
|
||||
# Node.js Telegram Bot API
|
||||
<h1 align="center">Node.js Telegram Bot API</h1>
|
||||
|
||||
[](https://core.telegram.org/bots/api)
|
||||
[](https://travis-ci.org/yagop/node-telegram-bot-api)
|
||||
[](https://ci.appveyor.com/project/yagop/node-telegram-bot-api/branch/master)
|
||||
[](https://coveralls.io/r/yagop/node-telegram-bot-api?branch=master)
|
||||
[](https://www.bithound.io/github/yagop/node-telegram-bot-api)
|
||||
[](https://telegram.me/node_telegram_bot_api)
|
||||
[](https://telegram.me/Yago_Perez)
|
||||
<div align="center">
|
||||
|
||||
Node.js module to interact with official [Telegram Bot API](https://core.telegram.org/bots/api). A bot token is **required** and can be obtained by talking to [@botfather](https://telegram.me/BotFather).
|
||||
Node.js module to interact with the official [Telegram Bot API](https://core.telegram.org/bots/api).
|
||||
|
||||
## Install
|
||||
|
||||
```bash
|
||||
npm install --save node-telegram-bot-api
|
||||
[](https://core.telegram.org/bots/api)
|
||||
[](https://www.npmjs.org/package/node-telegram-bot-api)
|
||||
[](https://codecov.io/gh/yagop/node-telegram-bot-api)
|
||||
|
||||
[](https://telegram.me/node_telegram_bot_api)
|
||||
[](https://t.me/+_IC8j_b1wSFlZTVk)
|
||||
[](https://telegram.me/Yago_Perez)
|
||||
|
||||
</div>
|
||||
|
||||
## 📦 Install
|
||||
|
||||
```sh
|
||||
npm i node-telegram-bot-api
|
||||
```
|
||||
|
||||
## Usage
|
||||
<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');
|
||||
@ -50,22 +62,22 @@ bot.on('message', (msg) => {
|
||||
});
|
||||
```
|
||||
|
||||
## Documentation
|
||||
## 📚 Documentation
|
||||
|
||||
* [Usage][usage]
|
||||
* [Examples][examples]
|
||||
* [Tutorials][tutorials]
|
||||
* [Help Information][help]
|
||||
* API Reference ([release][api-release] / [development][api-dev] / [experimental][api-experimental])
|
||||
* 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 **master** branch.
|
||||
Code for the latest release resides on the **release** branch
|
||||
_**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
|
||||
## 💭 Community
|
||||
|
||||
We thank all the developers in the Open-Source community who continuously
|
||||
take their time and effort in advancing this project.
|
||||
@ -74,6 +86,8 @@ 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
|
||||
@ -81,12 +95,25 @@ Some things built using this library that might interest you:
|
||||
* [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 © 2017 Yago
|
||||
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
|
||||
@ -99,3 +126,4 @@ Copyright © 2017 Yago
|
||||
[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/+nc3A9Hs1S81mYzdk
|
||||
|
3426
doc/api.md
3426
doc/api.md
File diff suppressed because it is too large
Load Diff
@ -110,6 +110,7 @@ Sources:
|
||||
|
||||
* Issue [#122](https://github.com/yagop/node-telegram-bot-api/issues/122)
|
||||
* Issue [#253](https://github.com/yagop/node-telegram-bot-api/issues/253)
|
||||
* Issue [#766](https://github.com/yagop/node-telegram-bot-api/issues/766)
|
||||
|
||||
<a name="new-feature"></a>
|
||||
### Can you add feature X to the library?
|
||||
|
@ -2,7 +2,11 @@
|
||||
|
||||
* [node-telegram-bot-api-tutorial by @hosein2398](https://github.com/hosein2398/node-telegram-bot-api-tutorial)
|
||||
* [node-telegram-bot-api-persian-language by @saeedhei](https://github.com/saeedhei/node-telegram-bot-api-persian-language)
|
||||
* [Node.JS: Делаем своего Telegram бота [RUS]](https://archakov.im/post/telegram-bot-on-nodejs.html)
|
||||
* [Node.JS: Делаем своего Telegram бота [RUS]](https://archakov.im/post/telegram-bot-on-nodejs)
|
||||
* [YouTube: Пишем Telegram бота на NodeJS [RUS]](https://www.youtube.com/watch?v=RS1nmDMf69U&list=PL6AOr-PZtK-mM2QC1ixyfa5CtJZGK61aN)
|
||||
|
||||
* [Node.jsでTelegramのチャットボットを作る - Qiita](https://qiita.com/neetshin/items/0e2f6fa3ade41adb77bc)
|
||||
* [Guía: Creación de bots de Telegram en Nodejs [ES]](https://tecnonucleous.com/creacion-de-bots-de-telegram-en-nodejs/)
|
||||
* [node-telegram-bot-api-tutorial:a telegram bot helper to send templates by sms](https://github.com/vito2005/chatManagerTelegramBot)
|
||||
* [Telegram bot using blockchain services](https://ilanolkies.com/post/Telegram-bot-using-blockchain-services)
|
||||
* [How to set webhooks using express local server and NGROK](https://github.com/leobloise/node-telegram-bot-api-wb-tutorial)
|
||||
> Send a PR with useful links **not** listed above
|
||||
|
26
doc/usage.md
26
doc/usage.md
@ -1,9 +1,14 @@
|
||||
# Usage
|
||||
|
||||
* [Events](#events)
|
||||
* [WebHooks](#webhooks)
|
||||
* [Sending files](#sending-files)
|
||||
* [Error handling](#error-handling)
|
||||
- [Usage](#usage)
|
||||
- [Events](#events)
|
||||
- [WebHooks](#webhooks)
|
||||
- [Sending files](#sending-files)
|
||||
- [File Options (metadata)](#file-options-metadata)
|
||||
- [Performance Issue](#performance-issue)
|
||||
- [Error handling](#error-handling)
|
||||
- [Polling errors](#polling-errors)
|
||||
- [WebHook errors](#webhook-errors)
|
||||
|
||||
<a name="events"></a>
|
||||
## Events
|
||||
@ -17,7 +22,7 @@ that emits the following events:
|
||||
`sticker`, `video`, `voice`, `contact`, `location`,
|
||||
`new_chat_members`, `left_chat_member`, `new_chat_title`,
|
||||
`new_chat_photo`, `delete_chat_photo`, `group_chat_created`,
|
||||
`game`, `pinned_message`, `migrate_from_chat_id`, `migrate_to_chat_id`,
|
||||
`game`, `pinned_message`, `poll`, `dice`, `migrate_from_chat_id`, `migrate_to_chat_id`,
|
||||
`channel_chat_created`, `supergroup_chat_created`,
|
||||
`successful_payment`, `invoice`, `video_note`
|
||||
1. **Arguments**: `message` ([Message][message]), `metadata` (`{ type?:string }`)
|
||||
@ -34,9 +39,14 @@ that emits the following events:
|
||||
1. `edited_channel_post_caption`
|
||||
1. `shipping_query`: Received a new incoming shipping query
|
||||
1. `pre_checkout_query`: Received a new incoming pre-checkout query
|
||||
1. `polling_error`: Error occurred during polling. See [polling errors](#polling-errors).
|
||||
1. `webhook_error`: Error occurred handling a webhook request. See [webhook errors](#webhook-errors).
|
||||
1. `error`: Unexpected error occurred, usually fatal!
|
||||
1. `poll`: Received a new incoming poll
|
||||
2. `poll_answer`: A user has changed their answer in a non-anonymous poll (Only polls sent by the bot)
|
||||
3. `chat_member`: A chat member's status was updated in a chat
|
||||
4. `my_chat_member`: The bot's chat member status was updated in a chat
|
||||
5. `chat_join_request`: A request to join the chat has been sent (The bot must have the can_invite_users administrator right)
|
||||
5. `polling_error`: Error occurred during polling. See [polling errors](#polling-errors).
|
||||
6. `webhook_error`: Error occurred handling a webhook request. See [webhook errors](#webhook-errors).
|
||||
7. `error`: Unexpected error occurred, usually fatal!
|
||||
|
||||
**Tip:** Its much better to listen a specific event rather than on
|
||||
`message` in order to stay safe from the content.
|
||||
|
@ -6,7 +6,7 @@
|
||||
|
||||
const TOKEN = process.env.TELEGRAM_TOKEN || 'YOUR_TELEGRAM_BOT_TOKEN';
|
||||
const TelegramBot = require('..');
|
||||
const request = require('request');
|
||||
const request = require('@cypress/request');
|
||||
const options = {
|
||||
polling: true
|
||||
};
|
||||
|
@ -10,7 +10,6 @@ const port = process.env.PORT;
|
||||
|
||||
const TelegramBot = require('../..');
|
||||
const express = require('express');
|
||||
const bodyParser = require('body-parser');
|
||||
|
||||
// No need to pass any parameters as we will handle the updates with Express
|
||||
const bot = new TelegramBot(TOKEN);
|
||||
@ -21,7 +20,7 @@ bot.setWebHook(`${url}/bot${TOKEN}`);
|
||||
const app = express();
|
||||
|
||||
// parse the updates to JSON
|
||||
app.use(bodyParser.json());
|
||||
app.use(express.json());
|
||||
|
||||
// We are receiving updates at the route below!
|
||||
app.post(`/bot${TOKEN}`, (req, res) => {
|
||||
|
2
index.js
2
index.js
@ -5,7 +5,7 @@
|
||||
*/
|
||||
const majorVersion = parseInt(process.versions.node.split('.')[0], 10);
|
||||
if (majorVersion <= 5) {
|
||||
const deprecate = require('depd')('node-telegram-bot-api');
|
||||
const deprecate = require('./src/utils').deprecate;
|
||||
deprecate('Node.js v5.x and below will no longer be supported in the future');
|
||||
module.exports = require('./lib/telegram');
|
||||
} else {
|
||||
|
498
package.json
498
package.json
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "node-telegram-bot-api",
|
||||
"version": "0.30.0",
|
||||
"version": "0.68.0",
|
||||
"description": "Telegram Bot API",
|
||||
"main": "./index.js",
|
||||
"directories": {
|
||||
@ -29,17 +29,15 @@
|
||||
"node": ">=0.12"
|
||||
},
|
||||
"dependencies": {
|
||||
"@cypress/request": "^3.0.8",
|
||||
"@cypress/request-promise": "^5.0.0",
|
||||
"array.prototype.findindex": "^2.0.2",
|
||||
"bl": "^1.2.1",
|
||||
"bluebird": "^3.5.1",
|
||||
"debug": "^3.1.0",
|
||||
"depd": "^1.1.1",
|
||||
"bl": "^1.2.3",
|
||||
"debug": "^3.2.7",
|
||||
"eventemitter3": "^3.0.0",
|
||||
"file-type": "^3.9.0",
|
||||
"mime": "^1.6.0",
|
||||
"pump": "^2.0.0",
|
||||
"request": "^2.83.0",
|
||||
"request-promise": "^4.2.2"
|
||||
"pump": "^2.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"babel-cli": "^6.26.0",
|
||||
@ -54,7 +52,6 @@
|
||||
"babel-preset-es2015": "^6.24.1",
|
||||
"babel-register": "^6.26.0",
|
||||
"concat-stream": "^1.6.0",
|
||||
"contributor": "^0.1.25",
|
||||
"eslint": "^2.13.1",
|
||||
"eslint-config-airbnb": "^6.2.0",
|
||||
"eslint-plugin-mocha": "^4.11.0",
|
||||
@ -73,484 +70,5 @@
|
||||
"bugs": {
|
||||
"url": "https://github.com/yagop/node-telegram-bot-api/issues"
|
||||
},
|
||||
"homepage": "https://github.com/yagop/node-telegram-bot-api",
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Oleg",
|
||||
"email": null,
|
||||
"url": "https://github.com/olegmdev",
|
||||
"contributions": 1,
|
||||
"additions": 1,
|
||||
"deletions": 0,
|
||||
"hireable": true
|
||||
},
|
||||
{
|
||||
"name": "Archakov Dennis",
|
||||
"email": null,
|
||||
"url": "https://github.com/Archakov06",
|
||||
"contributions": 1,
|
||||
"additions": 1,
|
||||
"deletions": 0,
|
||||
"hireable": true
|
||||
},
|
||||
{
|
||||
"name": "drGOD",
|
||||
"email": null,
|
||||
"url": "https://github.com/drGOD",
|
||||
"contributions": 1,
|
||||
"additions": 1,
|
||||
"deletions": 0,
|
||||
"hireable": null
|
||||
},
|
||||
{
|
||||
"name": "MCSH",
|
||||
"email": null,
|
||||
"url": "https://github.com/MCSH",
|
||||
"contributions": 1,
|
||||
"additions": 2,
|
||||
"deletions": 1,
|
||||
"hireable": true
|
||||
},
|
||||
{
|
||||
"name": "Aaron Meese",
|
||||
"email": null,
|
||||
"url": "https://github.com/ajmeese7",
|
||||
"contributions": 1,
|
||||
"additions": 4,
|
||||
"deletions": 4,
|
||||
"hireable": true
|
||||
},
|
||||
{
|
||||
"name": "Misha",
|
||||
"email": null,
|
||||
"url": "https://github.com/mnb3000",
|
||||
"contributions": 1,
|
||||
"additions": 24,
|
||||
"deletions": 12,
|
||||
"hireable": null
|
||||
},
|
||||
{
|
||||
"name": "Savely Krasovsky",
|
||||
"email": null,
|
||||
"url": "https://github.com/L11R",
|
||||
"contributions": 1,
|
||||
"additions": 297,
|
||||
"deletions": 1,
|
||||
"hireable": null
|
||||
},
|
||||
{
|
||||
"name": "Victor Le",
|
||||
"email": null,
|
||||
"url": "https://github.com/Coac",
|
||||
"contributions": 1,
|
||||
"additions": 1,
|
||||
"deletions": 1,
|
||||
"hireable": null
|
||||
},
|
||||
{
|
||||
"name": null,
|
||||
"email": null,
|
||||
"url": "https://github.com/kucherenkovova",
|
||||
"contributions": 1,
|
||||
"additions": 1,
|
||||
"deletions": 1,
|
||||
"hireable": null
|
||||
},
|
||||
{
|
||||
"name": "Guidone",
|
||||
"email": null,
|
||||
"url": "https://github.com/guidone",
|
||||
"contributions": 1,
|
||||
"additions": 1,
|
||||
"deletions": 0,
|
||||
"hireable": true
|
||||
},
|
||||
{
|
||||
"name": "Jaakko Lipsanen",
|
||||
"email": null,
|
||||
"url": "https://github.com/JaakkoLipsanen",
|
||||
"contributions": 1,
|
||||
"additions": 3,
|
||||
"deletions": 3,
|
||||
"hireable": null
|
||||
},
|
||||
{
|
||||
"name": "Fabio Zuber",
|
||||
"email": null,
|
||||
"url": "https://github.com/Sirius-A",
|
||||
"contributions": 1,
|
||||
"additions": 12,
|
||||
"deletions": 0,
|
||||
"hireable": null
|
||||
},
|
||||
{
|
||||
"name": "Evgeny Bondarenko",
|
||||
"email": null,
|
||||
"url": "https://github.com/jehy",
|
||||
"contributions": 1,
|
||||
"additions": 8,
|
||||
"deletions": 8,
|
||||
"hireable": true
|
||||
},
|
||||
{
|
||||
"name": "Anton Mironov",
|
||||
"email": null,
|
||||
"url": "https://github.com/mironov",
|
||||
"contributions": 1,
|
||||
"additions": 51,
|
||||
"deletions": 15,
|
||||
"hireable": null
|
||||
},
|
||||
{
|
||||
"name": "Daniil Yastremskiy",
|
||||
"email": null,
|
||||
"url": "https://github.com/TheBeastOfCaerbannog",
|
||||
"contributions": 1,
|
||||
"additions": 36,
|
||||
"deletions": 0,
|
||||
"hireable": true
|
||||
},
|
||||
{
|
||||
"name": "Nikolay Ershov",
|
||||
"email": null,
|
||||
"url": "https://github.com/Ni2c2k",
|
||||
"contributions": 1,
|
||||
"additions": 4,
|
||||
"deletions": 4,
|
||||
"hireable": null
|
||||
},
|
||||
{
|
||||
"name": "Alexander Tarmolov",
|
||||
"email": null,
|
||||
"url": "https://github.com/tarmolov",
|
||||
"contributions": 1,
|
||||
"additions": 5,
|
||||
"deletions": 0,
|
||||
"hireable": null
|
||||
},
|
||||
{
|
||||
"name": null,
|
||||
"email": null,
|
||||
"url": "https://github.com/GingerPlusPlus",
|
||||
"contributions": 1,
|
||||
"additions": 6,
|
||||
"deletions": 2,
|
||||
"hireable": null
|
||||
},
|
||||
{
|
||||
"name": "Mikhail Burshteyn",
|
||||
"email": null,
|
||||
"url": "https://github.com/m-burst",
|
||||
"contributions": 1,
|
||||
"additions": 12,
|
||||
"deletions": 5,
|
||||
"hireable": null
|
||||
},
|
||||
{
|
||||
"name": "Sergey Bogdanov",
|
||||
"email": null,
|
||||
"url": "https://github.com/desunit",
|
||||
"contributions": 1,
|
||||
"additions": 1,
|
||||
"deletions": 1,
|
||||
"hireable": null
|
||||
},
|
||||
{
|
||||
"name": "Ola Flisbäck",
|
||||
"email": null,
|
||||
"url": "https://github.com/oflisback",
|
||||
"contributions": 1,
|
||||
"additions": 3,
|
||||
"deletions": 3,
|
||||
"hireable": true
|
||||
},
|
||||
{
|
||||
"name": "Horus Lugo",
|
||||
"email": null,
|
||||
"url": "https://github.com/HorusGoul",
|
||||
"contributions": 1,
|
||||
"additions": 108,
|
||||
"deletions": 1,
|
||||
"hireable": true
|
||||
},
|
||||
{
|
||||
"name": "Conor Fennell",
|
||||
"email": null,
|
||||
"url": "https://github.com/conorfennell",
|
||||
"contributions": 1,
|
||||
"additions": 50,
|
||||
"deletions": 1,
|
||||
"hireable": null
|
||||
},
|
||||
{
|
||||
"name": "Serhii Dmytruk",
|
||||
"email": null,
|
||||
"url": "https://github.com/imserhii",
|
||||
"contributions": 1,
|
||||
"additions": 35,
|
||||
"deletions": 1,
|
||||
"hireable": null
|
||||
},
|
||||
{
|
||||
"name": "Aleksandr L.",
|
||||
"email": null,
|
||||
"url": "https://github.com/w-site",
|
||||
"contributions": 1,
|
||||
"additions": 24,
|
||||
"deletions": 0,
|
||||
"hireable": null
|
||||
},
|
||||
{
|
||||
"name": "Matthew Brandly",
|
||||
"email": null,
|
||||
"url": "https://github.com/brandly",
|
||||
"contributions": 1,
|
||||
"additions": 1,
|
||||
"deletions": 1,
|
||||
"hireable": null
|
||||
},
|
||||
{
|
||||
"name": "Patricio López Juri",
|
||||
"email": null,
|
||||
"url": "https://github.com/mrpatiwi",
|
||||
"contributions": 1,
|
||||
"additions": 49,
|
||||
"deletions": 2,
|
||||
"hireable": true
|
||||
},
|
||||
{
|
||||
"name": "Anton",
|
||||
"email": null,
|
||||
"url": "https://github.com/Feverqwe",
|
||||
"contributions": 1,
|
||||
"additions": 23,
|
||||
"deletions": 5,
|
||||
"hireable": true
|
||||
},
|
||||
{
|
||||
"name": "Guido García",
|
||||
"email": null,
|
||||
"url": "https://github.com/palmerabollo",
|
||||
"contributions": 1,
|
||||
"additions": 1,
|
||||
"deletions": 1,
|
||||
"hireable": true
|
||||
},
|
||||
{
|
||||
"name": "Sebastian Troć",
|
||||
"email": null,
|
||||
"url": "https://github.com/SebastianTroc",
|
||||
"contributions": 1,
|
||||
"additions": 1,
|
||||
"deletions": 1,
|
||||
"hireable": null
|
||||
},
|
||||
{
|
||||
"name": "CapacitorSet",
|
||||
"email": null,
|
||||
"url": "https://github.com/CapacitorSet",
|
||||
"contributions": 2,
|
||||
"additions": 110,
|
||||
"deletions": 2,
|
||||
"hireable": true
|
||||
},
|
||||
{
|
||||
"name": "Plusb Preco",
|
||||
"email": null,
|
||||
"url": "https://github.com/preco21",
|
||||
"contributions": 2,
|
||||
"additions": 111,
|
||||
"deletions": 200,
|
||||
"hireable": null
|
||||
},
|
||||
{
|
||||
"name": "Jishnu Mohan",
|
||||
"email": null,
|
||||
"url": "https://github.com/jishnu7",
|
||||
"contributions": 2,
|
||||
"additions": 84,
|
||||
"deletions": 0,
|
||||
"hireable": true
|
||||
},
|
||||
{
|
||||
"name": "TJ Horner",
|
||||
"email": null,
|
||||
"url": "https://github.com/tjhorner",
|
||||
"contributions": 2,
|
||||
"additions": 223,
|
||||
"deletions": 1,
|
||||
"hireable": null
|
||||
},
|
||||
{
|
||||
"name": "Alex Godko",
|
||||
"email": null,
|
||||
"url": "https://github.com/koloboid",
|
||||
"contributions": 2,
|
||||
"additions": 2,
|
||||
"deletions": 2,
|
||||
"hireable": true
|
||||
},
|
||||
{
|
||||
"name": "Dardan Neziri",
|
||||
"email": null,
|
||||
"url": "https://github.com/knock-in",
|
||||
"contributions": 2,
|
||||
"additions": 22,
|
||||
"deletions": 16,
|
||||
"hireable": true
|
||||
},
|
||||
{
|
||||
"name": "Jérémy Gotteland",
|
||||
"email": null,
|
||||
"url": "https://github.com/Tketa",
|
||||
"contributions": 2,
|
||||
"additions": 81,
|
||||
"deletions": 3,
|
||||
"hireable": null
|
||||
},
|
||||
{
|
||||
"name": "Iiro Jäppinen",
|
||||
"email": null,
|
||||
"url": "https://github.com/iiroj",
|
||||
"contributions": 2,
|
||||
"additions": 40,
|
||||
"deletions": 0,
|
||||
"hireable": null
|
||||
},
|
||||
{
|
||||
"name": null,
|
||||
"email": null,
|
||||
"url": "https://github.com/evolun",
|
||||
"contributions": 2,
|
||||
"additions": 7,
|
||||
"deletions": 3,
|
||||
"hireable": null
|
||||
},
|
||||
{
|
||||
"name": "Vitaly Aminev",
|
||||
"email": null,
|
||||
"url": "https://github.com/AVVS",
|
||||
"contributions": 2,
|
||||
"additions": 1065,
|
||||
"deletions": 1001,
|
||||
"hireable": true
|
||||
},
|
||||
{
|
||||
"name": "Cristian Baldi",
|
||||
"email": null,
|
||||
"url": "https://github.com/crisbal",
|
||||
"contributions": 2,
|
||||
"additions": 26,
|
||||
"deletions": 1,
|
||||
"hireable": true
|
||||
},
|
||||
{
|
||||
"name": "Vítor Augusto da Silva Vasconcellos",
|
||||
"email": null,
|
||||
"url": "https://github.com/HeavenVolkoff",
|
||||
"contributions": 2,
|
||||
"additions": 12,
|
||||
"deletions": 0,
|
||||
"hireable": null
|
||||
},
|
||||
{
|
||||
"name": "Rey",
|
||||
"email": null,
|
||||
"url": "https://github.com/reyy",
|
||||
"contributions": 2,
|
||||
"additions": 34,
|
||||
"deletions": 25,
|
||||
"hireable": null
|
||||
},
|
||||
{
|
||||
"name": "Ivan Skorokhodov",
|
||||
"email": null,
|
||||
"url": "https://github.com/universome",
|
||||
"contributions": 3,
|
||||
"additions": 219,
|
||||
"deletions": 5,
|
||||
"hireable": null
|
||||
},
|
||||
{
|
||||
"name": "Rafael Kr",
|
||||
"email": null,
|
||||
"url": "https://github.com/RafaelKr",
|
||||
"contributions": 3,
|
||||
"additions": 3,
|
||||
"deletions": 2,
|
||||
"hireable": null
|
||||
},
|
||||
{
|
||||
"name": null,
|
||||
"email": null,
|
||||
"url": "https://github.com/EXL",
|
||||
"contributions": 4,
|
||||
"additions": 4,
|
||||
"deletions": 4,
|
||||
"hireable": true
|
||||
},
|
||||
{
|
||||
"name": "Riddler",
|
||||
"email": null,
|
||||
"url": "https://github.com/Waterloo",
|
||||
"contributions": 3,
|
||||
"additions": 64,
|
||||
"deletions": 2,
|
||||
"hireable": true
|
||||
},
|
||||
{
|
||||
"name": "Chris54721",
|
||||
"email": null,
|
||||
"url": "https://github.com/chris54721",
|
||||
"contributions": 5,
|
||||
"additions": 22,
|
||||
"deletions": 6,
|
||||
"hireable": null
|
||||
},
|
||||
{
|
||||
"name": "Ilias Ismanalijev",
|
||||
"email": null,
|
||||
"url": "https://github.com/Illyism",
|
||||
"contributions": 7,
|
||||
"additions": 140,
|
||||
"deletions": 10,
|
||||
"hireable": true
|
||||
},
|
||||
{
|
||||
"name": "Gocho Mugo",
|
||||
"email": null,
|
||||
"url": "https://github.com/GochoMugo",
|
||||
"contributions": 152,
|
||||
"additions": 7186,
|
||||
"deletions": 3367,
|
||||
"hireable": true
|
||||
},
|
||||
{
|
||||
"name": "Mohammed Sohail",
|
||||
"email": null,
|
||||
"url": "https://github.com/kamikazechaser",
|
||||
"contributions": 12,
|
||||
"additions": 523,
|
||||
"deletions": 127,
|
||||
"hireable": true
|
||||
},
|
||||
{
|
||||
"name": "Yago",
|
||||
"email": null,
|
||||
"url": "https://github.com/yagop",
|
||||
"contributions": 197,
|
||||
"additions": 3023,
|
||||
"deletions": 1177,
|
||||
"hireable": true
|
||||
},
|
||||
{
|
||||
"name": "Sedric Heidarizarei",
|
||||
"email": null,
|
||||
"url": "https://github.com/saeedhei",
|
||||
"contributions": 1,
|
||||
"additions": 1,
|
||||
"deletions": 0,
|
||||
"hireable": null
|
||||
}
|
||||
]
|
||||
}
|
||||
"homepage": "https://github.com/yagop/node-telegram-bot-api"
|
||||
}
|
@ -30,7 +30,10 @@ exports.FatalError = class FatalError extends exports.BaseError {
|
||||
const error = (typeof data === 'string') ? null : data;
|
||||
const message = error ? error.message : data;
|
||||
super('EFATAL', message);
|
||||
if (error) this.stack = error.stack;
|
||||
if (error) {
|
||||
this.stack = error.stack;
|
||||
this.cause = error;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
4334
src/telegram.js
4334
src/telegram.js
File diff suppressed because it is too large
Load Diff
@ -1,6 +1,6 @@
|
||||
const errors = require('./errors');
|
||||
const debug = require('debug')('node-telegram-bot-api');
|
||||
const deprecate = require('depd')('node-telegram-bot-api');
|
||||
const deprecate = require('./utils').deprecate;
|
||||
const ANOTHER_WEB_HOOK_USED = 409;
|
||||
|
||||
|
||||
|
@ -4,8 +4,6 @@ const https = require('https');
|
||||
const http = require('http');
|
||||
const fs = require('fs');
|
||||
const bl = require('bl');
|
||||
const Promise = require('bluebird');
|
||||
|
||||
|
||||
class TelegramBotWebHook {
|
||||
/**
|
||||
@ -52,12 +50,16 @@ class TelegramBotWebHook {
|
||||
if (this.isOpen()) {
|
||||
return Promise.resolve();
|
||||
}
|
||||
return new Promise(resolve => {
|
||||
return new Promise((resolve, reject) => {
|
||||
this._webServer.listen(this.options.port, this.options.host, () => {
|
||||
debug('WebHook listening on port %s', this.options.port);
|
||||
this._open = true;
|
||||
return resolve();
|
||||
});
|
||||
|
||||
this._webServer.once('error', (err) => {
|
||||
reject(err);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
3
src/utils.js
Normal file
3
src/utils.js
Normal file
@ -0,0 +1,3 @@
|
||||
const util = require('util');
|
||||
// Native deprecation warning
|
||||
exports.deprecate = (msg) => util.deprecate(() => { }, msg, 'node-telegram-bot-api')();
|
Binary file not shown.
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 14 KiB |
BIN
test/data/photo.png
Normal file
BIN
test/data/photo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 14 KiB |
Binary file not shown.
Before Width: | Height: | Size: 182 KiB After Width: | Height: | Size: 52 KiB |
BIN
test/data/sticker_thumb.png
Normal file
BIN
test/data/sticker_thumb.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 14 KiB |
1770
test/telegram.js
1770
test/telegram.js
File diff suppressed because it is too large
Load Diff
@ -81,8 +81,7 @@ exports = module.exports = {
|
||||
|
||||
const assert = require('assert');
|
||||
const http = require('http');
|
||||
const Promise = require('bluebird');
|
||||
const request = require('request-promise');
|
||||
const request = require('@cypress/request-promise');
|
||||
const statics = require('node-static');
|
||||
|
||||
const servers = {};
|
||||
|
Loading…
x
Reference in New Issue
Block a user