diff options
| author | 2012-08-16 06:58:14 +0000 | |
|---|---|---|
| committer | 2012-08-16 06:58:14 +0000 | |
| commit | 6cf8963cfc8dc562f7ec8f3c5d538f05a0e7a0be (patch) | |
| tree | 2f54ae3d0f4a21ae6026e401832fffd053b79da6 /config-default | |
| parent | 5154f3cac3c3537d94b748c365dce88f3805b4a7 (diff) | |
Disabled message-sending-throttling
Added a command to view uptime/cpu/ram usage statistics
The hilight/dehilight commands can accept a comma-separated list of nicks
The exempt command is now deprecated
A restriction-system has been added to replace the old exemption system, and also includes additional restrictions that can be added, such as "don't let this account use !ops"
Added a plugin command, so other bots can have ASM generate alerts
Updated users and flags
Updated channel hilights
Replaced code that shows up in several places to split a long privmsg into two parts with a utility function
Added a detection class for fuzzy-matching against a nick blacklist
Fixed some major memory leaks, the bot stays stable around 30MB rather than shooting up to 65MB after a couple of days
The bot now uses nickserv REGAIN instead of ghost/release/nick
Added channel modes, ban lists, and quiet lists to state tracking
Ignore chanserv in netsplit detections
Track time/setter when a topic is changed in a channel
Monitor if a channel is set +r and is still +r 45 minutes later, if so generate an alert
Print status and how long it took to sync once the bot has started and synced, and warn about failed syncings.
Diffstat (limited to 'config-default')
| -rw-r--r-- | config-default/channels.xml | 61 | ||||
| -rw-r--r-- | config-default/commands.xml | 88 | ||||
| -rw-r--r-- | config-default/restrictions.xml | 13 | ||||
| -rw-r--r-- | config-default/users.xml | 13 |
4 files changed, 118 insertions, 57 deletions
diff --git a/config-default/channels.xml b/config-default/channels.xml index c9312b7..ecefc7a 100644 --- a/config-default/channels.xml +++ b/config-default/channels.xml @@ -2,6 +2,11 @@ <channel id="##English"> <hilights></hilights> </channel> + <channel id="##Linux"> + <hilights> + <low>DLange</low> + </hilights> + </channel> <channel id="##asb-debug" monitor="no"> <hilights></hilights> </channel> @@ -42,15 +47,13 @@ </channel> <channel id="##linux" silence="yes"> <hilights> - <disable>ST47</disable> + <info>Dominian</info> <low>denny</low> - <low>numist</low> <low>tomaw</low> <low>WildPikachu</low> <low>Gary</low> <medium>vorian</medium> <medium>DLange</medium> - <medium>pinPoint</medium> <medium>njan</medium> </hilights> <msgs> @@ -61,13 +64,21 @@ <hilights> <opalert>WildPikachu</opalert> <opalert>denny</opalert> - <opalert>numist</opalert> - <opalert>PhilKC</opalert> + <opalert>tomaw</opalert> + <opalert>Gary</opalert> + <opalert>vorian</opalert> + <opalert>DLange</opalert> + <opalert>njan</opalert> + <opalert>Dominian</opalert> </hilights> <msgs> <opalert>##linux-ops</opalert> </msgs> </channel> + <channel id="##olympics"> + <hilights></hilights> + <msgs></msgs> + </channel> <channel id="##philosophy" silence="yes"> <hilights></hilights> <msgs></msgs> @@ -80,6 +91,12 @@ <hilights></hilights> <msgs></msgs> </channel> + <channel id="##trans" silence="yes"> + <hilights> + <info>Kelsie</info> + </hilights> + <msgs></msgs> + </channel> <channel id="##transgender"> <hilights> <info>ttuttle</info> @@ -121,6 +138,7 @@ <hilights></hilights> <msgs></msgs> </channel> + <channel id="#antispammeta-debug" /> <channel id="#cisco"> <hilights></hilights> <msgs></msgs> @@ -152,21 +170,18 @@ <debug>Dave2</debug> <debug>Martinp23</debug> <debug>SeJo</debug> - <debug>pctony</debug> <debug>Corey</debug> - <debug>theacolyte-</debug> <debug>nhandler</debug> - <debug>Plazma</debug> - <debug>Plazma-Rooolz</debug> <high>mquin</high> <high>ttuttle</high> <info>njan</info> <info>ttuttle</info> + <info>gry</info> + <info>Adran</info> <low>denny</low> <low>Gary</low> <low>JonathanD</low> <low>ZoFreX</low> - <low>DLange</low> <low>PriceChild</low> <low>werdan7</low> <low>dax</low> @@ -179,6 +194,10 @@ <channel id="#freenode-newyears" link="#freenode" silence="yes"> <hilights></hilights> </channel> + <channel id="#frikipedia"> + <hilights></hilights> + <msgs></msgs> + </channel> <channel id="#gentoo" silence="yes"> <hilights> <debug>NeddySeagoon</debug> @@ -207,7 +226,6 @@ <hilights> <disable>Thehelpfulone</disable> <high>tomaw</high> - <high>DLange</high> <high>RichiH</high> </hilights> <msgs></msgs> @@ -317,7 +335,6 @@ <debug>Martinp23</debug> <debug>PeterSymonds</debug> <debug>vvv</debug> - <debug>Barras</debug> <debug>AfterDeath</debug> <debug>DeltaQuad</debug> <debug>Snowolf</debug> @@ -371,13 +388,13 @@ <debug>Not_the_NSA</debug> <debug>Kanonkas</debug> <debug>PeterSymonds</debug> - <debug>Barras</debug> <debug>AfterDeath</debug> <debug>Logan_</debug> <debug>jeremyb</debug> <debug>AfterDeath</debug> <info>charitwo</info> <info>TBloemink</info> + <info>Mh7kJ</info> <low>slakr</low> </hilights> <msgs> @@ -403,7 +420,6 @@ <debug>Thehelpfulone</debug> <debug>Tempodivalse</debug> <debug>Tanvir</debug> - <debug>Barras</debug> <debug>peteforsyth</debug> <debug>Az1568</debug> <debug>Cbrown1023</debug> @@ -425,7 +441,6 @@ </channel> <channel id="#wikimedia-stewards"> <hilights> - <debug>Barras</debug> <debug>PeterSymonds</debug> <debug>Snowolf</debug> <debug>Thehelpfulone</debug> @@ -436,8 +451,8 @@ <info>Fluffernutter</info> <info>Pmlineditor</info> <info>juancarlos</info> - <info>omtsh</info> <info>MBisanz</info> + <info>Mh7kJ</info> </hilights> <msgs> <debug>#wikimedia-ops</debug> @@ -488,7 +503,6 @@ <debug>jeremyb</debug> <debug>Maximillion</debug> <debug>stwalkerster</debug> - <debug>Barras</debug> <debug>DeltaQuad</debug> <debug>Gfoley4</debug> <debug>Logan_</debug> @@ -497,6 +511,7 @@ <debug>Tanvir</debug> <debug>TBloemink</debug> <debug>Rjd0060</debug> + <debug>Shirik</debug> <low>bumm13_</low> <low>Cyrius</low> <low>DanielB</low> @@ -538,7 +553,6 @@ <debug>stwalkerster</debug> <debug>Jamesofur</debug> <debug>SpitfireWP</debug> - <debug>Barras</debug> <debug>jeremyb</debug> <debug>DeltaQuad</debug> <debug>Theo10011</debug> @@ -548,7 +562,6 @@ <debug>Steven_Zhang</debug> <debug>Shirik</debug> <debug>TBloemink</debug> - <debug>foxj</debug> <debug>Rjd0060</debug> <low>Cobi</low> <low>Golbez</low> @@ -634,8 +647,6 @@ <debug>Snowolf</debug> <debug>Tanvir</debug> <debug>TBloemink</debug> - <debug>Barras</debug> - <debug>Barras</debug> <debug>Ocaasi</debug> <info>mabdul</info> <low>KFP</low> @@ -690,13 +701,6 @@ <debug>#wikimedia-ops</debug> </msgs> </channel> - <channel id="+#wikimedia-ops"> - <hilights></hilights> - </channel> - <channel id="antispammeta"> - <hilights></hilights> - <msgs></msgs> - </channel> <channel id="default"> <hilights></hilights> </channel> @@ -706,7 +710,6 @@ <low>marienz</low> <low>mrmist</low> <medium>dave2</medium> - <medium>RichiH</medium> </hilights> <msgs> <debug>##asb-nexus</debug> diff --git a/config-default/commands.xml b/config-default/commands.xml index 56db997..19e91ac 100644 --- a/config-default/commands.xml +++ b/config-default/commands.xml @@ -1,4 +1,16 @@ <commands> + <command cmd="^;status$" flag="o"> + <![CDATA[ + my $size = `ps -p $$ h -o size`; + my $cputime = `ps -p $$ h -o time`; + chomp $size; chomp $cputime; + $conn->privmsg($event->{to}->[0], "This bot has been running for " . (time - $::starttime) . " seconds" . + ", is tracking " . (scalar (keys %::sn)) . " nicks" . + " across " . (scalar (keys %::sc)) . " tracked channels." . + " It is using " . $size . "KB of RAM" . + " and has used " . $cputime . " of CPU time."); + ]]> + </command> <command cmd="^;mship (\S+)$" flag="c"> <![CDATA[ $conn->privmsg($event->{to}->[0], $1 . " is on: " . ASM::Util->commaAndify(@{$::sn{lc $1}->{mship}})); @@ -164,7 +176,7 @@ <command cmd="^;hilight (\S+) (\S+) ?(\S*)$" flag="h"> <![CDATA[ my $chan = $1; - my $nick = $2; + my @nicks = split(/,/,$2); my $level= $3; if ($level eq '') { $level = 'info'; } $level = lc $level; @@ -183,17 +195,19 @@ unless (defined($::channels->{channel}->{$chan}->{hilights}->{$level})) { $::channels->{channel}->{$chan}->{hilights}->{$level} = []; } - my @tmphl = @{$::channels->{channel}->{$chan}->{hilights}->{$level}}; - push(@tmphl, $nick); - $::channels->{channel}->{$chan}->{hilights}->{$level} = \@tmphl; + foreach my $nick (@nicks) { + my @tmphl = @{$::channels->{channel}->{$chan}->{hilights}->{$level}}; + push(@tmphl, $nick); + $::channels->{channel}->{$chan}->{hilights}->{$level} = \@tmphl; + } ASM::XML->writeChannels(); - $conn->privmsg($event->{to}->[0], "$nick added to $level risk hilights for $chan"); + $conn->privmsg($event->{to}->[0], ASM::Util->commaAndify(@nicks) . " added to $level risk hilights for $chan"); ]]> </command> <command cmd="^;dehilight (\S+) (\S+)" flag="h"> <![CDATA[ my $chan = $1; - my $nick = $2; + my @nicks = split(/,/, $2); my $link = ASM::Util->getLink(lc $chan); if ( lc $link ne lc $chan ) { $conn->privmsg($event->{to}->[0], "Error: $chan is linked to $link - use $link instead."); @@ -202,11 +216,13 @@ foreach my $risk ( keys %::RISKS ) { next unless defined($::channels->{channel}->{$chan}->{hilights}->{$risk}); my @ppl = @{$::channels->{channel}->{$chan}->{hilights}->{$risk}}; - @ppl = grep { lc $_ ne lc $nick } @ppl; + foreach my $nick (@nicks) { + @ppl = grep { lc $_ ne lc $nick } @ppl; + } $::channels->{channel}->{$chan}->{hilights}->{$risk} = \@ppl; } ASM::XML->writeChannels(); - $conn->privmsg($event->{to}->[0], "Removing hilights for $nick in $chan"); + $conn->privmsg($event->{to}->[0], "Removing hilights for " . ASM::Util->commaAndify(@nicks) . " in $chan"); ]]> </command> <command cmd="^;join (\S+)" flag="a"> @@ -275,15 +291,29 @@ </command> <command cmd="^;exempt (.*)" flag="o"> <![CDATA[ - my $x = lc $1; - $::eline{$x} = 1; - $x . "\n" >> io 'exempt.txt'; - $conn->privmsg($event->{to}->[0], $x . " exempted"); + $conn->privmsg($event->{to}->[0], "This command is now deprecated. Use ;restrict nick/account/host lineToRestrict +notrigger instead, i.e. ;restrict account eir +notrigger"); + ]]> + </command> + <command cmd="^;restrict (nick|account|host) (\S+) (\+|-)([a-z]+)$" flag="o"> + <![CDATA[ + my ($type, $who, $mode, $restriction) = ($1, lc $2, $3, $4); + if ($mode eq '-') { + delete $::restrictions->{$type . 's'}->{$type}->{$who}->{$restriction}; + $conn->privmsg($event->{to}->[0], "Removed $restriction restriction for $type $who"); + } + if ($mode eq '+') { + if (! defined($::restrictions->{$type . 's'}->{$type}->{$who})) { + $::restrictions->{$type . 's'}->{$type}->{$who} = {}; + } + $::restrictions->{$type . 's'}->{$type}->{$who}->{$restriction} = $restriction; + $conn->privmsg($event->{to}->[0], "Added $restriction restriction for $type $who"); + } + ASM::XML->writeRestrictions(); ]]> </command> <command cmd="^\!ops ?(#\S+)? ?(.*)" nohush="nohush"> <![CDATA[ -# if ($::sn{lc $event->{nick}}->{dnsbl} == 0) { + if (ASM::Util->notRestricted(lc $event->{nick}, "noops")) { my $tgt = $event->{to}->[0]; $tgt = $1 if (defined($1)); my $msg = $1; @@ -293,17 +323,10 @@ $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 ($msg) $hilite"; - foreach my $tgt2 (ASM::Util->getAlert($tgt, 'opalert', 'msgs')) { #unfortunately wikipedia has way too many ops, and it breaks things - if (length($txtz) <= 380) { - $conn->privmsg($tgt2, $txtz); - } else { - my $splitpart = rindex($txtz, " ", 380); - $conn->privmsg($tgt2, substr($txtz, 0, $splitpart)); - $conn->privmsg($tgt2, substr($txtz, $splitpart)); - } - } + my @tgts = ASM::Util->getAlert($tgt, 'opalert', 'msgs'); + ASM::Util->sendLongMsg($conn, \@tgts, $txtz); } -# } + } ]]> </command> <command cmd="^;blacklist (.*)" flag="o"> @@ -314,4 +337,23 @@ $conn->privmsg($event->{to}->[0], "$str blacklisted"); ]]> </command> + <command cmd="^;plugin (\S+) (\S+) (.*)" flag="p"> + <![CDATA[ + my $chan = $1; + my $risk = $2; + my $reason = $3; + my $txtz = "\x03" . $::RCOLOR{$::RISKS{$risk}} . "\u$risk\x03 risk threat [\x02$chan\x02] - ". + "\x02($event->{nick} plugin)\x02 - ${reason}; ping "; + $txtz = $txtz . ASM::Util->commaAndify(ASM::Util->getAlert(lc $chan, $risk, 'hilights')) if (ASM::Util->getAlert(lc $chan, $risk, 'hilights')); + $txtz = $txtz . ' !att-' . $chan . '-' . $risk; + my @tgts = ASM::Util->getAlert($chan, $risk, 'msgs'); + if (length($txtz) <= 380) { + $conn->privmsg(\@tgts, $txtz); + } else { + my $splitpart = rindex($txtz, " ", 380); + $conn->privmsg(\@tgts, substr($txtz, 0, $splitpart)); + $conn->privmsg(\@tgts, substr($txtz, $splitpart)); + } + ]]> + </command> </commands> diff --git a/config-default/restrictions.xml b/config-default/restrictions.xml new file mode 100644 index 0000000..c022a7c --- /dev/null +++ b/config-default/restrictions.xml @@ -0,0 +1,13 @@ +<restrictions> + <hosts> + <host id="services." notrigger="notrigger" noops="noops" nocommands="nocommands" /> + <host id="freenode/utility-bot/ex-server/idoru" noops="noops" /> + </hosts> + <nicks> + <nick id="eir" nocommands="nocommands" /> + </nicks> + <accounts> + <account id="toracat" notrigger="notrigger" /> + <account id="/>" notrigger="notrigger" /> + </accounts> +</restrictions> diff --git a/config-default/users.xml b/config-default/users.xml index d083b8e..c01a206 100644 --- a/config-default/users.xml +++ b/config-default/users.xml @@ -1,27 +1,29 @@ <people> - <person id="afterdeath" flags="hocdat" /> + <person id="afterdeath" flags="hocdatp" /> <person id="cbrown1023" flags="oath" /> - <person id="charitwo" flags="oath" /> <person id="dave2" flags="oath" /> <person id="denny" flags="ha" /> - <person id="dlange" flags="oathd" /> + <person id="dlange" flags="coathd" /> <person id="dmcdevit" flags="oath" /> + <person id="dominian" flags="oath" /> <person id="dungodung" flags="oath" /> <person id="errantego" flags="doath" /> <person id="gary" flags="oath" /> <person id="idleone" flags="o" /> <person id="jeremyb" flags="th" /> <person id="jonathand" flags="oath" /> + <person id="kelsie" flags="a" /> <person id="kindone" flags="t" /> <person id="ljl" flags="o" /> <person id="logan_" flags="oath" /> <person id="lstarnes" flags="oath" /> - <person id="marienz" flags="oath" /> + <person id="marienz" flags="doath" /> <person id="martinp23" flags="oath" /> <person id="mquin" flags="hota" /> <person id="myrtti" flags="htoa" /> <person id="nhandler" flags="oath" /> <person id="njan" flags="oath" /> + <person id="o_o" flags="oath" /> <person id="paradox" flags="h" /> <person id="petersymonds" flags="oath" /> <person id="pricechild" flags="oath" /> @@ -29,6 +31,7 @@ <person id="rjd0060" flags="th" /> <person id="sauvin" flags="oath" /> <person id="seanw" flags="oath" /> + <person id="shiibot" flags="p" /> <person id="snowolf" flags="oath" /> <person id="th1" flags="th" /> <person id="thehelpfulone" flags="oath" /> @@ -36,6 +39,6 @@ <person id="troubled" flags="oath" /> <person id="ttuttle" flags="oath" /> <person id="werdan7" flags="oath" /> - <person id="wildpikachu" flags="oath" /> + <person id="wildpikachu" flags="doath" /> <person id="windowshasyou" flags="oath" /> </people> |
