'Send a (private) message.
Parameters: <msgtarget> <text to be sent>'

def irc_PRIVMSG(self, prefix, params):

    try:
        targetName = params[0]
        if isinstance(targetName, bytes):
            targetName = targetName.decode(self.encoding)
    except UnicodeDecodeError:
        self.sendMessage(irc.ERR_NOSUCHNICK, params[0], ':No    such    nick/channel    (could    not    decode    your    unicode!)')
        return
    messageText = params[(-1)]
    if targetName.startswith('#'):
        target = self.realm.lookupGroup(targetName[1:])
    else:
        target = self.realm.lookupUser(targetName).addCallback((lambda user: user.mind))
    def cbTarget(targ):
        if (targ is not None):
            return self.avatar.send(targ, {'text': messageText})
    def ebTarget(err):
        self.sendMessage(irc.ERR_NOSUCHNICK, targetName, ':No    such    nick/channel.')
    target.addCallbacks(cbTarget, ebTarget)
