import time


def f_seen(self, origin, match, args):
    """.seen <nick> - Reports when <nick> was last seen."""
    if not match.group(2):
        return self.msg(origin.sender, 'Please provide a nick.')
    nick = match.group(2).lower()
    if not hasattr(self, 'seen'):
        return self.msg(origin.sender, '?')
    if self.seen.has_key(nick):
        channel, t = self.seen[nick]
        t = time.strftime('%Y-%m-%d %H:%M:%S UTC', time.gmtime(t))

        #msg = "I last saw %s at %s on %s" % (nick, t, channel)
        msg = 'I last saw %s at %s in some channel.' % (nick, t)
        self.msg(origin.sender, str(origin.nick) + ': ' + msg)
    else: self.msg(origin.sender, "Sorry, I haven't seen %s around." % nick)