summaryrefslogtreecommitdiff
path: root/src/NeonXP
diff options
context:
space:
mode:
Diffstat (limited to 'src/NeonXP')
-rw-r--r--src/NeonXP/BotScript.php19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/NeonXP/BotScript.php b/src/NeonXP/BotScript.php
index 6dfeb9e..ac01681 100644
--- a/src/NeonXP/BotScript.php
+++ b/src/NeonXP/BotScript.php
@@ -83,13 +83,26 @@ class BotScript
'33' => ['Я', 'А', ' ', ' ', ' ', ' ', '100001', '. - . -'],
];
$result = 'Непонятно :(';
- if (is_numeric($text) && (isset($db[$text]))) {
+ if ($text == '$') {
+ $result = '';
+ foreach ($db as $key => $value) {
+ $result .= sprintf('*%d* АлфЁ *%s* Алф *%s* ОбрЁ *%s* Обр *%s* Alph *%s* RvrsAlph *%s* Двоич *%s* Морз *%s*',
+ $key, $value[0],$value[1],$value[2],$value[3], $value[4],$value[5], $value[6],$value[7]
+ ) . PHP_EOL;
+ }
+ } elseif (is_numeric($text) && (isset($db[$text]))) {
$result = sprintf('*%d* АлфЁ *%s* Алф *%s* ОбрЁ *%s* Обр *%s* Alph *%s* RvrsAlph *%s* Двоич *%s* Морз *%s*',
$text, $db[$text][0],$db[$text][1],$db[$text][2],$db[$text][3], $db[$text][4],$db[$text][5], $db[$text][6],$db[$text][7]
);
} else {
foreach ($db as $key => $value) {
- if ($value[0] == $text) {
+ if (mb_strtolower($value[0], 'utf8') == mb_strtolower($text)) {
+ $result = sprintf('*%d* АлфЁ *%s* Алф *%s* ОбрЁ *%s* Обр *%s* Alph *%s* RvrsAlph *%s* Двоич *%s* Морз *%s*',
+ $key, $value[0],$value[1],$value[2],$value[3], $value[4],$value[5], $value[6],$value[7]
+ );
+ }
+
+ if (strtolower($value[4]) == strtolower($text)) {
$result = sprintf('*%d* АлфЁ *%s* Алф *%s* ОбрЁ *%s* Обр *%s* Alph *%s* RvrsAlph *%s* Двоич *%s* Морз *%s*',
$key, $value[0],$value[1],$value[2],$value[3], $value[4],$value[5], $value[6],$value[7]
);
@@ -97,7 +110,7 @@ class BotScript
}
}
if ($result) {
- $telegram->getMethods()->sendMessage($message->getChat(), $result, true);
+ $telegram->getMethods()->sendMessage($message->getChat(), '```' . PHP_EOL . $result . PHP_EOL . '```', true);
}
return State::INITIAL; //Set initial state