Adding the time to send karma in seconds.

This commit is contained in:
sergiotarxz 2022-02-10 00:04:22 +01:00
parent 1d6af96d00
commit c119638dad

View File

@ -145,9 +145,11 @@ sub check_can_modify_karma {
return 1;
}
my $last_karma_given_date = $user->last_karma_given_date;
my $time_to_post = $last_karma_given_date->add(minutes => 1) - DateTime->now();
$telegram->send_message(
chat_id => $chat_id,
text => "You cannot give karma yet wait a bit until <b>@{[xml_escape($last_karma_given_date.'')]}</b>.",
text => "You cannot give karma yet wait a bit.
<b>@{[xml_escape($time_to_post->seconds)]} seconds to send karma</b>.",
);
return 0;
}