update: autoremoval of bans

Elián Hanisch lambdae2 at gmail.com
Fri Sep 7 20:26:02 UTC 2012


Folks, today I merged the code that implements automatic removal of bans, 
should be ready to use once tsimpson or jussi updates and reloads ubottu.
Until then, you all can test it with scratDev in #ubuntu-bots-test. At this 
point I believe the feature is complete, should anyone find a bug please 
report it.

ubottu will need +o flag. It can always stay opped (in which case it will also 
need +O flag), or only op when is needed.

How to use it:

I modified the command @comment, you can use it as always but now it can set 
the ban duration or comment several bans a the same time:

@comment <id>[,<id> ...] [<comment>][, <duration>]

As you can see, the "duration" is whatever is behind the last comma, if the 
syntax is wrong then it will just comment the ban as always.

<duration> uses the time units years, months, weeks, days, hours and minutes, 
it uses fuzzy matching so you can write the partial word or just the first 
letter. The only clash is with 'm', so 'M' stands for month and 'm' for 
minute. If no unit is given it will default to seconds.

duration examples:
1 month 2 weeks 5 min
1M 2w 5m
1M2w5m
(the 3 are equivalent)

command examples:
@comment 123 this is a temporal ban, 2d
@comment 124,125,126 troll, ban evading, etc, 2 weeks
@comment 127 this ban will not expire, because no duration was given.

The <duration> part is not stripped from the comment, so it will show in the 
bantracker. And note that even though you can set a ban to expire in 1 minute, 
it will might take longer to be removed since the time between checks are 10 
minutes apart.

For show or change the ban duration I added the command @duration:

@duration [<id>[,<id> ...]] [<duration>]

It sets or changes the duration of a ban. If you don't give a duration the bot 
will reply how much time the ban has left until is removed, if you don't 
either give an id the bot will reply which bans are set to expire. If you use 
zero or a negative number as duration, the ban will be set to never expire.

command examples:
@duration 123 2d
@duration 123,124,125 2 weeks

The bot will send a notification 10 minutes before removing a ban.

That's all.

--
~ m4v
https://launchpad.net/~m4v
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-irc/attachments/20120907/bbe3d9b4/attachment.html>


More information about the Ubuntu-irc mailing list