From: Matthew Vernon Date: Fri, 4 Jun 2010 19:53:45 +0000 (+0100) Subject: remember to update the count X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~matthewv/git?p=irc.git;a=commitdiff_plain;h=b6a82529650123d4baab1e4312031c82df33dbb2 remember to update the count --- diff --git a/commands.py b/commands.py index fb35d4f..fb4175c 100644 --- a/commands.py +++ b/commands.py @@ -322,7 +322,7 @@ class UrlLog: def firstmen(self): return nicetime(time.time()-self.first) def urltype(self): - z=max(len(urlcomplaints), self.count-1) + z=min(len(urlcomplaints)-1, self.count-1) return urlcomplaints[z] urlre = re.compile("(https?://[^ ]+)( |$)") @@ -343,6 +343,7 @@ def urlq(bot, cmd, nick, conn, public,urldb): (T.urltype(),T.firstmen(),T.nick) if (public): complaint=complaint+". Furthermore it defeats the point of this command to use it other than via /msg." + T.count+=1 bot.automsg(False,nick,complaint) T.lastasked=time.time() else: @@ -363,6 +364,7 @@ def dourl(bot,conn,nick,command,urldb): (T.urltype(),T.firstmen(),T.nick) conn.action(bot.channel, message) T.lastseen=time.time() + T.count+=1 else: urldb[urlstring]=UrlLog(urlstring,nick)