Skip to content

Commit

Permalink
Don't reset function timer during cooldown
Browse files Browse the repository at this point in the history
  • Loading branch information
calebj committed Apr 19, 2016
1 parent f5a742a commit 5479ed4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sopel/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ def call(self, func, sopel, trigger):
if func in self._times[nick]:
usertimediff = current_time - self._times[nick][func]
if func.rate > 0 and usertimediff < func.rate:
self._times[nick][func] = current_time
#self._times[nick][func] = current_time
LOGGER.info(
"%s prevented from using %s in %s due to user limit: %d < %d",
trigger.nick, func.__name__, trigger.sender, usertimediff,
Expand All @@ -442,7 +442,7 @@ def call(self, func, sopel, trigger):
if func in self._times[self.nick]:
globaltimediff = current_time - self._times[self.nick][func]
if func.global_rate > 0 and globaltimediff < func.global_rate:
self._times[self.nick][func] = current_time
#self._times[self.nick][func] = current_time
LOGGER.info(
"%s prevented from using %s in %s due to global limit: %d < %d",
trigger.nick, func.__name__, trigger.sender, globaltimediff,
Expand All @@ -453,7 +453,7 @@ def call(self, func, sopel, trigger):
if not trigger.is_privmsg and func in self._times[trigger.sender]:
chantimediff = current_time - self._times[trigger.sender][func]
if func.channel_rate > 0 and chantimediff < func.channel_rate:
self._times[trigger.sender][func] = current_time
#self._times[trigger.sender][func] = current_time
LOGGER.info(
"%s prevented from using %s in %s due to channel limit: %d < %d",
trigger.nick, func.__name__, trigger.sender, timediff,
Expand Down

0 comments on commit 5479ed4

Please sign in to comment.