forked from mirzaev/pot-php
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 8389137f7c | |||
| 8225969e37 |
@@ -9,6 +9,7 @@ return [
|
||||
|
||||
// Main menu
|
||||
'menu_title' => 'Main menu',
|
||||
'menu_update' => 'Last update',
|
||||
|
||||
// Account
|
||||
'account_title' => 'Account',
|
||||
|
||||
@@ -9,7 +9,8 @@ return [
|
||||
|
||||
// Главное меню
|
||||
'menu_title' => 'Главное меню',
|
||||
|
||||
'menu_update' => 'Последнее обновление',
|
||||
|
||||
// Аккаунт
|
||||
'account_title' => 'Аккаунт',
|
||||
'account_authorized_system' => 'Доступ к системе',
|
||||
|
||||
@@ -228,11 +228,11 @@ final class account extends core implements record_interface
|
||||
$$settings->write(account: $$record->identifier);
|
||||
|
||||
// Writing the record into the database
|
||||
$$record = $$this->database->read(
|
||||
/* $$record = $$this->database->read(
|
||||
filter: fn(record $$_record) => $$_record->identifier === $$record->identifier,
|
||||
update: fn(record &$$_record) => $$_record = $$record,
|
||||
amount: 1
|
||||
)[0] ?? null;
|
||||
)[0] ?? null; */
|
||||
|
||||
// Exit (success)
|
||||
return $$record;
|
||||
|
||||
@@ -92,7 +92,7 @@ final class authorizations extends core implements record_interface
|
||||
* @param bool $$system_settings
|
||||
* @param bool $$active Is the record active?
|
||||
*
|
||||
* @return int|false The record identifier, if created
|
||||
* @return record|false The record identifier, if created
|
||||
*/
|
||||
public function write(
|
||||
int $$account,
|
||||
@@ -100,7 +100,7 @@ final class authorizations extends core implements record_interface
|
||||
bool $$settings = true,
|
||||
bool $$system_settings = false,
|
||||
bool $$active = true,
|
||||
): int|false
|
||||
): record|false
|
||||
{
|
||||
$$record = $$this->database->record(
|
||||
$$this->database->count() + 1,
|
||||
@@ -117,7 +117,7 @@ final class authorizations extends core implements record_interface
|
||||
$$created = $$this->database->write($$record);
|
||||
|
||||
// Exit (success)
|
||||
return $$created ? $$record->identifier : false;
|
||||
return $$created ? $$record : false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -83,12 +83,12 @@ final class settings extends core implements record_interface
|
||||
* @param int $$account The account identifier
|
||||
* @param int $$active Is the record active?
|
||||
*
|
||||
* @return int|false The record identifier, if created
|
||||
* @return record|false The record, if created
|
||||
*/
|
||||
public function write(
|
||||
int $$account,
|
||||
bool $$active = true,
|
||||
): int|false {
|
||||
): record|false {
|
||||
$$record = $$this->database->record(
|
||||
$$this->database->count() + 1,
|
||||
$$account,
|
||||
@@ -101,7 +101,7 @@ final class settings extends core implements record_interface
|
||||
$$created = $$this->database->write($$record);
|
||||
|
||||
// Exit (success)
|
||||
return $$created ? $$record->identifier : false;
|
||||
return $$created ? $$record : false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -74,13 +74,17 @@ final class commands extends core
|
||||
if ($$localization) {
|
||||
// Initialized localization
|
||||
|
||||
// Initializing the title
|
||||
// Initializing the message title
|
||||
$$title = '📋 *' . $$localization['menu_title'] . '*';
|
||||
|
||||
// Initializing the message last update text
|
||||
exec(command: 'git log --oneline $$(git describe --tags --abbrev=0 @^ --always)..@ -1 --format="%at" | xargs -I{} date -d @{} "+%Y.%m.%d %H:%M"', output: $$git);
|
||||
$$update = empty($$git[0]) ? '' : "\n\n🔏 *" . $$localization['menu_update'] . ':* ' . unmarkdown($$git[0]);
|
||||
|
||||
// Sending the message
|
||||
$$context->sendMessage(
|
||||
<<<TXT
|
||||
$$title
|
||||
$$title$$update
|
||||
TXT,
|
||||
[
|
||||
'reply_markup' => [
|
||||
|
||||
@@ -9,7 +9,7 @@ require ROOT . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php';
|
||||
define('PROJECT_NAME', '');
|
||||
define('PROJECT_DOMAIN', '');
|
||||
|
||||
defing('LANGUAGE_DEFAULT', language::en);
|
||||
define('LANGUAGE_DEFAULT', language::en);
|
||||
|
||||
// Initializing default theme for the views templater
|
||||
define('THEME', 'default');
|
||||
|
||||
Reference in New Issue
Block a user