diff --git a/CHANGELOG.md b/CHANGELOG.md index a229be4e..c0407c90 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,8 +23,10 @@ - Chg #217: Remove `receiverUserId` and `callbackQueryId` parameters from `SendMessage`, `SendAnimation`, `SendAudio`, `SendDocument`, `SendPhoto`, `SendSticker`, `SendVideo`, `SendVideoNote`, `SendVoice`, `SendContact`, `SendLocation` and `SendVenue` methods, use `ephemeralMessageParameters` parameter instead. -- Enh #217: Make `text` parameter of `EditEphemeralMessageText` method optional. - Enh #214: Rework `.gitattributes` to explicitly allow only distribution files for export. +- Enh #217: Make `text` parameter of `EditEphemeralMessageText` method optional. +- Bug #218: Register `PaidMediaLivePhoto` type in `PaidMediaValue` parse result value processor, without it + parsing of paid media with `live_photo` type failed. ## 0.21.2 July 15, 2026 diff --git a/src/ParseResult/ValueProcessor/PaidMediaValue.php b/src/ParseResult/ValueProcessor/PaidMediaValue.php index 5c02b085..8e50a50e 100644 --- a/src/ParseResult/ValueProcessor/PaidMediaValue.php +++ b/src/ParseResult/ValueProcessor/PaidMediaValue.php @@ -5,6 +5,7 @@ namespace Phptg\BotApi\ParseResult\ValueProcessor; use Phptg\BotApi\Type\PaidMedia; +use Phptg\BotApi\Type\PaidMediaLivePhoto; use Phptg\BotApi\Type\PaidMediaPhoto; use Phptg\BotApi\Type\PaidMediaPreview; use Phptg\BotApi\Type\PaidMediaVideo; @@ -25,6 +26,7 @@ public function getClassMap(): array 'preview' => PaidMediaPreview::class, 'photo' => PaidMediaPhoto::class, 'video' => PaidMediaVideo::class, + 'live_photo' => PaidMediaLivePhoto::class, ]; } diff --git a/tests/ParseResult/ValueProcessor/PaidMediaValueTest.php b/tests/ParseResult/ValueProcessor/PaidMediaValueTest.php index eb57ff0a..36ad4f78 100644 --- a/tests/ParseResult/ValueProcessor/PaidMediaValueTest.php +++ b/tests/ParseResult/ValueProcessor/PaidMediaValueTest.php @@ -9,6 +9,7 @@ use Phptg\BotApi\ParseResult\ObjectFactory; use Phptg\BotApi\ParseResult\TelegramParseResultException; use Phptg\BotApi\ParseResult\ValueProcessor\PaidMediaValue; +use Phptg\BotApi\Type\PaidMediaLivePhoto; use Phptg\BotApi\Type\PaidMediaPhoto; use Phptg\BotApi\Type\PaidMediaPreview; use Phptg\BotApi\Type\PaidMediaVideo; @@ -49,6 +50,19 @@ public static function dataBase(): array ], ], ], + [ + PaidMediaLivePhoto::class, + [ + 'type' => 'live_photo', + 'live_photo' => [ + 'file_id' => 'f12', + 'file_unique_id' => 'fu12', + 'width' => 100, + 'height' => 200, + 'duration' => 23, + ], + ], + ], ]; }