3 Commits
0.6.0 ... 0.7.0

Author SHA1 Message Date
f861a522fa /dreamers rules 2024-01-04 05:57:11 +07:00
09fe516871 senya fix 2024-01-04 04:31:28 +07:00
9af555e757 greeting fix 2024-01-04 02:27:45 +07:00

View File

@@ -91,7 +91,7 @@ final class index extends core
&& rand(0, 100) < 16
and levenshtein($_word, $arsen, 2, 2, 1) < 3
|| levenshtein($_word, $arsenchik, 2, 1, 2) < 4
|| levenshtein($_word, $senya, 2, 2, 1) < 3
|| (levenshtein($_word, $senya, 2, 2, 1) < 2 && $word !== 'меня' && $word !== 'тебя')
) {
// Найдено обращение к Арсену, он не в сети и шанс 15%
@@ -122,13 +122,14 @@ final class index extends core
$_word = self::ascii(mb_strtolower($word), $buffer);
if (
levenshtein($_word, $marina, 2, 2, 1) < 3
rand(0, 100) < 31
and levenshtein($_word, $marina, 2, 2, 1) < 3
|| levenshtein($_word, $marishka, 2, 1, 2) < 4
|| levenshtein($_word, $marinochka, 2, 1, 2) < 4
|| levenshtein($_word, $marinushka, 2, 1, 2) < 4
|| (levenshtein($_word, $marya, 3, 3, 1) < 3 && $word !== 'мария')
) {
// Найдено обращение к Марине
// Найдено обращение к Марине и шанс 30%
// Отправка сообщения
$message->reply(_message::new()->setContent('ЗДАРОВА'));
@@ -289,10 +290,16 @@ final class index extends core
$discord->application->commands->save(new command($discord, [
'name' => 'dreamers',
'description' => 'BEBRA DREAMERS',
'options' => [(new option($discord))
->setName('invite')
->setDescription('Send an invitation link to "BEBRA DREAMERS"')
->setType(option::SUB_COMMAND)]
'options' => [
(new option($discord))
->setName('invite')
->setDescription('Link to "BEBRA DREAMERS"')
->setType(option::SUB_COMMAND),
(new option($discord))
->setName('rules')
->setDescription('Rules of "BEBRA DREAMERS"')
->setType(option::SUB_COMMAND)
]
]));
$discord->listenCommand(['dreamers', 'invite'], function (interaction $interaction) {
@@ -302,6 +309,15 @@ final class index extends core
// Отправка ссылки с приглашением присоединиться на сервер BEBRA DREAMERS
if ($interaction->data->options->has('invite')) $interaction->respondWithMessage(_message::new()->setContent('https://discord.bebra.team'));
});
$discord->listenCommand(['dreamers', 'rules'], function (interaction $interaction) {
// Игнорирование чат-роботов
if ($interaction->user->bot) return;
// Отправка ссылки с приглашением присоединиться на сервер BEBRA DREAMERS
if ($interaction->data->options->has('rules')) $interaction->respondWithMessage(_message::new()->setContent('https://rules.bebra.team'));
});
});
$this->discord->run();