def METHOD_NAME(guid, chat_flags, message, chat_type, lang, channel=None):
    message_bytes = PacketWriter.string_to_bytes(message)
    data = pack('<BI', chat_type, lang)
    if not channel:
        data += pack('<Q', guid)
    else:
        channel_bytes = PacketWriter.string_to_bytes(channel)
        data += pack(f'<{len(channel_bytes)}sQ', channel_bytes, guid)
    data += pack(f'<{len(message_bytes)}sB', message_bytes, chat_flags)
    return PacketWriter.get_packet(OpCode.SMSG_MESSAGECHAT, data)