我有一个项目,我需要使用Madelineproto库要求。什么时候我运行的例子那个。phpstorm给我一些警告方法说他们不存在例如电话登录,给我一些错误。 我的代码是:
<?php
set_include_path(get_include_path().':'.realpath(dirname(__FILE__).'/MadelineProtoBot/'));
require 'MadelineProtoBot\MadelineProto\vendor\autoload.php';
$settings = ['app_info' => ['api_id' => ,... 'api_hash' => '...']];
$MadelineProto = new danog\MadelineProto\API($settings);
$MadelineProto->phone_login(readline('my phone '));
$authorization = $MadelineProto->complete_phone_login(readline('Enter the code you received: '));
if ($authorization['_'] === 'account.noPassword') {
throw new \danog\MadelineProto\Exception('2FA is enabled but no password is set!');
}
if ($authorization['_'] === 'account.password') {
$authorization = $MadelineProto->complete_2fa_login(readline('Please enter your password (hint '.$authorization['hint'].'): '));
}
if ($authorization['_'] === 'account.needSignup') {
$authorization = $MadelineProto->complete_signup(readline('Please enter your first name: '), readline('Please enter your last name (can be empty): '));
}
我该怎么办???
用这个来模拟它
你可以参考其他问题:Call to undefined function readline
相关问题 更多 >
编程相关推荐