fixes
This commit is contained in:
parent
5cc6719c3d
commit
5a2a515f33
2
bot.php
2
bot.php
@ -48,7 +48,7 @@ while (true) {
|
||||
$res = var_export($update, true);
|
||||
}
|
||||
try {
|
||||
$MadelineProto->messages->sendMessage(['peer' => $update['update']['_'] === 'updateNewMessage' ? $update['update']['message']['from_id'] : $update['update']['message']['to_id'], 'message' => $res, 'reply_to_msg_id' => $update['update']['message']['id'], 'entities' => [['_' => 'messageEntityPre', 'offset' => 0, 'length' => strlen($res), 'language' => 'json']]]);
|
||||
// $MadelineProto->messages->sendMessage(['peer' => $update['update']['_'] === 'updateNewMessage' ? $update['update']['message']['from_id'] : $update['update']['message']['to_id'], 'message' => $res, 'reply_to_msg_id' => $update['update']['message']['id'], 'entities' => [['_' => 'messageEntityPre', 'offset' => 0, 'length' => strlen($res), 'language' => 'json']]]);
|
||||
} catch (\danog\MadelineProto\RPCErrorException $e) {
|
||||
$MadelineProto->messages->sendMessage(['peer' => '@danogentili', 'message' => $e->getCode().': '.$e->getMessage().PHP_EOL.$e->getTraceAsString()]);
|
||||
}
|
||||
|
@ -301,12 +301,15 @@ trait Files
|
||||
}
|
||||
if ($res['_'] === 'upload.fileCdnRedirect') {
|
||||
$cdn = true;
|
||||
$this->get_config([], ['datacenter' => $this->datacenter->curdc]);
|
||||
$message_media['file_token'] = $res['file_token'];
|
||||
$message_media['cdn_key'] = $res['encryption_key'];
|
||||
$message_media['cdn_iv'] = $res['encryption_iv'];
|
||||
$old_dc = $datacenter;
|
||||
$datacenter = $res['dc_id'].'_cdn';
|
||||
if (!isset($this->datacenter->sockets[$datacenter])) {
|
||||
$this->config['expires'] = -1;
|
||||
$this->get_config([], ['datacenter' => $this->datacenter->curdc]);
|
||||
}
|
||||
\danog\MadelineProto\Logger::log(['File is stored on CDN!'], \danog\MadelineProto\Logger::NOTICE);
|
||||
continue;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user