2006-10-19 14:39:11 +00:00
|
|
|
###
|
2007-01-23 23:42:45 +00:00
|
|
|
# Copyright (c) 2006,2007 Dennis Kaarsemaker
|
2006-10-19 14:39:11 +00:00
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or modify
|
|
|
|
# it under the terms of version 2 of the GNU General Public License as
|
|
|
|
# published by the Free Software Foundation.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
###
|
|
|
|
|
2006-06-26 17:57:20 +00:00
|
|
|
import supybot.conf as conf
|
|
|
|
import supybot.registry as registry
|
|
|
|
|
2010-04-04 02:53:05 +00:00
|
|
|
|
2010-03-17 10:14:07 +00:00
|
|
|
class ValidTypes(registry.OnlySomeStrings):
|
|
|
|
"""Invalid type, valid types are: 'removal', 'ban' or 'quiet'."""
|
|
|
|
validStrings = ('removal', 'ban', 'quiet')
|
|
|
|
|
2010-04-04 02:53:05 +00:00
|
|
|
|
2010-03-17 10:14:07 +00:00
|
|
|
class SpaceSeparatedListOfTypes(registry.SpaceSeparatedListOf):
|
|
|
|
Value = ValidTypes
|
|
|
|
|
|
|
|
|
2006-06-26 17:57:20 +00:00
|
|
|
def configure(advanced):
|
|
|
|
conf.registerPlugin('Bantracker', True)
|
|
|
|
|
|
|
|
Bantracker = conf.registerPlugin('Bantracker')
|
2010-03-17 00:46:18 +00:00
|
|
|
conf.registerChannelValue(Bantracker, 'enabled',
|
2006-06-26 17:57:20 +00:00
|
|
|
registry.Boolean(False, """Enable the bantracker"""))
|
2010-03-17 00:46:18 +00:00
|
|
|
conf.registerGlobalValue(Bantracker, 'database',
|
2009-10-12 18:26:35 +00:00
|
|
|
registry.String('', "Filename of the bans database", private=True))
|
2010-03-17 00:46:18 +00:00
|
|
|
conf.registerGlobalValue(Bantracker, 'bansite',
|
2008-05-05 15:28:59 +00:00
|
|
|
registry.String('', "Web site for the bantracker, without the 'bans.cgi' appended", private=True))
|
2010-03-15 16:12:51 +00:00
|
|
|
|
2010-04-03 23:06:29 +00:00
|
|
|
conf.registerChannelValue(Bantracker, 'request',
|
2010-04-03 22:46:32 +00:00
|
|
|
registry.Boolean(False,
|
|
|
|
"Enable message requests from bot"))
|
2010-04-03 02:43:26 +00:00
|
|
|
conf.registerChannelValue(Bantracker.request, 'type',
|
2010-03-17 10:14:07 +00:00
|
|
|
SpaceSeparatedListOfTypes(['removal', 'ban', 'quiet'],
|
|
|
|
"List of events for which the bot should request a comment."))
|
2010-04-03 02:43:26 +00:00
|
|
|
conf.registerChannelValue(Bantracker.request, 'ignore',
|
|
|
|
registry.SpaceSeparatedListOfStrings(['FloodBot?', 'FloodBotK?', 'ChanServ'],
|
2010-04-04 02:53:05 +00:00
|
|
|
"List of nicks for which the bot won't request to comment or review."\
|
2010-03-15 23:51:32 +00:00
|
|
|
" Is case insensible and wildcards * ? are accepted."))
|
2010-04-03 02:43:26 +00:00
|
|
|
conf.registerChannelValue(Bantracker.request, 'forward',
|
2010-03-15 23:51:32 +00:00
|
|
|
registry.SpaceSeparatedListOfStrings([],
|
2010-03-16 02:26:19 +00:00
|
|
|
"List of nicks for which the bot will forward the request to"\
|
|
|
|
" the channels/nicks defined in forwards.channels option."\
|
2010-03-15 23:51:32 +00:00
|
|
|
" Is case insensible and wildcards * ? are accepted."))
|
2010-04-03 02:43:26 +00:00
|
|
|
conf.registerChannelValue(Bantracker.request.forward, 'channels',
|
2010-03-15 23:51:32 +00:00
|
|
|
registry.SpaceSeparatedListOfStrings([],
|
2010-04-04 02:53:05 +00:00
|
|
|
"List of channels/nicks to forward the request if the op is in the forward list."))
|
2010-04-04 00:55:59 +00:00
|
|
|
conf.registerGlobalValue(Bantracker.request, 'review',
|
2010-03-31 03:03:13 +00:00
|
|
|
registry.Float(7,
|
2010-04-04 02:53:05 +00:00
|
|
|
"Days after which the bot will request for review a ban. Can be an integer or decimal"
|
|
|
|
" value. Zero disables reviews."))
|
2010-04-03 02:43:26 +00:00
|
|
|
|
|
|
|
|