MadelineProto/classes/telepy.php

29 lines
1010 B
PHP
Raw Normal View History

2016-06-23 23:51:08 +02:00
<?php
2016-07-14 15:15:50 +02:00
set_include_path(get_include_path().PATH_SEPARATOR.dirname(__FILE__).DIRECTORY_SEPARATOR.'libpy2php');
require_once 'libpy2php.php';
class telepy
{
public function __construct()
{
2016-06-23 23:51:08 +02:00
try {
2016-07-14 15:15:50 +02:00
require_once 'configparser.php';
} catch (ImportError $e) {
require_once 'ConfigParser.php';
2016-06-23 23:51:08 +02:00
}
2016-07-14 15:15:50 +02:00
require_once 'mtproto.php';
2016-06-23 23:51:08 +02:00
$this->_config = $configparser->ConfigParser();
if (!($this->_config->read('credentials'))) {
pyjslib_printnl('File \'credentials\' seems to not exist.');
$exit(-1);
}
$ip = $this->_config->get('App data', 'ip_address');
$port = $this->_config->getint('App data', 'port');
$this->_session = $mtproto->Session($ip, $port);
$this->_session->create_auth_key();
2016-07-14 15:15:50 +02:00
$__temp22 = py2php_kwargs_method_call($this->_session, 'method_call', ['get_future_salts'], ['num' => 3]);
2016-06-23 23:51:08 +02:00
$this->_salt = $__temp22;
$future_salts = $__temp22;
}
}