@@ -549,7 +549,7 @@ public static function insertRequest(Update $update)
549
549
$ shipping_query_id = $ shipping_query ->getId ();
550
550
} elseif (($ pre_checkout_query = $ update ->getPreCheckoutQuery ()) && self ::insertPreCheckoutQueryRequest ($ pre_checkout_query )) {
551
551
$ pre_checkout_query_id = $ pre_checkout_query ->getId ();
552
- } elseif (($ poll = $ update ->getPoll ()) && self ::insertPoll ($ poll )) {
552
+ } elseif (($ poll = $ update ->getPoll ()) && self ::insertPollRequest ($ poll )) {
553
553
$ poll_id = $ poll ->getId ();
554
554
} else {
555
555
return false ;
@@ -844,7 +844,7 @@ public static function insertPollRequest(Poll $poll)
844
844
845
845
$ sth ->bindValue (':id ' , $ poll ->getId ());
846
846
$ sth ->bindValue (':question ' , $ poll ->getQuestion ());
847
- $ sth ->bindValue (':options ' , self ::entitiesArrayToJson ($ poll ->getOptions (), null ));
847
+ $ sth ->bindValue (':options ' , self ::entitiesArrayToJson ($ poll ->getOptions ()));
848
848
$ sth ->bindValue (':is_closed ' , $ poll ->getIsClosed ());
849
849
$ sth ->bindValue (':created_at ' , self ::getTimestamp ());
850
850
@@ -922,20 +922,20 @@ public static function insertMessageRequest(Message $message)
922
922
(
923
923
`id`, `user_id`, `chat_id`, `date`, `forward_from`, `forward_from_chat`, `forward_from_message_id`,
924
924
`forward_signature`, `forward_sender_name`, `forward_date`,
925
- `reply_to_chat`, `reply_to_message`, `media_group_id`, `text `, `entities `, `audio `, `document `,
926
- `animation`, `game`, `photo`, `sticker`, `video`, `voice`, `video_note`, `caption`, `contact`,
925
+ `reply_to_chat`, `reply_to_message`, `edit_date`, ` media_group_id`, `author_signature `, `text `, `entities `, `caption_entities `,
926
+ `audio`, `document`, ` animation`, `game`, `photo`, `sticker`, `video`, `voice`, `video_note`, `caption`, `contact`,
927
927
`location`, `venue`, `poll`, `new_chat_members`, `left_chat_member`,
928
- `new_chat_title`,`new_chat_photo`, `delete_chat_photo`, `group_chat_created`,
929
- `supergroup_chat_created`, `channel_chat_created`, `migrate_from_chat_id `, `migrate_to_chat_id `,
928
+ `new_chat_title`, `new_chat_photo`, `delete_chat_photo`, `group_chat_created`,
929
+ `supergroup_chat_created`, `channel_chat_created`, `migrate_to_chat_id `, `migrate_from_chat_id `,
930
930
`pinned_message`, `invoice`, `successful_payment`, `connected_website`, `passport_data`
931
931
) VALUES (
932
932
:message_id, :user_id, :chat_id, :date, :forward_from, :forward_from_chat, :forward_from_message_id,
933
933
:forward_signature, :forward_sender_name, :forward_date,
934
- :reply_to_chat, :reply_to_message, :media_group_id, :text , :entities , :audio , :document ,
935
- :animation, :game, :photo, :sticker, :video, :voice, :video_note, :caption, :contact,
934
+ :reply_to_chat, :reply_to_message, :edit_date, : media_group_id, :author_signature , :text , :entities , :caption_entities ,
935
+ :audio, :document, : animation, :game, :photo, :sticker, :video, :voice, :video_note, :caption, :contact,
936
936
:location, :venue, :poll, :new_chat_members, :left_chat_member,
937
937
:new_chat_title, :new_chat_photo, :delete_chat_photo, :group_chat_created,
938
- :supergroup_chat_created, :channel_chat_created, :migrate_from_chat_id , :migrate_to_chat_id ,
938
+ :supergroup_chat_created, :channel_chat_created, :migrate_to_chat_id , :migrate_from_chat_id ,
939
939
:pinned_message, :invoice, :successful_payment, :connected_website, :passport_data
940
940
)
941
941
' );
@@ -977,13 +977,13 @@ public static function insertMessageRequest(Message $message)
977
977
$ sth ->bindValue (':media_group_id ' , $ message ->getMediaGroupId ());
978
978
$ sth ->bindValue (':author_signature ' , $ message ->getAuthorSignature ());
979
979
$ sth ->bindValue (':text ' , $ message ->getText ());
980
- $ sth ->bindValue (':entities ' , self ::entitiesArrayToJson ($ message ->getEntities (), null ));
981
- $ sth ->bindValue (':caption_entities ' , self ::entitiesArrayToJson ($ message ->getCaptionEntities (), null ));
980
+ $ sth ->bindValue (':entities ' , self ::entitiesArrayToJson ($ message ->getEntities ()));
981
+ $ sth ->bindValue (':caption_entities ' , self ::entitiesArrayToJson ($ message ->getCaptionEntities ()));
982
982
$ sth ->bindValue (':audio ' , $ message ->getAudio ());
983
983
$ sth ->bindValue (':document ' , $ message ->getDocument ());
984
984
$ sth ->bindValue (':animation ' , $ message ->getAnimation ());
985
985
$ sth ->bindValue (':game ' , $ message ->getGame ());
986
- $ sth ->bindValue (':photo ' , self ::entitiesArrayToJson ($ message ->getPhoto (), null ));
986
+ $ sth ->bindValue (':photo ' , self ::entitiesArrayToJson ($ message ->getPhoto ()));
987
987
$ sth ->bindValue (':sticker ' , $ message ->getSticker ());
988
988
$ sth ->bindValue (':video ' , $ message ->getVideo ());
989
989
$ sth ->bindValue (':voice ' , $ message ->getVoice ());
@@ -996,13 +996,13 @@ public static function insertMessageRequest(Message $message)
996
996
$ sth ->bindValue (':new_chat_members ' , $ new_chat_members_ids );
997
997
$ sth ->bindValue (':left_chat_member ' , $ left_chat_member_id );
998
998
$ sth ->bindValue (':new_chat_title ' , $ message ->getNewChatTitle ());
999
- $ sth ->bindValue (':new_chat_photo ' , self ::entitiesArrayToJson ($ message ->getNewChatPhoto (), null ));
999
+ $ sth ->bindValue (':new_chat_photo ' , self ::entitiesArrayToJson ($ message ->getNewChatPhoto ()));
1000
1000
$ sth ->bindValue (':delete_chat_photo ' , $ message ->getDeleteChatPhoto ());
1001
1001
$ sth ->bindValue (':group_chat_created ' , $ message ->getGroupChatCreated ());
1002
1002
$ sth ->bindValue (':supergroup_chat_created ' , $ message ->getSupergroupChatCreated ());
1003
1003
$ sth ->bindValue (':channel_chat_created ' , $ message ->getChannelChatCreated ());
1004
- $ sth ->bindValue (':migrate_from_chat_id ' , $ message ->getMigrateFromChatId ());
1005
1004
$ sth ->bindValue (':migrate_to_chat_id ' , $ message ->getMigrateToChatId ());
1005
+ $ sth ->bindValue (':migrate_from_chat_id ' , $ message ->getMigrateFromChatId ());
1006
1006
$ sth ->bindValue (':pinned_message ' , $ message ->getPinnedMessage ());
1007
1007
$ sth ->bindValue (':invoice ' , $ message ->getInvoice ());
1008
1008
$ sth ->bindValue (':successful_payment ' , $ message ->getSuccessfulPayment ());
@@ -1059,7 +1059,7 @@ public static function insertEditedMessageRequest(Message $edited_message)
1059
1059
$ sth ->bindValue (':user_id ' , $ user_id );
1060
1060
$ sth ->bindValue (':edit_date ' , $ edit_date );
1061
1061
$ sth ->bindValue (':text ' , $ edited_message ->getText ());
1062
- $ sth ->bindValue (':entities ' , self ::entitiesArrayToJson ($ edited_message ->getEntities (), null ));
1062
+ $ sth ->bindValue (':entities ' , self ::entitiesArrayToJson ($ edited_message ->getEntities ()));
1063
1063
$ sth ->bindValue (':caption ' , $ edited_message ->getCaption ());
1064
1064
1065
1065
return $ sth ->execute ();
@@ -1216,7 +1216,7 @@ public static function getTelegramRequestCount($chat_id = null, $inline_message_
1216
1216
$ sth ->execute ();
1217
1217
1218
1218
return $ sth ->fetch ();
1219
- } catch (Exception $ e ) {
1219
+ } catch (PDOException $ e ) {
1220
1220
throw new TelegramException ($ e ->getMessage ());
1221
1221
}
1222
1222
}
@@ -1252,7 +1252,7 @@ public static function insertTelegramRequest($method, $data)
1252
1252
$ sth ->bindValue (':created_at ' , self ::getTimestamp ());
1253
1253
1254
1254
return $ sth ->execute ();
1255
- } catch (Exception $ e ) {
1255
+ } catch (PDOException $ e ) {
1256
1256
throw new TelegramException ($ e ->getMessage ());
1257
1257
}
1258
1258
}
@@ -1295,7 +1295,7 @@ public static function update($table, array $fields_values, array $where_fields_
1295
1295
$ sql .= count ($ where ) > 0 ? ' WHERE ' . implode (' AND ' , $ where ) : '' ;
1296
1296
1297
1297
return self ::$ pdo ->prepare ($ sql )->execute ($ tokens );
1298
- } catch (Exception $ e ) {
1298
+ } catch (PDOException $ e ) {
1299
1299
throw new TelegramException ($ e ->getMessage ());
1300
1300
}
1301
1301
}
0 commit comments