Merge branch 'master' into redis
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,
|
||||||
|
|||||||
@@ -458,6 +458,9 @@ sub sendChatAction {
|
|||||||
elsif ($args->{action} eq 'upload_video_note') {
|
elsif ($args->{action} eq 'upload_video_note') {
|
||||||
$send_args->{action} = 'upload_video_note';
|
$send_args->{action} = 'upload_video_note';
|
||||||
}
|
}
|
||||||
|
elsif ($args->{action} eq 'choose_sticker') {
|
||||||
|
$send_args->{action} = 'choose_sticker';
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
$send_args->{action} = 'typing';
|
$send_args->{action} = 'typing';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,9 @@ has 'first_name'; # Optional.
|
|||||||
has 'last_name'; # Optional.
|
has 'last_name'; # Optional.
|
||||||
has 'photo'; # Teapot::Bot::Object::ChatPhoto. Optional. Returned only in getChat.
|
has 'photo'; # Teapot::Bot::Object::ChatPhoto. Optional. Returned only in getChat.
|
||||||
has 'bio'; # Optional. Bio of the other party in a private chat. Returned only in getChat.
|
has 'bio'; # Optional. Bio of the other party in a private chat. Returned only in getChat.
|
||||||
|
has 'has_private_forwards'; # Optional. True, if privacy settings of the other party in the private chat allows to
|
||||||
|
# use tg://user?id=<user_id> links only in chats with the user.
|
||||||
|
# Returned only in getChat.
|
||||||
has 'description'; # Optional. Returned only in getChat.
|
has 'description'; # Optional. Returned only in getChat.
|
||||||
has 'invite_link'; # Optional. Returned only in getChat.
|
has 'invite_link'; # Optional. Returned only in getChat.
|
||||||
has 'pinned_message'; # Teapot::Bot::Object::Message
|
has 'pinned_message'; # Teapot::Bot::Object::Message
|
||||||
@@ -25,6 +28,8 @@ has 'permissions'; # Teapot::Bot::Object::ChatPermissions. Optional
|
|||||||
has 'slow_mode_delay'; # Optional. Returned only in getChat.
|
has 'slow_mode_delay'; # Optional. Returned only in getChat.
|
||||||
has 'message_auto_delete_time'; # Optional. The time after which all messages sent to the chat will be automatically
|
has 'message_auto_delete_time'; # Optional. The time after which all messages sent to the chat will be automatically
|
||||||
# deleted; in seconds. Returned only in getChat.
|
# deleted; in seconds. Returned only in getChat.
|
||||||
|
has 'has_protected_content'; # Optional. True, if messages from the chat can't be forwarded to other chats.
|
||||||
|
# Returned only in getChat.
|
||||||
has 'sticker_set_name'; # Optional. Returned only in getChat.
|
has 'sticker_set_name'; # Optional. Returned only in getChat.
|
||||||
has 'can_set_sticker_set'; # Optional. Returned only in getChat.
|
has 'can_set_sticker_set'; # Optional. Returned only in getChat.
|
||||||
has 'linked_chat_id'; # Optional. greater than 32 bits, smaller than 52 bits
|
has 'linked_chat_id'; # Optional. greater than 32 bits, smaller than 52 bits
|
||||||
@@ -32,8 +37,9 @@ has 'location'; # Optional. Returned only in getChat.
|
|||||||
|
|
||||||
sub fields {
|
sub fields {
|
||||||
return {
|
return {
|
||||||
'scalar' => [qw/id type title username first_name last_name bio description
|
'scalar' => [qw/id type title username first_name last_name bio
|
||||||
invite_link slow_mode_delay message_auto_delete_time
|
has_private_forwards description invite_link slow_mode_delay
|
||||||
|
message_auto_delete_time has_protected_content
|
||||||
sticker_set_name can_set_sticker_set linked_chat_id/],
|
sticker_set_name can_set_sticker_set linked_chat_id/],
|
||||||
'Teapot::Bot::Object::ChatPhoto' => [qw/photo/],
|
'Teapot::Bot::Object::ChatPhoto' => [qw/photo/],
|
||||||
'Teapot::Bot::Object::Message' => [qw/pinned_message/],
|
'Teapot::Bot::Object::Message' => [qw/pinned_message/],
|
||||||
|
|||||||
@@ -8,15 +8,19 @@ $Teapot::Bot::Object::ChatInviteLink::VERSION = '0.022';
|
|||||||
|
|
||||||
has 'invite_link';
|
has 'invite_link';
|
||||||
has 'creator';
|
has 'creator';
|
||||||
|
has 'creates_join_request';
|
||||||
has 'is_primary';
|
has 'is_primary';
|
||||||
has 'is_revoked';
|
has 'is_revoked';
|
||||||
|
has 'name';
|
||||||
has 'expire_date'; # Optional. Point in time (Unix timestamp) when the link will expire or has been expired
|
has 'expire_date'; # Optional. Point in time (Unix timestamp) when the link will expire or has been expired
|
||||||
has 'member_limit'; # Optional. Maximum number of users that can be members of the chat simultaneously after joining
|
has 'member_limit'; # Optional. Maximum number of users that can be members of the chat simultaneously after joining
|
||||||
# the chat via this invite link; 1-99999
|
# the chat via this invite link; 1-99999
|
||||||
|
has 'pending_join_request_count';
|
||||||
|
|
||||||
sub fields {
|
sub fields {
|
||||||
return {
|
return {
|
||||||
'scalar' => [qw/invite_link is_primary is_revoked expire_date expire_date member_limit/],
|
'scalar' => [qw/invite_link creates_join_request is_primary is_revoked name expire_date
|
||||||
|
member_limit pending_join_request_count/],
|
||||||
'Teapot::Bot::Object::User' => [qw/creator/],
|
'Teapot::Bot::Object::User' => [qw/creator/],
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,9 +52,11 @@ has 'forward_from_message_id';
|
|||||||
has 'forward_signature';
|
has 'forward_signature';
|
||||||
has 'forward_sender_name';
|
has 'forward_sender_name';
|
||||||
has 'forward_date';
|
has 'forward_date';
|
||||||
|
has 'is_automatic_forward';
|
||||||
has 'reply_to_message'; # Message
|
has 'reply_to_message'; # Message
|
||||||
has 'via_bot'; # User
|
has 'via_bot'; # User
|
||||||
has 'edit_date';
|
has 'edit_date';
|
||||||
|
has 'has_protected_content';
|
||||||
has 'media_group_id';
|
has 'media_group_id';
|
||||||
has 'author_signature';
|
has 'author_signature';
|
||||||
has 'text';
|
has 'text';
|
||||||
@@ -102,8 +104,8 @@ sub fields {
|
|||||||
return {
|
return {
|
||||||
'scalar' => [qw/message_id date forward_from_message_id
|
'scalar' => [qw/message_id date forward_from_message_id
|
||||||
forward_signature forward_sender_name
|
forward_signature forward_sender_name
|
||||||
forward_date edit_date media_group_id
|
forward_date is_automatic_forward edit_date has_protected_content
|
||||||
author_signature text caption
|
media_group_id author_signature text caption
|
||||||
new_chat_title delete_chat_photo
|
new_chat_title delete_chat_photo
|
||||||
group_chat_created supergroup_chat_created
|
group_chat_created supergroup_chat_created
|
||||||
channel_chat_created migrate_to_chat_id
|
channel_chat_created migrate_to_chat_id
|
||||||
|
|||||||
@@ -201,20 +201,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