diff --git a/PBot/MessageHistory.pm b/PBot/MessageHistory.pm index 6e5976ca..f7d850d2 100644 --- a/PBot/MessageHistory.pm +++ b/PBot/MessageHistory.pm @@ -246,9 +246,12 @@ sub recall_message { $recall_history = shift @$args if not defined $recall_history; $recall_channel = shift @$args if not defined $recall_channel; - $recall_count = 1 if $recall_count <= 0; + $recall_count = 1 if (not defined $recall_count) || ($recall_count <= 0); return "You may only select a count of up to 50 messages." if $recall_count > 50; + $recall_before = 0 if not defined $recall_before; + $recall_after = 0 if not defined $recall_after; + if ($recall_before + $recall_after > 200) { return "You may only select up to 200 lines of surrounding context."; } @@ -264,6 +267,8 @@ sub recall_message { $recall_channel = $temp; } + $recall_history = 1 if not defined $recall_history; + # swap history and channel if history looks like a channel and neither history or channel were specified if(not $channel_arg and not $history_arg and $recall_history =~ m/^#/) { my $temp = $recall_history;