3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-10-03 01:48:38 +02:00

Plugins/RestrictedMod: !mod command is now opt-in per-channel

This commit is contained in:
Pragmatic Software 2020-02-02 14:53:28 -08:00
parent 8e7bdafa29
commit 6d8aa0ef91

View File

@ -77,7 +77,10 @@ sub generic_command {
} }
} }
return "I do not have OPs for this channel. I cannot do any moderation here." if not $self->{pbot}->{chanops}->can_gain_ops($channel); return "I do not have OPs for this channel. I cannot do any moderation here."
if not $self->{pbot}->{chanops}->can_gain_ops($channel);
return "Voiced channel moderation is not enabled for this channel. Use `regset $channel.restrictedmod 1` to enable."
if not $self->{pbot}->{registry}->get_value($channel, 'restrictedmod');
my $hostmask = "$stuff->{nick}!$stuff->{user}\@$stuff->{host}"; my $hostmask = "$stuff->{nick}!$stuff->{user}\@$stuff->{host}";
my $admin = $self->{pbot}->{users}->loggedin_admin($channel, $hostmask); my $admin = $self->{pbot}->{users}->loggedin_admin($channel, $hostmask);
my $voiced = $self->{pbot}->{nicklist}->get_meta($channel, $stuff->{nick}, '+v'); my $voiced = $self->{pbot}->{nicklist}->get_meta($channel, $stuff->{nick}, '+v');