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]); + } + } } }