2
0
mirror of https://github.com/yagop/node-telegram-bot-api synced 2025-08-22 01:47:25 +00:00

124 Commits

Author SHA1 Message Date
danielperez9430
8df6e6583e test: CopyMessage and getMyDefaultAdministratorRights 2024-02-21 00:58:40 +01:00
Sp3rick
cceea22a93
feat: Add methods deleteMessages and copyMessages
* Added setMessageReaction method
* Added setMessageReaction method

* Added and implemented _fixReplyParameters

---------

Co-authored-by: Sp3rick <your_email@example.com>
2024-02-20 19:47:13 +01:00
Daniel Pérez Fernández
12d4d25af4
deps: Change request to @cypress/request (#1145) 2023-10-25 12:31:46 +02:00
Daniel Pérez Fernández
542002ec0d
feat: Telegram Bot API Support 6.6 + 6.7 [WIP] (#1069)
* feat: Telegram Bot API Support

* refactor: uploadStickerFile

* feat: Support Telegram Bot API v6.7

* fix: tests

* feat: Test for deleteStickerSet
2023-08-23 00:49:09 +02:00
Daniel Pérez Fernández
ab5928669b
feat: Telegram Bot API v6.3 (#1020)
* feat: Telegram Topics

* update docs

* fix: test

* update: docs
2022-11-06 02:54:23 +01:00
Daniel Pérez Fernández
fe4afd6533
feat: Support Bot API v6.2 (#996)
* docs: Update readme and add Typescript types

* feat: getCustomEmojiStickers

* feat: Add getCustomEmojiStickers test + fix other test

* fix: docs

* docs: Update changelog + docs
2022-08-15 21:44:44 +02:00
Daniel Pérez Fernández
f50cf982c7
Hotfix: tests + modify order src/telegram + docs (#988)
* test: stopPoll

* test: setChatStickerSet and deleteChatStickerSet

* refactor: src/telegram.js

* Remove legacy methods:
 - getChatMembersCount
 - getChatMembersCount
 - kickChatMember

* Remove mandatory param  “start_parameter” from sendInvoice, because actually is a optional param

* docs: Update docs API

* docs: Update

* fix: addStickerToSet

* fix: stringify

* refactor: And add deleteStickerFromSet + setStickerPositionInSet

* fix: eslint

* docs: Update changelog
2022-07-19 12:43:39 +02:00
Daniel Pérez Fernández
449f03f786
feat: Remove bluebird + depd (#987)
* feat: Remove bluebird

* docs: Update

* remove depd ans use node native deprecate msg warnings

* fix: correct util import name

* remove: contributor dev dependencie and add list of contributors in the readme
2022-07-18 08:41:31 +02:00
Daniel Pérez Fernández
d28875154c
feat: Telegram Bot API 6.1 and bug fixes (#977)
## [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
2022-06-22 21:11:16 +02:00
danielperez9430
280a58c0e2 Support for Telegram Bot API 6.0
* 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
2022-04-23 01:01:34 +02:00
danielperez9430
5ff22148d8 feat: banChatSenderChat and unbanChatSenderChat methods 2021-12-07 16:42:00 +01:00
danielperez9430
19b5fc5bd3 fix(Test): Update test for new chat invite link format 2021-12-07 16:41:35 +01:00
Daniel Pérez Fernández
5a4787884e
Telegram Bot API v5.3 Support (#886)
* Add new method sendPoll

* getMyCommands

* setMyCommands

* Update doc/api

* 1# Fix Test sendPhoto

The sendPhoto method does not support .gif files, use sendAnimation.

This fix remplace .gif file by .png

* CustomTitle and ChatPermissions support

setChatAdministratorCustomTitle
setChatPermissions

* Update Readme

Update Badge Telegram API Version

* Minor Fix and Fix setChatPhoto

The Telegram Bots api has a bug that they are fixing and gives problems with the previous image. While they don't fix it, the image replacement is the fastest solution

* Minor Fix and Add Test

Fixed setChatPermissions

Test:
- sendDice
- getMyCommands
- setMyCommands
- setChatAdministratorCustomTitle
- setChatPermissions

* Update Changelog and Package.json version

* Fix typos in Changelog

* Add support for poll_answer

From: https://github.com/yagop/node-telegram-bot-api/pull/777

* Add JieJiSS contribution in Changelog

* Add sendPoll Test

* Add unpinAllChatMessages Support

* Add copyMessage support

* Add close and logOut Support

* Add Test + Minor fixes

* Update CHANGELOG

Update version 0.50.1

* Update Readme Bot API Badge

* Update Version to 0.51.0

* Bot API 5.1 support Improved Invite Links

- Added the method createChatInviteLink
- Added the method editChatInviteLink
- Added the method revokeChatInviteLink

* Update version to 0.52.0 and new tests

- Update Changelog
- New Test
- Update version to 0.52.0

* Add new messageTypes

-  voice_chat_started
-  voice_chat_ended
- voice_chat_participants_invited

* Update Changelog and add new MessageType

* New messageTypes and updates

Add support for new messageTypes:
  - chat_invite_link
  - chat_member_updated

Add support for new updates:
 - my_chat_member
 - chat_member

* Telegram Bot API 5.2 Support

* Update Changelog + readme

* Fix Changelog

* Telegram Bot API v5.3

Add new methods:
* deleteMyCommands
* banChatMember
* getChatMemberCount

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

New Test:
  * deleteMyCommands
  * banChatMember
  * getChatMemberCount

* docs: gen on linux

Co-authored-by: Mohammed Sohail <sohailsameja@gmail.com>
2021-06-29 11:38:33 +03:00
Daniel Pérez Fernández
de76dcd2cb
Bot API 5.1: Support Improved Invite Links and new messageTypes (#859)
* Add new method sendPoll

* getMyCommands

* setMyCommands

* Update doc/api

* 1# Fix Test sendPhoto

The sendPhoto method does not support .gif files, use sendAnimation.

This fix remplace .gif file by .png

* CustomTitle and ChatPermissions support

setChatAdministratorCustomTitle
setChatPermissions

* Update Readme

Update Badge Telegram API Version

* Minor Fix and Fix setChatPhoto

The Telegram Bots api has a bug that they are fixing and gives problems with the previous image. While they don't fix it, the image replacement is the fastest solution

* Minor Fix and Add Test

Fixed setChatPermissions

Test:
- sendDice
- getMyCommands
- setMyCommands
- setChatAdministratorCustomTitle
- setChatPermissions

* Update Changelog and Package.json version

* Fix typos in Changelog

* Add support for poll_answer

From: https://github.com/yagop/node-telegram-bot-api/pull/777

* Add JieJiSS contribution in Changelog

* Add sendPoll Test

* Add unpinAllChatMessages Support

* Add copyMessage support

* Add close and logOut Support

* Add Test + Minor fixes

* Update CHANGELOG

Update version 0.50.1

* Update Readme Bot API Badge

* Update Version to 0.51.0

* Bot API 5.1 support Improved Invite Links

- Added the method createChatInviteLink
- Added the method editChatInviteLink
- Added the method revokeChatInviteLink

* Update version to 0.52.0 and new tests

- Update Changelog
- New Test
- Update version to 0.52.0

* Add new messageTypes

-  voice_chat_started
-  voice_chat_ended
- voice_chat_participants_invited

* Update Changelog and add new MessageType

* New messageTypes and updates

Add support for new messageTypes:
  - chat_invite_link
  - chat_member_updated

Add support for new updates:
 - my_chat_member
 - chat_member
2021-03-29 17:37:10 +03:00
Daniel Pérez Fernández
5d30b6a134
Telegram Bot API 5.0 Support (#835)
* Add new method sendPoll

* getMyCommands

* setMyCommands

* Update doc/api

* 1# Fix Test sendPhoto

The sendPhoto method does not support .gif files, use sendAnimation.

This fix remplace .gif file by .png

* CustomTitle and ChatPermissions support

setChatAdministratorCustomTitle
setChatPermissions

* Update Readme

Update Badge Telegram API Version

* Minor Fix and Fix setChatPhoto

The Telegram Bots api has a bug that they are fixing and gives problems with the previous image. While they don't fix it, the image replacement is the fastest solution

* Minor Fix and Add Test

Fixed setChatPermissions

Test:
- sendDice
- getMyCommands
- setMyCommands
- setChatAdministratorCustomTitle
- setChatPermissions

* Update Changelog and Package.json version

* Fix typos in Changelog

* Add support for poll_answer

From: https://github.com/yagop/node-telegram-bot-api/pull/777

* Add JieJiSS contribution in Changelog

* Add sendPoll Test

* Add unpinAllChatMessages Support

* Add copyMessage support

* Add close and logOut Support

* Add Test + Minor fixes

* Update CHANGELOG

Update version 0.50.1

* Update Readme Bot API Badge

* Update Version to 0.51.0
2020-12-10 13:47:22 +03:00
Mohammed Sohail
93eaad082c
test: update removeTextListener 2020-05-12 12:42:44 +05:30
Daniel Pérez Fernández
1bae9c2964
Add new method sendDice, getMyCommands, setMyCommands and more (#796)
* Add new method sendPoll

* getMyCommands

* setMyCommands

* Update doc/api

* 1# Fix Test sendPhoto

The sendPhoto method does not support .gif files, use sendAnimation.

This fix remplace .gif file by .png

* CustomTitle and ChatPermissions support

setChatAdministratorCustomTitle
setChatPermissions

* Update Readme

Update Badge Telegram API Version

* Minor Fix and Fix setChatPhoto

The Telegram Bots api has a bug that they are fixing and gives problems with the previous image. While they don't fix it, the image replacement is the fastest solution

* Minor Fix and Add Test

Fixed setChatPermissions

Test:
- sendDice
- getMyCommands
- setMyCommands
- setChatAdministratorCustomTitle
- setChatPermissions

* Update Changelog and Package.json version

* Fix typos in Changelog

* Add support for poll_answer

From: https://github.com/yagop/node-telegram-bot-api/pull/777

* Add JieJiSS contribution in Changelog

* Add sendPoll Test
2020-05-12 09:31:30 +05:30
Mohammed Sohail
667380f1de
test: skip sendContact
- rate limits still apply
2019-10-15 21:50:06 +05:30
Mohammed Sohail
1f1e46e01b
test: skip stopMessageLiveLocation
- unexplicable error that is probabilistic in natuu
2019-10-15 20:19:44 +05:30
Mohammed Sohail
7feb88464d
test: update test suite
- remove unecessary tests for node v5 and below
- fix tg side errors when running tests i.e. currency format
- enable force builds on pr
2019-10-15 15:03:20 +05:30
Mohammed Sohail Sameja
47bea20539
[Tests] Update
- Set max-len at 200
- Fix eslint errors
2018-10-31 21:34:24 +05:30
Mohammed Sohail Sameja
6a7c088a63
[v4.0] Add tests and add minor improvement
Follow up update to #625

 - Tests for both methods (sendAnimation, editMediaMessage) have been
 added. editMediaMessage is nested under sendAnimation, hence both tests
 are technically under a single block.

- Add an improvement/minor fix to the editMediaMessage method, where we
now stringify the first parameter (media) object interally within the
library. This allows the lib user to simply pass an object as the 1st
param without stringifying it.
2018-10-26 15:03:52 +05:30
GochoMugo
0781ae685d
src/telegram: Add TelegramBot#sendMediaGroup()
References:

  * Telegram API documentation: https://core.telegram.org/bots/api#sendmediagroup
2017-12-20 11:59:39 +03:00
GochoMugo
1a08221174
src/telegram: Improve sending files (#471)
References:

  * PR: https://github.com/yagop/node-telegram-bot-api/pull/471
2017-12-20 11:03:00 +03:00
GochoMugo
4051117ed0
src: Minor reorganisation, fixes 2017-12-11 18:24:22 +03:00
GochoMugo
04e8b892aa
src/telegram: Emit 'info' on stream from TelegramBot#getFileStream() 2017-12-08 19:25:56 +03:00
GochoMugo
b968e893d3
src/telegram: Populate Stream#path from TelegramBot#getFileStream() 2017-12-08 19:18:55 +03:00
GochoMugo
b91409a2b6
test: Fix path to ssl key, cert 2017-12-07 13:05:48 +03:00
GochoMugo
d9692f45a9
src/telegram: Add TelegramBot#getFileStream()
References:

  * FR: https://github.com/yagop/node-telegram-bot-api/issues/442
2017-12-07 12:04:46 +03:00
GochoMugo
3b603b1dbd
src: Minor fix, complete TODO 2017-12-05 13:59:32 +03:00
GochoMugo
b774ff436f src: Minor fixes 2017-12-05 13:56:07 +03:00
GochoMugo
d6083e4327 src: Support file options, defaults in sending files 2017-12-05 13:39:17 +03:00
GochoMugo
59378d381b
test: Add tests 2017-11-27 06:33:59 +03:00
CapacitorSet
8fd243e6a8
src/telegram: Add TelegramBot#uploadStickerFile
Notes:

    * Closes PR #430

References:

    * FR: https://github.com/yagop/node-telegram-bot-api/issues/407
    * PR: https://github.com/yagop/node-telegram-bot-api/pull/430
    * PR-by: @CapacitorSet
2017-10-07 15:08:18 +03:00
CapacitorSet
a2d85b889a
src/telegram: Add TelegramBot#getStickerSet()
References:

    * FR: https://github.com/yagop/node-telegram-bot-api/issues/407
    * PR: https://github.com/yagop/node-telegram-bot-api/pull/429
    * PR-by: @CapacitorSet, @libertylocked
2017-10-07 14:50:25 +03:00
GochoMugo
ef48af49f5
src/telegram: Deprecate auto-enabling Promise cancellation
Side-effects:

  src/telegram: Allow providing custom Promise constructor

References:

  * BR: https://github.com/yagop/node-telegram-bot-api/issues/319
2017-08-25 18:39:13 +03:00
GochoMugo
5f7d306f60
test: Skip tests on TelegramBot#sendVideoNote()
References:

  * BR: https://github.com/yagop/node-telegram-bot-api/issues/365
2017-08-06 12:22:43 +03:00
Yago
f20a7f4ee5 Uppps, fix "{" 2017-07-05 23:51:03 +02:00
Yago
0bf148adb9 Check if test are running in CI and skip invoice if so 2017-07-05 23:47:05 +02:00
Yago
e1f8fb25ec Skip sendInvoice test method 2017-07-05 23:30:14 +02:00
GochoMugo
8ed0a2dcef
test: Fix test for TelegramBot#setChatDescription()
Bug:

  We MUST ensure we update the description. If the description
  is unchanged, an error is thrown by the API.

Fix:

  Append a random number to the description.
2017-07-05 11:38:39 +03:00
GochoMugo
96b90c2d56
src/telegram: Add tests for Bot API v3.1 methods
References:

  * PR: https://github.com/yagop/node-telegram-bot-api/pull/369
  * PR-by: @kamikazechaser
  * Parent-PR: https://github.com/yagop/node-telegram-bot-api/pull/362
  * Parent-PR-by: @Lord-Protector
2017-07-05 09:09:42 +03:00
Mohammed Sohail
fe527957e0 src/telegram: Support API v3 Payments (#335)
References:

   * API v3 Payments: https://core.telegram.org/bots/payments
    * PR: https://github.com/yagop/node-telegram-bot-api/pull/335
    * PR-by: @kamikazechaser 
    * API v3 progress tracker: https://github.com/yagop/node-telegram-bot-api/issues/332
2017-05-26 17:59:22 +03:00
GochoMugo
cda9d8d597
src/telegram: Add deleteMessage method
References:

  * API deleteMessage method: https://core.telegram.org/bots/api#deleteMessage
  * PR: https://github.com/yagop/node-telegram-bot-api/pull/324
  * PR-by: @JonasFowl
  * API v3: https://github.com/yagop/node-telegram-bot-api/issues/332
2017-05-26 16:29:02 +03:00
Mohammed Sohail
942fc4854b src/telegram: Add sendVideoNote method (#330)
References:

    * API sendVideoNote method: https://core.telegram.org/bots/api#sendvideonote
    * PR: https://github.com/yagop/node-telegram-bot-api/pull/330
    * PR-by: @kamikazechaser 
    * API v3: https://github.com/yagop/node-telegram-bot-api/issues/332
2017-05-26 16:25:34 +03:00
GochoMugo
64bbefd898
test: Fix tests for 'TelegramBot#onText()'
Bug:

  The registered listeners remain in effect even after
  the suite is completed; allowing other suites to trigger
  the listeners.

Fix:

  Perform clean-up before moving to next suite.
2017-05-13 11:34:14 +03:00
GochoMugo
11bcdd3b6a
src/telegram: Add TelegramBot#removeTextListener()
Feature:

  This is the opposite action to `TelegramBot#onText()`.
  It allows removing any previously-registered listeners.

  It is similar to `TelegramBot#removeReplyListener()`.
2017-05-13 11:28:04 +03:00
Fabio Zuber
9f3107b5ab src/telegram: reset state of global regexp (#326)
References:

  * BR: https://github.com/yagop/node-telegram-bot-api/issues/325
  * BR-by: @Sirius-A
  * PR: https://github.com/yagop/node-telegram-bot-api/pull/326
  * PR-by: @Sirius-A
2017-05-13 10:53:21 +03:00
Evgeny Bondarenko
c1fc486225 src: Load transpiled code for Node 5
References:
  * Bug-Report #297: https://github.com/yagop/node-telegram-bot-api/issues/297
  * Bug-Report-by: @jehy
  * PR  #298: https://github.com/yagop/node-telegram-bot-api/pull/298
  * PR-by: @jehy
2017-03-09 17:17:03 +03:00
GochoMugo
130f6940ce
src/polling: Fix bug #284
Bug:

  During polling, deleting the already-set webhook, caused
  the `TelegramBotPolling#_getUpdates()` return an unexpected
  value.

  We expect the method to return an array (in the `.then()` clause).
  However, deleting the webhook returns its value, which is an object,
  from the method `_getUpdates()`.

Fix:

  Simply retry the polling request and return the promise.

Notes:

  Should we use recursion? I do not think so.
  Why? The chances of getting the error (having a webhook set) AGAIN
  is quite rare. And if it happens, there must be some problem with
  different instances invoking polling and webhook simultaneously.
  In that case, we wont struggle to recover from such a scenario.
  User is on their own! Isht!

References:

  * Bug report:   https://github.com/yagop/node-telegram-bot-api/issues/284
  * Reported by:  @dcparga
2017-02-10 12:40:47 +03:00