c.execute("REPLACE INTO `seen` (`nick`, `date`) VALUES (?, ?)",(nick.lower(),datest))
self.log.info("Seen: %s on %s"%(nick.lower(),datest))
sql.commit()
iftrailing.startswith(".seen"):
cmdargs=trailing.split("");
# query the DB for the user
iflen(cmdargs)>=2:
searchnic=cmdargs[1].lower();
c.execute("SELECT * FROM `seen` WHERE `nick`= ? ",[searchnic])
rows=c.fetchall()
iflen(rows)==1:
self.bot.act_PRIVMSG(args[0],"I last saw %s on %s (%s)."%(cmdargs[1],time.strftime("%m/%d/%y at %I:%M %p",time.localtime(rows[0]['date'])),self.config["timezone"]));
else:
self.bot.act_PRIVMSG(args[0],"Sorry, I haven't seen %s!"%cmdargs[1])