From a70142e7a8ee7a02a403f81c5d1c098ab7b1650f Mon Sep 17 00:00:00 2001 From: flogarko Date: Sat, 23 Sep 2017 00:15:42 +0200 Subject: [PATCH] Update __call method update for work with the new telegram api --- TelegramBotApi.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/TelegramBotApi.php b/TelegramBotApi.php index 1607df1..be461a8 100644 --- a/TelegramBotApi.php +++ b/TelegramBotApi.php @@ -31,9 +31,16 @@ public function __construct(Container $container) public function __call($name, $arguments) { - if ($this->config['legacy'] === true) { + if ($this->config['legacy'] === true) { call_user_method($name, $this->old_api, $arguments); } + else{ + if(method_exists($this->telegram,$name)){ + return $this->telegram->$name(implode(',',$arguments)); + }else{ + return TGRequest::$name($arguments[0]); + } + } } }