'Send a message to a user or channel.
The message will be split into multiple commands to the server if:
- The message contains any newline characters
- Any span between newline characters is longer than the given
line-length.
@param user: Username or channel name to which to direct the
message.
@type user: C{str}
@param message: Text to send.
@type message: C{str}
@param length: Maximum number of octets to send in a single
command, including the IRC protocol framing. If L{None} is given
then L{IRCClient._safeMaximumLineLength} is used to determine a
value.
@type length: C{int}'

def msg(self, user, message, length=None):

    fmt = ('PRIVMSG    %s    :' % (user,))
    if (length is None):
        length = self._safeMaximumLineLength(fmt)
    minimumLength = (len(fmt) + 2)
    if (length <= minimumLength):
        raise ValueError(('Maximum    length    must    exceed    %d    for    message    to    %s' % (minimumLength, user)))
    for line in split(message, (length - minimumLength)):
        self.sendLine((fmt + line))
