Last commit before watching endgame

This commit is contained in:
Daniil Gentili 2019-04-28 15:27:50 +00:00
parent de1f2445a4
commit cf7a407368
3 changed files with 7 additions and 5 deletions

View File

@ -42,10 +42,10 @@ class EventHandler extends \danog\MadelineProto\EventHandler
if ($res == '') {
$res = var_export($update, true);
}
yield $this->sleep_async(3);
//yield $this->sleep_async(3);
try {
yield $this->messages->sendMessage(['peer' => $update, 'message' => "<code>$res</code>\n\nDopo 3 secondi, in modo asincrono", 'reply_to_msg_id' => isset($update['message']['id']) ? $update['message']['id'] : null, 'parse_mode' => 'HTML']); //'entities' => [['_' => 'messageEntityPre', 'offset' => 0, 'length' => strlen($res), 'language' => 'json']]]);
yield $this->messages->sendMessage(['peer' => $update, 'message' => "<code>$res</code>", 'reply_to_msg_id' => isset($update['message']['id']) ? $update['message']['id'] : null, 'parse_mode' => 'HTML']); //'entities' => [['_' => 'messageEntityPre', 'offset' => 0, 'length' => strlen($res), 'language' => 'json']]]);
} catch (\danog\MadelineProto\RPCErrorException $e) {
\danog\MadelineProto\Logger::log((string) $e, \danog\MadelineProto\Logger::FATAL_ERROR);
} catch (\danog\MadelineProto\Exception $e) {

2
docs

@ -1 +1 @@
Subproject commit 2566f9ab998e645217654356792f82c9e131a06e
Subproject commit 0fcff8e5a31af300511949c4dbafc7be6c0d4dd7

View File

@ -104,13 +104,15 @@ trait Loop
$this->logger->logger('Started update loop', \danog\MadelineProto\Logger::NOTICE);
while (true) {
foreach ($this->updates as $update) {
$updates = $this->updates;
$this->updates = [];
foreach ($updates as $update) {
$r = $this->settings['updates']['callback']($update);
if (is_object($r)) {
\Amp\Promise\rethrow($this->call($r));
}
}
$this->updates = [];
$updates = [];
if ($this->loop_callback !== null) {
$callback = $this->loop_callback;