mirror of
https://github.com/pragma-/pbot.git
synced 2025-02-02 15:34:05 +01:00
Improve error messages for grab
command
This commit is contained in:
parent
1155205f0e
commit
e1588491e3
@ -246,11 +246,11 @@ sub grab_quotegrab {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(not defined $found_mask) {
|
if(not defined $found_mask) {
|
||||||
return "No message history for $grab_nick.";
|
return "No message history for $grab_nick in channel $channel. Usage: grab <nick> [history [channel]]; to specify channel, you must also specify history";
|
||||||
}
|
}
|
||||||
|
|
||||||
if(not exists $self->{pbot}->antiflood->message_history->{$found_mask}->{channels}->{$channel}) {
|
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 <nick> [history [channel]]; to specify channel, you must also specify history";
|
||||||
}
|
}
|
||||||
|
|
||||||
my @messages = @{ $self->{pbot}->antiflood->message_history->{$found_mask}->{channels}->{$channel}{messages} };
|
my @messages = @{ $self->{pbot}->antiflood->message_history->{$found_mask}->{channels}->{$channel}{messages} };
|
||||||
@ -260,7 +260,7 @@ sub grab_quotegrab {
|
|||||||
$grab_history--;
|
$grab_history--;
|
||||||
|
|
||||||
if($grab_history > $#messages) {
|
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;
|
$grab_history = $#messages - $grab_history;
|
||||||
@ -280,7 +280,7 @@ sub grab_quotegrab {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if($found == 0) {
|
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 {
|
} else {
|
||||||
return undef;
|
return undef;
|
||||||
}
|
}
|
||||||
@ -435,9 +435,9 @@ sub show_random_quotegrab {
|
|||||||
|
|
||||||
if($#quotes < 0) {
|
if($#quotes < 0) {
|
||||||
if($nick_search eq ".*") {
|
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 <nick> <channel>` to specify the correct channel). Use `grab` to grab a quote.";
|
||||||
} else {
|
} 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 <nick> <channel>` to specify the correct channel).. Use `grab` to grab a quote.";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ 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 => 456,
|
BUILD_REVISION => 457,
|
||||||
BUILD_DATE => "2013-10-22",
|
BUILD_DATE => "2013-10-22",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user