Extend weather command list, add !weather, !погода, !погадка, !погодка, also allow oboobs and obutts plugins in private conversation
This commit is contained in:
@@ -102,6 +102,12 @@ sub Command {
|
|||||||
} elsif (length ($text) >= 2 && (substr ($text, 1, 2) eq 'w ' || substr ($text, 1, 2) eq 'п ')) {
|
} elsif (length ($text) >= 2 && (substr ($text, 1, 2) eq 'w ' || substr ($text, 1, 2) eq 'п ')) {
|
||||||
my $city = substr $text, 3;
|
my $city = substr $text, 3;
|
||||||
$reply = Weather $city;
|
$reply = Weather $city;
|
||||||
|
} elsif (substr ($text, 1, 7) eq 'погода ') {
|
||||||
|
my $city = substr $text, 7;
|
||||||
|
$reply = Weather $city;
|
||||||
|
} elsif ((substr ($text, 1, 8) eq 'погодка ') || (substr ($text, 1, 8) eq 'погадка ') || (substr ($text, 1, 8) eq 'weather ')){
|
||||||
|
my $city = substr $text, 8;
|
||||||
|
$reply = Weather $city;
|
||||||
} elsif (substr ($text, 1) eq 'buni') {
|
} elsif (substr ($text, 1) eq 'buni') {
|
||||||
$msg->typing ();
|
$msg->typing ();
|
||||||
$reply = Buni ();
|
$reply = Buni ();
|
||||||
@@ -178,11 +184,11 @@ sub Command {
|
|||||||
$msg->replyMd ($reply);
|
$msg->replyMd ($reply);
|
||||||
return;
|
return;
|
||||||
} elsif (
|
} elsif (
|
||||||
substr ($text, 1) eq 'tits' ||
|
substr ($text, 1) eq 'tits' ||
|
||||||
substr ($text, 1) eq 'boobs' ||
|
substr ($text, 1) eq 'boobs' ||
|
||||||
substr ($text, 1) eq 'tities' ||
|
substr ($text, 1) eq 'tities' ||
|
||||||
substr ($text, 1) eq 'boobies' ||
|
substr ($text, 1) eq 'boobies' ||
|
||||||
substr ($text, 1) eq 'сиси' ||
|
substr ($text, 1) eq 'сиси' ||
|
||||||
substr ($text, 1) eq 'сисечки'
|
substr ($text, 1) eq 'сисечки'
|
||||||
) {
|
) {
|
||||||
if (PluginEnabled $chatid, 'oboobs') {
|
if (PluginEnabled $chatid, 'oboobs') {
|
||||||
@@ -195,8 +201,8 @@ sub Command {
|
|||||||
return;
|
return;
|
||||||
} elsif (
|
} elsif (
|
||||||
substr ($text, 1) eq 'butt' ||
|
substr ($text, 1) eq 'butt' ||
|
||||||
substr ($text, 1) eq 'booty' ||
|
substr ($text, 1) eq 'booty' ||
|
||||||
substr ($text, 1) eq 'ass' ||
|
substr ($text, 1) eq 'ass' ||
|
||||||
substr ($text, 1) eq 'попа' ||
|
substr ($text, 1) eq 'попа' ||
|
||||||
substr ($text, 1) eq 'попка'
|
substr ($text, 1) eq 'попка'
|
||||||
) {
|
) {
|
||||||
@@ -271,6 +277,10 @@ ${csign}roll | ${csign}dice | ${csign}кости - бросить кост
|
|||||||
${csign}snail | ${csign}улитка - улитка
|
${csign}snail | ${csign}улитка - улитка
|
||||||
${csign}ver | ${csign}version | ${csign}версия - что-то про версию ПО
|
${csign}ver | ${csign}version | ${csign}версия - что-то про версию ПО
|
||||||
${csign}w город | ${csign}п город - погода в указанном городе
|
${csign}w город | ${csign}п город - погода в указанном городе
|
||||||
|
${csign}weather город - погода в указанном городе
|
||||||
|
${csign}погода город - погода в указанном городе
|
||||||
|
${csign}погодка город - погода в указанном городе
|
||||||
|
${csign}погадка город - погода в указанном городе
|
||||||
${csign}xkcd - рандомный стрип с сайта xkcd.ru
|
${csign}xkcd - рандомный стрип с сайта xkcd.ru
|
||||||
${csign}karma фраза | ${csign}карма фраза - посмотреть карму фразы
|
${csign}karma фраза | ${csign}карма фраза - посмотреть карму фразы
|
||||||
фраза-- | фраза++ - убавить или добавить карму фразе
|
фраза-- | фраза++ - убавить или добавить карму фразе
|
||||||
|
|||||||
@@ -206,6 +206,11 @@ sub PluginEnabled (@) {
|
|||||||
my $chatid = shift;
|
my $chatid = shift;
|
||||||
my $plugin = shift;
|
my $plugin = shift;
|
||||||
|
|
||||||
|
# seems that we have point to return always true if chat is private
|
||||||
|
if ($chatid > 0) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
my $cache = CHI->new (
|
my $cache = CHI->new (
|
||||||
driver => 'BerkeleyDB',
|
driver => 'BerkeleyDB',
|
||||||
root_dir => $cachedir,
|
root_dir => $cachedir,
|
||||||
|
|||||||
@@ -198,20 +198,32 @@ sub __on_msg {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($just_message_in_chat) {
|
if ($just_message_in_chat) {
|
||||||
my $str = $hailo->{$msg->chat->id}->learn_reply ($text);
|
if ($text =~ /^кто +все +эти +люди *\?$/i) {
|
||||||
|
$reply = 'Какие люди? Мы здесь вдвоём, только ты и я.';
|
||||||
|
} elsif ($text =~ /покажи +(сиськи|сиси|титьки) *$/i) {
|
||||||
|
$reply = Oboobs ();
|
||||||
|
} elsif ($text =~ /show +(titts|tities|boobs) *$/i) {
|
||||||
|
$reply = Oboobs ();
|
||||||
|
} elsif ($text =~ /покажи +(попку|попу) *$/i) {
|
||||||
|
$reply = Obutts ();
|
||||||
|
} elsif ($text =~ /show +(ass|butt|butty) *$/i) {
|
||||||
|
$reply = Obutts ();
|
||||||
|
} else {
|
||||||
|
my $str = $hailo->{$msg->chat->id}->learn_reply ($text);
|
||||||
|
|
||||||
if (defined ($str) && $str ne '') {
|
if (defined ($str) && $str ne '') {
|
||||||
$reply = $str;
|
$reply = $str;
|
||||||
$phrase = trim $text;
|
$phrase = trim $text;
|
||||||
|
|
||||||
while ($phrase =~ /[\.|\,|\?|\!]$/) {
|
while ($phrase =~ /[\.|\,|\?|\!]$/) {
|
||||||
chop $phrase;
|
chop $phrase;
|
||||||
}
|
}
|
||||||
|
|
||||||
$phrase = lc $phrase;
|
$phrase = lc $phrase;
|
||||||
|
|
||||||
if (fmatch (lc ($reply), $phrase)) {
|
if (fmatch (lc ($reply), $phrase)) {
|
||||||
$reply = RandomCommonPhrase ();
|
$reply = RandomCommonPhrase ();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user