Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
TelegramBot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
TelegramBot
Commits
b2e6005b
Unverified
Commit
b2e6005b
authored
Aug 27, 2016
by
Armando Lüscher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tidy up insertTelegramUpdate method.
parent
b8752f08
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
22 deletions
+16
-22
DB.php
src/DB.php
+16
-22
No files found.
src/DB.php
View file @
b2e6005b
...
...
@@ -268,7 +268,7 @@ class DB
$callback_query_id
,
$edited_message_id
)
{
if
(
is_null
(
$message_id
)
&&
is_null
(
$inline_query_id
)
&&
is_null
(
$chosen_inline_result_id
)
&&
is_null
(
$callback_query_id
)
&&
is_null
(
$edited_message_id
)
)
{
if
(
$message_id
===
null
&&
$inline_query_id
===
null
&&
$chosen_inline_result_id
===
null
&&
$callback_query_id
===
null
&&
$edited_message_id
===
null
)
{
throw
new
TelegramException
(
'message_id, inline_query_id, chosen_inline_result_id, callback_query_id, edited_message_id are all null'
);
}
...
...
@@ -277,28 +277,22 @@ class DB
}
try
{
$sth_insert_telegram_update
=
self
::
$pdo
->
prepare
(
'INSERT IGNORE INTO `'
.
TB_TELEGRAM_UPDATE
.
'`
(
`id`, `chat_id`, `message_id`, `inline_query_id`, `chosen_inline_result_id`, `callback_query_id`, `edited_message_id`
)
VALUES (
:id, :chat_id, :message_id, :inline_query_id, :chosen_inline_result_id, :callback_query_id, :edited_message_id
)
'
);
$sth
=
self
::
$pdo
->
prepare
(
'
INSERT IGNORE INTO `'
.
TB_TELEGRAM_UPDATE
.
'`
(`id`, `chat_id`, `message_id`, `inline_query_id`, `chosen_inline_result_id`, `callback_query_id`, `edited_message_id`)
VALUES
(:id, :chat_id, :message_id, :inline_query_id, :chosen_inline_result_id, :callback_query_id, :edited_message_id)
'
);
$sth
->
bindParam
(
':id'
,
$id
,
PDO
::
PARAM_INT
);
$sth
->
bindParam
(
':chat_id'
,
$chat_id
,
PDO
::
PARAM_INT
);
$sth
->
bindParam
(
':message_id'
,
$message_id
,
PDO
::
PARAM_INT
);
$sth
->
bindParam
(
':inline_query_id'
,
$inline_query_id
,
PDO
::
PARAM_INT
);
$sth
->
bindParam
(
':chosen_inline_result_id'
,
$chosen_inline_result_id
,
PDO
::
PARAM_INT
);
$sth
->
bindParam
(
':callback_query_id'
,
$callback_query_id
,
PDO
::
PARAM_INT
);
$sth
->
bindParam
(
':edited_message_id'
,
$edited_message_id
,
PDO
::
PARAM_INT
);
$sth_insert_telegram_update
->
bindParam
(
':id'
,
$id
,
PDO
::
PARAM_INT
);
$sth_insert_telegram_update
->
bindParam
(
':chat_id'
,
$chat_id
,
PDO
::
PARAM_INT
);
$sth_insert_telegram_update
->
bindParam
(
':message_id'
,
$message_id
,
PDO
::
PARAM_INT
);
$sth_insert_telegram_update
->
bindParam
(
':inline_query_id'
,
$inline_query_id
,
PDO
::
PARAM_INT
);
$sth_insert_telegram_update
->
bindParam
(
':chosen_inline_result_id'
,
$chosen_inline_result_id
,
PDO
::
PARAM_INT
);
$sth_insert_telegram_update
->
bindParam
(
':callback_query_id'
,
$callback_query_id
,
PDO
::
PARAM_INT
);
$sth_insert_telegram_update
->
bindParam
(
':edited_message_id'
,
$edited_message_id
,
PDO
::
PARAM_INT
);
return
$sth_insert_telegram_update
->
execute
();
return
$sth
->
execute
();
}
catch
(
PDOException
$e
)
{
throw
new
TelegramException
(
$e
->
getMessage
());
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment