12/23/18 8:45 AM PT -- TMZ has obtained exclusive footage of the arrest.

TMZ.com

J.D. Madison -- best known as Thomas Ravenel's buddy on "Southern Charm" -- got arrested for allegedly writing a bad check ... TMZ has learned.

Madison was picked up by cops Saturday in Charleston County, SC after a warrant was issued for his arrest. He's been booked on a check violation charge and is still being held ... we're waiting on more details.

It's been a rough few months, legally speaking, for both J.D. and Thomas. Madison was reportedly accused of sexual assault in August by a woman who claims he slipped a drug in her drink and raped her. She filed a police report about the alleged 2017 incident.

And, as we reported ... Ravenel was arrested in South Carolina in September for assault and battery after he too was accused of trying to rape a woman.

We reached out to Madison ... no word back, so far.