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!
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/).
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.
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.
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
* 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