unreal4u / telegram-api

Complete async capable Telegram bot API implementation for PHP7
https://github.com/unreal4u/telegram-api/wiki
MIT License
784 stars 172 forks source link

How can I get the result from GetChatAdministrators? #124

Closed nikelanjelo closed 3 years ago

nikelanjelo commented 3 years ago

$GetChatAdministrators = new unreal4u\TelegramAPI\Telegram\Methods\GetChatAdministrators(); $GetChatAdministrators->chat_id = $update->message->chat->id; $tgLog->performApiRequest($GetChatAdministrators);

How can I get results after that?

unreal4u commented 3 years ago

Hi!

I would suggest to take a look at the examples directory where you can find a very similar example using getChatMember:

$getChatMemberPromise = $tgLog->performApiRequest($getChatMember);
$getChatMemberPromise->then(
    function ($response) {
        echo '<pre>';
        var_dump($response);
        echo '</pre>';
    },
    function (\Exception $exception) {
        // Onoes, an exception occurred...
        echo 'Exception ' . get_class($exception) . ' caught, message: ' . $exception->getMessage().PHP_EOL;
    }
);

https://github.com/unreal4u/telegram-api/blob/master/examples/get-chat-member.php

Greetings.