2
0
mirror of https://github.com/yagop/node-telegram-bot-api synced 2025-08-29 13:27:44 +00:00

88 Commits

Author SHA1 Message Date
Plusb Preco
a44eb7f1ee docs: Docs improvements (#291)
Feature:

  * Add notes about events in `api` document
  * Update copyright year
  * Cleanup docs

References:

  * Feature request: https://github.com/yagop/node-telegram-bot-api/issues/289
  * PR: https://github.com/yagop/node-telegram-bot-api/pull/291
  * Requested-by: @preco21 
  * PR-by: @preco21
2017-02-15 07:59:56 +03:00
GochoMugo
92506f50e6
doc: Link to the latest documentation 2017-01-30 10:13:31 +03:00
Ni2c2k
535aa56345 doc: Fix links for examples and help in README (#266) 2017-01-25 21:48:38 +03:00
Mohammed Sohail
235ea2276b doc: Add Badge for supported Bot API Version (#264) 2017-01-25 11:46:50 +03:00
GochoMugo
584a388fc5
doc: Add project to community section 2017-01-20 15:11:16 +03:00
GochoMugo
ef3574ee88 doc: Improve project documentation 2017-01-20 09:13:18 +03:00
GochoMugo
a9d6e93622
[telegram] Return error on trying to use Polling, WebHook together
Feature:

  Polling and WebHook are mutually exclusive. Therefore, return an
  error whenever the user tries to start polling, and the instance has
  an open webhook, or user tries to open a webhook, and the instance
  is already polling.
2017-01-11 17:06:04 +03:00
GochoMugo
0c18cda922
[docs] Fix undocumented return value for TelegramBot#setWebHook() 2017-01-11 16:20:07 +03:00
GochoMugo
0d20565bd5
[telegram] Add constructor option, 'filepath'
Feature:

  The constructor option, 'filepath', allows us to remove
  the TelegramBot's behaviour of allowing users to pass in
  file-paths as arguments, as it involves some operations
  that might be (are) strongly against what a programmer wishes
  to achieve with the library.

  Expect this to be documented better in the near future.

Implementation:

  * Backwards compatible: The default behavior is not changed!
2017-01-11 11:06:41 +03:00
GochoMugo
97c8130d93
[webhook,polling] Improve starting, stopping of webhook, polling
Feature:

  The different mechanisms of fetching updates, i.e. polling
  and webhook, have had their implementations improved:

  * the TelegramBot instance needs to create the polling and
    webhook instances once, and when necessary
  * returning promises from TelegramBot#openWebHook() and
    TelegramBot#startPolling() allows more precise control

  Also,

  * TelegramBot#initPolling() is being deprecated in favor of
    TelegramBot#startPolling() to ensure consistency (as the
    opposite action of TelegramBot#stopPolling())
2017-01-09 15:57:34 +03:00
GochoMugo
4735518116
[docs] Mention auto-deletion of webhook during polling 2017-01-09 15:56:28 +03:00
GochoMugo
31a2376a1f
[webhook] Allow passing options to HTTPS server
Feature:

  We shall allow passing more options to the HTTP server,
  in `https.createServer()`.

  We are using a new property, `https`, to avoid any namespace
  collisions with our own options.

  `options.key`, `options.cert` and `options.pfx` are convenient
  options, in that they allow the user to provide paths to the
  corresponding files, which are read automatically,
  though synchronously!

Implementation:

  * completely backwards-compatible
  * all changes are being tested, except `options.pfx`

References:

  * Pass `ca` prop to https.createServer(): https://github.com/yagop/node-telegram-bot-api/pull/17
2017-01-07 17:58:01 +03:00
Gocho Mugo
215e0dc23b Add deleteWebHook, getWebHookInfo (#246) 2017-01-06 21:48:31 +03:00
Gocho Mugo
bc7549599e Ensure consistency of methods signatures (#245)
Bug:

  The library assumes signatures of methods to be, somewhat:

    methodName(requiredParam1, requiredParam2, form = {})

  where 'requiredParam1' ('requiredParam2', ..., 'requiredParamN')
  are parameters that MUST be provided, and
  'form' is an optional object allowing supplying any additional,
  optional parameters that the Bot API allows.

  This allows any new parameters added by Telegram to be
  readily-supported by our library.

  Also, the following have been included:

  * Corresponding tests
  * Documentation on the old, deprecated signatures
  * Console-logging the deprecation notices
2017-01-06 21:03:10 +03:00
GochoMugo
eba70cd3d7
[telegram] Expose TelegramBot#processUpdate()
Feature:

  We are exposing TelegramBot#processUpdate() to allow instances
  to be used, with mechanisms of fetching updates, other than
  those provided by the library.

References:

  * Example use case: https://github.com/GochoMugo/tgfancy/pull/7
2017-01-06 14:44:42 +03:00
GochoMugo
84329d05b4
[lint] Fix error reported by linter 2017-01-02 14:36:39 +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
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
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
Gocho Mugo
775977e564 Merge PR #213 from jishnu7/games
Feature:

* Add `getGameHighScores`
2016-11-03 18:53:17 +03:00
GingerPlusPlus
0fb142f6ac Added onlyFirstMatch option 2016-11-03 18:49:13 +03:00
Jishnu Mohan
2fa3f68d61 adding getGameHighScores 2016-10-22 16:03:50 +05:30
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
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
5a11cce18d
Accompanying doc-updates for PR #186 2016-10-10 14:47:52 +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
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
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
Jishnu Mohan
3a4e3cd721 adding sendGame and setGameScore 2016-10-04 00:53:00 +05:30
Chris54721
b308c956ae Update documentation 2016-09-15 18:48:32 +02:00
Chris54721
bf3302a957 Update README.md 2016-09-15 18:24:01 +02:00
Yago
743cc0ff9d Update readme 2016-07-07 23:51:13 +02:00
Horus Lugo
67344660d4 Added getChat, getChatAdministrators, getChatMembersCount and getChatMember 2016-06-27 18:09:44 +02:00
Conor Fennell
96adb918c1 Create a stop method #81 2016-06-21 10:48:05 +01:00
Serhii Dmytruk
cf8e90e70f getchat action 2016-06-10 12:51:10 +03:00
Yago
2dfb2d801a Updated README 2016-06-06 23:34:03 +02:00
Yago
cc3c206765 Updated readme 2016-06-06 22:57:06 +02:00
Jérémy Gotteland
527b469dc8 Fixed a few typos 2016-05-13 16:20:36 +02:00
Jérémy Gotteland
3eaf377024 Added new methods sendVenue and sendContact 2016-05-13 16:16:23 +02:00