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
3b7ddbc8
Unverified
Commit
3b7ddbc8
authored
Aug 27, 2016
by
Armando Lüscher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tidy up insertRequest method.
parent
b2e6005b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
6 deletions
+14
-6
DB.php
src/DB.php
+14
-6
No files found.
src/DB.php
View file @
3b7ddbc8
...
...
@@ -425,30 +425,36 @@ class DB
* @param \Longman\TelegramBot\Entities\Update $update
*
* @return bool
* @throws \Longman\TelegramBot\Exception\TelegramException
*/
public
static
function
insertRequest
(
Update
$update
)
{
$update_id
=
$update
->
getUpdateId
();
if
(
$update
->
getUpdateType
()
==
'message'
)
{
$update_type
=
$update
->
getUpdateType
();
if
(
$update_type
===
'message'
)
{
$message
=
$update
->
getMessage
();
if
(
self
::
insertMessageRequest
(
$message
))
{
$message_id
=
$message
->
getMessageId
();
$chat_id
=
$message
->
getChat
()
->
getId
();
return
self
::
insertTelegramUpdate
(
$update_id
,
$chat_id
,
$message_id
,
null
,
null
,
null
,
null
);
}
}
elseif
(
$update
->
getUpdateType
()
==
'inline_query'
)
{
}
elseif
(
$update
_type
=
==
'inline_query'
)
{
$inline_query
=
$update
->
getInlineQuery
();
if
(
self
::
insertInlineQueryRequest
(
$inline_query
))
{
$inline_query_id
=
$inline_query
->
getId
();
return
self
::
insertTelegramUpdate
(
$update_id
,
null
,
null
,
$inline_query_id
,
null
,
null
,
null
);
}
}
elseif
(
$update
->
getUpdateType
()
==
'chosen_inline_result'
)
{
}
elseif
(
$update
_type
=
==
'chosen_inline_result'
)
{
$chosen_inline_result
=
$update
->
getChosenInlineResult
();
if
(
self
::
insertChosenInlineResultRequest
(
$chosen_inline_result
))
{
$chosen_inline_result_local_id
=
self
::
$pdo
->
lastInsertId
();
return
self
::
insertTelegramUpdate
(
$update_id
,
null
,
...
...
@@ -459,19 +465,21 @@ class DB
null
);
}
}
elseif
(
$update
->
getUpdateType
()
==
'callback_query'
)
{
}
elseif
(
$update
_type
=
==
'callback_query'
)
{
$callback_query
=
$update
->
getCallbackQuery
();
if
(
self
::
insertCallbackQueryRequest
(
$callback_query
))
{
$callback_query_id
=
$callback_query
->
getId
();
return
self
::
insertTelegramUpdate
(
$update_id
,
null
,
null
,
null
,
null
,
$callback_query_id
,
null
);
}
}
elseif
(
$update
->
getUpdateType
()
==
'edited_message'
)
{
}
elseif
(
$update
_type
=
==
'edited_message'
)
{
$edited_message
=
$update
->
getEditedMessage
();
if
(
self
::
insertEditedMessageRequest
(
$edited_message
))
{
$chat_id
=
$edited_message
->
getChat
()
->
getId
();
$edited_message_local_id
=
self
::
$pdo
->
lastInsertId
();
return
self
::
insertTelegramUpdate
(
$update_id
,
$chat_id
,
...
...
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