Apply fixes from StyleCI
This commit is contained in:
parent
96efd18e13
commit
2f8149c4d9
5
id.php
5
id.php
@ -12,7 +12,7 @@ If not, see <http://www.gnu.org/licenses/>.
|
|||||||
|
|
||||||
require 'vendor/autoload.php';
|
require 'vendor/autoload.php';
|
||||||
|
|
||||||
$id = ['AgADBAADcKoxG4_aCgYKET2oLMua7pxRaRkABKoeLWY9bpazGdcCAAEC', "BQADBAADhQEAAo_aCgZOb3LWhOazMQI"];
|
$id = ['AgADBAADcKoxG4_aCgYKET2oLMua7pxRaRkABKoeLWY9bpazGdcCAAEC', 'BQADBAADhQEAAo_aCgZOb3LWhOazMQI'];
|
||||||
|
|
||||||
function foreach_offset_length($string)
|
function foreach_offset_length($string)
|
||||||
{
|
{
|
||||||
@ -22,9 +22,10 @@ function foreach_offset_length($string)
|
|||||||
for ($length = $strlen - $offset; $length > 0; $length--) {
|
for ($length = $strlen - $offset; $length > 0; $length--) {
|
||||||
$s = substr($string, $offset, $length);
|
$s = substr($string, $offset, $length);
|
||||||
$number = (string) (new \phpseclib\Math\BigInteger(strrev($s), 256));
|
$number = (string) (new \phpseclib\Math\BigInteger(strrev($s), 256));
|
||||||
$res []= ['number' => $number, 'offset' => $offset, 'length' => $length];
|
$res[] = ['number' => $number, 'offset' => $offset, 'length' => $length];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $res;
|
return $res;
|
||||||
}
|
}
|
||||||
$res = [];
|
$res = [];
|
||||||
|
@ -35,14 +35,13 @@ trait CallHandler
|
|||||||
while ($server_answer === null && $res_count++ < $this->settings['max_tries']['response']) { // Loop until we get a response, loop for a max of $this->settings['max_tries']['response'] times
|
while ($server_answer === null && $res_count++ < $this->settings['max_tries']['response']) { // Loop until we get a response, loop for a max of $this->settings['max_tries']['response'] times
|
||||||
try {
|
try {
|
||||||
\danog\MadelineProto\Logger::log('Getting response (try number '.$res_count.' for '.$method.')...');
|
\danog\MadelineProto\Logger::log('Getting response (try number '.$res_count.' for '.$method.')...');
|
||||||
$this->recv_message(); // This method receives data from the socket, and parses stuff
|
$this->recv_message(); // This method receives data from the socket, and parses stuff
|
||||||
|
|
||||||
if (!isset($this->datacenter->outgoing_messages[$int_message_id]['response']) || !isset($this->datacenter->incoming_messages[$this->datacenter->outgoing_messages[$int_message_id]['response']]['content'])) { // Checks if I have received the response to the called method, if not continue looping
|
if (!isset($this->datacenter->outgoing_messages[$int_message_id]['response']) || !isset($this->datacenter->incoming_messages[$this->datacenter->outgoing_messages[$int_message_id]['response']]['content'])) { // Checks if I have received the response to the called method, if not continue looping
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
$server_answer = $this->datacenter->incoming_messages[$this->datacenter->outgoing_messages[$int_message_id]['response']]['content']; // continue was not called, so I got a response
|
$server_answer = $this->datacenter->incoming_messages[$this->datacenter->outgoing_messages[$int_message_id]['response']]['content']; // continue was not called, so I got a response
|
||||||
|
|
||||||
} catch (\danog\MadelineProto\Exception $e) {
|
} catch (\danog\MadelineProto\Exception $e) {
|
||||||
\danog\MadelineProto\Logger::log('An error getting response of method '.$method.': '.$e->getMessage().' in '.basename($e->getFile(), '.php').' on line '.$e->getLine().'. Retrying...');
|
\danog\MadelineProto\Logger::log('An error getting response of method '.$method.': '.$e->getMessage().' in '.basename($e->getFile(), '.php').' on line '.$e->getLine().'. Retrying...');
|
||||||
continue;
|
continue;
|
||||||
|
@ -194,6 +194,7 @@ trait UpdateHandler
|
|||||||
\danog\MadelineProto\Logger::log('Got channel too long update, getting difference...');
|
\danog\MadelineProto\Logger::log('Got channel too long update, getting difference...');
|
||||||
if (!isset($this->channels_state[$channel_id]) && !isset($update['pts'])) {
|
if (!isset($this->channels_state[$channel_id]) && !isset($update['pts'])) {
|
||||||
\danog\MadelineProto\Logger::log('I do not have the channel in the states and the pts is not set.');
|
\danog\MadelineProto\Logger::log('I do not have the channel in the states and the pts is not set.');
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -79,6 +79,5 @@ sleep(5);
|
|||||||
var_dump($MadelineProto->API->get_updates());
|
var_dump($MadelineProto->API->get_updates());
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
$sentMessage = $MadelineProto->messages->sendMessage(['peer' => '@pwrtelegramgroupita', 'message' => $message, 'entities' => [['_' => 'inputMessageEntityMentionName', 'offset' => 0, 'length' => strlen($message), 'user_id' => $mention]]]);
|
$sentMessage = $MadelineProto->messages->sendMessage(['peer' => '@pwrtelegramgroupita', 'message' => $message, 'entities' => [['_' => 'inputMessageEntityMentionName', 'offset' => 0, 'length' => strlen($message), 'user_id' => $mention]]]);
|
||||||
|
}
|
||||||
}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user