'Generates the formatted string sent to listeners on a channel.
Args:
msgobj (Msg): Message object to send.
emit (bool, optional): In emit mode the message is not associated
with a specific sender name.
prefix (bool, optional): Prefix `msg` with a text given by `self.channel_prefix`.
sender_strings (list, optional): Used by bots etc, one string per external sender.
external (bool, optional): If this is an external sender or not.'

def message_transform(self, msgobj, emit=False, prefix=True, sender_strings=None, external=False):

    if (sender_strings or external):
        body = self.format_external(msgobj, sender_strings, emit=emit)
    else:
        body = self.format_message(msgobj, emit=emit)
    if prefix:
        body = ('%s%s' % (self.channel_prefix(msgobj, emit=emit), body))
    msgobj.message = body
    return msgobj
