Do not answer back if someone quote our new member greet
This commit is contained in:
@@ -235,6 +235,12 @@ sub __on_msg {
|
|||||||
defined ($msg->reply_to_message->from->username) &&
|
defined ($msg->reply_to_message->from->username) &&
|
||||||
($msg->reply_to_message->from->username eq $myusername)) {
|
($msg->reply_to_message->from->username eq $myusername)) {
|
||||||
carp sprintf ('[DEBUG] In public chat %s (%s) %s quote us!', $chatname, $chatid, $vis_a_vi) if $c->{debug};
|
carp sprintf ('[DEBUG] In public chat %s (%s) %s quote us!', $chatname, $chatid, $vis_a_vi) if $c->{debug};
|
||||||
|
|
||||||
|
# do not answer back if someone quote our new member greet
|
||||||
|
if ((substr ($msg->reply_to_message->text, 0, 9) eq 'Дратути, ') &&
|
||||||
|
(substr ($msg->reply_to_message->text, -61) eq 'Представьтес, пожалуйста, и расскажите, что вас сюда привело.')) {
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
# remove our name from users reply, just in case
|
# remove our name from users reply, just in case
|
||||||
my $pat1 = quotemeta ('@' . $myusername);
|
my $pat1 = quotemeta ('@' . $myusername);
|
||||||
my $pat2 = quotemeta $myfullname;
|
my $pat2 = quotemeta $myfullname;
|
||||||
@@ -244,6 +250,7 @@ sub __on_msg {
|
|||||||
|
|
||||||
# figure out reply :)
|
# figure out reply :)
|
||||||
$reply = $hailo->{$msg->chat->id}->learn_reply ($phrase) if (length ($phrase) > 3);
|
$reply = $hailo->{$msg->chat->id}->learn_reply ($phrase) if (length ($phrase) > 3);
|
||||||
|
}
|
||||||
# simple commands
|
# simple commands
|
||||||
} elsif (substr ($text, 0, 1) eq $csign) {
|
} elsif (substr ($text, 0, 1) eq $csign) {
|
||||||
$reply = command ($self, $msg, $text, $chatid);
|
$reply = command ($self, $msg, $text, $chatid);
|
||||||
|
|||||||
Reference in New Issue
Block a user