mirror of
https://github.com/pragma-/pbot.git
synced 2025-01-23 18:44:33 +01:00
Restrict /msg to level 60+ admins
This commit is contained in:
parent
6a18d8eb4d
commit
6c0cbb6ff2
@ -947,9 +947,12 @@ sub handle_action {
|
||||
}
|
||||
elsif ($self->{factoids}->hash->{$channel}->{$keyword}->{type} eq 'text') {
|
||||
# Don't allow user-custom /msg factoids, unless factoid triggered by admin
|
||||
if (($action =~ m/^\/msg/i) and (not $self->{pbot}->{admins}->loggedin($stuff->{from}, "$stuff->{nick}!$stuff->{user}\@$stuff->{host}"))) {
|
||||
$self->{pbot}->{logger}->log("[ABUSE] Bad factoid (contains /msg): $action\n");
|
||||
return "You must login to use this command.";
|
||||
if ($action =~ m/^\/msg/i) {
|
||||
my $admin = $self->{pbot}->{admins}->loggedin($stuff->{from}, "$stuff->{nick}!$stuff->{user}\@$stuff->{host}");
|
||||
if (not $admin or $admin->{level} < 60) {
|
||||
$self->{pbot}->{logger}->log("[ABUSE] Bad factoid (contains /msg): $action\n");
|
||||
return "You are not powerful enough to do this.";
|
||||
}
|
||||
}
|
||||
|
||||
if ($stuff->{ref_from}) {
|
||||
|
Loading…
Reference in New Issue
Block a user