Improve output when no matching quotes found for `rq` command

This commit is contained in:
Pragmatic Software 2014-02-10 18:04:05 +00:00
parent 29316b23ba
commit 6d8fac71fb
2 changed files with 16 additions and 6 deletions

View File

@ -448,11 +448,21 @@ sub show_random_quotegrab {
} }
if($#quotes < 0) { if($#quotes < 0) {
if($nick_search eq ".*") { my $result = "No quotes grabbed ";
return "No quotes grabbed in $channel_search yet (use `rq <nick> <channel>` to specify the correct channel). Use `grab` to grab a quote.";
} else { if($channel_search ne '.*') {
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."; $result .= "in $channel_search ";
} }
if($nick_search ne '.*') {
$result .= "for $nick_search ";
}
if($text_search ne '.*') {
$result .= "matching '$text_search' ";
}
return $result . "yet (use `rq <nick> <channel>` to specify the correct channel).. Use `grab` to grab a quote.";;
} }
my $quotegrab = $quotes[int rand($#quotes + 1)]; my $quotegrab = $quotes[int rand($#quotes + 1)];

View File

@ -13,8 +13,8 @@ use warnings;
# These are set automatically by the build/commit script # These are set automatically by the build/commit script
use constant { use constant {
BUILD_NAME => "PBot", BUILD_NAME => "PBot",
BUILD_REVISION => 479, BUILD_REVISION => 480,
BUILD_DATE => "2014-02-04", BUILD_DATE => "2014-02-10",
}; };
1; 1;