Skip to content

Commit f3b8d0b

Browse files
authored
Merge pull request #455 from BoShurik/video-note
Message Video Note
2 parents d44a9d5 + 939b6d7 commit f3b8d0b

File tree

3 files changed

+29
-0
lines changed

3 files changed

+29
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ All Notable changes to `PHP Telegram Bot Api` will be documented in this file
1414
- Add support for third party http clients (`psr/http-client` and `symfony/http-client`)
1515
- Add support for local bot API server
1616
- Add method `\TelegramBot\Api\BotApi::validateWebAppData` to validate `window.Telegram.WebApp.initData`
17+
- Add `\TelegramBot\Api\Types\Message::$videoNote` field
1718

1819
## 2.5.0 - 2023-08-09
1920

src/Types/Message.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ class Message extends BaseType implements TypeInterface
4848
'photo' => ArrayOfPhotoSize::class,
4949
'sticker' => Sticker::class,
5050
'video' => Video::class,
51+
'video_note' => VideoNote::class,
5152
'voice' => Voice::class,
5253
'caption' => true,
5354
'contact' => Contact::class,
@@ -254,6 +255,13 @@ class Message extends BaseType implements TypeInterface
254255
*/
255256
protected $video;
256257

258+
/**
259+
* Optional. Message is a video note, information about the video message
260+
*
261+
* @var \TelegramBot\Api\Types\VideoNote|null
262+
*/
263+
protected $videoNote;
264+
257265
/**
258266
* Optional. Message is a voice message, information about the file
259267
*
@@ -874,6 +882,23 @@ public function getVideo()
874882
return $this->video;
875883
}
876884

885+
/**
886+
* @return VideoNote|null
887+
*/
888+
public function getVideoNote()
889+
{
890+
return $this->videoNote;
891+
}
892+
893+
/**
894+
* @param VideoNote|null $videoNote
895+
* @return void
896+
*/
897+
public function setVideoNote($videoNote)
898+
{
899+
$this->videoNote = $videoNote;
900+
}
901+
877902
/**
878903
* @param Video $video
879904
* @return void

tests/Types/MessageTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ public static function getFullResponse()
5959
],
6060
'sticker' => StickerTest::getMinResponse(),
6161
'video' => VideoTest::getMinResponse(),
62+
'video_note' => VideoNoteTest::getMinResponse(),
6263
'voice' => VoiceTest::getMinResponse(),
6364
'caption' => 'caption',
6465
'contact' => ContactTest::getMinResponse(),
@@ -125,6 +126,7 @@ protected function assertMinItem($item)
125126
$this->assertNull($item->getPhoto());
126127
$this->assertNull($item->getSticker());
127128
$this->assertNull($item->getVideo());
129+
$this->assertNull($item->getVideoNote());
128130
$this->assertNull($item->getVoice());
129131
$this->assertNull($item->getCaption());
130132
$this->assertNull($item->getContact());
@@ -186,6 +188,7 @@ protected function assertFullItem($item)
186188
$this->assertEquals([PhotoSizeTest::createMinInstance()], $item->getPhoto());
187189
$this->assertEquals(StickerTest::createMinInstance(), $item->getSticker());
188190
$this->assertEquals(VideoTest::createMinInstance(), $item->getVideo());
191+
$this->assertEquals(VideoNoteTest::createMinInstance(), $item->getVideoNote());
189192
$this->assertEquals(VoiceTest::createMinInstance(), $item->getVoice());
190193
$this->assertEquals('caption', $item->getCaption());
191194
$this->assertEquals(ContactTest::createMinInstance(), $item->getContact());

0 commit comments

Comments
 (0)