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

Commands: use boundary when extracting admin channel from arguments

This commit is contained in:
Pragmatic Software 2020-01-03 23:04:46 -08:00
parent ab3776be88
commit 9dbd84f6c5

View File

@ -100,7 +100,7 @@ sub interpreter {
}
my $from = exists $stuff->{admin_channel_override} ? $stuff->{admin_channel_override} : $stuff->{from};
my ($admin_channel) = $stuff->{arguments} =~ m/(#[^ ]+)/; # assume first channel-like argument
my ($admin_channel) = $stuff->{arguments} =~ m/\B(#[^ ]+)/; # assume first channel-like argument
$admin_channel = $from if not defined $admin_channel;
my $admin = $self->{pbot}->{admins}->loggedin($admin_channel, "$stuff->{nick}!$stuff->{user}\@$stuff->{host}");
my $level = defined $admin ? $admin->{level} : 0;