2
0
mirror of https://github.com/yagop/node-telegram-bot-api synced 2025-08-22 09:57:10 +00:00

19 Commits

Author SHA1 Message Date
Daniel Pérez Fernández
449f03f786
feat: Remove bluebird + depd (#987)
* feat: Remove bluebird

* docs: Update

* remove depd ans use node native deprecate msg warnings

* fix: correct util import name

* remove: contributor dev dependencie and add list of contributors in the readme
2022-07-18 08:41:31 +02:00
GochoMugo
8c965d3a14
src: Improve default error logging of polling_error, webhook_error
References:

  * BR: https://github.com/yagop/node-telegram-bot-api/issues/377
2017-11-18 23:21:52 +03:00
Gocho Mugo
eed7c1e4d0 src: Add proper error handling (#283)
Feature:

    Please see `doc/usage.md` for more information on error-handling.
2017-02-09 16:12:22 +03:00
GochoMugo
9d12bdfa41
src/webhook: Use String#indexOf() instead of RegExp#test() to find token
References:

  * Original PR: https://github.com/yagop/node-telegram-bot-api/pull/147
  * Original Author: @AVVS
2017-02-03 10:16:19 +03:00
GochoMugo
dad8697411
doc: Document options.webHook.host 2017-01-30 13:44:07 +03:00
GochoMugo
9f031a72e5
pr/272: Finish on PR 2017-01-30 13:24:15 +03:00
Anton Mironov
3263c6c253 Webhook health check endpoint 2017-01-30 12:50:22 +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
aaa3992a78
[webhook] Fix referencing options
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.
2017-01-08 00:43:01 +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
GochoMugo
487b5f4b8b
Fix ES6 syntax
Fix:

  This enables the library to be used without transpiling on
  Node 6 (current LTS).

Author: @GingerPlusPlus
2017-01-06 22:26:25 +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
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
Ola Flisbäck
10af3e4f55 Fixed a couple of debug prints 2016-07-13 20:01:21 +02:00
icdevin
d6ef1f9d97 Fixes stream end event never being called
For writable streams, like `http.ClientRequest`, there is no `end` event, only `finish`. Thus, `req.end` was never called and never sending a response.

This resulted in a nasty bug for WebHook users that basically rendered the library useless because if Telegram doesn't receive a response from the bot server, it will continue to queue and send requests until it does, or until 24 hours have passed.
2016-06-06 23:07:18 +02:00
AVVS
83e42201ee refactor: rewrite to babel, es6 & eslint 2016-03-17 13:02:25 +03:00
Yago
6a679b5644 jshint 2015-09-27 11:18:25 +02:00
yago
923e65c789 Separated WebHook 2015-07-13 00:24:49 +02:00