forked from mirzaev/deeproots_bot
switch tabs to spaces, editorconfig
This commit is contained in:
parent
468f454cab
commit
a45eaca11f
|
@ -0,0 +1,7 @@
|
|||
root = true
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
indent_style = space
|
||||
indent_size = 4
|
|
@ -7,4 +7,3 @@ fi
|
|||
if [ -d author ]; then
|
||||
mv author mirzaev
|
||||
fi
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ return [
|
|||
// Repository
|
||||
'repository_title' => 'Repository',
|
||||
'repository_text' => <<<TXT
|
||||
Svoboder is written in [PHP](https://www.php.net/) using [Zanzara](https://github.com/badfarm/zanzara) for Telegram,
|
||||
Deeproots is written in [PHP](https://www.php.net/) using [Zanzara](https://github.com/badfarm/zanzara) for Telegram,
|
||||
my [MINIMAL](https://git.svoboda.works/mirzaev/minimal) framework for PHP and my [Baza](https://git.svoboda.works/mirzaev/baza) database
|
||||
|
||||
The code is under the [WTFPL](https://en.wikipedia.org/wiki/WTFPL) license
|
||||
|
|
|
@ -202,15 +202,15 @@ final class account extends core
|
|||
$identifier,
|
||||
$name,
|
||||
$language->name,
|
||||
ACCOUNT_ACCESS_SYSTEM,
|
||||
ACCOUNT_ACCESS_GAME_PLAY,
|
||||
ACCOUNT_ACCESS_RATING_DISPLAY,
|
||||
ACCOUNT_ACCESS_BALANCE_DEPOSIT,
|
||||
ACCOUNT_ACCESS_BALANCE_WITHDRAW,
|
||||
ACCOUNT_ACCESS_SETTINGS,
|
||||
ACCOUNT_ACCESS_SYSTEM_ACCOUNTS,
|
||||
ACCOUNT_ACCESS_SYSTEM_QUESTIONS,
|
||||
ACCOUNT_ACCESS_SYSTEM_SETTINGS,
|
||||
1, // ACCOUNT_ACCESS_SYSTEM
|
||||
1, // ACCOUNT_ACCESS_GAME_PLAY
|
||||
1, // ACCOUNT_ACCESS_RATING_DISPLAY
|
||||
1, // ACCOUNT_ACCESS_BALANCE_DEPOSIT
|
||||
1, // ACCOUNT_ACCESS_BALANCE_WITHDRAW
|
||||
1, // ACCOUNT_ACCESS_SETTINGS
|
||||
0, // ACCOUNT_ACCESS_SYSTEM_ACCOUNTS
|
||||
0, // ACCOUNT_ACCESS_SYSTEM_QUESTIONS
|
||||
0, // ACCOUNT_ACCESS_SYSTEM_SETTINGS
|
||||
svoboda::timestamp(),
|
||||
svoboda::timestamp()
|
||||
);
|
||||
|
|
|
@ -41,4 +41,3 @@ class core extends model
|
|||
{
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -59,7 +59,7 @@ final class question extends core
|
|||
$this->database = new database()
|
||||
->encoding(encoding::ascii)
|
||||
->columns(
|
||||
new column('identifier', type::long_long_unsigned),
|
||||
new column('identifier', type::integer_unsigned),
|
||||
new column('active', type::char),
|
||||
new column('updated', type::integer_unsigned),
|
||||
new column('created', type::integer_unsigned)
|
||||
|
|
|
@ -412,79 +412,6 @@ final class middlewares extends core
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Join (middleware)
|
||||
*
|
||||
* Check the account for access to join to distributions
|
||||
*
|
||||
* @param context $context
|
||||
* @param node $next
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public static function join(context $context, node $next): void
|
||||
{
|
||||
// Is the process stopped?
|
||||
if ($context->get('stop')) return;
|
||||
|
||||
// Initializing the account
|
||||
$account = $context->get('account');
|
||||
|
||||
if ($account instanceof record) {
|
||||
// Initialized the account
|
||||
|
||||
// Initializing localization
|
||||
$localization = $context->get('localization');
|
||||
|
||||
if ($localization) {
|
||||
// Initialized localization
|
||||
|
||||
if ($account->authorized_joins) {
|
||||
// Authorized the account to joint to distributions
|
||||
|
||||
// Continuation of the process
|
||||
$next($context);
|
||||
} else {
|
||||
// Not authorized the account to joint to distributions
|
||||
|
||||
// Sending the message
|
||||
$context->sendMessage('⛔ *' . $localization['not_authorized_joins'] . '*')
|
||||
->then(function (message $message) use ($context) {
|
||||
// Sended the message
|
||||
|
||||
// Ending the conversation process
|
||||
$context->endConversation();
|
||||
});
|
||||
|
||||
// Stopping the process
|
||||
$context->set('stop', true);
|
||||
}
|
||||
} else {
|
||||
// Not initialized localization
|
||||
|
||||
// Sending the message
|
||||
$context->sendMessage('⚠️ *Failed to initialize localization*')
|
||||
->then(function (message $message) use ($context) {
|
||||
// Sended the message
|
||||
|
||||
// Ending the conversation process
|
||||
$context->endConversation();
|
||||
});
|
||||
}
|
||||
} else {
|
||||
// Not initialized the account
|
||||
|
||||
// Sending the message
|
||||
$context->sendMessage('⚠️ *Failed to initialize the account*')
|
||||
->then(function (message $message) use ($context) {
|
||||
// Sended the message
|
||||
|
||||
// Ending the conversation process
|
||||
$context->endConversation();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Settings (middleware)
|
||||
*
|
||||
|
|
|
@ -78,7 +78,7 @@ $robot->onCommand('repository', [commands::class, 'repository']);
|
|||
/* $robot->onCommand('projects', [commands::class, 'projects']); */
|
||||
$robot->onCommand('author', [commands::class, 'author']);
|
||||
$robot->onCommand('society', [commands::class, 'society']);
|
||||
/* $robot->onCommand('system_settings', [commands::class, 'system_settings'])->middleware([middlewares::class, 'system_settings']); */
|
||||
// $robot->onCommand('system_settings', [commands::class, 'system_settings'])->middleware([middlewares::class, 'system']);
|
||||
|
||||
// Initializing the robot settings language buttons handlers
|
||||
foreach (language::cases() as $language) {
|
||||
|
|
|
@ -208,4 +208,3 @@ final class templater extends controller implements array_access
|
|||
return isset($this->variables[$name]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -28,4 +28,3 @@
|
|||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
|
|
Loading…
Reference in New Issue