Skip to content

Commit e804163

Browse files
authored
Merge pull request #1418 from php-telegram-bot/bot-api-6.8
Bot API 6.8
2 parents b85a12c + 6ea1ae7 commit e804163

File tree

9 files changed

+40
-5
lines changed

9 files changed

+40
-5
lines changed

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c
55

66
## [Unreleased]
77
### Notes
8-
- [:ledger: View file changes][Unreleased]
8+
- [:ledger: View file changes][Unreleased][:page_with_curl: DB migration script][unreleased-sql-migration]
99
### Added
10+
- Bot API 6.8 (@noplanman)
1011
### Changed
1112
### Deprecated
1213
### Removed
@@ -624,6 +625,7 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c
624625
### Deprecated
625626
- Move `hideKeyboard` to `removeKeyboard`.
626627

628+
[unreleased-sql-migration]: https://github.com/php-telegram-bot/core/tree/develop/utils/db-schema-update/0.81.0-unreleased.sql
627629
[0.81.0-sql-migration]: https://github.com/php-telegram-bot/core/tree/master/utils/db-schema-update/0.80.0-0.81.0.sql
628630
[0.80.0-sql-migration]: https://github.com/php-telegram-bot/core/tree/master/utils/db-schema-update/0.79.0-0.80.0.sql
629631
[0.80.0-bc-commands-with-underscores]: https://github.com/php-telegram-bot/core/wiki/Breaking-backwards-compatibility#commands-with-underscores

src/DB.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1136,7 +1136,7 @@ public static function insertMessageRequest(Message $message): bool
11361136
`id`, `user_id`, `chat_id`, `message_thread_id`, `sender_chat_id`, `date`, `forward_from`, `forward_from_chat`, `forward_from_message_id`,
11371137
`forward_signature`, `forward_sender_name`, `forward_date`, `is_topic_message`,
11381138
`reply_to_chat`, `reply_to_message`, `via_bot`, `edit_date`, `media_group_id`, `author_signature`, `text`, `entities`, `caption_entities`,
1139-
`audio`, `document`, `animation`, `game`, `photo`, `sticker`, `video`, `voice`, `video_note`, `caption`, `has_media_spoiler`, `contact`,
1139+
`audio`, `document`, `animation`, `game`, `photo`, `sticker`, `story`, `video`, `voice`, `video_note`, `caption`, `has_media_spoiler`, `contact`,
11401140
`location`, `venue`, `poll`, `dice`, `new_chat_members`, `left_chat_member`,
11411141
`new_chat_title`, `new_chat_photo`, `delete_chat_photo`, `group_chat_created`,
11421142
`supergroup_chat_created`, `channel_chat_created`, `message_auto_delete_timer_changed`, `migrate_to_chat_id`, `migrate_from_chat_id`,
@@ -1147,7 +1147,7 @@ public static function insertMessageRequest(Message $message): bool
11471147
:message_id, :user_id, :chat_id, :message_thread_id, :sender_chat_id, :date, :forward_from, :forward_from_chat, :forward_from_message_id,
11481148
:forward_signature, :forward_sender_name, :forward_date, :is_topic_message,
11491149
:reply_to_chat, :reply_to_message, :via_bot, :edit_date, :media_group_id, :author_signature, :text, :entities, :caption_entities,
1150-
:audio, :document, :animation, :game, :photo, :sticker, :video, :voice, :video_note, :caption, :has_media_spoiler, :contact,
1150+
:audio, :document, :animation, :game, :photo, :sticker, :story, :video, :voice, :video_note, :caption, :has_media_spoiler, :contact,
11511151
:location, :venue, :poll, :dice, :new_chat_members, :left_chat_member,
11521152
:new_chat_title, :new_chat_photo, :delete_chat_photo, :group_chat_created,
11531153
:supergroup_chat_created, :channel_chat_created, :message_auto_delete_timer_changed, :migrate_to_chat_id, :migrate_from_chat_id,
@@ -1202,6 +1202,7 @@ public static function insertMessageRequest(Message $message): bool
12021202
$sth->bindValue(':game', $message->getGame());
12031203
$sth->bindValue(':photo', self::entitiesArrayToJson($message->getPhoto() ?: []));
12041204
$sth->bindValue(':sticker', $message->getSticker());
1205+
$sth->bindValue(':story', $message->getStory());
12051206
$sth->bindValue(':video', $message->getVideo());
12061207
$sth->bindValue(':voice', $message->getVoice());
12071208
$sth->bindValue(':video_note', $message->getVideoNote());

src/Entities/Chat.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
* @method ChatPhoto getPhoto() Optional. Chat photo. Returned only in getChat.
2929
* @method string[] getActiveUsernames() Optional. If non-empty, the list of all active chat usernames; for private chats, supergroups and channels. Returned only in getChat.
3030
* @method string getEmojiStatusCustomEmojiId() Optional. Custom emoji identifier of emoji status of the other party in a private chat. Returned only in getChat.
31+
* @method int getEmojiStatusExpirationDate() Optional. Expiration date of the emoji status of the other party in a private chat in Unix time, if any. Returned only in getChat.
3132
* @method string getBio() Optional. Bio of the other party in a private chat. Returned only in getChat.
3233
* @method bool getHasPrivateForwards() Optional. True, if privacy settings of the other party in the private chat allows to use tg://user?id=<user_id> links only in chats with the user. Returned only in getChat.
3334
* @method bool getHasRestrictedVoiceAndVideoMessages() Optional. True, if the privacy settings of the other party restrict sending voice and video note messages in the private chat. Returned only in getChat.

src/Entities/Message.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
* @method Game getGame() Optional. Message is a game, information about the game.
5858
* @method PhotoSize[] getPhoto() Optional. Message is a photo, available sizes of the photo
5959
* @method Sticker getSticker() Optional. Message is a sticker, information about the sticker
60+
* @method Story getStory() Optional. Message is a forwarded story
6061
* @method Video getVideo() Optional. Message is a video, information about the video
6162
* @method Voice getVoice() Optional. Message is a voice message, information about the file
6263
* @method VideoNote getVideoNote() Optional. Message is a video note message, information about the video
@@ -121,6 +122,7 @@ protected function subEntities(): array
121122
'document' => Document::class,
122123
'photo' => [PhotoSize::class],
123124
'sticker' => Sticker::class,
125+
'story' => Story::class,
124126
'video' => Video::class,
125127
'video_note' => VideoNote::class,
126128
'voice' => Voice::class,

src/Entities/PollAnswer.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
* @link https://core.telegram.org/bots/api#pollanswer
2020
*
2121
* @method string getPollId() Unique poll identifier
22-
* @method User getUser() The user, who changed the answer to the poll
22+
* @method Chat getVoterChat() Optional. The chat that changed the answer to the poll, if the voter is anonymous
23+
* @method User getUser() Optional. The user, who changed the answer to the poll
2324
* @method array getOptionIds() 0-based identifiers of answer options, chosen by the user. May be empty if the user retracted their vote.
2425
*/
2526
class PollAnswer extends Entity
@@ -30,7 +31,8 @@ class PollAnswer extends Entity
3031
protected function subEntities(): array
3132
{
3233
return [
33-
'user' => User::class,
34+
'voter_chat' => Chat::class,
35+
'user' => User::class,
3436
];
3537
}
3638
}

src/Entities/Story.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
3+
/**
4+
* This file is part of the TelegramBot package.
5+
*
6+
* (c) Avtandil Kikabidze aka LONGMAN <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace Longman\TelegramBot\Entities;
13+
14+
/**
15+
* Class Story
16+
*
17+
* @link https://core.telegram.org/bots/api#story
18+
*/
19+
class Story extends Entity
20+
{
21+
22+
}

src/Request.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@
9494
* @method static ServerResponse reopenGeneralForumTopic(array $data) Use this method to reopen a closed 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights. The topic will be automatically unhidden if it was hidden. Returns True on success.
9595
* @method static ServerResponse hideGeneralForumTopic(array $data) Use this method to hide the 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights. The topic will be automatically closed if it was open. Returns True on success.
9696
* @method static ServerResponse unhideGeneralForumTopic(array $data) Use this method to unhide the 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights. Returns True on success.
97+
* @method static ServerResponse unpinAllGeneralForumTopicMessages(array $data) Use this method to clear the list of pinned messages in a General forum topic. The bot must be an administrator in the chat for this to work and must have the can_pin_messages administrator right in the supergroup. Returns True on success.
9798
* @method static ServerResponse answerCallbackQuery(array $data) Use this method to send answers to callback queries sent from inline keyboards. The answer will be displayed to the user as a notification at the top of the chat screen or as an alert. On success, True is returned.
9899
* @method static ServerResponse answerInlineQuery(array $data) Use this method to send answers to an inline query. On success, True is returned.
99100
* @method static ServerResponse setMyCommands(array $data) Use this method to change the list of the bot's commands. Returns True on success.
@@ -269,6 +270,7 @@ class Request
269270
'reopenGeneralForumTopic',
270271
'hideGeneralForumTopic',
271272
'unhideGeneralForumTopic',
273+
'unpinAllGeneralForumTopicMessages',
272274
'answerCallbackQuery',
273275
'answerInlineQuery',
274276
'setMyCommands',

structure.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ CREATE TABLE IF NOT EXISTS `message` (
102102
`game` TEXT COMMENT 'Game object. Message is a game, information about the game',
103103
`photo` TEXT COMMENT 'Array of PhotoSize objects. Message is a photo, available sizes of the photo',
104104
`sticker` TEXT COMMENT 'Sticker object. Message is a sticker, information about the sticker',
105+
`story` TEXT COMMENT 'Story object. Message is a forwarded story',
105106
`video` TEXT COMMENT 'Video object. Message is a video, information about the video',
106107
`voice` TEXT COMMENT 'Voice Object. Message is a Voice, information about the Voice',
107108
`video_note` TEXT COMMENT 'VoiceNote Object. Message is a Video Note, information about the Video Note',
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
ALTER TABLE `message`
2+
ADD COLUMN `story` TEXT DEFAULT NULL COMMENT 'Story object. Message is a forwarded story' AFTER `sticker`;

0 commit comments

Comments
 (0)