mirror of
https://github.com/danog/MadelineProto.git
synced 2024-12-14 04:27:22 +01:00
1.0 KiB
1.0 KiB
title | description |
---|---|
get_info | get_info parameters, return type and example |
Method: get_info
Parameters:
Name | Type |
---|---|
id | A username, a bot API chat id, a tg-cli chat id, a Chat, a User, an InputPeer, an InputUser, an InputChannel, a Peer, or a Chat object |
Return type: Info
Example:
$MadelineProto = new \danog\MadelineProto\API();
if (isset($token)) {
$this->bot_login($token);
}
if (isset($number)) {
$sentCode = $MadelineProto->phone_login($number);
echo 'Enter the code you received: ';
$code = '';
for ($x = 0; $x < $sentCode['type']['length']; $x++) {
$code .= fgetc(STDIN);
}
$MadelineProto->complete_phone_login($code);
}
$Chat = $MadelineProto->get_info($id);
Or, if you're into Lua:
Chat = get_info(id)