Changed to Configurable.

This commit is contained in:
Jeremy Fincher 2003-11-08 09:51:05 +00:00
parent 783b56bbed
commit 234728b322

View File

@ -63,11 +63,14 @@ minRandomLength = 8
minRandomWords = 3 minRandomWords = 3
class QuoteGrabs(plugins.ChannelDBHandler, class QuoteGrabs(plugins.ChannelDBHandler,
plugins.Toggleable, plugins.Configurable,
callbacks.Privmsg): callbacks.Privmsg):
toggles = plugins.ToggleDictionary({'random': False}) configurables = plugins.ConfigurableDictionary(
[('random-grabber', plugins.ConfigurableTypes.bool, False,
"""Determines whether the bot will randomly grab possibly-suitable
quotes for someone."""),]
)
def __init__(self): def __init__(self):
plugins.Toggleable.__init__(self)
plugins.ChannelDBHandler.__init__(self) plugins.ChannelDBHandler.__init__(self)
callbacks.Privmsg.__init__(self) callbacks.Privmsg.__init__(self)
@ -94,7 +97,7 @@ class QuoteGrabs(plugins.ChannelDBHandler,
def doPrivmsg(self, irc, msg): def doPrivmsg(self, irc, msg):
if ircutils.isChannel(msg.args[0]): if ircutils.isChannel(msg.args[0]):
channel = msg.args[0] channel = msg.args[0]
if self.toggles.get('random', channel): if self.configurables.get('random', channel):
if len(msg.args[1]) > minRandomLength and \ if len(msg.args[1]) > minRandomLength and \
len(msg.args[1].split()) > minRandomWords: len(msg.args[1].split()) > minRandomWords:
db = self.getDb(channel) db = self.getDb(channel)