Skip to content

Commit 81ac79c

Browse files
authored
Merge pull request #799 from noplanman/bot_api_3.6
Bot API 3.6
2 parents ced1a5d + 26e3182 commit 81ac79c

File tree

6 files changed

+28
-18
lines changed

6 files changed

+28
-18
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ 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+
- Implemented new changes for Bot API 3.6 (streamable InputMediaVideo, connected website).
810
### Changed
911
- Updated Travis to use Trusty containers (for HHVM) and add PHP 7.2 to the tests.
1012
- Add debug log entry instead of throwing an exception for duplicate updates.
@@ -192,6 +194,7 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c
192194
### Deprecated
193195
- Move `hideKeyboard` to `removeKeyboard`.
194196

197+
[unreleased-sql-migration]: https://github.com/php-telegram-bot/core/tree/develop/utils/db-schema-update/0.52.0-unreleased.sql
195198
[0.51.0-sql-migration]: https://github.com/php-telegram-bot/core/tree/develop/utils/db-schema-update/0.50.0-0.51.0.sql
196199
[0.50.0-bc-messagegetcommand-return-value]: https://github.com/php-telegram-bot/core/wiki/Breaking-backwards-compatibility#messagegetcommand-return-value
197200
[0.48.0-sql-migration]: https://github.com/php-telegram-bot/core/tree/develop/utils/db-schema-update/0.47.1-0.48.0.sql

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
`location`, `venue`, `new_chat_members`, `left_chat_member`,
830830
`new_chat_title`,`new_chat_photo`, `delete_chat_photo`, `group_chat_created`,
831831
`supergroup_chat_created`, `channel_chat_created`,
832-
`migrate_from_chat_id`, `migrate_to_chat_id`, `pinned_message`
832+
`migrate_from_chat_id`, `migrate_to_chat_id`, `pinned_message`, `connected_website`
833833
) VALUES (
834834
:message_id, :user_id, :chat_id, :date, :forward_from, :forward_from_chat, :forward_from_message_id,
835835
:forward_date, :reply_to_chat, :reply_to_message, :media_group_id, :text, :entities, :audio, :document,
836836
:photo, :sticker, :video, :voice, :video_note, :caption, :contact,
837837
:location, :venue, :new_chat_members, :left_chat_member,
838838
:new_chat_title, :new_chat_photo, :delete_chat_photo, :group_chat_created,
839839
:supergroup_chat_created, :channel_chat_created,
840-
:migrate_from_chat_id, :migrate_to_chat_id, :pinned_message
840+
:migrate_from_chat_id, :migrate_to_chat_id, :pinned_message, :connected_website
841841
)
842842
');
843843

@@ -897,6 +897,7 @@ public static function insertMessageRequest(Message $message)
897897
$sth->bindValue(':migrate_from_chat_id', $message->getMigrateFromChatId());
898898
$sth->bindValue(':migrate_to_chat_id', $message->getMigrateToChatId());
899899
$sth->bindValue(':pinned_message', $message->getPinnedMessage());
900+
$sth->bindValue(':connected_website', $message->getConnectedWebsite());
900901

901902
return $sth->execute();
902903
} catch (PDOException $e) {

src/Entities/InputMedia/InputMediaVideo.php

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -19,26 +19,29 @@
1919
*
2020
* <code>
2121
* $data = [
22-
* 'media' => '123abc',
23-
* 'caption' => 'Video caption',
24-
* 'width' => 800,
25-
* 'heidht' => 600,
26-
* 'duration' => 42
22+
* 'media' => '123abc',
23+
* 'caption' => 'Video caption (streamable)',
24+
* 'width' => 800,
25+
* 'height' => 600,
26+
* 'duration' => 42,
27+
* 'supports_streaming' => true
2728
* ];
2829
* </code>
2930
*
30-
* @method string getType() Type of the result, must be video
31-
* @method string getMedia() File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass "attach://<file_attach_name>" to upload a new one using multipart/form-data under <file_attach_name> name.
32-
* @method string getCaption() Optional. Caption of the video to be sent, 0-200 characters
33-
* @method int getWidth() Optional. Video width
34-
* @method int getHeight() Optional. Video height
35-
* @method int getDuration() Optional. Video duration
31+
* @method string getType() Type of the result, must be video
32+
* @method string getMedia() File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass "attach://<file_attach_name>" to upload a new one using multipart/form-data under <file_attach_name> name.
33+
* @method string getCaption() Optional. Caption of the video to be sent, 0-200 characters
34+
* @method int getWidth() Optional. Video width
35+
* @method int getHeight() Optional. Video height
36+
* @method int getDuration() Optional. Video duration
37+
* @method bool getSupportsStreaming() Optional. Pass True, if the uploaded video is suitable for streaming
3638
*
37-
* @method $this setMedia(string $media) File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass "attach://<file_attach_name>" to upload a new one using multipart/form-data under <file_attach_name> name.
38-
* @method $this setCaption(string $caption) Optional. Caption of the video to be sent, 0-200 characters
39-
* @method $this setWidth(int $width) Optional. Video width
40-
* @method $this setHeight(int $height) Optional. Video height
41-
* @method $this setDuration(int $duration) Optional. Video duration
39+
* @method $this setMedia(string $media) File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass "attach://<file_attach_name>" to upload a new one using multipart/form-data under <file_attach_name> name.
40+
* @method $this setCaption(string $caption) Optional. Caption of the video to be sent, 0-200 characters
41+
* @method $this setWidth(int $width) Optional. Video width
42+
* @method $this setHeight(int $height) Optional. Video height
43+
* @method $this setDuration(int $duration) Optional. Video duration
44+
* @method $this setSupportsStreaming(bool $supports_streaming) Optional. Pass True, if the uploaded video is suitable for streaming
4245
*/
4346
class InputMediaVideo extends Entity implements InputMedia
4447
{

src/Entities/Message.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
* @method Message getPinnedMessage() Optional. Specified message was pinned. Note that the Message object in this field will not contain further reply_to_message fields even if it is itself a reply.
5353
* @method Invoice getInvoice() Optional. Message is an invoice for a payment, information about the invoice.
5454
* @method SuccessfulPayment getSuccessfulPayment() Optional. Message is a service message about a successful payment, information about the payment.
55+
* @method string getConnectedWebsite() Optional. The domain name of the website on which the user has logged in.
5556
*/
5657
class Message extends Entity
5758
{

structure.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ CREATE TABLE IF NOT EXISTS `message` (
101101
`migrate_to_chat_id` bigint NULL DEFAULT NULL COMMENT 'Migrate to chat identifier. The group has been migrated to a supergroup with the specified identifier',
102102
`migrate_from_chat_id` bigint NULL DEFAULT NULL COMMENT 'Migrate from chat identifier. The supergroup has been migrated from a group with the specified identifier',
103103
`pinned_message` TEXT NULL COMMENT 'Message object. Specified message was pinned',
104+
`connected_website` TEXT NULL COMMENT 'The domain name of the website on which the user has logged in.',
104105

105106
PRIMARY KEY (`chat_id`, `id`),
106107
KEY `user_id` (`user_id`),
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ALTER TABLE `message` ADD COLUMN `connected_website` TEXT NULL COMMENT 'The domain name of the website on which the user has logged in.' AFTER `pinned_message`;

0 commit comments

Comments
 (0)