3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-11-26 22:09:26 +01:00

Capabilities: cap userhas now finds any channel from /msg

This commit is contained in:
Pragmatic Software 2020-02-10 14:55:14 -08:00
parent dea1d8469d
commit 3be1299dd3

View File

@ -205,8 +205,11 @@ sub capcmd {
return "Usage: cap userhas <user> [capability]; Lists capabilities belonging to <user>" if not defined $hostmask;
$cap = lc $cap if defined $cap;
my $u = $self->{pbot}->{users}->find_user($from, $hostmask);
return "No such user $hostmask in $from." if not defined $u;
my $u = $self->{pbot}->{users}->find_user($from, $hostmask, 1);
if (not defined $u) {
$from = 'global' if $from !~ /^#/;
return "No such user $hostmask in $from."
}
if (defined $cap) {
return "Try again. No such capability $cap." if not $self->exists($cap);