Added support for video notes (round videos)

This commit is contained in:
Daniil Gentili 2017-05-19 16:35:09 +01:00
parent dfc7d17f2d
commit 4b561510e7
4 changed files with 12 additions and 4 deletions

View File

@ -617,7 +617,7 @@ class MTProto extends \Volatile
public function getV()
{
return 30;
return 31;
}
public function get_self()

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;