From e1588491e3cbc1d20b541a5c5fbbe7783bed0c8f Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Tue, 22 Oct 2013 21:30:56 +0000 Subject: [PATCH] Improve error messages for `grab` command --- PBot/Quotegrabs.pm | 12 ++++++------ PBot/VERSION.pm | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/PBot/Quotegrabs.pm b/PBot/Quotegrabs.pm index 42c8fce2..3e394e0a 100644 --- a/PBot/Quotegrabs.pm +++ b/PBot/Quotegrabs.pm @@ -246,11 +246,11 @@ sub grab_quotegrab { } if(not defined $found_mask) { - return "No message history for $grab_nick."; + return "No message history for $grab_nick in channel $channel. Usage: grab [history [channel]]; to specify channel, you must also specify history"; } if(not exists $self->{pbot}->antiflood->message_history->{$found_mask}->{channels}->{$channel}) { - return "No message history for $grab_nick in $channel."; + return "No message history for $grab_nick in channel $channel. Usage: grab [history [channel]]; to specify channel, you must also specify history"; } my @messages = @{ $self->{pbot}->antiflood->message_history->{$found_mask}->{channels}->{$channel}{messages} }; @@ -260,7 +260,7 @@ sub grab_quotegrab { $grab_history--; if($grab_history > $#messages) { - return "$grab_nick has only " . ($#messages + 1) . " messages in the history."; + return "$grab_nick has only " . ($#messages + 1) . " messages in the history for channel $channel."; } $grab_history = $#messages - $grab_history; @@ -280,7 +280,7 @@ sub grab_quotegrab { } if($found == 0) { - return "/msg $nick No message containing regex '$grab_history' found for $grab_nick"; + return "/msg $nick No message containing regex '$grab_history' found for $grab_nick in channel $channel."; } else { return undef; } @@ -435,9 +435,9 @@ sub show_random_quotegrab { if($#quotes < 0) { if($nick_search eq ".*") { - return "No quotes grabbed in $channel_search yet (use `rq [nick [channel]]` to specify the correct channel). Use `grab` to grab a quote."; + return "No quotes grabbed in $channel_search yet (use `rq ` to specify the correct channel). Use `grab` to grab a quote."; } else { - return "No quotes grabbed for $nick_search in $channel_search yet (use `rq [nick [channel]]` to specify the correct channel).. Use `grab` to grab a quote."; + return "No quotes grabbed for $nick_search in $channel_search yet (use `rq ` to specify the correct channel).. Use `grab` to grab a quote."; } } diff --git a/PBot/VERSION.pm b/PBot/VERSION.pm index 399c3de1..01688bd7 100644 --- a/PBot/VERSION.pm +++ b/PBot/VERSION.pm @@ -13,7 +13,7 @@ use warnings; # These are set automatically by the build/commit script use constant { BUILD_NAME => "PBot", - BUILD_REVISION => 456, + BUILD_REVISION => 457, BUILD_DATE => "2013-10-22", };