Adding only to show the too much karma message when replying.

This commit is contained in:
sergiotarxz 2022-02-09 18:14:26 +01:00
parent 2ec3e34326
commit cf2fa3df1e

View File

@ -62,11 +62,11 @@ sub process_message_with_text {
my $log_username = defined $username ? "\@$username" : '';
$logger->log_info(
"'$message->{text}' received from $first_name:$log_username:$user_id");
if ( $text eq '+1' && defined $reply_to_message ) {
if ( defined $reply_to_message && $text eq '+1' ) {
add_karma_to_replied_message_user($message);
return;
}
if ( $text eq '-1' && defined $reply_to_message ) {
if ( defined $reply_to_message && $text eq '-1' ) {
substract_karma_to_replied_message_user($message);
return;
}
@ -82,7 +82,7 @@ sub process_message_with_text {
show_top_ten_hate($message);
return;
}
if ( $text =~ /^(?:-|\+)\d+$/ ) {
if ( defined $reply_to_message && $text =~ /^(?:-|\+)\d+$/ ) {
error_too_much_karma($message);
return;
}