diff --git a/bot.php b/bot.php index df622a39f..535ca769f 100755 --- a/bot.php +++ b/bot.php @@ -67,13 +67,8 @@ class EventHandler extends \danog\MadelineProto\EventHandler $settings = ['app_info' => ['api_id' => 6, 'api_hash' => 'eb06d4abfb49dc3eeb1aeb98ae0f581e'], 'updates' => ['handle_updates' => true]]; //, 'connection_settings' => ['all' => ['test_mode' => true]]]; -try { - $MadelineProto = new \danog\MadelineProto\API('bot.madeline', $settings); -} catch (\danog\MadelineProto\Exception $e) { - \danog\MadelineProto\Logger::log($e->getMessage()); - unlink('bot.madeline'); - $MadelineProto = new \danog\MadelineProto\API('bot.madeline', $settings); -} +$MadelineProto = new \danog\MadelineProto\API('bot.madeline', $settings); + $MadelineProto->start(); $MadelineProto->setEventHandler('\EventHandler'); $MadelineProto->loop(); diff --git a/magna.php b/magna.php index 537576cbc..9c1a8633d 100755 --- a/magna.php +++ b/magna.php @@ -19,14 +19,7 @@ if (file_exists('web_data.php')) { echo 'Deserializing MadelineProto from session.madeline...'.PHP_EOL; -try { - $MadelineProto = new \danog\MadelineProto\API('session.madeline'); -} catch (\danog\MadelineProto\Exception $e) { - echo $e.PHP_EOL; - unlink('session.madeline'); - $MadelineProto = new \danog\MadelineProto\API('session.madeline'); -} - +$MadelineProto = new \danog\MadelineProto\API('session.madeline'); $MadelineProto->start(); if (!isset($MadelineProto->programmed_call)) { diff --git a/tests/testing.php b/tests/testing.php index f8cbb158c..837f4c60e 100755 --- a/tests/testing.php +++ b/tests/testing.php @@ -43,13 +43,7 @@ $settings = json_decode(getenv('MTPROTO_SETTINGS'), true) ?: []; */ echo 'Loading MadelineProto...'.PHP_EOL; -try { - $MadelineProto = new \danog\MadelineProto\API(getcwd().'/testing.madeline', $settings); -} catch (\danog\MadelineProto\Exception $e) { - echo $e.PHP_EOL; - unlink(getcwd().'/testing.madeline'); - $MadelineProto = new \danog\MadelineProto\API(getcwd().'/testing.madeline', $settings); -} +$MadelineProto = new \danog\MadelineProto\API(getcwd().'/testing.madeline', $settings); /* * If this session is not logged in, login