Changed magic numbers to variables.

This commit is contained in:
Jeremy Fincher 2003-11-03 17:45:48 +00:00
parent 5fb5241602
commit be3e5e482a

View File

@ -63,6 +63,8 @@ Add an example IRC session using this module here.
""") """)
grabTime = 864000 # 10 days grabTime = 864000 # 10 days
minRandomLength = 8
minRandomWords = 3
class QuoteGrabs(plugins.ChannelDBHandler, class QuoteGrabs(plugins.ChannelDBHandler,
plugins.Toggleable, plugins.Toggleable,
@ -95,7 +97,8 @@ class QuoteGrabs(plugins.ChannelDBHandler,
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.toggles.get('random', channel):
if len(msg.args[1]) > 8 and len(msg.args[1].split()) > 3: if len(msg.args[1]) > minRandomLength and \
len(msg.args[1].split()) > minRandomWords:
db = self.getDb(channel) db = self.getDb(channel)
cursor = db.cursor() cursor = db.cursor()
cursor.execute("""SELECT added_at FROM quotegrabs cursor.execute("""SELECT added_at FROM quotegrabs