Added support for video notes (round videos)
This commit is contained in:
parent
dfc7d17f2d
commit
4b561510e7
@ -617,7 +617,7 @@ class MTProto extends \Volatile
|
|||||||
|
|
||||||
public function getV()
|
public function getV()
|
||||||
{
|
{
|
||||||
return 30;
|
return 31;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function get_self()
|
public function get_self()
|
||||||
|
@ -275,7 +275,7 @@ trait BotAPI
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 'documentAttributeVideo':
|
case 'documentAttributeVideo':
|
||||||
$type_name = 'video';
|
$type_name = $attribute['round_message'] ? 'video_note' : 'video';
|
||||||
$res['width'] = $attribute['w'];
|
$res['width'] = $attribute['w'];
|
||||||
$res['height'] = $attribute['h'];
|
$res['height'] = $attribute['h'];
|
||||||
$res['duration'] = $attribute['duration'];
|
$res['duration'] = $attribute['duration'];
|
||||||
|
@ -116,7 +116,15 @@ trait BotAPIFiles
|
|||||||
|
|
||||||
case 'bot_video':
|
case 'bot_video':
|
||||||
unset($deserialized['_']);
|
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' => ''];
|
$res['MessageMedia'] = ['_' => 'messageMediaDocument', 'document' => $constructor, 'caption' => ''];
|
||||||
|
|
||||||
|
@ -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_sticker#8 dc_id:int id:long access_hash:long = File;
|
||||||
bot_audio#9 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_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;
|
||||||
|
Loading…
Reference in New Issue
Block a user