Ignore custom input

parent 8a70d87e
......@@ -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();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment