chiark / gitweb /
deal with empty ~blame arguments
authorMatthew Vernon <matthewv@chiark.greenend.org.uk>
Tue, 2 Aug 2011 22:02:56 +0000 (23:02 +0100)
committerMatthew Vernon <matthewv@chiark.greenend.org.uk>
Tue, 2 Aug 2011 22:02:56 +0000 (23:02 +0100)
commands.py

index bbcaeb8..7232bd1 100644 (file)
@@ -300,6 +300,9 @@ def __getall(tdb,tdbk,fdb,fdbk,sdb,sdbk,what):
 
 def blameq(bot,cmd,nick,conn,public,fish,tdb,tdbk,fdb,fdbk,sdb,sdbk):
     clist=cmd.split()
+    if len(clist) < 2:
+       bot.automsg(public,nick,"Who or what do you want to blame?")
+       return
     cwhat=' '.join(clist[2:])
     if clist[1]=="#last":
        ans=__getall(tdb,tdbk,fdb,fdbk,sdb,sdbk,fish.last)