Skip to content

Commit

Permalink
Make ponies work in 2.6
Browse files Browse the repository at this point in the history
  • Loading branch information
mythmon committed Jul 29, 2011
1 parent 65439e3 commit 93436cd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions hamper/plugins/friendly.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,10 @@ def setup(self, factory):
def process(self, bot, comm):
if re.match(r'.*pon(y|ies).*', comm['message'], re.I):
now = datetime.now()
since_last_pony = now - self.last_pony_time
if since_last_pony.total_seconds() >= self.cooldown:
since_last = now - self.last_pony_time
since_last = since_last.seconds + 24*3600*since_last.days

if since_last >= self.cooldown:
bot.msg(comm['channel'], 'OMG!!! PONIES!!!')
self.last_pony_time = now
else:
Expand Down

0 comments on commit 93436cd

Please sign in to comment.