'Called when the connected channel receives a message.
Args:
user (str): User name sending the message.
channel (str): Channel name seeing the message.
msg (str): The message arriving from channel.'

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

    if (channel == self.nickname):
        user = user.split('!', 1)[0]
        self.data_in(text=msg, type='privmsg', user=user, channel=channel)
    elif (not msg.startswith('***')):
        user = user.split('!', 1)[0]
        user = ansi.raw(user)
        self.data_in(text=msg, type='msg', user=user, channel=channel)
