generated from mirzaev/pot
fixes
This commit is contained in:
parent
53f8f3871c
commit
accfe5a496
|
@ -900,6 +900,7 @@ final class interneturok extends core
|
|||
*/
|
||||
public static function amount(): int
|
||||
{
|
||||
try {
|
||||
// Opening the interneturok accounts file
|
||||
$file = new spl(INTERNETUROK_ACCOUNTS_FILE, 'r');
|
||||
|
||||
|
@ -911,5 +912,9 @@ final class interneturok extends core
|
|||
|
||||
// Exit (success)
|
||||
return $rows;
|
||||
} catch (exception $exception) {
|
||||
// Exit (fail)
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,6 +17,9 @@ use Zanzara\Context as context,
|
|||
// Framework for asynchronous PHP
|
||||
use function React\Async\await;
|
||||
|
||||
// Built-in libraries
|
||||
use Exception as exception;
|
||||
|
||||
/**
|
||||
* Telegram shcool subjects parser
|
||||
*
|
||||
|
@ -205,6 +208,8 @@ final class parser extends core
|
|||
// Initializing the parser
|
||||
$parser = new interneturok();
|
||||
|
||||
try {
|
||||
|
||||
// Parsing homework files
|
||||
$files = $parser->parse(subject: $subject, grade: $grade, waiting: 3);
|
||||
|
||||
|
@ -232,6 +237,16 @@ final class parser extends core
|
|||
commands::menu($context);
|
||||
});
|
||||
}
|
||||
} catch (exception $exception) {
|
||||
// Sending the message
|
||||
$context->sendMessage('⚠️ *Произошла ошибка при обработке домашних заданий')
|
||||
->then(function (message $message) use ($context) {
|
||||
// Sended the message
|
||||
|
||||
// Sending the menu with subjects
|
||||
commands::menu($context);
|
||||
});
|
||||
}
|
||||
} else {
|
||||
// Not initialized the parsing process
|
||||
|
||||
|
|
Loading…
Reference in New Issue