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
70d55ff3
Unverified
Commit
70d55ff3
authored
Apr 22, 2018
by
Avtandil Kikabidze
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ignore custom input
parent
8a70d87e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
21 deletions
+16
-21
Kernel.php
src/Console/Kernel.php
+16
-21
No files found.
src/Console/Kernel.php
View file @
70d55ff3
...
...
@@ -62,31 +62,26 @@ class Kernel
$offset
=
0
;
// Take custom input into account.
if
(
$custom_input
=
$this
->
app
->
getCustomInput
())
{
$response
=
new
Response
(
json_decode
(
$custom_input
,
true
),
$this
->
app
->
getBotUsername
());
}
else
{
if
(
DB
::
isDbConnected
())
{
// Get last update id from the database
$last_update
=
DB
::
selectTelegramUpdate
(
1
);
$last_update
=
reset
(
$last_update
);
if
(
DB
::
isDbConnected
())
{
// Get last update id from the database
$last_update
=
DB
::
selectTelegramUpdate
(
1
);
$last_update
=
reset
(
$last_update
);
$this
->
app
->
last_update_id
=
isset
(
$last_update
[
'id'
])
?
$last_update
[
'id'
]
:
null
;
}
if
(
$this
->
app
->
last_update_id
!==
null
)
{
$offset
=
$this
->
app
->
last_update_id
+
1
;
//As explained in the telegram bot API documentation
}
$this
->
app
->
last_update_id
=
isset
(
$last_update
[
'id'
])
?
$last_update
[
'id'
]
:
null
;
}
$response
=
Client
::
getUpdates
(
[
'offset'
=>
$offset
,
'limit'
=>
$limit
,
'timeout'
=>
$timeout
,
]
);
if
(
$this
->
app
->
last_update_id
!==
null
)
{
$offset
=
$this
->
app
->
last_update_id
+
1
;
//As explained in the telegram bot API documentation
}
$response
=
Client
::
getUpdates
(
[
'offset'
=>
$offset
,
'limit'
=>
$limit
,
'timeout'
=>
$timeout
,
]
);
if
(
$response
->
isOk
())
{
$results
=
$response
->
getResult
();
...
...
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