diff --git a/conf/example/config.json b/conf/example/config.json index 6974770..8918523 100644 --- a/conf/example/config.json +++ b/conf/example/config.json @@ -27,7 +27,8 @@ "Prefix": "*" }, "Delays": { - "WhoLoop": 60 + "WhoLoop": 600, + "WhoRange": 1800 } }, "Default": { diff --git a/core/bot.py b/core/bot.py index c2ebca5..4fe36a5 100644 --- a/core/bot.py +++ b/core/bot.py @@ -3,6 +3,8 @@ from twisted.words.protocols.irc import IRCClient from twisted.internet.defer import Deferred from twisted.internet.task import LoopingCall +from random import randint + import modules.keyword as keyword import modules.userinfo as userinfo import modules.counters as count @@ -247,7 +249,10 @@ class IRCBot(IRCClient): main.saveConf("masterbuf") lc = LoopingCall(self.getWho, channel) self._getWho[channel] = lc - lc.start(main.config["Tweaks"]["Delays"]["WhoLoop"]) + intrange = main.config["Tweaks"]["Delays"]["WhoRange"] + minint = main.config["Tweaks"]["Delays"]["WhoLoop"] + interval = randint(minint, minint+intrange) + lc.start(interval) def left(self, channel, message): if channel in self.channels: @@ -266,6 +271,8 @@ class IRCBot(IRCClient): keyword.sendMaster("KICK %s: (%s/%s) %s" % (self.name, kicker, channel, message)) count.event(self.name, "selfkick") monitor.event(self.name, channel, {"type": "kick", "exact": kicker, "nick": nick, "ident": ident, "host": host, "message": message}) + lc = self._getWho[channel] + lc.stop() def userJoined(self, user, channel): nick, ident, host = self.parsen(user)