Z
Z
zevilz2018-02-22 13:37:44
PHP
zevilz, 2018-02-22 13:37:44

How to use MadelineProto (Telegran API) correctly?

Connected MadelineProto , created a class with account data. Everything seems to be working, because. a lot of service information came out. But the page takes about half a minute to load. I don't understand why I'm getting all this information. And when calling any method, it says:

Exception:      	This peer is not present in the internal peer database in PeerHandler.php:203

Can someone explain how to work with MadelineProto and what am I doing wrong?
include 'phar.php';
$api_settings = [
  'authorization' => [
    'default_temp_auth_key_expires_in' => 86400,
    'rsa_keys'                         => массив_с_ключами
  ],
  'app_info' => [
    'api_id'   => ****,
    'api_hash' => *********************************
  ],
];
$MadelineProto = new \danog\MadelineProto\API($api_settings);
$messages_Chats = $MadelineProto->channels->getChannels(['id' => ["id_канала"]]);

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
yazux, 2018-04-03
@yazux

Here in an article on Habré, the guy wrote in detail how to work with a cart from under php.
In short, you need to create a php script, log in using it. It will save the authorization data to a file, then connect it to MadelineProto and make requests.
For the sake of interest, I performed manipulations from the article, everything worked.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question