mirror of
https://github.com/danog/TelegramApiServer.git
synced 2024-11-26 20:04:45 +01:00
Allow call API methods.
This commit is contained in:
parent
a5d7ea6e13
commit
6ee61530c4
@ -11,6 +11,7 @@ use Amp\Http\Server\Response;
|
|||||||
use Amp\Http\Server\Router;
|
use Amp\Http\Server\Router;
|
||||||
use danog\MadelineProto\API;
|
use danog\MadelineProto\API;
|
||||||
use JsonException;
|
use JsonException;
|
||||||
|
use TelegramApiServer\Client;
|
||||||
use TelegramApiServer\Exceptions\NoticeException;
|
use TelegramApiServer\Exceptions\NoticeException;
|
||||||
use TelegramApiServer\Logger;
|
use TelegramApiServer\Logger;
|
||||||
use TelegramApiServer\MadelineProtoExtensions\ApiExtensions;
|
use TelegramApiServer\MadelineProtoExtensions\ApiExtensions;
|
||||||
@ -163,6 +164,11 @@ abstract class AbstractApiController
|
|||||||
$madelineProtoExtensions = new $this->extensionClass($madelineProto, $this->request, $this->file);
|
$madelineProtoExtensions = new $this->extensionClass($madelineProto, $this->request, $this->file);
|
||||||
$result = $madelineProtoExtensions->{$this->api[0]}(...$this->parameters);
|
$result = $madelineProtoExtensions->{$this->api[0]}(...$this->parameters);
|
||||||
} else {
|
} else {
|
||||||
|
if ($this->api[0] === 'API') {
|
||||||
|
$madelineProto = Client::getWrapper($madelineProto)->getAPI();
|
||||||
|
array_shift($this->api);
|
||||||
|
$pathCount = count($this->api);
|
||||||
|
}
|
||||||
//Проверяем нет ли в MadilineProto такого метода.
|
//Проверяем нет ли в MadilineProto такого метода.
|
||||||
switch ($pathCount) {
|
switch ($pathCount) {
|
||||||
case 1:
|
case 1:
|
||||||
|
Loading…
Reference in New Issue
Block a user