#!/usr/bin/env php . */ require_once 'vendor/autoload.php'; $MadelineProto = new \danog\MadelineProto\API(); if (file_exists('number.php')) { include_once 'number.php'; $checkedPhone = $MadelineProto->auth->checkPhone(// auth.checkPhone becomes auth->checkPhone [ 'phone_number' => $number, ] ); var_dump($checkedPhone); $sentCode = $MadelineProto->phone_login($number); var_dump($sentCode); echo 'Enter the code you received: '; $code = ''; for ($x = 0; $x < $sentCode['type']['length']; $x++) { $code .= fgetc(STDIN); } $authorization = $MadelineProto->complete_phone_login($code); var_dump($authorization); } if (file_exists('token.php')) { include_once 'token.php'; $MadelineProto->bot_login($token); } echo 'Size of MadelineProto instance is '.strlen(var_export($MadelineProto, true)).' bytes'.PHP_EOL;