Not the user you replied to, but there's no harm (and in my judgement great benefit) from diving right into Kant, or more generally, German idealism - so Kant, Fichte, Schelling and Hegel. Marx is also worth visiting for his "Hegelian" materialism (in this case opposed to idealism). That'll provide the basics to know what Foucault was talking about.
The Cambridge Companion to German Idealism (I forget which year) is also highly recommended though I haven't looked into that myself.
Also, to plug my own favorite dead German guy, Schopenhauer spends a lot of time in his writings explaining (his interpretation of) Kant's ideas, and his prose is much easier to understand than Kant's, even in translation. You won't get any love for Fichte, Schelling, and Hegel from him though.
It should be noted that even Kant said that Hume "awoke me [kant] from my dogmatic slumber." Hume is pivotal to Kant's work, so at least reading the Enquiry is a good thing to read before Kant.
While true, and I realize the irony of saying this since I mentioned building up to Foucault, I don't think one is harmed so much by simply starting. There's a lot of people who try to pile on more and more prerequisites and I think it's less productive; for every person who tells you to read Hume before Kant there are ten who will tell you to read Berkely before Hume. Personally I simply entered what interested me; first Marx (which is an ongoing love) then Hegel and now Kant. Heraclitus can come later.
The Cambridge Companion to German Idealism (I forget which year) is also highly recommended though I haven't looked into that myself.