Slight improvement
This commit is contained in:
parent
690b38e11d
commit
0c40d6fb58
2
bot.php
2
bot.php
@ -55,7 +55,7 @@ class EventHandler extends \danog\MadelineProto\EventHandler
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$settings = ['logger' => ['logger_level' => 5]];
|
$settings = ['logger' => ['logger_level' => 5], 'connection_settings' => ['all' => ['protocol' => 'https']]];
|
||||||
|
|
||||||
|
|
||||||
$MadelineProto = new \danog\MadelineProto\API('bot.madeline', $settings);
|
$MadelineProto = new \danog\MadelineProto\API('bot.madeline', $settings);
|
||||||
|
@ -52,7 +52,7 @@ class HttpWaitLoop extends ResumableSignalLoop
|
|||||||
|
|
||||||
$timeout = $API->settings['connection_settings'][isset($API->settings['connection_settings'][$datacenter]) ? $datacenter : 'all']['timeout'];
|
$timeout = $API->settings['connection_settings'][isset($API->settings['connection_settings'][$datacenter]) ? $datacenter : 'all']['timeout'];
|
||||||
while (true) {
|
while (true) {
|
||||||
if (yield $this->waitSignal($this->pause($timeout))) {
|
if (yield $this->waitSignal($this->pause())) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!in_array($connection->getCtx()->getStreamName(), [HttpStream::getName(), HttpsStream::getName()])) {
|
if (!in_array($connection->getCtx()->getStreamName(), [HttpStream::getName(), HttpsStream::getName()])) {
|
||||||
|
@ -615,7 +615,7 @@ trait ResponseHandler
|
|||||||
if (!isset($updates['request']['body'])) {
|
if (!isset($updates['request']['body'])) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
$updates['user_id'] = $updates['request']['body']['peer'];
|
$updates['user_id'] = (yield $this->get_info_async($updates['request']['body']['peer']))['bot_api_id'];
|
||||||
$updates['message'] = $updates['request']['body']['message'];
|
$updates['message'] = $updates['request']['body']['message'];
|
||||||
unset($updates['request']);
|
unset($updates['request']);
|
||||||
case 'updateShortMessage':
|
case 'updateShortMessage':
|
||||||
@ -625,7 +625,6 @@ trait ResponseHandler
|
|||||||
if (!yield $this->peer_isset_async($from_id) || !yield $this->peer_isset_async($to_id) || isset($updates['via_bot_id']) && !yield $this->peer_isset_async($updates['via_bot_id']) || isset($updates['entities']) && !yield $this->entities_peer_isset_async($updates['entities']) || isset($updates['fwd_from']) && !yield $this->fwd_peer_isset_async($updates['fwd_from'])) {
|
if (!yield $this->peer_isset_async($from_id) || !yield $this->peer_isset_async($to_id) || isset($updates['via_bot_id']) && !yield $this->peer_isset_async($updates['via_bot_id']) || isset($updates['entities']) && !yield $this->entities_peer_isset_async($updates['entities']) || isset($updates['fwd_from']) && !yield $this->fwd_peer_isset_async($updates['fwd_from'])) {
|
||||||
yield $this->updaters[false]->resume();
|
yield $this->updaters[false]->resume();
|
||||||
return;
|
return;
|
||||||
// TOFIX
|
|
||||||
}
|
}
|
||||||
$message = $updates;
|
$message = $updates;
|
||||||
$message['_'] = 'message';
|
$message['_'] = 'message';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user