danog / MadelineProto

Async PHP client API for the telegram MTProto protocol
https://docs.madelineproto.xyz
GNU Affero General Public License v3.0
2.83k stars 651 forks source link

Undefined array key "sizes" in danog\MadelineProto\MTProtoTools\Files.php:838 #1471

Closed valentinkrynin closed 8 months ago

valentinkrynin commented 8 months ago

There is no $messageMedia['sizes'] element when $messageMedia["photo"] is "photoEmpty"

https://github.com/danog/MadelineProto/blob/0de601baabd98cca90b7647a692aca02747d8c25/src/MTProtoTools/Files.php#L835-L838

An error occured while wrapping {"_":"updateNewChannelMessage","message":{"_":"message","out":false,"mentioned":false,"media_unread":false,"silent":false,"post":false,"from_scheduled":false,"legacy":false,"edit_hide":false,"pinned":false,"noforwards":false,"invert_media":false,"id":7227026,"from_id":6716018774,"peer_id":-1001626553821,"date":1706098482,"message":"","media":{"_":"messageMediaPhoto","spoiler":false,"photo":{"_":"photoEmpty","id":5874954355835257841}},"replies":{"_":"messageReplies","comments":false,"replies":0,"replies_pts":12904762}},"pts":-1,"pts_count":-1}: 

\danog\MadelineProto\Exception: Undefined array key "sizes" in /some_project/vendor/danog/madelineproto/src/MTProtoTools/Files.php:838
Revision: 8.0.0-beta188