X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~matthewv/git?a=blobdiff_plain;f=commands.py;h=721089d3912d6e86d466c2be1d65edbf3253f7e9;hb=5b81b760d26e6ded7f49acfe88964e7cdf7162d4;hp=d6ba5302dee49573d96ae9013fae6526a4c206a8;hpb=f7846893b2318a67fe429d1e8bc79c012d2c78cb;p=irc.git diff --git a/commands.py b/commands.py index d6ba530..721089d 100755 --- a/commands.py +++ b/commands.py @@ -333,7 +333,14 @@ def blameq(bot,cmd,nick,conn,public,fishpond,cfgs): cwhat=' '.join(clist[2:]) kindsfile = "fish?" if clist[1]=="#last": - try: lmsg, lcfg = fishpond.last[0] + try: + n = abs(int(clist[2]))-1 + if n < 0: raise ValueError + except IndexError: n = 0 + except ValueError: + bot.automsg(public,nick,"Huh?") + return + try: lmsg, lcfg = fishpond.last[n] except IndexError: bot.automsg(public,nick,"Nothing") return