Skip to content

Commit

Permalink
bot - texts and routes
Browse files Browse the repository at this point in the history
  • Loading branch information
grandmotivator committed May 3, 2023
1 parent ab9eee0 commit 8c68b87
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 7 deletions.
6 changes: 6 additions & 0 deletions messages/ru/bot.php
Original file line number Diff line number Diff line change
Expand Up @@ -632,6 +632,8 @@
'Your wallets' => 'Ваши кошельки',
'Wallet' => 'Кошелек',
'Send' => 'Отправить',
'Deposit' => 'Пополнить',
'Withdraw' => 'Вывести',
'Transactions' => 'Транзакции',
'P2P Exchange' => 'P2P обмен',
'Transaction' => 'Транзакция',
Expand All @@ -644,9 +646,13 @@
'Receiver' => 'Получатель',
'Transfer confirmation' => 'Подтверждение перевода',
'Tips' => 'Чаевые',
'Thanks' => 'Благодарность',
'Any member of the group can add financial thanks to this author using this bot' => 'Любой участник группы может добавить финансовую благодарность этому автору используя этого бота',
'Send a Tip' => 'Отправить чаевые',
'Add a Tip' => 'Добавить чаевые',
'Send a Thank' => 'Отправить благодарность',
'Add a Thank' => 'Добавить благодарность',
'Any member of the group can receive a financial gift using this bot' => 'Любой участник группы может получить финансовый подарок используя этого бота',
'Send money' => 'Отправить деньги',
'Cancel' => 'Отменить',
'CANCEL' => 'ОТМЕНИТЬ',
Expand Down
1 change: 1 addition & 0 deletions modules/bot/components/helpers/Emoji.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,5 @@ class Emoji
public const LIST = '📖';
public const GIFT = '🎁';
public const EYE = '👁‍🗨';
public const THANKS = '🙏';
}
13 changes: 7 additions & 6 deletions modules/bot/components/response/ResponseBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -280,14 +280,15 @@ private function filterAndMergeOptionalParams(
array $optionalParams,
array $optionalParamsFilter
): array {
foreach ($replyMarkup as $key1 => $array1) {
foreach ($array1 as $key2 => $array2) {
// remove all items with visible = 0
if (isset($array2['visible'])) {
if ($array2['visible']) {
foreach ($replyMarkup as $key1 => $rowButtons) {
foreach ($rowButtons as $key2 => $button) {
// remove all buttons with visible = 0
if (isset($button['visible'])) {
if ($button['visible']) {
unset($replyMarkup[$key1][$key2]['visible']);
} else {
array_splice($replyMarkup[$key1], $key2, 1);
unset($replyMarkup[$key1][$key2]);
unset($rowButtons[$key2]);
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions modules/bot/config/actions.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,6 @@
'input_amount',
'confirmation',
'set_to_user',
'new_chat_members',
'left_chat_members',
];
2 changes: 1 addition & 1 deletion modules/bot/config/groups.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
'/help(@<botname:[\w_]+bot>)?( <message:.+>)?' => 'hello/index',
'/reload(@<botname:[\w_]+bot>)?( <message:.+>)?' => 'refresh/index',
'/norepeat(@<botname:[\w_]+bot>)?( <message:.+>)?' => 'repeat/off',
'/(gift|donation|charity|reward|present)(@<botname:[\w_]+bot>)?( <message:.+>)?' => 'tip/index',
'/(thanks|gift|donation|charity|reward|present)(@<botname:[\w_]+bot>)?( <message:.+>)?' => 'tip/index',
'/<controller:\w+>__<action:\w+>(@<botname:[\w_]+bot>)?(\?<query:(&?\w+=[^&]*)*>)?( <message:.+>)?' => '<controller>/<action>',
'/<controller:\w+>(@<botname:[\w_]+bot>)?(\?<query:(&?\w+=[^&]*)*>)?( <message:.+>)?' => '<controller>/index',
],
Expand Down

0 comments on commit 8c68b87

Please sign in to comment.