Fix return value for handle() method.

parent 3d14b749
...@@ -324,6 +324,8 @@ class Telegram ...@@ -324,6 +324,8 @@ class Telegram
* Handle bot request from webhook * Handle bot request from webhook
* *
* @return bool * @return bool
*
* @throws \Longman\TelegramBot\Exception\TelegramException
*/ */
public function handle() public function handle()
{ {
...@@ -337,7 +339,11 @@ class Telegram ...@@ -337,7 +339,11 @@ class Telegram
throw new TelegramException('Invalid JSON!'); throw new TelegramException('Invalid JSON!');
} }
return $this->processUpdate(new Update($post, $this->bot_name))->isOk(); if ($response = $this->processUpdate(new Update($post, $this->bot_name))) {
return $response->isOk();
}
return false;
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment