Add media_group_id to Message entity and database.

parent 54d4bb48
...@@ -830,7 +830,7 @@ class DB ...@@ -830,7 +830,7 @@ class DB
INSERT IGNORE INTO `' . TB_MESSAGE . '` INSERT IGNORE INTO `' . TB_MESSAGE . '`
( (
`id`, `user_id`, `chat_id`, `date`, `forward_from`, `forward_from_chat`, `forward_from_message_id`, `id`, `user_id`, `chat_id`, `date`, `forward_from`, `forward_from_chat`, `forward_from_message_id`,
`forward_date`, `reply_to_chat`, `reply_to_message`, `text`, `entities`, `audio`, `document`, `forward_date`, `reply_to_chat`, `reply_to_message`, `media_group_id`, `text`, `entities`, `audio`, `document`,
`photo`, `sticker`, `video`, `voice`, `video_note`, `caption`, `contact`, `photo`, `sticker`, `video`, `voice`, `video_note`, `caption`, `contact`,
`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`,
...@@ -838,7 +838,7 @@ class DB ...@@ -838,7 +838,7 @@ class DB
`migrate_from_chat_id`, `migrate_to_chat_id`, `pinned_message` `migrate_from_chat_id`, `migrate_to_chat_id`, `pinned_message`
) 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, :text, :entities, :audio, :document, :forward_date, :reply_to_chat, :reply_to_message, :media_group_id, :text, :entities, :audio, :document,
:photo, :sticker, :video, :voice, :video_note, :caption, :contact, :photo, :sticker, :video, :voice, :video_note, :caption, :contact,
: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,
...@@ -878,6 +878,7 @@ class DB ...@@ -878,6 +878,7 @@ class DB
$sth->bindValue(':reply_to_chat', $reply_to_chat_id); $sth->bindValue(':reply_to_chat', $reply_to_chat_id);
$sth->bindValue(':reply_to_message', $reply_to_message_id); $sth->bindValue(':reply_to_message', $reply_to_message_id);
$sth->bindValue(':media_group_id', $message->getMediaGroupId());
$sth->bindValue(':text', $message->getText()); $sth->bindValue(':text', $message->getText());
$sth->bindValue(':entities', $t = self::entitiesArrayToJson($message->getEntities(), null)); $sth->bindValue(':entities', $t = self::entitiesArrayToJson($message->getEntities(), null));
$sth->bindValue(':audio', $message->getAudio()); $sth->bindValue(':audio', $message->getAudio());
......
...@@ -29,6 +29,7 @@ use Longman\TelegramBot\Entities\Payments\SuccessfulPayment; ...@@ -29,6 +29,7 @@ use Longman\TelegramBot\Entities\Payments\SuccessfulPayment;
* @method int getForwardDate() Optional. For forwarded messages, date the original message was sent in Unix time * @method int getForwardDate() Optional. For forwarded messages, date the original message was sent in Unix time
* @method Message getReplyToMessage() Optional. For replies, the original message. Note that the Message object in this field will not contain further reply_to_message fields even if it itself is a reply. * @method Message getReplyToMessage() Optional. For replies, the original message. Note that the Message object in this field will not contain further reply_to_message fields even if it itself is a reply.
* @method int getEditDate() Optional. Date the message was last edited in Unix time * @method int getEditDate() Optional. Date the message was last edited in Unix time
* @method string getMediaGroupId() Optional. The unique identifier of a media message group this message belongs to
* @method string getAuthorSignature() Optional. Signature of the post author for messages in channels * @method string getAuthorSignature() Optional. Signature of the post author for messages in channels
* @method Audio getAudio() Optional. Message is an audio file, information about the file * @method Audio getAudio() Optional. Message is an audio file, information about the file
* @method Document getDocument() Optional. Message is a general file, information about the file * @method Document getDocument() Optional. Message is a general file, information about the file
......
...@@ -76,6 +76,7 @@ CREATE TABLE IF NOT EXISTS `message` ( ...@@ -76,6 +76,7 @@ CREATE TABLE IF NOT EXISTS `message` (
`forward_date` timestamp NULL DEFAULT NULL COMMENT 'date the original message was sent in timestamp format', `forward_date` timestamp NULL DEFAULT NULL COMMENT 'date the original message was sent in timestamp format',
`reply_to_chat` bigint NULL DEFAULT NULL COMMENT 'Unique chat identifier', `reply_to_chat` bigint NULL DEFAULT NULL COMMENT 'Unique chat identifier',
`reply_to_message` bigint UNSIGNED DEFAULT NULL COMMENT 'Message that this message is reply to', `reply_to_message` bigint UNSIGNED DEFAULT NULL COMMENT 'Message that this message is reply to',
`media_group_id` TEXT COMMENT 'The unique identifier of a media message group this message belongs to',
`text` TEXT COMMENT 'For text messages, the actual UTF-8 text of the message max message length 4096 char utf8mb4', `text` TEXT COMMENT 'For text messages, the actual UTF-8 text of the message max message length 4096 char utf8mb4',
`entities` TEXT COMMENT 'For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text', `entities` TEXT COMMENT 'For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text',
`audio` TEXT COMMENT 'Audio object. Message is an audio file, information about the file', `audio` TEXT COMMENT 'Audio object. Message is an audio file, information about the file',
......
ALTER TABLE `message` ADD COLUMN `media_group_id` TEXT COMMENT 'The unique identifier of a media message group this message belongs to' AFTER `reply_to_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