This commit is contained in:
Daniil Gentili 2017-05-19 16:36:38 +01:00
commit 1e7c552459
4 changed files with 15 additions and 3 deletions

View File

@ -323,6 +323,10 @@ trait ResponseHandler
public function handle_rpc_error($server_answer, &$aargs)
{
if ($server_answer['error_message'] === 'PERSISTENT_TIMESTAMP_OUTDATED') {
$this->got_state = false;
throw new \danog\MadelineProto\Exception('Update the timestamp pls');
}
switch ($server_answer['error_code']) {
case 303:
$this->datacenter->curdc = $aargs['datacenter'] = (int) preg_replace('/[^0-9]+/', '', $server_answer['error_message']);

View File

@ -275,7 +275,7 @@ trait BotAPI
break;
case 'documentAttributeVideo':
$type_name = 'video';
$type_name = $attribute['round_message'] ? 'video_note' : 'video';
$res['width'] = $attribute['w'];
$res['height'] = $attribute['h'];
$res['duration'] = $attribute['duration'];

View File

@ -116,7 +116,15 @@ trait BotAPIFiles
case 'bot_video':
unset($deserialized['_']);
$constructor = array_merge($deserialized, ['_' => 'document', 'mime_type' => '', 'attributes' => [['_' => 'documentAttributeVideo']]]);
$constructor = array_merge($deserialized, ['_' => 'document', 'mime_type' => '', 'attributes' => [['_' => 'documentAttributeVideo', 'round_message' => false]]]);
$res['MessageMedia'] = ['_' => 'messageMediaDocument', 'document' => $constructor, 'caption' => ''];
return $res;
case 'bot_video_note':
unset($deserialized['_']);
$constructor = array_merge($deserialized, ['_' => 'document', 'mime_type' => '', 'attributes' => [['_' => 'documentAttributeVideo', 'round_message' => true]]]);
$res['MessageMedia'] = ['_' => 'messageMediaDocument', 'document' => $constructor, 'caption' => ''];

View File

@ -6,4 +6,4 @@ bot_document#5 dc_id:int id:long access_hash:long = File;
bot_sticker#8 dc_id:int id:long access_hash:long = File;
bot_audio#9 dc_id:int id:long access_hash:long = File;
bot_gif#A dc_id:int id:long access_hash:long = File;
bot_roundvideo#D dc_id:int id:long access_hash:long = File;
bot_video_note#D dc_id:int id:long access_hash:long = File;