1
0
generated from mirzaev/pot

2 Commits
1.0.2 ... 1.0.4

Author SHA1 Message Date
05143b6865 fixed messages 2025-03-06 06:21:52 +07:00
accfe5a496 fixes 2025-03-06 06:17:11 +07:00
2 changed files with 43 additions and 23 deletions

View File

@@ -900,6 +900,7 @@ final class interneturok extends core
*/ */
public static function amount(): int public static function amount(): int
{ {
try {
// Opening the interneturok accounts file // Opening the interneturok accounts file
$file = new spl(INTERNETUROK_ACCOUNTS_FILE, 'r'); $file = new spl(INTERNETUROK_ACCOUNTS_FILE, 'r');
@@ -911,5 +912,9 @@ final class interneturok extends core
// Exit (success) // Exit (success)
return $rows; return $rows;
} catch (exception $exception) {
// Exit (fail)
return 0;
}
} }
} }

View File

@@ -17,6 +17,9 @@ use Zanzara\Context as context,
// Framework for asynchronous PHP // Framework for asynchronous PHP
use function React\Async\await; use function React\Async\await;
// Built-in libraries
use Exception as exception;
/** /**
* Telegram shcool subjects parser * Telegram shcool subjects parser
* *
@@ -205,6 +208,8 @@ final class parser extends core
// Initializing the parser // Initializing the parser
$parser = new interneturok(); $parser = new interneturok();
try {
// Parsing homework files // Parsing homework files
$files = $parser->parse(subject: $subject, grade: $grade, waiting: 3); $files = $parser->parse(subject: $subject, grade: $grade, waiting: 3);
@@ -224,7 +229,17 @@ final class parser extends core
// Not initialized homework files // Not initialized homework files
// Sending the message // Sending the message
$context->sendMessage('❌ *Не найдены домашние задания') $context->sendMessage('❌ *Не найдены домашние задания*')
->then(function (message $message) use ($context) {
// Sended the message
// Sending the menu with subjects
commands::menu($context);
});
}
} catch (exception $exception) {
// Sending the message
$context->sendMessage('⚠️ *Произошла ошибка при обработке домашних заданий*')
->then(function (message $message) use ($context) { ->then(function (message $message) use ($context) {
// Sended the message // Sended the message