mirror of
https://github.com/pragma-/pbot.git
synced 2024-12-23 19:22:40 +01:00
Commands: improve output of user account errors
This commit is contained in:
parent
6b6dfa9c53
commit
95a4c9114c
@ -86,7 +86,7 @@ sub interpreter {
|
|||||||
|
|
||||||
my ($cmd_channel) = $stuff->{arguments} =~ m/\B(#[^ ]+)/; # assume command is invoked in regards to first channel-like argument
|
my ($cmd_channel) = $stuff->{arguments} =~ m/\B(#[^ ]+)/; # assume command is invoked in regards to first channel-like argument
|
||||||
$cmd_channel = $from if not defined $cmd_channel; # otherwise command is invoked in regards to the channel the user is in
|
$cmd_channel = $from if not defined $cmd_channel; # otherwise command is invoked in regards to the channel the user is in
|
||||||
my $user = $self->{pbot}->{users}->loggedin($cmd_channel, "$stuff->{nick}!$stuff->{user}\@$stuff->{host}");
|
my $user = $self->{pbot}->{users}->find_user($cmd_channel, "$stuff->{nick}!$stuff->{user}\@$stuff->{host}");
|
||||||
|
|
||||||
my $cap_override;
|
my $cap_override;
|
||||||
if (exists $stuff->{'cap-override'}) {
|
if (exists $stuff->{'cap-override'}) {
|
||||||
@ -104,6 +104,13 @@ sub interpreter {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (not defined $user) {
|
if (not defined $user) {
|
||||||
|
my ($found_chan, $found_mask) = $self->{pbot}->{users}->find_user_account($cmd_channel, "$stuff->{nick}!$stuff->{user}\@$stuff->{host}", 1);
|
||||||
|
if (not defined $found_chan) {
|
||||||
|
return "/msg $stuff->{nick} You must have a user account to use $keyword.";
|
||||||
|
} else {
|
||||||
|
return "/msg $stuff->{nick} You must have a user account in $cmd_channel to use $keyword. (You have an account in $found_chan.)";
|
||||||
|
}
|
||||||
|
} elsif (not $user->{loggedin}) {
|
||||||
return "/msg $stuff->{nick} You must be logged into your user account to use $keyword.";
|
return "/msg $stuff->{nick} You must be logged into your user account to use $keyword.";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user