From 234728b32204eacb2e6d7dec7a39b8edcd7f7667 Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Sat, 8 Nov 2003 09:51:05 +0000 Subject: [PATCH] Changed to Configurable. --- plugins/QuoteGrabs.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/plugins/QuoteGrabs.py b/plugins/QuoteGrabs.py index ce54e8617..bbae857e3 100644 --- a/plugins/QuoteGrabs.py +++ b/plugins/QuoteGrabs.py @@ -63,11 +63,14 @@ minRandomLength = 8 minRandomWords = 3 class QuoteGrabs(plugins.ChannelDBHandler, - plugins.Toggleable, + plugins.Configurable, 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): - plugins.Toggleable.__init__(self) plugins.ChannelDBHandler.__init__(self) callbacks.Privmsg.__init__(self) @@ -94,7 +97,7 @@ class QuoteGrabs(plugins.ChannelDBHandler, def doPrivmsg(self, irc, msg): if ircutils.isChannel(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 \ len(msg.args[1].split()) > minRandomWords: db = self.getDb(channel)