Add easter egg phrases in private and group conversations, fix previous addition of private phrases a bit

This commit is contained in:
eleksir
2021-12-25 14:27:30 +03:00
parent ae553d8aa5
commit 31e077c219

View File

@@ -21,6 +21,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);
use RedisLib qw (redis_parse_message); use RedisLib qw (redis_parse_message);
@@ -200,16 +201,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 ();
@@ -300,8 +307,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);
} }
@@ -309,8 +320,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);
} }
@@ -318,8 +333,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);
} }
@@ -335,8 +354,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);
} }