diff --git a/bot.php b/bot.php index 6d8d91db..d7c5f869 100755 --- a/bot.php +++ b/bot.php @@ -59,7 +59,7 @@ class EventHandler extends \danog\MadelineProto\EventHandler } $settings = ['logger' => ['logger_level' => 5]]; -$MadelineProto = new \danog\MadelineProto\API('testing.madeline', $settings); +$MadelineProto = new \danog\MadelineProto\API('bot.madeline', $settings); $MadelineProto->async(true); $MadelineProto->loop(function () use ($MadelineProto) { yield $MadelineProto->start(); diff --git a/docs b/docs index 8f6784ad..ddb2e4f7 160000 --- a/docs +++ b/docs @@ -1 +1 @@ -Subproject commit 8f6784adf5bca1dbab98ba1ec69ab52050633ca1 +Subproject commit ddb2e4f76938b69ceac6e4615901c642accae1ef diff --git a/src/danog/MadelineProto/TL/TL.php b/src/danog/MadelineProto/TL/TL.php index 5f8c6c7f..c4f5f001 100644 --- a/src/danog/MadelineProto/TL/TL.php +++ b/src/danog/MadelineProto/TL/TL.php @@ -576,7 +576,7 @@ trait TL $serialized .= pack('@4'); continue; } - if (in_array($current_argument['type'], ['bytes', 'string', 'Vector t'])) { + if (in_array($current_argument['type'], ['bytes', 'string'])) { $serialized .= pack('@4'); continue; } @@ -588,10 +588,30 @@ trait TL $serialized .= $id['id']; continue; } - - throw new Exception(\danog\MadelineProto\Lang::$current_lang['params_missing'], $current_argument['name']); + switch ($current_argument['type']) { + case 'Vector t': + case 'vector': + $arguments[$current_argument['name']] = []; + break; + /* + case 'long': + $serialized .= $this->random(8); + continue 2; + case 'int': + $serialized .= $this->random(4); + continue 2; + case 'string': + case 'bytes': + $arguments[$current_argument['name']] = ''; + break; + case 'Bool': + $arguments[$current_argument['name']] = false; + break; + default: + $arguments[$current_argument['name']] = ['_' => $this->constructors->find_by_type($current_argument['type'])['predicate']]; + break;*/ + } } - if (in_array($current_argument['type'], ['DataJSON', '%DataJSON'])) { $arguments[$current_argument['name']] = ['_' => 'dataJSON', 'data' => json_encode($arguments[$current_argument['name']])]; }