Skip to content

Commit 0904162

Browse files
committed
Also save the Message reply_markup to DB.
1 parent a9b15e8 commit 0904162

File tree

4 files changed

+6
-2
lines changed

4 files changed

+6
-2
lines changed

src/DB.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -927,7 +927,7 @@ public static function insertMessageRequest(Message $message)
927927
`location`, `venue`, `poll`, `new_chat_members`, `left_chat_member`,
928928
`new_chat_title`, `new_chat_photo`, `delete_chat_photo`, `group_chat_created`,
929929
`supergroup_chat_created`, `channel_chat_created`, `migrate_to_chat_id`, `migrate_from_chat_id`,
930-
`pinned_message`, `invoice`, `successful_payment`, `connected_website`, `passport_data`
930+
`pinned_message`, `invoice`, `successful_payment`, `connected_website`, `passport_data`, `reply_markup`
931931
) VALUES (
932932
:message_id, :user_id, :chat_id, :date, :forward_from, :forward_from_chat, :forward_from_message_id,
933933
:forward_signature, :forward_sender_name, :forward_date,
@@ -936,7 +936,7 @@ public static function insertMessageRequest(Message $message)
936936
:location, :venue, :poll, :new_chat_members, :left_chat_member,
937937
:new_chat_title, :new_chat_photo, :delete_chat_photo, :group_chat_created,
938938
:supergroup_chat_created, :channel_chat_created, :migrate_to_chat_id, :migrate_from_chat_id,
939-
:pinned_message, :invoice, :successful_payment, :connected_website, :passport_data
939+
:pinned_message, :invoice, :successful_payment, :connected_website, :passport_data, :reply_markup
940940
)
941941
');
942942

@@ -1008,6 +1008,7 @@ public static function insertMessageRequest(Message $message)
10081008
$sth->bindValue(':successful_payment', $message->getSuccessfulPayment());
10091009
$sth->bindValue(':connected_website', $message->getConnectedWebsite());
10101010
$sth->bindValue(':passport_data', $message->getPassportData());
1011+
$sth->bindValue(':reply_markup', $message->getReplyMarkup());
10111012

10121013
return $sth->execute();
10131014
} catch (PDOException $e) {

src/Entities/Message.php

+1
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,7 @@ public function getType()
315315
'invoice',
316316
'successful_payment',
317317
'passport_data',
318+
'reply_markup',
318319
];
319320

320321
$is_command = strlen($this->getCommand()) > 0;

structure.sql

+1
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ CREATE TABLE IF NOT EXISTS `message` (
115115
`successful_payment` TEXT NULL COMMENT 'Message is a service message about a successful payment, information about the payment',
116116
`connected_website` TEXT NULL COMMENT 'The domain name of the website on which the user has logged in.',
117117
`passport_data` TEXT NULL COMMENT 'Telegram Passport data',
118+
`reply_markup` TEXT NULL COMMENT 'Inline keyboard attached to the message',
118119

119120
PRIMARY KEY (`chat_id`, `id`),
120121
KEY `user_id` (`user_id`),

utils/db-schema-update/unreleased.sql

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ALTER TABLE `message` ADD COLUMN `reply_markup` TEXT NULL COMMENT 'Inline keyboard attached to the message' AFTER `passport_data`;

0 commit comments

Comments
 (0)