diff --git a/bot.php b/bot.php index 2b33d4d4..ec0c5772 100755 --- a/bot.php +++ b/bot.php @@ -30,7 +30,7 @@ try { //var_dump($MadelineProto->API->get_config([], ['datacenter' => $MadelineProto->API->datacenter->curdc])); //var_dump($MadelineProto->API->settings['connection']); echo 'Wrote '.\danog\MadelineProto\Serialization::serialize('bot.madeline', $MadelineProto).' bytes'.PHP_EOL; - +$MadelineProto->messages->sendMessage(['peer' => ['_' => 'inputPeerChat'], 'message' => '']); $offset = 0; while (true) { $updates = $MadelineProto->API->get_updates(['offset' => $offset, 'limit' => 50, 'timeout' => 0]); // Just like in the bot API, you can specify an offset, a limit and a timeout diff --git a/src/danog/MadelineProto/MTProto.php b/src/danog/MadelineProto/MTProto.php index 35af8920..1361e7d7 100644 --- a/src/danog/MadelineProto/MTProto.php +++ b/src/danog/MadelineProto/MTProto.php @@ -44,7 +44,7 @@ class MTProto extends \Volatile use \danog\MadelineProto\Wrappers\DialogHandler; use \danog\MadelineProto\Wrappers\Login; - const V = 60; + const V = 61; const NOT_LOGGED_IN = 0; const WAITING_CODE = 1; diff --git a/src/danog/MadelineProto/TL/Exception.php b/src/danog/MadelineProto/TL/Exception.php index de47ddf3..82e96c1c 100644 --- a/src/danog/MadelineProto/TL/Exception.php +++ b/src/danog/MadelineProto/TL/Exception.php @@ -18,7 +18,7 @@ class Exception extends \Exception public function __toString() { - return get_class($this).($this->message !== '' ? ': ' : '').$this->message.PHP_EOL.'TL Trace'.PHP_EOL.PHP_EOL.$this->getTLTrace().PHP_EOL; + return get_class($this).($this->message !== '' ? ': ' : '').$this->message.PHP_EOL.'TL Trace:'.PHP_EOL.PHP_EOL.$this->getTLTrace().PHP_EOL; } public function __construct($message, $file = '') diff --git a/src/danog/MadelineProto/TL/PrettyException.php b/src/danog/MadelineProto/TL/PrettyException.php index 1a58e533..f658b181 100644 --- a/src/danog/MadelineProto/TL/PrettyException.php +++ b/src/danog/MadelineProto/TL/PrettyException.php @@ -26,8 +26,10 @@ trait PrettyException $tl = false; foreach (array_reverse($this->getTrace()) as $frame) { if (isset($frame['function']) && in_array($frame['function'], ['serialize_params', 'serialize_object'])) { - $this->tl_trace .= $tl ? "['".$frame['args'][2]."']" : "While serializing: \t".$frame['args'][2]; - $tl = true; + if ($frame['args'][2] !== '') { + $this->tl_trace .= $tl ? "['".$frame['args'][2]."']" : "While serializing: \t".$frame['args'][2]; + $tl = true; + } } else { if ($tl) { $this->tl_trace .= PHP_EOL; @@ -41,5 +43,6 @@ trait PrettyException } } $this->tl_trace .= $init !== '' ? "['".$init."']" : ''; + $this->tl_trace = implode(PHP_EOL, array_reverse(explode(PHP_EOL, $this->tl_trace))); } } diff --git a/src/danog/MadelineProto/TL/TL.php b/src/danog/MadelineProto/TL/TL.php index dc7bf928..6759895e 100644 --- a/src/danog/MadelineProto/TL/TL.php +++ b/src/danog/MadelineProto/TL/TL.php @@ -378,7 +378,7 @@ trait TL $concat .= $constructorData['id']; } - return $concat.$this->serialize_params($constructorData, $object, $constructorData['predicate'], $layer); + return $concat.$this->serialize_params($constructorData, $object, '', $layer); } public function serialize_method($method, $arguments)