Skip to content

Commit afe6b13

Browse files
authored
Merge branch 'develop' into patch-1
2 parents e9da7f9 + 59cda46 commit afe6b13

24 files changed

+274
-45
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,11 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
44
Exclamation symbols (:exclamation:) note something of importance e.g. breaking changes. Click them to learn more.
55

66
## [Unreleased]
7+
:exclamation: After updating to this version, you will need to execute the [SQL migration script][unreleased-sql-migration] on your database.
78
### Added
9+
- Bot API 4.0 (without Passport)
810
### Changed
11+
- [:exclamation:][unreleased-bc-move-animation-out-of-games-namespace] Move Animation entity out of Games namespace.
912
### Deprecated
1013
### Removed
1114
### Fixed
@@ -217,6 +220,8 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c
217220
### Deprecated
218221
- Move `hideKeyboard` to `removeKeyboard`.
219222

223+
[unreleased-sql-migration]: https://github.com/php-telegram-bot/core/tree/master/utils/db-schema-update/0.54.0-unreleased.sql
224+
[unreleased-bc-move-animation-out-of-games-namespace]: https://github.com/php-telegram-bot/core/wiki/Breaking-backwards-compatibility#move-animation-out-of-games-namespace
220225
[0.54.0-sql-migration]: https://github.com/php-telegram-bot/core/tree/master/utils/db-schema-update/0.53.0-0.54.0.sql
221226
[0.54.0-bc-rename-constants]: https://github.com/php-telegram-bot/core/wiki/Breaking-backwards-compatibility#rename-constants
222227
[0.53.0-sql-migration]: https://github.com/php-telegram-bot/core/tree/master/utils/db-schema-update/0.52.0-0.53.0.sql

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ $result = Request::sendPhoto([
364364
]);
365365
```
366366

367-
*sendAudio*, *sendDocument*, *sendSticker*, *sendVideo*, *sendVoice* and *sendVideoNote* all work in the same way, just check the [API documentation](https://core.telegram.org/bots/api#sendphoto) for the exact usage.
367+
*sendAudio*, *sendDocument*, *sendAnimation*, *sendSticker*, *sendVideo*, *sendVoice* and *sendVideoNote* all work in the same way, just check the [API documentation](https://core.telegram.org/bots/api#sendphoto) for the exact usage.
368368
See the [*ImageCommand.php*][ImageCommand.php] for a full example.
369369

370370
#### Send Chat Action

composer.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/DB.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -829,15 +829,15 @@ public static function insertMessageRequest(Message $message)
829829
(
830830
`id`, `user_id`, `chat_id`, `date`, `forward_from`, `forward_from_chat`, `forward_from_message_id`,
831831
`forward_date`, `reply_to_chat`, `reply_to_message`, `media_group_id`, `text`, `entities`, `audio`, `document`,
832-
`game`, `photo`, `sticker`, `video`, `voice`, `video_note`, `caption`, `contact`,
832+
`animation`, `game`, `photo`, `sticker`, `video`, `voice`, `video_note`, `caption`, `contact`,
833833
`location`, `venue`, `new_chat_members`, `left_chat_member`,
834834
`new_chat_title`,`new_chat_photo`, `delete_chat_photo`, `group_chat_created`,
835835
`supergroup_chat_created`, `channel_chat_created`,
836836
`migrate_from_chat_id`, `migrate_to_chat_id`, `pinned_message`, `connected_website`
837837
) VALUES (
838838
:message_id, :user_id, :chat_id, :date, :forward_from, :forward_from_chat, :forward_from_message_id,
839839
:forward_date, :reply_to_chat, :reply_to_message, :media_group_id, :text, :entities, :audio, :document,
840-
:game, :photo, :sticker, :video, :voice, :video_note, :caption, :contact,
840+
:animation, :game, :photo, :sticker, :video, :voice, :video_note, :caption, :contact,
841841
:location, :venue, :new_chat_members, :left_chat_member,
842842
:new_chat_title, :new_chat_photo, :delete_chat_photo, :group_chat_created,
843843
:supergroup_chat_created, :channel_chat_created,
@@ -881,6 +881,7 @@ public static function insertMessageRequest(Message $message)
881881
$sth->bindValue(':entities', $t = self::entitiesArrayToJson($message->getEntities(), null));
882882
$sth->bindValue(':audio', $message->getAudio());
883883
$sth->bindValue(':document', $message->getDocument());
884+
$sth->bindValue(':animation', $message->getAnimation());
884885
$sth->bindValue(':game', $message->getGame());
885886
$sth->bindValue(':photo', $t = self::entitiesArrayToJson($message->getPhoto(), null));
886887
$sth->bindValue(':sticker', $message->getSticker());

src/Entities/Games/Animation.php renamed to src/Entities/Animation.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@
88
* file that was distributed with this source code.
99
*/
1010

11-
namespace Longman\TelegramBot\Entities\Games;
12-
13-
use Longman\TelegramBot\Entities\Entity;
11+
namespace Longman\TelegramBot\Entities;
1412

1513
/**
1614
* Class Animation
@@ -20,6 +18,9 @@
2018
* @link https://core.telegram.org/bots/api#animation
2119
*
2220
* @method string getFileId() Unique file identifier
21+
* @method int getWidth() Video width as defined by sender
22+
* @method int getHeight() Video height as defined by sender
23+
* @method int getDuration() Duration of the video in seconds as defined by sender
2324
* @method PhotoSize getThumb() Optional. Animation thumbnail as defined by sender
2425
* @method string getFileName() Optional. Original animation filename as defined by sender
2526
* @method string getMimeType() Optional. MIME type of the file as defined by sender

src/Entities/Audio.php

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,23 @@
1515
*
1616
* @link https://core.telegram.org/bots/api#audio
1717
*
18-
* @method string getFileId() Unique identifier for this file
19-
* @method int getDuration() Duration of the audio in seconds as defined by sender
20-
* @method string getPerformer() Optional. Performer of the audio as defined by sender or by audio tags
21-
* @method string getTitle() Optional. Title of the audio as defined by sender or by audio tags
22-
* @method string getMimeType() Optional. MIME type of the file as defined by sender
23-
* @method int getFileSize() Optional. File size
18+
* @method string getFileId() Unique identifier for this file
19+
* @method int getDuration() Duration of the audio in seconds as defined by sender
20+
* @method string getPerformer() Optional. Performer of the audio as defined by sender or by audio tags
21+
* @method string getTitle() Optional. Title of the audio as defined by sender or by audio tags
22+
* @method string getMimeType() Optional. MIME type of the file as defined by sender
23+
* @method int getFileSize() Optional. File size
24+
* @method PhotoSize getThumb() Optional. Thumbnail of the album cover to which the music file belongs
2425
*/
2526
class Audio extends Entity
2627
{
27-
28+
/**
29+
* {@inheritdoc}
30+
*/
31+
protected function subEntities()
32+
{
33+
return [
34+
'thumb' => PhotoSize::class,
35+
];
36+
}
2837
}

src/Entities/Contact.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
* @method string getFirstName() Contact's first name
2020
* @method string getLastName() Optional. Contact's last name
2121
* @method int getUserId() Optional. Contact's user identifier in Telegram
22+
* @method string getVcard() Optional. Additional data about the contact in the form of a vCard
2223
*/
2324
class Contact extends Entity
2425
{

src/Entities/Games/Game.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@
1010

1111
namespace Longman\TelegramBot\Entities\Games;
1212

13+
use Longman\TelegramBot\Entities\Animation;
1314
use Longman\TelegramBot\Entities\Entity;
1415
use Longman\TelegramBot\Entities\MessageEntity;
16+
use Longman\TelegramBot\Entities\PhotoSize;
1517

1618
/**
1719
* Class Game
@@ -45,7 +47,7 @@ protected function subEntities()
4547
* This method overrides the default getPhoto method
4648
* and returns a nice array of PhotoSize objects.
4749
*
48-
* @return null|PhotoSize[]
50+
* @return null|\Longman\TelegramBot\Entities\PhotoSize[]
4951
*/
5052
public function getPhoto()
5153
{
@@ -60,7 +62,7 @@ public function getPhoto()
6062
* This method overrides the default getTextEntities method
6163
* and returns a nice array of MessageEntity objects.
6264
*
63-
* @return null|MessageEntity[]
65+
* @return null|\Longman\TelegramBot\Entities\MessageEntity[]
6466
*/
6567
public function getTextEntities()
6668
{

src/Entities/Games/GameHighScore.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
namespace Longman\TelegramBot\Entities\Games;
1212

1313
use Longman\TelegramBot\Entities\Entity;
14+
use Longman\TelegramBot\Entities\User;
1415

1516
/**
1617
* Class GameHighScore

src/Entities/InlineQuery/InlineQueryResultContact.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
* @method string getPhoneNumber() Contact's phone number
3838
* @method string getFirstName() Contact's first name
3939
* @method string getLastName() Optional. Contact's last name
40+
* @method string getVcard() Optional. Additional data about the contact in the form of a vCard, 0-2048 bytes
4041
* @method InlineKeyboard getReplyMarkup() Optional. Inline keyboard attached to the message
4142
* @method InputMessageContent getInputMessageContent() Optional. Content of the message to be sent instead of the contact
4243
* @method string getThumbUrl() Optional. Url of the thumbnail for the result
@@ -47,6 +48,7 @@
4748
* @method $this setPhoneNumber(string $phone_number) Contact's phone number
4849
* @method $this setFirstName(string $first_name) Contact's first name
4950
* @method $this setLastName(string $last_name) Optional. Contact's last name
51+
* @method $this setVcard(string $vcard) Optional. Additional data about the contact in the form of a vCard, 0-2048 bytes
5052
* @method $this setReplyMarkup(InlineKeyboard $reply_markup) Optional. Inline keyboard attached to the message
5153
* @method $this setInputMessageContent(InputMessageContent $input_message_content) Optional. Content of the message to be sent instead of the contact
5254
* @method $this setThumbUrl(string $thumb_url) Optional. Url of the thumbnail for the result

0 commit comments

Comments
 (0)