This phrase, “history has no meaning” could be taken as an atheistic prejudice that God has no purpose for reality. But that is not particularly what Foucault has in mind. It might be better thought of as a claim that we do not have access to know the one and final meaning of each historical event. Foucault says,
History has no "meaning," though this is not to say that it is absurd or incoherent. On the contrary, it is intelligible and should be susceptible to analysis down to the smallest detail--but this in accordance with the intelligibility of struggles, of strategies and tactics. (FR 56)
The point here is that any notion of "the history" of an event is not pure, not free from prejudices of perspective. Every history is a story told by someone. That isn't to say that history is merely a make-believe fairy tale invented by imagination, but it is to say that when a subject (individual) gives an account of an event, their account is by definition subjective (of a subject) and particularly idiocycratic in a certain type of way. This is more obvious on a broader societal level, where societies perpetuate certain ways of describing events and happenings. We have a tendency to think that our perspective is the best one ever, that we can see things more clearly than any of our predecessors. But the fact is that we live in time and cannot escape our contingent state to achieve a perfectly non-context-influenced position from which to view "history". In this sense then, we cannot get at the history of the world, or an event, etc.
I think we should have the modesty to say to ourselves that, on the one hand, the time we live in is not the unique or fundamental or irruptive point in history where everything is completed and begun again. We must also have the modesty to say, on the other hand, that . . . the time we live in is very interesting; . . . It is a time like any other, or rather, a time which is never quite like any other. (Politics, 36)
Foucault doesn't want to try to find "the perfect story" of history. He doesn't think that is possible. His project is primarily critical. Foucault is not interested in finding solutions. He is interested in pointing out problems. He is actively concerned with showing the overlooked dangers and unresolved tensions in our thinking. This leads Foucault not to apathy, but rather leads him to a hyper-activism:
You see, what I want to do is not the history of solutions . . . I would like to do the genealogy of problems, of problematiques. My point is not that everything is bad, but that everything is dangerous, which is not exactly the same as bad. If everything is dangerous, then we always have something to do. So my position leads not to apathy but to a hyper- and pessimistic activism.
I think that the ethico-politcal choice we have to make every day is to determine which is the main danger. (Foucault Reader, 343)
Foucault, as Lyotard, is interested in finding unexplored options, unthought of ways, by putting the status quo in question and raising serious difficulties. His concern is not in building consensus, but in preventing violent hegemony: "The farthest I would go is to say that perhaps one must not be for consensuality, but one must be against nonconsensuality."(FR 379) Again, we find a pluralistic obsession, which is, as far as I have here presented it, not so distant from Lyotard's. While I do think that Foucault and Lyotard’s concerns are legitimate, they do not provide us with much in the way of constructive paradigms for community, consensus, etc.