Updated method \TgBotLib > Bot > handleGetUpdates() to handle exceptions

This commit is contained in:
Netkas 2023-08-09 20:02:59 -04:00
parent 8a4dfddae6
commit fbc472d8de
No known key found for this signature in database
GPG key ID: 5DAF58535614062B
6 changed files with 21 additions and 27 deletions

View file

@ -1,19 +0,0 @@
<?php
require __DIR__ . DIRECTORY_SEPARATOR . 'autoload.php';
import('net.nosial.tamerlib');
$bot = new TgBotLib\Bot(getenv('BOT_TOKEN'));
TamerLib\Tamer::init(\TamerLib\Abstracts\ProtocolType::Gearman, ['127.0.0.1:4730']);
TamerLib\Tamer::addWorker(__DIR__ . DIRECTORY_SEPARATOR . 'worker.php', 10);
var_dump('Starting workers');
TamerLib\Tamer::startWorkers();
while(true)
{
foreach($bot->getUpdates() as $update)
{
TamerLib\Tamer::do(TamerLib\Objects\Task::create('handle_update', json_encode($update->toArray())));
}
}