3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-11-19 10:29:30 +01:00

MessageHistory: use max_recall_count registry setting

This commit is contained in:
Pragmatic Software 2021-02-07 13:40:40 -08:00
parent f426594d80
commit c400ffda10

View File

@ -286,8 +286,9 @@ sub cmd_recall_message {
$recall_history = $recall_text;
}
my $max_count = $self->{pbot}->{registry}->get_value('messagehistory', 'max_recall_count') // 50;
$recall_count = 1 if (not defined $recall_count) || ($recall_count <= 0);
return "You may only select a count of up to 100 messages." if $recall_count > 100;
return "You may only select a count of up to $max_count messages." if $recall_count > $max_count;
$recall_before = 0 if not defined $recall_before;
$recall_after = 0 if not defined $recall_after;