Ie,
~blame #last 1 = ~blame #last
~blame #last 2 = the last-but-one fish
~blame #last 3 = the last-but-two fish
etc.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
---
v2: Fixed off-by-one error in commit message.
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