2
0
mirror of https://github.com/yagop/node-telegram-bot-api synced 2025-08-28 21:07:39 +00:00

62 Commits

Author SHA1 Message Date
GochoMugo
a32259b1a1
src/telegram: Consider stream.path could not be parsed 2017-01-25 18:59:06 +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
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
e009b60efa
[webhook] Do not rely on http.Server#listening property
Bug:

  The 'http.Server#listening' property was added in Node.js v5.7.0!
  Support the older Node.js versions!
2017-01-09 16:49:06 +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
2a782fddbc
Deprecate support for Node.js v0.12
Notes:

  We are deprecating support for Node.js v0.12, to
  be removed in next major version!
2017-01-09 15:46:27 +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
96bff10119
[test] Skip tests for TelegramBot#sendContact()
Bug:

  Please see note in test file!
2017-01-06 18:25:49 +03:00
GochoMugo
0cd993f3e8 [test] Fix incorrect test cases 2017-01-06 13:03:52 +03:00
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