PK!A7��n new AppInfo([ 'api_id' => '20741333', // Replace with your API ID from my.telegram.org 'api_hash' => '4938bc0912c8619b2a50be85143a7944', // Replace with your API Hash from my.telegram.org ]), 'connection_settings' => new Connection([ // Customize connection settings if needed, or leave empty for default settings ]) ]); $MadelineProto = new API('session.madeline', $settings); try { $MadelineProto->start(); // Start the session // Define the contact to import $contact = [ '_' => 'inputPhoneContact', 'client_id' => 807105545, // 'client_id' => rand() << 32 | rand(), 'phone' => '+919650983216', // Phone number with country code 'first_name' => 'Paaji', // Placeholder first name 'last_name' => '' // Placeholder last name (optional) ]; // Import the contact $response = $MadelineProto->contacts->importContacts([ 'contacts' => [$contact], // Wrap the contact inside an array ]); print_r($response); // Check if the contact was imported successfully if (isset($response['users']) && count($response['users']) > 0) { foreach ($response['users'] as $user) { echo 'User imported successfully.' . PHP_EOL; echo 'User ID: ' . $user['id'] . PHP_EOL; echo 'Username: ' . (isset($user['username']) ? $user['username'] : 'No username') . PHP_EOL; } } else { echo 'No user found for the provided phone number, or import failed.' . PHP_EOL; } } catch (\danog\MadelineProto\Exception $e) { echo 'MadelineProto error: ' . $e->getMessage() . PHP_EOL; echo 'Trace: ' . $e->getTraceAsString() . PHP_EOL; }