~m4v/scratbot/main

« back to all changes in this revision

Viewing changes to plugins/Misc/plugin.py

  • Committer: Elián Hanisch
  • Date: 2009-06-19 04:50:47 UTC
  • Revision ID: lambdae2@gmail.com-20090619045047-sat743lpjf03sgqc
added config variables for change the flood proction's timeout for commands
and invalid commands. Moved the replies to supybot.replies instead of being
hardcored.

new config
supybot.abuse.flood.command.timeout
supybot.abuse.flood.command.invalid.timeout
supybot.replies.abuseFlood
supybot.replies.abuseFlood.invalid

Show diffs side-by-side

added added

removed removed

Lines of Context:
48
48
    def __init__(self, irc):
49
49
        self.__parent = super(Misc, self)
50
50
        self.__parent.__init__(irc)
51
 
        self.invalidCommands = ircutils.FloodQueue(60)
 
51
        timeout = conf.supybot.abuse.flood.command.invalid.timeout
 
52
        self.invalidCommands = ircutils.FloodQueue(timeout)
52
53
 
53
54
    def callPrecedence(self, irc):
54
55
        return ([cb for cb in irc.callbacks if cb is not self], [])
74
75
                                 'observed.  Consider ignoring this bot '
75
76
                                 'permanently.')
76
77
            ircdb.ignores.add(banmask, time.time() + punishment)
77
 
            irc.reply('You\'ve given me %s invalid commands within the last '
78
 
                      'minute; I\'m now ignoring you for %s.' %
79
 
                      (maximum,
80
 
                       utils.timeElapsed(punishment, seconds=False)))
 
78
            irc.reply(conf.supybot.replies.abuseFlood.invalid())
81
79
            return
82
80
        # Now, for normal handling.
83
81
        channel = msg.args[0]