Compare commits
2 Commits
redis
...
b992698b9b
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b992698b9b | ||
|
|
8d21991af6 |
@@ -1,5 +1,12 @@
|
|||||||
# Aleesa-Telegram-bot - Telegram chatty bot
|
# Aleesa-Telegram-bot - Telegram chatty bot
|
||||||
|
|
||||||
|
## Disclaimer
|
||||||
|
|
||||||
|
This version - 3 (something) - considered stable. It means that further
|
||||||
|
development of new features kind of frosen. Most effort will be targeted to
|
||||||
|
future 4-th version development. If you have some ideas or fixes to this version
|
||||||
|
feel free PR them, they will be merged as soon as being reviewed.
|
||||||
|
|
||||||
## About
|
## About
|
||||||
|
|
||||||
It is based on Perl modules [Telegram::Bot][1] and [Hailo][2] as conversation
|
It is based on Perl modules [Telegram::Bot][1] and [Hailo][2] as conversation
|
||||||
|
|||||||
11
README_RU.md
11
README_RU.md
@@ -1,5 +1,16 @@
|
|||||||
# Aleesa-Telegram-bot - Болтливый бот для Telegram
|
# Aleesa-Telegram-bot - Болтливый бот для Telegram
|
||||||
|
|
||||||
|
## Дисклеймер
|
||||||
|
|
||||||
|
Эта версия бота за номером 3 (с мелочью) стабильная. Сие означает, что
|
||||||
|
дальнейшего развития функций в этой версии не предполагается. Конечно, возможны
|
||||||
|
исключения, но основной план - переключиться на 4-ю версию, куда планируется
|
||||||
|
перенести большинство функций 3-й версии.
|
||||||
|
|
||||||
|
Если у кого-то возникнут идеи относительно этой версии бота ставьте PR, я только
|
||||||
|
рад. Т.к. несмотря на то, что развитие этой версии слегка заморожено,
|
||||||
|
поддерживать её планируется до выхода в свет 4-й версии бота.
|
||||||
|
|
||||||
## Что это такое
|
## Что это такое
|
||||||
|
|
||||||
Это бот, основанный на перловых модулях [Telegram::Bot][1] для работы в
|
Это бот, основанный на перловых модулях [Telegram::Bot][1] для работы в
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ sub Command {
|
|||||||
} elsif (substr ($text, 1) eq 'roll' || substr ($text, 1) eq 'dice' || substr ($text, 1) eq 'кости') {
|
} elsif (substr ($text, 1) eq 'roll' || substr ($text, 1) eq 'dice' || substr ($text, 1) eq 'кости') {
|
||||||
$reply = sprintf 'На первой кости выпало %d, а на второй — %d.', irand (6) + 1, irand (6) + 1;
|
$reply = sprintf 'На первой кости выпало %d, а на второй — %d.', irand (6) + 1, irand (6) + 1;
|
||||||
} elsif (substr ($text, 1) eq 'ver' || substr ($text, 1) eq 'version' || substr ($text, 1) eq 'версия') {
|
} elsif (substr ($text, 1) eq 'ver' || substr ($text, 1) eq 'version' || substr ($text, 1) eq 'версия') {
|
||||||
$reply = 'Версия: Нуль.Чего-то_там.Чего-то_там';
|
$reply = 'Версия: Три.Чего-то_там.С_мелочью';
|
||||||
} elsif (substr ($text, 1) eq 'anek' || substr ($text, 1) eq 'анек' || substr ($text, 1) eq 'анекдот') {
|
} elsif (substr ($text, 1) eq 'anek' || substr ($text, 1) eq 'анек' || substr ($text, 1) eq 'анекдот') {
|
||||||
$msg->typing ();
|
$msg->typing ();
|
||||||
$reply = "```\n" . Anek () . "\n```";
|
$reply = "```\n" . Anek () . "\n```";
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ use BotLib::Admin qw (FortuneToggleList);
|
|||||||
use BotLib qw (RandomCommonPhrase Command Highlight BotSleep IsCensored);
|
use BotLib qw (RandomCommonPhrase Command Highlight BotSleep IsCensored);
|
||||||
use BotLib::Conf qw (LoadConf);
|
use BotLib::Conf qw (LoadConf);
|
||||||
use BotLib::Fortune qw (Fortune);
|
use BotLib::Fortune qw (Fortune);
|
||||||
|
use BotLib::Image qw (Oboobs Obutts);
|
||||||
use BotLib::Karma qw (KarmaSet);
|
use BotLib::Karma qw (KarmaSet);
|
||||||
use BotLib::Util qw (trim fmatch);
|
use BotLib::Util qw (trim fmatch);
|
||||||
|
|
||||||
@@ -195,16 +196,22 @@ sub __on_msg {
|
|||||||
} else {
|
} else {
|
||||||
$just_message_in_chat = 1;
|
$just_message_in_chat = 1;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
$just_message_in_chat = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($just_message_in_chat) {
|
if ($just_message_in_chat) {
|
||||||
if ($text =~ /^кто +все +эти +люди *\?$/i) {
|
if ($text =~ /^ *кто +все +эти +люди *\?$/ui) {
|
||||||
$reply = 'Какие люди? Мы здесь вдвоём, только ты и я.';
|
$reply = 'Какие "люди"? Мы здесь вдвоём, только ты и я.';
|
||||||
} elsif ($text =~ /покажи +(сиськи|сиси|титьки) *$/i) {
|
} elsif ($text =~ /^ *кто +я *\?$/ui) {
|
||||||
|
$reply = 'Где?';
|
||||||
|
} elsif ($text =~ /^ *кто +(здесь|тут) *\?$/ui) {
|
||||||
|
$reply = 'Ты да я, да мы с тобой.';
|
||||||
|
} elsif ($text =~ /покажи +(сиськи|сиси|титьки) *$/ui) {
|
||||||
$reply = Oboobs ();
|
$reply = Oboobs ();
|
||||||
} elsif ($text =~ /show +(titts|tities|boobs) *$/i) {
|
} elsif ($text =~ /show +(titts|tities|boobs) *$/i) {
|
||||||
$reply = Oboobs ();
|
$reply = Oboobs ();
|
||||||
} elsif ($text =~ /покажи +(попку|попу) *$/i) {
|
} elsif ($text =~ /покажи +(попку|попу) *$/ui) {
|
||||||
$reply = Obutts ();
|
$reply = Obutts ();
|
||||||
} elsif ($text =~ /show +(ass|butt|butty) *$/i) {
|
} elsif ($text =~ /show +(ass|butt|butty) *$/i) {
|
||||||
$reply = Obutts ();
|
$reply = Obutts ();
|
||||||
@@ -295,8 +302,12 @@ sub __on_msg {
|
|||||||
if ((lc ($text) =~ /^${qname}[\,|\:]? (.+)/) or (lc ($text) =~ /^${qtname}[\,|\:]? (.+)/)){
|
if ((lc ($text) =~ /^${qname}[\,|\:]? (.+)/) or (lc ($text) =~ /^${qtname}[\,|\:]? (.+)/)){
|
||||||
$phrase = $1;
|
$phrase = $1;
|
||||||
|
|
||||||
if ($phrase =~ /^кто +все +эти +люди *\?$/i) {
|
if ($phrase =~ /^ *кто +все +эти +люди *\?$/ui) {
|
||||||
$reply = 'Кто здесь?';
|
$reply = 'Кто здесь?';
|
||||||
|
} elsif ($phrase =~ /^ *кто +я *?$/ui){
|
||||||
|
$reply = 'Где?';
|
||||||
|
} elsif ($phrase =~ /^ *кто +(здесь|тут) *\?$/ui) {
|
||||||
|
$reply = 'Здесь все: Никита, Стас, Гена, Турбо и Дюша Метёлкин.';
|
||||||
} else {
|
} else {
|
||||||
$reply = $hailo->{$msg->chat->id}->learn_reply ($phrase);
|
$reply = $hailo->{$msg->chat->id}->learn_reply ($phrase);
|
||||||
}
|
}
|
||||||
@@ -304,8 +315,12 @@ sub __on_msg {
|
|||||||
} elsif ((lc ($text) =~ /.+ ${qname}[\,|\!|\?|\.| ]/) or (lc ($text) =~ / $qname$/)) {
|
} elsif ((lc ($text) =~ /.+ ${qname}[\,|\!|\?|\.| ]/) or (lc ($text) =~ / $qname$/)) {
|
||||||
$phrase = $text;
|
$phrase = $text;
|
||||||
|
|
||||||
if ($phrase =~ /^кто +все +эти +люди *\?$/i) {
|
if ($phrase =~ /^ *кто +все +эти +люди *\?$/ui) {
|
||||||
$reply = 'Кто здесь?';
|
$reply = 'Кто здесь?';
|
||||||
|
} elsif ($phrase =~ /^ *кто +я *?$/ui){
|
||||||
|
$reply = 'Где?';
|
||||||
|
} elsif ($phrase =~ /^ *кто +(здесь|тут) *\?$/ui) {
|
||||||
|
$reply = 'Здесь все: Никита, Стас, Гена, Турбо и Дюша Метёлкин.';
|
||||||
} else {
|
} else {
|
||||||
$reply = $hailo->{$msg->chat->id}->learn_reply ($phrase);
|
$reply = $hailo->{$msg->chat->id}->learn_reply ($phrase);
|
||||||
}
|
}
|
||||||
@@ -313,8 +328,12 @@ sub __on_msg {
|
|||||||
} elsif ((lc ($text) =~ /.+ ${qtname}[\,|\!|\?|\.| ]/) or (lc ($text) =~ / $qtname$/)) {
|
} elsif ((lc ($text) =~ /.+ ${qtname}[\,|\!|\?|\.| ]/) or (lc ($text) =~ / $qtname$/)) {
|
||||||
$phrase = $text;
|
$phrase = $text;
|
||||||
|
|
||||||
if ($phrase =~ /^кто +все +эти +люди *\?$/i) {
|
if ($phrase =~ /^ *кто +все +эти +люди *\?$/ui) {
|
||||||
$reply = 'Кто здесь?';
|
$reply = 'Кто здесь?';
|
||||||
|
} elsif ($phrase =~ /^ *кто +я *?$/ui){
|
||||||
|
$reply = 'Где?';
|
||||||
|
} elsif ($phrase =~ /^ *кто +(здесь|тут) *\?$/ui) {
|
||||||
|
$reply = 'Здесь все: Никита, Стас, Гена, Турбо и Дюша Метёлкин.';
|
||||||
} else {
|
} else {
|
||||||
$reply = $hailo->{$msg->chat->id}->learn_reply ($phrase);
|
$reply = $hailo->{$msg->chat->id}->learn_reply ($phrase);
|
||||||
}
|
}
|
||||||
@@ -330,8 +349,12 @@ sub __on_msg {
|
|||||||
}
|
}
|
||||||
# just message in chat
|
# just message in chat
|
||||||
} else {
|
} else {
|
||||||
if ($text =~ /^кто +все +эти +люди *\?$/i) {
|
if ($text =~ /^ *кто +все +эти +люди *\?$/ui) {
|
||||||
$reply = 'Кто здесь?';
|
$reply = 'Кто здесь?';
|
||||||
|
} elsif ($phrase =~ /^ *кто +я *?$/ui){
|
||||||
|
$reply = 'Где?';
|
||||||
|
} elsif ($phrase =~ /^ *кто +(здесь|тут) *\?$/ui) {
|
||||||
|
$reply = 'Здесь все: Никита, Стас, Гена, Турбо и Дюша Метёлкин.';
|
||||||
} else {
|
} else {
|
||||||
$hailo->{$msg->chat->id}->learn ($text);
|
$hailo->{$msg->chat->id}->learn ($text);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user