2
0
mirror of https://github.com/yagop/node-telegram-bot-api synced 2025-08-28 12:57:38 +00:00

496 Commits

Author SHA1 Message Date
GochoMugo
a7972cc6a4
[test] FIX OUR TESTS
Feature:

  Our tests are PASSING!

  NOTE:
  -----
  Before running tests, provide the environment variable,
  TEST_GAME_SHORT_NAME, whose value is the short name of a game
  created for the test bot. It is used in testing methods for
  games, such as TelegramBot#sendGame().
2017-01-02 14:37:39 +03:00
GochoMugo
84329d05b4
[lint] Fix error reported by linter 2017-01-02 14:36:39 +03:00
GochoMugo
d768749e8f
[polling] Fix stopping polling
Bug:

  TelegramBot#stopPolling() fails to clear the timeout
  that is waiting to make the next polling request.
  Thus, if the method is invoked after the timeout has
  already been set up, once the timeout fn is executed,
  another request is made, before polling is stopped in the
  '.finally()' handler of the request!
2017-01-02 14:19:52 +03:00
GochoMugo
6b4ff126f4
[telegram] Allow specifying API Base URL
Feature:

  We can now pass a custom API Base URL to
  be used during making HTTP requests. This is useful in
  proxying requests, or running tests.

  In particular, this library is (almost) ready to
  be used with PWRTelegram API (http://pwrtelegram.xyz/).
2017-01-02 14:05:10 +03:00
GochoMugo
8edd5f4c6d
[polling,webhook] Add methods controlling polling, webhook
Feature:

  For finer control over bot's polling and web-hook, the
  following methods have been added:

  * TelegramBot#isPolling()
  * TelegramBot#openWebHook()
  * TelegramBot#closeWebHook()
  * TelegramBot#hasOpenWebHook()

  Please read README.md for more information on the
  new methods.
2017-01-02 13:58:46 +03:00
GochoMugo
69b059a4d7
[webhook] Allow enabling/disabling webhook auto-open
Feature:

  Currently, if the constructor option 'options.webHook' is passed,
  the bot opens the webHook immediately! There's NO way to disable
  this behavior, which might be useful in cases such as:

  * providing custom webhook parameters without opening the webhook
    immediately

  The new boolean option, 'autoOpen', can now be used to control this
  behavior. For example,

  ```js
  const bot = new TelegramBot(token, {
    webHook: {
      autoOpen: false,
    },
  });
  ```

  If set to 'false', the bot does NOT open the web-hook immediately.
  Currently, there's NO way to open the web-hook in this case.
  I'm working on that. Expect a feature to add a method to open
  the web-hook manually!

  If not provided, its value defaults to 'true'.

Implementation:

  * Backwards-compatible: the behavior of opening the web-hook
    immediately remains, when the parameter is NOT provided.
2017-01-02 13:43:56 +03:00
GochoMugo
e2f095fc52 [polling] Allow enabling/disabling polling auto-start
Feature:

  Currently, if the constructor option 'options.polling' is
  passed, the bot begins polling immediately! There's NO
  way to disable this behavior, which might be useful in
  cases such as:

  * providing custom polling parameters without starting
    the polling immediately

  The boolean option, 'autoStart', can now be used to control this
  behavior. For example,

  ```js
  const bot = new TelegramBot(token, {
    polling: {
      autoStart: false,
    },
  });
  ```

  If set to 'false', the bot does NOT begin polling
  immediately. You'll have to use TelegramBot#initPolling().

  If not provided, its value defaults to 'true'.

Implementation:

  * Backwards-compatible: the behavior of starting polling
    immediately remains, when the parameter is NOT provided
2017-01-02 13:42:12 +03:00
GochoMugo
daab34d98d
Update codebase
Details:

  * Update documentation on constructors and methods
  * Make code more modular
  * Improve code (generally)
2017-01-02 13:04:44 +03:00
GochoMugo
4e5a493cad
v0.25.0 v0.25.0 2016-12-21 17:33:00 +03:00
GochoMugo
7f30aef7b3
[docs] Update docs on API v2.3 updates 2016-12-17 02:19:00 +03:00
Mohammed Sohail
2a4fea42d7 New Update Fields From API v2.3 (#227)
* New Update Fields

bot will now get updates about posts in channels. Added new fields channel_post and edited_channel_post to Update.
2016-12-17 02:12:55 +03:00
GochoMugo
2ff2716ca2
[docs] Add link to docs for more information 2016-11-21 12:34:29 +03:00
Alexander Tarmolov
afd2373351 Proxy extra request options (PR #178) 2016-11-21 12:25:33 +03:00
Plusb Preco
d4a5f5d16c Fix request performance issue (PR #193) 2016-11-21 12:10:18 +03:00
Gocho Mugo
75d940c473 Add simple example in README (PR #54) (#224)
* Fixes the readme with an appropriate example that doesn't crash

Addresses #45

* [docs] Use simple example in Readme

References:

  * Original PR: https://github.com/yagop/node-telegram-bot-api/pull/54

* [docs] Improve the example in the Readme
2016-11-11 16:54:04 +03:00
GochoMugo
578ad1fa13
[doc] Update doc on TelegramBot#sendContact() 2016-11-10 18:17:59 +03:00
GochoMugo
9f79ba8b3b
[pr] PR #124: Merge branch 'master' of https://github.com/Tketa/node-telegram-bot-api into pr/124 2016-11-10 18:12:30 +03:00
GochoMugo
306b492ebf
[pr] PR #169: Merge branch 'pr/169' 2016-11-10 17:33:39 +03:00
GochoMugo
2b5dfe0e84
[pr] Merge branch 'fix-debug-prints' of https://github.com/oflisback/node-telegram-bot-api into pr-169 2016-11-10 17:31:33 +03:00
Gocho Mugo
775977e564 Merge PR #213 from jishnu7/games
Feature:

* Add `getGameHighScores`
2016-11-03 18:53:17 +03:00
Gocho Mugo
8555ab64f8 Merge PR #216 from GingerPlusPlus/master
Feature:

* Add option to ignore further regexes after match is found
2016-11-03 18:51:01 +03:00
GingerPlusPlus
0fb142f6ac Added onlyFirstMatch option 2016-11-03 18:49:13 +03:00
Gocho Mugo
54e34636f9 Merge PR #211 from desunit/master
Closes issues #202 and #207.
2016-11-03 18:40:31 +03:00
Jishnu Mohan
2fa3f68d61 adding getGameHighScores 2016-10-22 16:03:50 +05:30
Sergey Bogdanov
ae2530583d updated request-promise package to eliminate memory leaks 2016-10-19 11:19:20 +03:00
Yago
00d74d13c8 Create CONTRIBUTING.md 2016-10-17 21:43:09 +02:00
Yago
58566d2df5 0.24.0 2016-10-12 12:58:21 +02:00
Yago
2559f6d677 Revert "Fix ES6 syntax errors"
This reverts commit 0ed1efedfb01fdf6948ebcdfccc41aa2e12915f3.
2016-10-12 12:46:54 +02:00
GochoMugo
0ed1efedfb
Fix ES6 syntax errors 2016-10-11 01:01:11 +03:00
GochoMugo
75b36abfeb
Fix errors reported by our linter 2016-10-10 23:04:48 +03:00
GochoMugo
eae1999ad1
Closes #191: Add 'edited_message' event 2016-10-10 23:00:58 +03:00
GochoMugo
8dc3fe82ef
Add 'edited_message' event
Notes:

  Merge branch 'master' of https://github.com/chris54721/node-telegram-bot-api into pr/191

References:

  * PR #191: https://github.com/yagop/node-telegram-bot-api/pull/191
2016-10-10 22:58:09 +03:00
GochoMugo
db3c5c3cc3
Run test for TelegramBot#_formatSendData() on supported Node.js versions
Bug:

  The test for `TelegramBot#_formatSendData()` is only applicable on
  newer versions of Node.js (v6+) that support passing a Buffer
  representation of the path to `fs.createReadStream()`.

Fix:

  If the runtime does NOT supports passing the Buffer argument, do
  NOT run the test on it. This is safe since we are sure that
  `fs.ReadStream.path` will never be a Buffer on the runtime being
  tested.
2016-10-10 16:51:20 +03:00
Gocho Mugo
bf5ca1340b Closes #204: Fix handling fs.readStream.path if it's a buffer 2016-10-10 15:08:15 +03:00
GochoMugo
d35d0ea329
Closes #201: Add initial support for games 2016-10-10 15:04:53 +03:00
GochoMugo
12770e6e95
Add initial support for games
Notes:

  Merge branch 'support-games' of https://github.com/jishnu7/node-telegram-bot-api into pr/201

References:

  * PR #201: https://github.com/yagop/node-telegram-bot-api/pull/201
2016-10-10 15:03:50 +03:00
GochoMugo
ce4decebd8
Closes #186: Add TelegramBot#leaveChat() method 2016-10-10 14:48:28 +03:00
GochoMugo
5a11cce18d
Accompanying doc-updates for PR #186 2016-10-10 14:47:52 +03:00
GochoMugo
394f363465 Implement 'leaveChat'
Notes:

  Merge branch 'feature/leaveChat' of
  https://github.com/GochoMugo/node-telegram-bot-api into pr/186

References:

  * PR #186: https://github.com/yagop/node-telegram-bot-api/pull/186
2016-10-10 14:45:15 +03:00
GochoMugo
dcc3d481e4 Add accompanying minor fixes and doc updates for PR #163 2016-10-10 14:43:16 +03:00
Alex Godko
f50936fd7b Update README.md
Added a word about "callback_query" update
2016-10-10 14:43:16 +03:00
GochoMugo
c4d090dcb3
Closes #163: Mention 'callback_query' in README 2016-10-10 14:32:01 +03:00
GochoMugo
d844ddd15a
Add accompanying minor fixes and doc updates for PR #163 2016-10-10 14:30:54 +03:00
GochoMugo
4c9901e411 Mention "callback_query" in README
Notes:

  Merge branch 'patch-1' of https://github.com/koloboid/node-telegram-bot-api into pr/163

References:

  * PR #163: https://github.com/yagop/node-telegram-bot-api/pull/163
2016-10-10 14:27:20 +03:00
GochoMugo
626f183cb7
Closes #158: Add new methods from the API v2.1 2016-10-10 14:22:20 +03:00
GochoMugo
f5af2bf588
Add accompanying tests, minor fixes and updates for PR #158 2016-10-10 14:21:25 +03:00
GochoMugo
628aa5b2d9 Add new methods from the API v2.1
Notes:

  Merge branch 'master' of https://github.com/HorusGoul/node-telegram-bot-api into pr/158

References:

  * PR #158: https://github.com/yagop/node-telegram-bot-api/pull/158
2016-10-10 13:48:49 +03:00
GochoMugo
74fb4ab181
Closes #144: Add TelegramBot#getChat() method 2016-10-10 13:42:29 +03:00
GochoMugo
f91d426c35
Minor fixes and Docs update for PR #144 2016-10-10 13:41:28 +03:00
GochoMugo
e2eaa3c8db Add TelegramBot#getChat() method
Notes:

  Merge branch 'master' of https://github.com/serhiidmytruk/node-telegram-bot-api into pr/144

References:

  * PR #144: https://github.com/yagop/node-telegram-bot-api/pull/144
2016-10-10 13:34:00 +03:00