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

src: Minor fixes

This commit is contained in:
GochoMugo 2017-02-09 19:06:38 +03:00
parent e75d51ca8f
commit 9a9dfa9560
No known key found for this signature in database
GPG Key ID: 7B6A01CB57AA39E4
4 changed files with 4 additions and 2 deletions

View File

@ -75,6 +75,7 @@ Emits `message` when a message arrives.
| [options.polling.interval] | <code>String</code> &#124; <code>Number</code> | <code>300</code> | Interval between requests in miliseconds |
| [options.polling.autoStart] | <code>Boolean</code> | <code>true</code> | Start polling immediately |
| [options.polling.params] | <code>Object</code> | | Parameters to be used in polling API requests. See https://core.telegram.org/bots/api#getupdates for more information. |
| [options.polling.params.timeout] | <code>Number</code> | <code>10</code> | Timeout in seconds for long polling. |
| [options.webHook] | <code>Boolean</code> &#124; <code>Object</code> | <code>false</code> | Set true to enable WebHook or set options |
| [options.webHook.host] | <code>String</code> | <code>0.0.0.0</code> | Host to bind to |
| [options.webHook.port] | <code>Number</code> | <code>8443</code> | Port to bind to |

View File

@ -57,6 +57,7 @@ class TelegramBot extends EventEmitter {
* @param {Boolean} [options.polling.autoStart=true] Start polling immediately
* @param {Object} [options.polling.params] Parameters to be used in polling API requests.
* See https://core.telegram.org/bots/api#getupdates for more information.
* @param {Number} [options.polling.params.timeout=10] Timeout in seconds for long polling.
* @param {Boolean|Object} [options.webHook=false] Set true to enable WebHook or set options
* @param {String} [options.webHook.host=0.0.0.0] Host to bind to
* @param {Number} [options.webHook.port=8443] Port to bind to

View File

@ -133,7 +133,7 @@ class TelegramBotPolling {
*/
_getUpdates() {
debug('polling with options: %j', this.options.params);
return this.bot._request('getUpdates', this.options.params)
return this.bot.getUpdates(this.options.params)
.catch(err => {
if (err.response && err.response.statusCode === ANOTHER_WEB_HOOK_USED) {
return this._unsetWebHook();

View File

@ -48,7 +48,7 @@ before(function beforeAll() {
describe('module.exports', function moduleExportsSuite() {
const nodeVersion = parseInt(process.versions.node.split('.')[0], 10);
it('is loaded from src/ on Node.js v5+', function test() {
it('is loaded from src/ on Node.js v5+ and above', function test() {
if (nodeVersion <= 4) this.skip(); // skip on Node.js v4 and below
assert.equal(TelegramBot, require('../src/telegram'));
});