Feature:
To be more RFC compliant, particularly when sending
files, we are going to default to using POST requests.
We have been using GET requests (even when uploading files).
PS: This causes major problems with PWRTelegram API
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.
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!
Bug:
The method TelegramBot#_formatSendData() throws an error
if the Buffer file type is NOT supported. We need to handle
it, by returning a Promise that is reject with the originally
thrown exception.
References:
* PR trying to achieve the same: https://github.com/yagop/node-telegram-bot-api/pull/66
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())
Bug:
Upgrading the dependencies 'file-type' and 'babel-eslint'
removed support for Node.js v0.12 series.
We are intending to continue to support 0.12 until we
reach v1.
Bug:
The confusion between using 'options' (passed by caller)
and 'this.options' (cached on the object), we were making
the assumption 'options.https' is unchanged!
It's references is changed already as we had earlier assigned
'this.options' to point to 'options', thus same object.
Feature:
* Add example demonstrating use of inline keyboards
and callback queries (see PR #150)
* Use token from environment variable, if available
References:
* PR #150 - Provided example with inline keyboard and callbacks:
https://github.com/yagop/node-telegram-bot-api/pull/150
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
Bug:
The contributors tool is invoked during testing.
It prompts for user input which freezes the CI.
Disable it for now until we find a proper workaround
or fix the tool!
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
Feature:
Instead of guessing of a proper timeout, we shall use the error
response to calculate it. The error provides us with the number
of milliseconds we need to wait before retrying the request.
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
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().
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!