Unverified Commit 81ac79c9 authored by Armando Lüscher's avatar Armando Lüscher Committed by GitHub

Merge pull request #799 from noplanman/bot_api_3.6

Bot API 3.6
parents ced1a5dd 26e31826
...@@ -4,7 +4,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p ...@@ -4,7 +4,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
Exclamation symbols (:exclamation:) note something of importance e.g. breaking changes. Click them to learn more. Exclamation symbols (:exclamation:) note something of importance e.g. breaking changes. Click them to learn more.
## [Unreleased] ## [Unreleased]
:exclamation: After updating to this version, you will need to execute the [SQL migration script][unreleased-sql-migration] on your database.
### Added ### Added
- Implemented new changes for Bot API 3.6 (streamable InputMediaVideo, connected website).
### Changed ### Changed
- Updated Travis to use Trusty containers (for HHVM) and add PHP 7.2 to the tests. - Updated Travis to use Trusty containers (for HHVM) and add PHP 7.2 to the tests.
- Add debug log entry instead of throwing an exception for duplicate updates. - 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 ...@@ -192,6 +194,7 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c
### Deprecated ### Deprecated
- Move `hideKeyboard` to `removeKeyboard`. - Move `hideKeyboard` to `removeKeyboard`.
[unreleased-sql-migration]: https://github.com/php-telegram-bot/core/tree/develop/utils/db-schema-update/0.52.0-unreleased.sql
[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 [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
[0.50.0-bc-messagegetcommand-return-value]: https://github.com/php-telegram-bot/core/wiki/Breaking-backwards-compatibility#messagegetcommand-return-value [0.50.0-bc-messagegetcommand-return-value]: https://github.com/php-telegram-bot/core/wiki/Breaking-backwards-compatibility#messagegetcommand-return-value
[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 [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
......
...@@ -829,7 +829,7 @@ class DB ...@@ -829,7 +829,7 @@ class DB
`location`, `venue`, `new_chat_members`, `left_chat_member`, `location`, `venue`, `new_chat_members`, `left_chat_member`,
`new_chat_title`,`new_chat_photo`, `delete_chat_photo`, `group_chat_created`, `new_chat_title`,`new_chat_photo`, `delete_chat_photo`, `group_chat_created`,
`supergroup_chat_created`, `channel_chat_created`, `supergroup_chat_created`, `channel_chat_created`,
`migrate_from_chat_id`, `migrate_to_chat_id`, `pinned_message` `migrate_from_chat_id`, `migrate_to_chat_id`, `pinned_message`, `connected_website`
) VALUES ( ) VALUES (
:message_id, :user_id, :chat_id, :date, :forward_from, :forward_from_chat, :forward_from_message_id, :message_id, :user_id, :chat_id, :date, :forward_from, :forward_from_chat, :forward_from_message_id,
:forward_date, :reply_to_chat, :reply_to_message, :media_group_id, :text, :entities, :audio, :document, :forward_date, :reply_to_chat, :reply_to_message, :media_group_id, :text, :entities, :audio, :document,
...@@ -837,7 +837,7 @@ class DB ...@@ -837,7 +837,7 @@ class DB
:location, :venue, :new_chat_members, :left_chat_member, :location, :venue, :new_chat_members, :left_chat_member,
:new_chat_title, :new_chat_photo, :delete_chat_photo, :group_chat_created, :new_chat_title, :new_chat_photo, :delete_chat_photo, :group_chat_created,
:supergroup_chat_created, :channel_chat_created, :supergroup_chat_created, :channel_chat_created,
:migrate_from_chat_id, :migrate_to_chat_id, :pinned_message :migrate_from_chat_id, :migrate_to_chat_id, :pinned_message, :connected_website
) )
'); ');
...@@ -897,6 +897,7 @@ class DB ...@@ -897,6 +897,7 @@ class DB
$sth->bindValue(':migrate_from_chat_id', $message->getMigrateFromChatId()); $sth->bindValue(':migrate_from_chat_id', $message->getMigrateFromChatId());
$sth->bindValue(':migrate_to_chat_id', $message->getMigrateToChatId()); $sth->bindValue(':migrate_to_chat_id', $message->getMigrateToChatId());
$sth->bindValue(':pinned_message', $message->getPinnedMessage()); $sth->bindValue(':pinned_message', $message->getPinnedMessage());
$sth->bindValue(':connected_website', $message->getConnectedWebsite());
return $sth->execute(); return $sth->execute();
} catch (PDOException $e) { } catch (PDOException $e) {
......
...@@ -19,26 +19,29 @@ use Longman\TelegramBot\Entities\Entity; ...@@ -19,26 +19,29 @@ use Longman\TelegramBot\Entities\Entity;
* *
* <code> * <code>
* $data = [ * $data = [
* 'media' => '123abc', * 'media' => '123abc',
* 'caption' => 'Video caption', * 'caption' => 'Video caption (streamable)',
* 'width' => 800, * 'width' => 800,
* 'heidht' => 600, * 'height' => 600,
* 'duration' => 42 * 'duration' => 42,
* 'supports_streaming' => true
* ]; * ];
* </code> * </code>
* *
* @method string getType() Type of the result, must be video * @method string getType() Type of the result, must be video
* @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. * @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.
* @method string getCaption() Optional. Caption of the video to be sent, 0-200 characters * @method string getCaption() Optional. Caption of the video to be sent, 0-200 characters
* @method int getWidth() Optional. Video width * @method int getWidth() Optional. Video width
* @method int getHeight() Optional. Video height * @method int getHeight() Optional. Video height
* @method int getDuration() Optional. Video duration * @method int getDuration() Optional. Video duration
* @method bool getSupportsStreaming() Optional. Pass True, if the uploaded video is suitable for streaming
* *
* @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. * @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.
* @method $this setCaption(string $caption) Optional. Caption of the video to be sent, 0-200 characters * @method $this setCaption(string $caption) Optional. Caption of the video to be sent, 0-200 characters
* @method $this setWidth(int $width) Optional. Video width * @method $this setWidth(int $width) Optional. Video width
* @method $this setHeight(int $height) Optional. Video height * @method $this setHeight(int $height) Optional. Video height
* @method $this setDuration(int $duration) Optional. Video duration * @method $this setDuration(int $duration) Optional. Video duration
* @method $this setSupportsStreaming(bool $supports_streaming) Optional. Pass True, if the uploaded video is suitable for streaming
*/ */
class InputMediaVideo extends Entity implements InputMedia class InputMediaVideo extends Entity implements InputMedia
{ {
......
...@@ -52,6 +52,7 @@ use Longman\TelegramBot\Entities\Payments\SuccessfulPayment; ...@@ -52,6 +52,7 @@ use Longman\TelegramBot\Entities\Payments\SuccessfulPayment;
* @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. * @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.
* @method Invoice getInvoice() Optional. Message is an invoice for a payment, information about the invoice. * @method Invoice getInvoice() Optional. Message is an invoice for a payment, information about the invoice.
* @method SuccessfulPayment getSuccessfulPayment() Optional. Message is a service message about a successful payment, information about the payment. * @method SuccessfulPayment getSuccessfulPayment() Optional. Message is a service message about a successful payment, information about the payment.
* @method string getConnectedWebsite() Optional. The domain name of the website on which the user has logged in.
*/ */
class Message extends Entity class Message extends Entity
{ {
......
...@@ -101,6 +101,7 @@ CREATE TABLE IF NOT EXISTS `message` ( ...@@ -101,6 +101,7 @@ CREATE TABLE IF NOT EXISTS `message` (
`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', `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',
`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', `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',
`pinned_message` TEXT NULL COMMENT 'Message object. Specified message was pinned', `pinned_message` TEXT NULL COMMENT 'Message object. Specified message was pinned',
`connected_website` TEXT NULL COMMENT 'The domain name of the website on which the user has logged in.',
PRIMARY KEY (`chat_id`, `id`), PRIMARY KEY (`chat_id`, `id`),
KEY `user_id` (`user_id`), KEY `user_id` (`user_id`),
......
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`;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment