diff options
Diffstat (limited to 'config-default')
| -rw-r--r-- | config-default/commands.xml | 89 |
1 files changed, 47 insertions, 42 deletions
diff --git a/config-default/commands.xml b/config-default/commands.xml index 6589458..6828438 100644 --- a/config-default/commands.xml +++ b/config-default/commands.xml @@ -529,44 +529,14 @@ $tgt = lc $1 if (defined($1)); my $msg = $1; $msg = $2 if defined($2); - if (ASM::Util->notRestricted(lc $event->{nick}, "noops")) { - my $tgt = lc $event->{to}->[0]; - $tgt = lc $1 if (defined($1)); - my $msg = $1; - $msg = $2 if defined($2); - unless (lc $tgt ~~ $::sn{lc $event->{nick}}->{mship}) { - return; #they're not on the channel they're calling !ops for - } - unless (defined($::ignored{$tgt}) && ($::ignored{$tgt} >= $::RISKS{'opalert'})) { - if (lc $event->{to}->[0] eq '##linux') { - $conn->privmsg($event->{nick}, "I've summoned op attention. In the future, please use /msg " . - "$conn->{_nick} !ops $event->{to}->[0] reasonGoesHere - this allows ops to " . - "be notified while minimizing channel hostility."); - } elsif ((lc $event->{to}->[0] eq '#wikipedia-en-help') && (!defined($msg))) { - $conn->privmsg($event->{nick}, "I've summoned op attention, but in the future, please specify " . - "a reason, e.g. !ops reasongoeshere - so ops know what is going on. Thanks! :)"); - } elsif (lc $event->{to}->[0] eq lc $conn->{_nick}) { - if (lc $tgt eq lc $conn->{_nick}) { # they privmsged the bot without providing a target - $conn->privmsg($event->{nick}, "Sorry, it looks like you've tried to use the !ops command " . - "via PM but haven't specified a target. Try again with /msg $conn->{_nick} " . - "!ops #channelGoesHere ReasonGoesHere"); - return; - } else { - $conn->privmsg($event->{nick}, "Thanks, I'm notifying $tgt ops."); - } - } - $::ignored{$tgt} = $::RISKS{'opalert'}; - $conn->schedule(30, sub { delete($::ignored{$tgt})}); - my $hilite=ASM::Util->commaAndify(ASM::Util->getAlert($tgt, 'opalert', 'hilights')); - my $txtz = "[\x02$tgt\x02] - $event->{nick} wants op attention"; - if ((time-$::sc{$tgt}{users}{lc $event->{nick}}{jointime}) > 90) { -# return; #they've been on the channel for less than 90 seconds, probably nuisance botspam - $txtz = "$txtz ($msg) $hilite !att-$tgt-opalert"; - } - my @tgts = ASM::Util->getAlert($tgt, 'opalert', 'msgs'); - ASM::Util->sendLongMsg($conn, \@tgts, $txtz); - $::log->incident($tgt, "$tgt: $event->{nick} requested op attention\n"); - } else { # ops has recently been called + if ((defined($::channels->{channel}->{$tgt}->{monitor})) and ($::channels->{channel}->{$tgt}->{monitor} eq "no")) { + return; + } + unless (lc $tgt ~~ $::sn{lc $event->{nick}}->{mship}) { + return; #they're not on the channel they're calling !ops for + } + if (defined($::ignored{$tgt}) && ($::ignored{$tgt} >= $::RISKS{'opalert'})) { + if (ASM::Util->notRestricted(lc $event->{nick}, "noops")) { if (lc $event->{to}->[0] eq '##linux') { $conn->privmsg($event->{nick}, "I've already been recently asked to summon op attention. " . "In the future, please use /msg $conn->{_nick} !ops $event->{to}->[0] reasonGoesHere" . @@ -576,19 +546,54 @@ $conn->privmsg($event->{nick}, "Sorry, it looks like you've tried to use the !ops command " . "via PM but haven't specified a target. Try again with /msg $conn->{_nick} " . "!ops #channelGoesHere ReasonGoesHere"); - return; } else { $conn->privmsg($event->{nick}, "I've already recently notified $tgt ops."); } } } + return; } - else { + if (ASM::Util->notRestricted(lc $event->{nick}, "noops")) { + my $tgt = lc $event->{to}->[0]; + $tgt = lc $1 if (defined($1)); + my $msg = $1; + $msg = $2 if defined($2); + if (lc $event->{to}->[0] eq '##linux') { + $conn->privmsg($event->{nick}, "I've summoned op attention. In the future, please use /msg " . + "$conn->{_nick} !ops $event->{to}->[0] reasonGoesHere - this allows ops to " . + "be notified while minimizing channel hostility."); + } elsif ((lc $event->{to}->[0] eq '#wikipedia-en-help') && (!defined($msg))) { + $conn->privmsg($event->{nick}, "I've summoned op attention, but in the future, please specify " . + "a reason, e.g. !ops reasongoeshere - so ops know what is going on. Thanks! :)"); + } elsif (lc $event->{to}->[0] eq lc $conn->{_nick}) { + if (lc $tgt eq lc $conn->{_nick}) { # they privmsged the bot without providing a target + $conn->privmsg($event->{nick}, "Sorry, it looks like you've tried to use the !ops command " . + "via PM but haven't specified a target. Try again with /msg $conn->{_nick} " . + "!ops #channelGoesHere ReasonGoesHere"); + return; + } else { + $conn->privmsg($event->{nick}, "Thanks, I'm notifying $tgt ops."); + } + } + my $hilite=ASM::Util->commaAndify(ASM::Util->getAlert($tgt, 'opalert', 'hilights')); + my $txtz = "[\x02$tgt\x02] - $event->{nick} wants op attention"; + if ((time-$::sc{$tgt}{users}{lc $event->{nick}}{jointime}) > 90) { +# return; #they've been on the channel for less than 90 seconds, probably nuisance botspam + $txtz = "$txtz ($msg) $hilite !att-$tgt-opalert"; + } my @tgts = ASM::Util->getAlert($tgt, 'opalert', 'msgs'); - foreach my $chan (@tgts) { - $conn->privmsg($chan, $event->{nick} . " tried to use the ops trigger for $tgt but is restricted from doing so."); + ASM::Util->sendLongMsg($conn, \@tgts, $txtz); + $::log->incident($tgt, "$tgt: $event->{nick} requested op attention\n"); + } else { + unless (defined($::ignored{$tgt}) && ($::ignored{$tgt} >= $::RISKS{'opalert'})) { + my @tgts = ASM::Util->getAlert($tgt, 'opalert', 'msgs'); + foreach my $chan (@tgts) { + $conn->privmsg($chan, $event->{nick} . " tried to use the ops trigger for $tgt but is restricted from doing so."); + } } } + $::ignored{$tgt} = $::RISKS{'opalert'}; + $conn->schedule(45, sub { delete($::ignored{$tgt}) if $::ignored{$tgt} == $::RISKS{'opalert'} }); ]]> </command> <command cmd="^;blacklist (.*)" flag="s"> |
