[pr] Merge branch 'fix-debug-prints' of https://github.com/oflisback/node-telegram-bot-api into pr-169

experimental
GochoMugo 9 years ago
commit 2b5dfe0e84
No known key found for this signature in database
GPG Key ID: 7B6A01CB57AA39E4
  1. 4
      src/telegram.js
  2. 2
      src/telegramWebHook.js

@ -101,10 +101,10 @@ class TelegramBot extends EventEmitter {
if (message.text) {
debug('Text message');
this.textRegexpCallbacks.some(reg => {
debug('Matching %s whith', message.text, reg.regexp);
debug('Matching %s with %s', message.text, reg.regexp);
const result = reg.regexp.exec(message.text);
if (result) {
debug('Matches', reg.regexp);
debug('Matches %s', reg.regexp);
reg.callback(message, result);
// returning truthy value exits .some
return this.options.onlyFirstMatch;

@ -60,7 +60,7 @@ class TelegramBotWebHook {
// bound req listener
_requestListener = (req, res) => {
debug('WebHook request URL:', req.url);
debug('WebHook request URL: %s', req.url);
debug('WebHook request headers: %j', req.headers);
// If there isn't token on URL

Loading…
Cancel
Save