arrow_back
Back

MadelineProto get_self: current account profile

Andrew Dorokhov Andrew Dorokhov schedule 1 min read

Use get_self() to fetch information about the account that owns the session:

use danog\MadelineProto\API;

$api = new API('session.file');
$me = $api->get_self();

Response example:

Array
(
    [_] => user
    [self] => 1
    [contact] => 1
    [mutual_contact] =>
    [deleted] =>
    [bot] =>
    [bot_chat_history] =>
    [bot_nochats] =>
    [verified] =>
    [restricted] =>
    [min] =>
    [bot_inline_geo] =>
    [id] => 109075721
    [access_hash] => -8161497169871068283
    [first_name] => Andrew
    [last_name] => Dorokhov
    [username] => dorohoff
    [phone] => 380665550062
    [photo] => Array
        (
            [_] => userProfilePhoto
            [photo_id] => 468476654938859527
            [photo_small] => Array
                (
                    [_] => fileLocation
                    [dc_id] => 2
                    [volume_id] => 238226218
                    [local_id] => 229615
                    [secret] => -2050381823259470921
                )

            [photo_big] => Array
                (
                    [_] => fileLocation
                    [dc_id] => 2
                    [volume_id] => 238226218
                    [local_id] => 229617
                    [secret] => 3279272717315329957
                )

        )

    [status] => Array
        (
            [_] => userStatusOffline
            [was_online] => 1537478044
        )

)
code

Need Help with Development?

Happy to help — reach out via the contacts or go straight to my Upwork profile.

work View Upwork Profile arrow_forward
Next Article

MadelineProto get_info: users, bots, groups, and channels

arrow_forward