'This will get called when the bot receives a message.'

def privmsg(self, user, channel, msg):

    user = user.split('!', 1)[0]
    self.logger.log(('<%s>    %s' % (user, msg)))
    if (channel == self.nickname):
        msg = "It    isn't    nice    to    whisper!        Play    nice    with    the    group."
        self.msg(user, msg)
        return
    if msg.startswith((self.nickname + ':')):
        msg = ('%s:    I    am    a    log    bot' % user)
        self.msg(channel, msg)
        self.logger.log(('<%s>    %s' % (self.nickname, msg)))
